numdart library

Classes

Array
Class to create 1 dimension Array.
Array2d
Class to create 2 dimensions Array.
Array3d
Class to create 3 dimensions Array.
ArrayComplex
Class to create 1 dimension ArrayComplex.
Complex
Class to create and handle a complex numbers.
FloatInfo
LU
For an m-by-n matrix A with m >= n, the LU decomposition is an m-by-n unit lower triangular matrix L, an n-by-n upper triangular matrix U, and a permutation vector piv of length m so that A(piv,:) = L*U. If m < n, then L is m-by-m and U is m-by-n. The LU decomposition with pivoting always exists, even if the matrix is singular, so the constructor will never fail. The primary use of the LU decomposition is in the solution of square systems of simultaneous linear equations. This will fail if isNonsingular() returns false.
PolyFit
The PolynomialRegression class performs a polynomial regression on an set of N data points (yi, xi). That is, it fits a polynomial y = β0 + β1 x + β2 x2 + ... + βd xd (where y is the response variable, x is the predictor variable, and the βi are the regression coefficients) that minimizes the sum of squared residuals of the multiple regression model. It also computes associated the coefficient of determination R2. This implementation performs a QR-decomposition of the underlying Vandermonde matrix, so it is neither the fastest nor the most numerically stable way to perform the polynomial regression.
QR
QR Decomposition. For an m-by-n matrix A with m >= n, the QR decomposition is an m-by-n orthogonal matrix Q and an n-by-n upper triangular matrix R so that A = Q*R. The QR decompostion always exists, even if the matrix does not have full rank, so the constructor will never fail. The primary use of the QR decomposition is in the least squares solution of nonsquare systems of simultaneous linear equations. This will fail if isFullRank() returns false.
SVD
Singular Value Decomposition. For an m-by-n matrix A with m >= n, the singular value decomposition is an m-by-n orthogonal matrix U, an n-by-n diagonal matrix S, and an n-by-n orthogonal matrix V so that A = USV'. The singular values, sigma[k] = S[k][k], are ordered so that sigma[0] >= sigma[1] >= ... >= sigma[n-1]. The singular value decompostion always exists, so the constructor will never fail. The matrix condition number and the effective numerical rank can be computed from this decomposition.

Enums

Even

Constants

acos → const double Function(num x)
acre → const double
alpha → const double
fine-structure constant
angstrom → const double
arcmin → const double
arcminute → const double
arcsec → const double
arcsecond → const double
asin → const double Function(num x)
astronomicalUnit → const double
atan2 → const double Function(num a, num b)
atm → const int
atmosphere → const int
atomicMass → const double
atto → const double
au → const double
Avogadro → const double
bar → const double
barrel → const double
bbl → const double
for oil
blob → const double
lbf*s**2/in (added in 1.0.0)
Boltzmann → const double
Btu → const double
BtuIT → const double
BtuTh → const double
c → const int
physical constants
calorie → const double
calorieIT → const double
calorieTh → const double
carat → const double
centi → const double
cos → const double Function(num radians)
day → const double
deci → const double
degree → const double
angle in rad
degreeFahrenheit → const double
only for differences
deka → const double
dyn → const double
force in newton
dyne → const double
e → const double
Base of the natural logarithms. Typically written as "e".
eC → const double
elementary charge
electron_volt → const double
electronMass → const double
elementaryCharge → const double
epsilon0 → const double
erg → const double
eV → const double
energy in joule
exa → const double
exbi → const double
exp → const double Function(num x)
femto → const double
fermi → const double
fineStructure → const double
fluid_ounce_imp → const double
fluidOunce → const double
pint = gallon_US / 8
fluidOunceUS → const double
G → const double
Newtonian constant of gravitation
g → const double
Standard acceleration of gravity
gallon → const double
gallonImp → const double
UK
gallonUS → const double
gasConstant → const double
gibi → const int
giga → const double
golden → const double
goldenRatio → const double
grain → const double
gram → const double
mass in kg
gravitationalConstant → const double
h → const double
Planck constant
hbar → const double
hectare → const double
hecto → const double
horsepower → const double
hour → const double
hp → const double
power in watt
inch → const double
length in meter
JulianYear → const double
k → const double
Boltzmann constant
kgf → const double
  • 1 kg
  • kibi → const int
    binary prefixes
    kilo → const double
    kilogram_force → const double
    kmh → const double
    speed in meter per second
    knot → const double
    lb → const double
    avoirdupois
    lbf → const double
    lightYear → const double
    liter → const double
    litre → const double
    volume in meter**3
    ln10 → const double
    ln2 → const double
    log → const double Function(num x)
    log10e → const double
    log2e → const double
    longTon → const double
    mach → const double
    max → const T Function<T extends num>(T a, T b)
    mE → const double
    electron mass
    mebi → const int
    mega → const double
    metricTon → const double
    micro → const double
    micron → const double
    mil → const double
    mile → const double
    milli → const double
    min → const T Function<T extends num>(T a, T b)
    minute → const double
    time in second
    mmHg → const double
    mN → const double
    neutron mass
    mP → const double
    proton mass
    mph → const double
    mU → const double
    atomic mass constant
    mu0 → const double
    NA → const double
    Avogadro constant
    nano → const double
    nauticalMile → const double
    neutronMass → const double
    ounce → const double
    oz → const double
    parsec → const double
    pebi → const int
    peta → const double
    pi → const double
    The PI constant.
    pico → const double
    Planck → const double
    point → const double
    pound → const double
    poundForce → const double
    pow → const num Function(num x, num exponent)
    protonMass → const double
    psi → const double
    pt → const double
    typography
    R → const double
    molar gas constant
    Rydberg → const double
    Rydberg constant
    shortTon → const double
    sigma → const double
    Stefan-Boltzmann constant
    sin → const double Function(num radians)
    slinch → const double
    slug → const double
    lbf*s**2/foot (added in 1.0.0)
    speedOfLight → const int
    speedOfSound → const double
    sqrt → const double Function(num x)
    sqrt1_2 → const double
    sqrt2 → const double
    Stefan_Boltzmann → const double
    stone → const double
    surveyFoot → const double
    surveyMile → const double
    tan → const double Function(num radians)
    tebi → const int
    tera → const double
    ton_TNT → const double
    torr → const double
    troyOunce → const double
    troyPound → const double
    u → const double
    week → const double
    Wien → const double
    Wien wavelength displacement law constant
    yard → const double
    year → const double
    yobi → const double
    yotta → const double
    SI prefixes
    zebi → const double
    zepto → const double
    zero_Celsius → const double
    temperature in kelvin
    zetta → const double

    Functions

    arange({int start = 0, int stop = 10, int step = 1}) Array
    array2dAddToScalar(Array2d a, num b, {bool returnNewArray = false}) → dynamic
    Add all the matrix elements for a number
    array2dDivisionToScalar(Array2d a, num b, {bool returnNewArray = false}) → dynamic
    Divide all the matrix elements for a number
    array2dInverseOfEachElement(Array2d a, {bool returnNewArray = false}) → dynamic
    Compute the inverse of each elements ( xl = 1/xl )
    array2dMultiplyToScalar(Array2d a, num b, {bool returnNewArray = false}) → dynamic
    Multiply all the matrix elements for a number
    array2dPow(Array2d a, double exponent, {bool returnNewArray = false}) → dynamic
    Compute the power of each element of the array2d a by exponent ( xl = xl^exponent )
    array2dSubToScalar(Array2d a, num b, {bool returnNewArray = false}) → dynamic
    Subtract all the matrix elements for a number
    array2dTruncateEachElement(Array2d a, int fractionDigits, {bool returnNewArray = false}) → dynamic
    Truncate all the elements of the array
    arrayAddToScalar(Array a, num b) Array
    Add a number for each array element
    arrayArgMax(Array a) int
    Return the index of the first greater element of the array
    arrayComplexAbs(ArrayComplex a) Array
    Absolute value of all elements of the current array
    arrayComplexConcat(ArrayComplex a, ArrayComplex b) ArrayComplex
    Concatenate X in to the current array
    arrayComplexConjugate(ArrayComplex a) ArrayComplex
    Conjugate of all elements of the current array
    arrayComplexCos(ArrayComplex a) ArrayComplex
    Compute the cos for each element of the array
    arrayComplexDivisionToScalar(ArrayComplex a, num b) ArrayComplex
    Divide all the array elements for a number
    arrayComplexMultiplyToScalar(ArrayComplex a, num b) ArrayComplex
    Multiply all the array elements for a number
    arrayComplexPadStart(ArrayComplex a, int pad) ArrayComplex
    Add zeros at begging of the array
    arrayComplexReverse(ArrayComplex a) ArrayComplex
    Return the array complex reversed
    arrayComplexSum(ArrayComplex a, ArrayComplex b) ArrayComplex
    Sum two arrays
    arrayComplexTruncateEachElement(ArrayComplex a, int fractionDigits, {bool returnNewArray = false}) → dynamic
    Truncate all the numbers of the array
    arrayComplexTruncateLast(ArrayComplex a) ArrayComplex
    Return an Array without the last element
    arrayConcat(List<Array> arrays) Array
    Concatenate a list of arrays and return
    arrayCos(Array a) Array
    Compute the cos for each element of the array
    arrayCumSum(Array a) Array
    Return the array with accumulative sum of all elements of the array
    arrayDiff(Array a) Array
    Calculate the n-th discrete difference of an Array using the formula out[i] = a[i+1] - a[i].
    arrayDivisionToScalar(Array a, num b) Array
    Divide all the array elements for a number
    arrayLog(Array a) Array
    Compute the natural logarithm for each element of the array
    arrayLog10(Array a) Array
    Compute the log10 for each element of the array
    arrayMax(Array a) double
    Return the greater element in the array
    arrayMin(Array a) double
    Return the sum of all elements of the array
    arrayMultiplyToScalar(Array a, num b) Array
    Multiply all the array elements for a number
    arrayPadStart(Array a, int pad) Array
    Add zeros at begging of the array
    arrayPow(Array a, double exponent) Array
    Compute the power for each element of the array a by exponent
    arrayReshapeToMatrix(Array a, int order) Array2d
    Reshape an Array to a matrix with a given order
    arrayReverse(Array a) Array
    Return the array reversed
    arraySin(Array a) Array
    Compute the sin for each element of the array
    arraySinc(Array a) Array
    Compute the sinc for each element of the array
    arraySqrt(Array a) Array
    Compute the square root for each element of the array
    arraySubToScalar(Array a, num b) Array
    Subtract all the array elements for a number
    arraySum(Array a) double
    Return the sum of all elements of the array
    arrayToColumnMatrix(Array a) Array2d
    Convert an Array to a matrix with one column
    arrayToComplexArray(Array a) ArrayComplex
    Convert an Array to ArrayComplex
    arrayTruncateEachElement(Array a, int fractionDigits, {bool returnNewArray = false}) → dynamic
    Truncate all the numbers of the array
    arrayTruncateLast(Array a) Array
    Return an Array without the last element
    atan2Fast(double y, double x) double
    Two arguments arctangent function
    atanFast(double xa, [double xb = 0.0, bool leftPlane = false]) double
    Internal helper function to compute arctangent.
    bitReverse(int n, int bits) int
    Rotate to left the bits of an int number n times
    boolToInt(bool a) int
    Convert a bool to int, if true return 1, else 0
    checkParamsGetRangeArray(Array? y, Array? x, int dx) → void
    complexAbs(Complex a) double
    Return a double that represent the absolute value of a complex number
    complexConjugate(Complex a) Complex
    Return the conjugate of a complex number
    complexCos(Complex a) Complex
    Compute the cosine of this complex number.
    complexDivideScalar(Complex a, num b) Complex
    Divide real part and imaginary for a double number
    complexExp(Complex exponent) Complex
    Calculate natural exponent for any number complex number: e^(x+(yi)). It's a generatlization of Euler’s formula: e^(iy) = cos(y) + i*sen(y).
    complexMultiplyScalar(Complex a, num b) Complex
    Multiply real part and imaginary for a double number
    complexTruncate(Complex val, int fractionDigits) Complex
    Truncate the real and imaginary part of an imaginary number. This function is very useful for compere two double numbers.
    copySign(double magnitude, double sign) double
    Returns the first argument with the sign of the second argument. A NaN sign argument is treated as positive.
    cosh(double x) double
    Compute the hyperbolic cosine of a number.
    createArrayRange({int start = 0, int stop = 10, int step = 1}) Array
    Return evenly spaced values within a given interval. Values are generated within the half-open interval [start, stop) (in other words, the interval including start but excluding stop). When using a non-integer step, such as 0.1, It is better to use linspace.
    cumIntegration(Array y, {Array? x, int dx = 1, double? initial}) Array
    Compute the numerical accumulative integration of an Array using the trapezoidal rule.
    differentiateArray(Array y, Array x) Array
    Compute the numerical derivative of two arrays
    differentiateFunction(double x, Function f, {double dx = 0.00000001}) double
    Compute the numerical derivative of a function in a certain point
    expFast(double x, [double extra = 0.0, List<double>? hiPrec]) double
    Internal helper method for exponential function.
    expm1(double x, {List<double>? hiPrecOut}) double
    Compute exp(x) - 1.
    highestOneBit(int n) int
    Reurn the highest one bit of an int n : input number References
    hypotenuse(double x, double y) double
    Calculate the hypotenuse with pythagorean theorem
    intToBool(int a) bool
    Convert an int to bool, if 0 return false, else true
    isEven(int a) bool
    Check if a is an Even number.
    isEvenDouble(double a, int fractionDigits) bool
    Check if a is an Even number after a truncation.
    isOdd(int a) bool
    Check if a is an Odd number.
    isOddDouble(double a, int fractionDigits) bool
    Check if a is an Odd number after a truncation.
    isPowerOf2(int n) bool
    CHeck if n is power of 2.
    linspace(double start, double stop, {int num = 50, bool endpoint = true}) Array
    Return evenly spaced numbers over a specified interval. Returns num evenly spaced samples, calculated over the interval `start`, `stop`.
    matrixColumnToArray(Array2d a, int column) Array
    Get matrix column. return Array
    matrixDeterminant(Array2d a) double
    Matrix determinant return determinant
    matrixDivideColumns(Array2d a, Array b) Array2d
    Divide all the columns by an Array
    matrixDot(Array2d a, Array2d b) Array2d
    Multiply two matrix
    matrixIdentity(int row, int column) Array2d
    Generate identity matrix
    matrixInverse(Array2d a) Array2d
    Matrix inverse or pseudoinverse return inverse(A) if A is square, pseudoinverse otherwise.
    matrixMultiplyColumns(Array2d a, Array b) Array2d
    Multiply all the columns by an Array
    matrixNormOne(Array2d a) double
    One norm return maximum column sum.
    matrixNormTwo(Array2d a) double
    Two norm return maximum singular value.
    matrixPseudoInverse(Array2d matrix) Array2d
    Pseudo inverse matrix using Moore–Penrose return inverse(A) if A is square, pseudoinverse otherwise.
    matrixQR(Array2d a) QR
    Generate a QR decomposition of the matrix
    matrixRank(Array2d a) int
    Matrix rank return rank, obtained from SVD.
    matrixSolve(Array2d a, Array2d b) Array2d
    Solve A*X = B
    matrixSub(Array2d a, int i0, int i1, int j0, int j1) Array2d
    generate a submatrix from a given interval
    matrixSubFromArray(Array2d a, Array rows, int col0, int col1) Array2d
    Get a submatrix where each element of rows array represent a column on current matrix.
    matrixSumColumns(Array2d a) Array
    Sum the all columns of the array
    matrixTranspose(Array2d a) Array2d
    Matrix transpose. return A'
    matrixVander(Array x, {int? N, bool increasing = false}) Array2d
    Generate a Vandermonde matrix. The columns of the output matrix are powers of the input vector. The order of the powers is determined by the increasing boolean argument. Specifically, when increasing is False, the i-th output column is the input vector raised element-wise to the power of N - i - 1. Such a matrix with a geometric progression in each row is named for Alexandre- Theophile Vandermonde.
    mean(Array a) double
    Return the mean of all elements of the array
    median(Array a) double
    Return the median of an array
    mode(Array a) double
    Return the mode of all elements of the array
    ones(int num) Array
    Return a new array of given shape and type, filled with ones.
    parabolic(Array y, int x) List
    Quadratic interpolation for estimating the true position of an inter-sample maximum when nearby samples are known.
    randomArray(int n) Array
    Generates an Array with n elements containing non-negative random floating point value uniformly distributed in the range from 0.0, inclusive, to 1.0, exclusive.
    randomArray2d(int rows, int columns) Array2d
    Generates an Array with n elements containing non-negative random floating point value uniformly distributed in the range from 0.0, inclusive, to 1.0, exclusive.
    randomArrayComplex(int n) ArrayComplex
    Generates an ArrayComplex with n elements containing non-negative random floating point value uniformly distributed complex numbers in the range from 0.0, inclusive, to 1.0, exclusive.
    simpsArray(Array y, {Array? x, int dx = 1, Even even = Even.last}) double
    Integrate y(x) using samples along the given axis and the composite Simpson's rule. If x is None, spacing of dx is assumed. If there are an even number of samples, N, then there are an odd number of intervals (N-1), but Simpson's rule requires an even number of intervals. The parameter 'even' controls how this is handled.
    simpsFunction(double a, double b, int n, Function f) double
    Compute the numerical integration of f() using the Simpson's rule.
    sinc(double x) double
    compute nomilized sinc function of x
    sinh(double x) double
    Compute the hyperbolic sine of a number.
    standardDeviation(Array a) double
    Return the standard deviation of sample array
    timeit(Function function) Duration
    Return the time necessary to compute a function.
    trapzArray(Array y, {Array? x, int dx = 1}) double
    Compute the numerical integration of an Array using the trapezoidal rule.
    trapzFunction(double a, double b, int n, Function f) double
    Compute the numerical integration of f() using the trapezoidal rule.
    truncate(double val, int fractionDigits) double
    Truncate the decimal part of a double number. This function is very useful for compere two double numbers.
    variance(Array a) double
    Return the variance of the array
    zeros(int num) Array
    Return a new array of given shape and type, filled with zeros.