This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Numerics; | |
public static class Factorization | |
{ | |
private static BigInteger _cacheCeiling; | |
private static List<BigInteger> _primeCache; | |
private static BigInteger _cacheLargestPrimeCurrently; | |
private static BigInteger[] _probablePrimeCheckBases; | |
static Factorization() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Linq; | |
using System.Numerics; | |
using System.Collections.Generic; | |
public static class Maths | |
{ | |
/// <summary> | |
/// Legendre Symbol returns 1 for a (nonzero) quadratic residue mod p, -1 for a non-quadratic residue (non-residue), or 0 on zero. | |
/// </summary> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class GenericArithmeticFactory<T> | |
{ | |
private static Dictionary<ExpressionType, Func<T, T, T>> _binaryOperationDictionary; | |
private static Dictionary<ExpressionType, Func<T, T, bool>> _comparisonOperationDictionary; | |
private static Func<T, T> _sqrtOperation = null; | |
static GenericArithmeticFactory() | |
{ | |
_binaryOperationDictionary = new Dictionary<ExpressionType, Func<T, T, T>>(); | |
_comparisonOperationDictionary = new Dictionary<ExpressionType, Func<T, T, bool>>(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Linq; | |
using System.Collections; | |
using System.ComponentModel; | |
using System.Collections.Generic; | |
using System.Collections.Specialized; | |
using System.Collections.ObjectModel; | |
using System.Runtime.CompilerServices; | |
OlderNewer