C# Класс YAMP.Numerics.Helpers

Provides some commonly used methods for numeric algorithms.
Показать файл Открыть проект

Открытые свойства

Свойство Тип Описание
BernoulliNumbers Double[]
LanczosD Double[]
LogPI Double
LogTwo Double
SqrtPI Double
SqrtThree Double
SqrtTwo Double
SqrtTwoPI Double
TwoPIpow Double[]

Открытые методы

Метод Описание
BinomialCoefficient ( Double n, Double k ) : Double

Computes the real binomial coefficient (almost general) given two values, n choose k.

BinomialCoefficient ( ScalarValue n, ScalarValue k ) : ScalarValue

Computes the complex binomial coefficient (very general) given two values, n choose k.

ChebEval ( ChebSeries cs, Double x ) : Double

Evaluate a real Chebyshev polynomial on an interval, given the coefficients.

ChebEval ( Int32 n, Double coefficients, Double x ) : Double

Evaluate a real Chebyshev polynomial on an interval, given the coefficients.

ChebEval ( ChebSeries cs, ScalarValue z ) : ScalarValue

Evaluate a complex Chebyshev polynomial on an interval, given the coefficients.

ComputeRoots ( Int32 N, Int32 sign ) : ScalarValue[]

computes the N-th roots of unity, which are the factors in a length-N Fourier transform.

Factorial ( Int32 n ) : Double

Computes the factorial of an integer and returns a double with the result.

GCD ( Int32 A, Int32 B ) : Int32

Computes the greatest common divisor of two numbers.

Hypot ( Double a, Double b ) : Double

Computes the length of a right triangle's hypotenuse.

IsPrimeNumber ( Int32 n ) : System.Boolean

Returns a boolean if the given integer is a prime number.

PowMod ( Int32 b, Int32 e, Int32 m ) : Int32

Computes a power of an integer in modular arithmetic.

Power ( ScalarValue z, Int32 n ) : ScalarValue

Takes the power of z to an integer n.

Приватные методы

Метод Описание
IsProbablyPrime ( Int32 n, Int32 m, Int32 s, Int32 d, Int32 w ) : System.Boolean

Описание методов

BinomialCoefficient() публичный статический Метод

Computes the real binomial coefficient (almost general) given two values, n choose k.
public static BinomialCoefficient ( Double n, Double k ) : Double
n Double We have n elements.
k Double We choose k elements.
Результат Double

BinomialCoefficient() публичный статический Метод

Computes the complex binomial coefficient (very general) given two values, n choose k.
public static BinomialCoefficient ( ScalarValue n, ScalarValue k ) : ScalarValue
n ScalarValue We have n elements.
k ScalarValue We choose k elements.
Результат ScalarValue

ChebEval() публичный статический Метод

Evaluate a real Chebyshev polynomial on an interval, given the coefficients.
public static ChebEval ( ChebSeries cs, Double x ) : Double
cs ChebSeries The coefficients to consider.
x Double The real evaluation argument.
Результат Double

ChebEval() публичный статический Метод

Evaluate a real Chebyshev polynomial on an interval, given the coefficients.
public static ChebEval ( Int32 n, Double coefficients, Double x ) : Double
n System.Int32 The order for the summation of the polynomial.
coefficients Double The coefficients to consider.
x Double The real evaluation argument.
Результат Double

ChebEval() публичный статический Метод

Evaluate a complex Chebyshev polynomial on an interval, given the coefficients.
public static ChebEval ( ChebSeries cs, ScalarValue z ) : ScalarValue
cs ChebSeries The coefficients to consider.
z ScalarValue The complex evaluation argument.
Результат ScalarValue

ComputeRoots() публичный статический Метод

computes the N-th roots of unity, which are the factors in a length-N Fourier transform.
public static ComputeRoots ( Int32 N, Int32 sign ) : ScalarValue[]
N System.Int32 What number of roots.
sign System.Int32 The sign to take.
Результат ScalarValue[]

Factorial() публичный статический Метод

Computes the factorial of an integer and returns a double with the result.
public static Factorial ( Int32 n ) : Double
n System.Int32 The argument to take the factorial.
Результат Double

GCD() публичный статический Метод

Computes the greatest common divisor of two numbers.
public static GCD ( Int32 A, Int32 B ) : Int32
A System.Int32 The first number.
B System.Int32 The second number.
Результат System.Int32

Hypot() публичный статический Метод

Computes the length of a right triangle's hypotenuse.
public static Hypot ( Double a, Double b ) : Double
a Double The length of one side.
b Double The length of another side.
Результат Double

IsPrimeNumber() публичный статический Метод

Returns a boolean if the given integer is a prime number.
public static IsPrimeNumber ( Int32 n ) : System.Boolean
n System.Int32 The integer to examine.
Результат System.Boolean

PowMod() публичный статический Метод

Computes a power of an integer in modular arithmetic.
public static PowMod ( Int32 b, Int32 e, Int32 m ) : Int32
b System.Int32 The base, which must be positive.
e System.Int32 The exponent, which must be positive.
m System.Int32 The modulus, which must be positive.
Результат System.Int32

Power() публичный статический Метод

Takes the power of z to an integer n.
public static Power ( ScalarValue z, Int32 n ) : ScalarValue
z ScalarValue The complex value z in C.
n System.Int32 The power n in N.
Результат ScalarValue

Описание свойств

BernoulliNumbers публичное статическое свойство

Provides access to the first 21 bernoulli numbers.
public static Double[] BernoulliNumbers
Результат Double[]

LanczosD публичное статическое свойство

Provides access do some Lanczos numbers.
public static Double[] LanczosD
Результат Double[]

LogPI публичное статическое свойство

Value of ln(Pi)
public static Double LogPI
Результат Double

LogTwo публичное статическое свойство

Value of ln(2)
public static Double LogTwo
Результат Double

SqrtPI публичное статическое свойство

Value of Sqrt(Pi)
public static Double SqrtPI
Результат Double

SqrtThree публичное статическое свойство

Value of Sqrt(3)
public static Double SqrtThree
Результат Double

SqrtTwo публичное статическое свойство

Value of Sqrt(2)
public static Double SqrtTwo
Результат Double

SqrtTwoPI публичное статическое свойство

Value of Sqrt(2 * Pi)
public static Double SqrtTwoPI
Результат Double

TwoPIpow публичное статическое свойство

Provides access to (2*pi)^(10*n) with n = 0, ..., 17.
public static Double[] TwoPIpow
Результат Double[]