Numerics class
This class provides a number of useful numeric calculations with vectors and matrices, such as multiplication, transpose, invert. Some of the provided methods are based on the respective js MIT-licensed code of https://github.com/sloisel/numeric.
Constructors
- Numerics()
- Creates instance for accessing the methods
Properties
- hashCode → int
-
The hash code for this object. [...]
read-only, inherited
- runtimeType → Type
-
A representation of the runtime type of the object.
read-only, inherited
Methods
-
addMM(
List< List< matr1, List<double> >List< matr2) → List<double> >List< double> > -
Returns pointwise sum of
matr1
andmatr2
in a new matrix. -
addVV(
List< double> vec1, List<double> vec2) → List<double> -
Returns pointwise sum of
vec1
andvec2
in a new vector. -
cloneMatrix(
List< List< matrix) → List<double> >List< double> > -
Clones a
matrix
: Returns a new matrix with same contents. -
compareMM(
List< List< mat1, List<double> >List< mat2, double epsilon) → Stringdouble> > -
Compares two matrices
mat1
andmat2
. If all elements are not different more thanepsilon
, the matrices are considered as equals, and null is returned. Otherwise, a String of the form "i, k, mat1k
, mat2k
" is returned showing the first encountered unequal matrix element. -
createDiagMatrix(
int n, double value) → List< List< double> > -
Creates
n
xn
diagonal matrix withvalue
. -
createMatrix(
int nrows, int ncols, double value) → List< List< double> > -
Returns a new
nrows
xncols
matrix. All elements are set tovalue
. -
dotCM(
double c, List< List< matr) → List<double> >List< double> > -
Returns new matrix, the pointwise multiplication of
matr
withc
. -
dotMM(
List< List< matr1, List<double> >List< matr2) → List<double> >List< double> > -
Returns product of matrices
matr1
andmatr2
. Suitable sizes required! -
dotMMbig(
List< List< x, List<double> >List< y) → List<double> >List< double> > - Utility for dotMM
-
dotMMsmall(
List< List< x, List<double> >List< y) → List<double> >List< double> > - Utility for dotMM
-
dotMV(
List< List< matr, List<double> >double> vec) → List<double> -
Returns product
matr
dotvec
. -
dotVV(
List< double> vec1, List<double> vec2) → double -
Returns scalar product
vec1
dotvec2
. -
getDiag(
List< List< matr) → List<double> >double> -
Returns the diagonal of a matrix
matr
Its length is the minimum of the row or column size ofmatr
. -
invMatrix(
List< List< mat) → List<double> >List< double> > -
Computes and returns the inverse of an invertible matrix
mat
. -
sqrtV(
List< double> vec) → List<double> -
Returns new vector, the pointwise square root of
vec
. -
sumM(
List< List< matrix) → doubledouble> > -
Returns the sum of all entries of
matrix
. -
transpose(
List< List< matrix) → List<double> >List< double> > -
Transposes
matrix
: Returns a new matrix. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a non-existent method or property is accessed. [...]
inherited
-
toString(
) → String -
Returns a string representation of this object.
inherited
Operators
-
operator ==(
dynamic other) → bool -
The equality operator. [...]
inherited