IGLib  1.7.2
The IGLib base library for development of numerical, technical and business applications.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros
IG.Num.MatrixBase Class Referenceabstract

Base class for matrices. More...

+ Inheritance diagram for IG.Num.MatrixBase:
+ Collaboration diagram for IG.Num.MatrixBase:

Public Member Functions

abstract MatrixBase GetCopyBase ()
 Creates and returns a copy of the current matrix. More...
 
abstract MatrixBase GetNewBase (int rowCount, int columnCount)
 Creates and returns a new matrix with the specified dimensions, and of the same type as the current matrix. More...
 
abstract MatrixBase GetNewBase ()
 Creates and returns a new matrix with the same dimensions and of the same type as the current matrix. More...
 
abstract VectorBase GetNewVectorBase (int length)
 Creates and returns a new vector with the specified dimension, and of the type that is consistent with the type of the current vector. More...
 
virtual IMatrix GetCopy ()
 Creates and returns a copy of the current matrix. More...
 
virtual IMatrix GetNew (int rowCount, int columnCount)
 Creates and returns a new matrix with the specified dimensions, and of the same type as the current matrix. More...
 
virtual IMatrix GetNew ()
 Creates and returns a new matrix with the same dimensions and of the same type as the current matrix. More...
 
virtual IVector GetNewVector (int length)
 Creates and returns a new vector with the specified dimension, and of the type that is consistent with the type of the current vector. More...
 
virtual double[,] ToArray ()
 Creates and returns a rectangular 2D array that contains a component-wise copy of the matrix. More...
 
virtual double[][] ToJaggedArray ()
 Creates and returns a jagged 2D array that contains a component-wise copy of the matrix. More...
 
virtual int Index (int row, int column)
 Calculates and returns flat index corresponding to the specified row and column indices of the current matrix. More...
 
virtual void Indices (int flatIndex, out int row, out int column)
 Returns (through output arguments) row and column indices corresponding to the specified flat index in the current matrix. More...
 
virtual void SetZero ()
 Sets all components of the current matrix to 0. More...
 
virtual void SetConstant (double elementValue)
 Sets all components of the current matrix to the specified value. More...
 
virtual void SetIdentity ()
 Sets the current matrix to identity matrix. WARNING: Exception is thrown if a matrix is not square. For nonsquare matrices, use SetDiagonal(1.0)! More...
 
virtual void SetRandom ()
 Sets the current matrix such that it contains random elements on the interval (0,1]. More...
 
virtual void SetRandom (IRandomGenerator rnd)
 Sets the current matrix such that it contains random elements on the interval (0,1]. More...
 
virtual void SetDiagonal (double diagonalElement)
 Sets the current matrix to the diagonal matrix with all diagonal elements equal to the specified value. Matrix does not need to be a square matrix. More...
 
virtual void SetDiagonal (IVector diagonal)
 Sets the current matrix to the diagonal matrix with diagonal element specified by a vector. More...
 
virtual bool IsSquare ()
 Returns true if the current matrix is a square matrix, and false if not. More...
 
virtual bool IsSymmetric ()
 Returns true if the current matrix is symmetric, and false if not. If the matrix is not a square matrix then false is returned. More...
 
virtual bool IsSymmetric (double relativeRMSTolerance=0.0)
 Returns true if the specified matrix is symmetric within some tolerance, and false if not. If the matrix is null then false is returned. More...
 
virtual void Negate ()
 Negates the current matrix. More...
 
virtual void Transpose ()
 Transposes the current matrix. WARNING: this operation can only be done on square matrices! More...
 
override int GetHashCode ()
 Returns the hashRet code (hashRet function) of the current matrix. More...
 
override bool Equals (Object obj)
 Returns a value indicating whether the specified object is equal to the current matrix. More...
 
int GetHashFunctionInt ()
 Returns an integer valued hashRet function of the current matrix object. More...
 
string GetHashFunctionString ()
 Returns a string valued hashRet function of the current matrix object. More...
 
override string ToString ()
 Returns string representation of the current matrix in the standard IGLib form. Rows and elements are printed in comma separated lists in curly brackets. More...
 
virtual string ToStringReadable (int accuracy=4, int padding=8)
 Returns a readable an easily string form of a matrix, accuracy and padding can be set. More...
 
virtual string ToStringNewlines ()
 Returns a string representation of this matrix with newlines inserted after each row. Rows and elements are printed in comma separated lists in curly brackets. More...
 
virtual string ToStringNewlines (string elementFormat)
 Returns a string representation of this matrix with newlines inserted after each row, with the specified format for elements of the matrix. Rows and elements are printed in comma separated lists in curly brackets. More...
 
virtual string ToStringMath ()
 Returns string representation of the current matrix in the standard IGLib form (Mathematica-like format but with C representation of numbers). Rows and elements are printed in comma separated lists in curly brackets. More...
 
virtual string ToString (string elementFormat)
 Returns a string representation of the current matrix in a standard IGLib form (Mathematica-like format but with C representation of numbers), with the specified format for elements of the matrix. More...
 
virtual string ToStringMath (string elementFormat)
 Returns a string representation of the current matrix in a standard IGLib form (Mathematica-like format but with C representation of numbers), with the specified format for elements of the matrix. More...
 

Static Public Member Functions

static int Index (int dim1, int dim2, int row, int column)
 Returns flat index corresponding to the specified row and column indices of a matrix with specified dimensions. More...
 
static int Index (IMatrix mat, int row, int column)
 Calculates and returns flat index corresponding to the specified row and column indices of the specified matrix. More...
 
static void Indices (int dim1, int dim2, int flatIndex, out int row, out int column)
 Returns (through output arguments) row and column indices corresponding to the specified flat index in a matrix with the specified dimensions. More...
 
static void Indices (IMatrix mat, int flatIndex, out int row, out int column)
 Returns (through output arguments) row and column indices corresponding to the specified flat index in the specified matrix. More...
 
static void SetZero (IMatrix mat)
 Sets all components of the specified matrix to 0. More...
 
static void SetConstant (IMatrix mat, double elementValue)
 Sets all components of the specified matrix to the specified value. More...
 
static void SetIdentity (IMatrix mat)
 Sets the specified matrix to identity matrix. WARNING: Works only for square matrices (exception is thrown if matrix is not square). For nonsquare matrices, use SetDiagonal(1.0)! More...
 
static void SetDiagonal (IMatrix mat, IVector diagonal)
 Sets the current matrix to the diagonal matrix with diagonal element specified by a vector. More...
 
static void SetDiagonal (IMatrix mat, double diagonalElement)
 Sets the current matrix to the diagonal matrix with all diagonal elements equal to the specified value. Matrix does not need to be a square matrix. More...
 
static void SetRandom (IMatrix mat)
 Sets the specified matrix such that it contains random elements on the interval (0,1]. More...
 
static void SetRandom (IMatrix mat, IRandomGenerator rnd=null)
 Sets the current matrix such that it contains random elements on the interval (0,1]. More...
 
static void SetRandomSymmetric (IMatrix mat)
 Sets the specified matrix such that it is symmetric and contains random elements on the interval (0,1]. More...
 
static void SetRandomSymmetric (IMatrix mat, IRandomGenerator rnd)
 Sets the specified matrix such that it is symmetric and contains random elements on the interval (0,1]. More...
 
static void SetRandomAntiSymmetric (IMatrix mat)
 Sets the specified matrix such that it is antisymmetric and contains random elements on the interval (0,1]. More...
 
static void SetRandomAntiSymmetric (IMatrix mat, IRandomGenerator rnd)
 Sets the specified matrix such that it is antisymmetric and contains random elements on the interval (0,1]. More...
 
static void SetRandomLowerTriangular (IMatrix mat)
 Sets the specified matrix such that it is lower triangular and contains random elements on the interval (0,1]. More...
 
static void SetRandomLowerTriangular (IMatrix mat, IRandomGenerator rnd)
 Sets the specified matrix such that it is lower triangular and contains random elements on the interval (0,1]. More...
 
static void SetRandomUpperTriangular (IMatrix mat)
 Sets the specified matrix such that it is upper triangular and contains random elements on the interval (0,1]. More...
 
static void SetRandomUpperTriangular (IMatrix mat, IRandomGenerator rnd)
 Sets the specified matrix such that it is upper triangular and contains random elements on the interval (0,1]. More...
 
static void SetRandomSymmetricPositiveDefinite (IMatrix mat)
 Sets the specified matrix such that it is positive definite and contains random elements on the interval (0,1]. More...
 
static void SetRandomSymmetricPositiveDefinite (IMatrix mat, IRandomGenerator rnd)
 Sets the specified matrix such that it is positive definite and contains random elements. More...
 
static void SetRandomPositiveDiagonallyDominant (IMatrix mat, IRandomGenerator rnd=null, double dominancyFactor=100.0)
 Sets the specified matrix such that it is has random elements and is diagonally dominant with positive diagonal elements, i.e. any diagonal element is greater by absolute value than sum of absolute values of nondiagonal elements in the corresponding column. More...
 
static void SetRandomPositiveDiagonallyDominant (IMatrix mat, double dominancyFactor)
 Sets the specified matrix such that it is has random elements and is diagonally dominant with positive diagonal elements, i.e. any diagonal element is greater by absolute value than sum of absolute values of nondiagonal elements in the corresponding column. More...
 
static void SetRandomPositiveDiagonallyDominantSymmetric (IMatrix mat, IRandomGenerator rnd=null, double dominancyFactor=100.0)
 Sets the specified matrix such that it is has random elements and is symmetric diagonally dominant with positive diagonal elements, i.e. any diagonal element is greater by absolute value than sum of absolute values of nondiagonal elements in the corresponding column. More...
 
static void SetRandomPositiveDiagonallyDominantSymmetric (IMatrix mat, double dominancyFactor)
 Sets the specified matrix such that it is has random elements and is symmetric diagonally dominant with positive diagonal elements, i.e. any diagonal element is greater by absolute value than sum of absolute values of nondiagonal elements in the corresponding column. More...
 
static double SetRandomInvertible (IMatrix mat, IRandomGenerator rnd=null)
 Sets the specified QUADRATIC matrix such that it is has random elements and is nonsingular. More...
 
static double SetRandomPositiveDefiniteSymmetric (IMatrix mat, IRandomGenerator rnd=null)
 Sets the specified QUADRATIC matrix such that it is has random elements and is a symmetric positive definite matrix. More...
 
static bool IsSquare (IMatrix mat)
 Returns true if the specified matrix is a square matrix, and false if not. If the matrix is null then false is returned. More...
 
static bool IsSymmetric (IMatrix mat)
 Returns true if the specified matrix is symmetric, and false if not. If the matrix is null then false is returned. More...
 
static bool IsSymmetric (IMatrix mat, double relativeRMSTolerance)
 Returns true if the specified matrix is symmetric within some tolerance, and false if not. If the matrix is null then false is returned. More...
 
static int Compare (IMatrix m1, IMatrix m2)
 Compares two matrices and returns -1 if the first matrix is smaller than the second one, 0 if matrices are equal, and 1 if the first matrix is greater. Matrix that is null is considered smaller than a matrix that is not null. Two null matrices are considered equal. Matrix with smaller dimension is considered smaller than a matrix with greater dimension. Matrices with equal dimensions ar compared by elements. The first element that is different decides which matrix is considered greater. More...
 
static void Resize (ref IMatrix mat, IMatrix template, int rowCount, int columnCount)
 Resizes, if necessary, the specified matrix according to the required dimensions. If the matrix is initially null then a new matrix is created. If in this case a template matrix is specified then the newly created matrix will be of the same type as that template matrix, because it is created by the GetNew() method on that matrix. If dimensions of the initial matrix do not match the required dim., then matrix is resized. If the specified matrix dimension is less or equal to 0 then matrix is resized with the same dimensions as those of the template matirx. If in this case the template matrix is null, an exception is thrown. WARNINGS: Components are NOT preserved and have in general undefined values after operation is performed. If matrix and template are both null then the type of nawly created matrix is Matrix. More...
 
static void Resize (ref IMatrix mat, int rowCount, int columnCount)
 Resizes, if necessary, the specified matrix according to the required dimensions. If the matrix is initially null then a new matrix (of type Matrix) is created. If dimensions of the initial matrix do not match the required dimensions, then matrix is resized. Components are NOT preserved and have in general undefined values after operation is performed. WARNING: If the matrix is initially null then the type of the newly created matrix is Matrix. More...
 
static void Resize (ref IMatrix mat, IMatrix template)
 Resizes, if necessary, the specified matrix according to the dimensions of the specified template matrix. If the matrix is initially null then a new matrix is created. In this case the newly created matrix will be of the same type as that template matrix, because it is created by the GetNew() method on that matrix. If dimensions of the initial matrix do not match the dimensions of the template matrix, then matrix is resized. If the template matrix is null, then an exception is thrown. WARNINGS: Components are NOT preserved and have in general undefined values after operation is performed. If matrix and template are null then the type of newly created matrix is Matrix. More...
 
static void CopyPlain (IMatrix a, IMatrix result)
 Copies components of a matrix to another matrix. This is a plain version of the method that does not perform any consistency checks. WARNING: dimensions of the copied matrix and result storage must match. More...
 
static void Copy (IMatrix a, IMatrix result)
 Copies components of a matrix to another matrix. WARNING: dimensions of the copied matrix and result storage must match. More...
 
static void Copy (IMatrix a, ref IMatrix result)
 Copies components of a matrix to another matrix. Resulting matrix is allocated or reallocated if necessary. More...
 
static void CopyPlain (MatrixBase_MathNetNumerics a, IMatrix result)
 Copies components of a matrix to another matrix. This is a plain version of the method that does not perform any consistency checks. WARNING: dimensions of the copied matrix and result storage must match. More...
 
static void Copy (MatrixBase_MathNetNumerics a, IMatrix result)
 Copies components of a matrix to another matrix. WARNING: dimensions of the copied matrix and result storage must match. More...
 
static void Copy (MatrixBase_MathNetNumerics a, ref IMatrix result)
 Copies components of a matrix to another matrix. Resulting matrix is allocated or reallocated if necessary. More...
 
static void CopyPlain (IMatrix a, Matrix_MathNetNumercs result)
 Copies components of a matrix to another matrix. This is a plain version of the method that does not perform any consistency checks. WARNING: dimensions of the copied matrix and result storage must match. More...
 
static void Copy (IMatrix a, Matrix_MathNetNumercs result)
 Copies components of a matrix to another matrix. WARNING: dimensions of the copied matrix and result storage must match. More...
 
static void Copy (IMatrix a, ref Matrix_MathNetNumercs result)
 Copies components of a matrix to another matrix. Resulting matrix is allocated or reallocated if necessary. More...
 
static void NegatePlain (IMatrix a, IMatrix result)
 Stores a negative matrix of the operand in another matrix. Can be done in-place. This is a plain version of the method that does not perform any consistency checks. WARNING: dimensions of the operand and result storage must match. More...
 
static void Negate (IMatrix a, IMatrix result)
 Stores a negative matrix of the operand in another matrix. Can be done in-place. WARNING: dimensions of the operand and result storage must match. More...
 
static void Negate (IMatrix a, ref IMatrix result)
 Stores a negative matrix of the operand in another matrix. Can be done in-place. Resulting matrix is allocated or reallocated if necessary. More...
 
static void TransposePlain (IMatrix a, IMatrix result)
 Stores transpose of the operand in another matrix. Can be done in-place. This is a plain version of the method that does not perform any consistency checks. WARNING: dimensions of the operand and result storage must match. More...
 
static void Transpose (IMatrix a, IMatrix result)
 Stores transpose of the operand in another matrix. Can be done in-place. WARNING: dimensions of the operand and result storage must match. More...
 
static void Transpose (IMatrix a, ref IMatrix result)
 Stores transpose of the matrix operand in another matrix. Can be done in-place. Resulting matrix is allocated or reallocated if necessary. More...
 
static void SymmetrizePlain (IMatrix a, IMatrix sym, IMatrix antiSym)
 Calculates symmetric and antisymmetric part of the specified matrix (symmetric part is stored in the first result argument but is calculated last, such that it overrides antisymmetric when both arguments point to the same matrix object). More...
 
static void Symmetrize (IMatrix a, IMatrix sym, IMatrix antiSym)
 Calculates symmetric and antisymmetric part of the specified matrix (symmetric part is stored in the first result argument but is calculated last, such that it overrides antisymmetric when both arguments point to the same matrix object). More...
 
static void Symmetrize (IMatrix a, ref IMatrix sym, ref IMatrix antiSym)
 Stores symmetrized and antisymmetirzed matrix obtained from the specified matrix. Resulting matrix is allocated or reallocated if necessary. More...
 
static void SymmetricPartPlain (IMatrix a, IMatrix result)
 Stores symmetric part of a square matrix operand in another matrix. Symmetrization is performed by averaging of non-diagonal terms and their transposed terms. Can be done in-place. This is a plain version of the method that does not perform any consistency checks. WARNING: dimensions of the operand and result storage must match. More...
 
static void SymmetricPart (IMatrix a, IMatrix result)
 Stores symmetric part of a square matrix operand in another matrix. Symmetrization is performed by averaging of non-diagonal terms and their transposed terms. Can be done in-place. WARNING: dimensions of the operand and result storage must match. More...
 
static void SymmetricPart (IMatrix a, ref IMatrix result)
 Stores symmetric part of a square matrix operand in another matrix. Symmetrization is performed by averaging of non-diagonal terms and their transposed terms. Can be done in-place. Resulting matrix is allocated or reallocated if necessary. More...
 
static void AntisymmetricPartPlain (IMatrix a, IMatrix result)
 Stores antisymmetric part of a square matrix operand in another matrix. Antisymmetrization is performed by subtracting non-diagonal terms and their transposed terms, division by 2 and storing result in one matrix element and its negative value in another element. Can be done in-place. This is a plain version of the method that does not perform any consistency checks. WARNING: dimensions of the operand and result storage must match. More...
 
static void AntisymmetricPart (IMatrix a, IMatrix result)
 Stores antisymmetric part of a square matrix operand in another matrix. Antisymmetrization is performed by subtracting non-diagonal terms and their transposed terms, division by 2 and storing result in one matrix element and its negative value in another element. Can be done in-place. WARNING: dimensions of the operand and result storage must match. More...
 
static void AntisymmetricPart (IMatrix a, ref IMatrix result)
 Stores antisymmetric part of a square matrix operand in another matrix. Antisymmetrization is performed by subtracting non-diagonal terms and their transposed terms, division by 2 and storing result in one matrix element and its negative value in another element. Can be done in-place. Resulting matrix is allocated or reallocated if necessary. More...
 
static void AddPlain (IMatrix a, IMatrix b, IMatrix result)
 Sums two matrices and stores the result in the specified result matrix. Operation can be performed in place. This is a plain version of the method that does not perform any consistency checks. WARNING: dimensions of matrices must match, otherwise an exception is thrown. More...
 
static void Add (IMatrix a, IMatrix b, IMatrix result)
 Sums two matrices and stores the result in the specified result matrix. WARNING: dimensions of matrices must match, otherwise an exception is thrown. More...
 
static void Add (IMatrix a, IMatrix b, ref IMatrix result)
 Sums two matrices and stores the result in the specified result matrix. Operation can be performed in place. WARNING: dimensions of operands must match, otherwise an exception is thrown. If dimensions of the result do not match then teh result is re-allocated. More...
 
static void SubtractPlain (IMatrix a, IMatrix b, IMatrix result)
 Subtracts two matrices and stores the result in the specified result matrix. Operation can be performed in place. This is a plain version of the method that does not perform any consistency checks. WARNING: dimensions of matrices must match, otherwise an exception is thrown. More...
 
static void Subtract (IMatrix a, IMatrix b, IMatrix result)
 Subtracts two matrices and stores the result in the specified result matrix. Operation can be performed in place. WARNING: dimensions of matrices must match, otherwise an exception is thrown. More...
 
static void Subtract (IMatrix a, IMatrix b, ref IMatrix result)
 Subtracts two matrices and stores the result in the specified result matrix. Operation can be performed in place. WARNING: dimensions of operands must match, otherwise an exception is thrown. If dimensions of the result do not match then teh result is re-allocated. More...
 
static void ArrayMultiplyPlain (IMatrix a, IMatrix b, IMatrix result)
 Element-by-element multiplication. This operation can be performed in place. This is a plain version of the method that does not perform any consistency checks. WARNING: dimensions of matrices must match, otherwise an exception is thrown. More...
 
static void ArrayMultiply (IMatrix a, IMatrix b, IMatrix result)
 Element-by-element multiplication. WARNING: dimensions of matrices must match, otherwise an exception is thrown. More...
 
static void ArrayMultiply (IMatrix a, IMatrix b, ref IMatrix result)
 Element-by-element multiplication. WARNING: dimensions of operands must match, otherwise an exception is thrown. If dimensions of the result do not match then teh result is re-allocated. More...
 
static void ArrayDividePlain (IMatrix a, IMatrix b, IMatrix result)
 Element-by-element division. This operation can be performed in place. This is a plain version of the method that does not perform any consistency checks. WARNING: dimensions of matrices must match, otherwise an exception is thrown. More...
 
static void ArrayDivide (IMatrix a, IMatrix b, IMatrix result)
 Element-by-element division. WARNING: dimensions of matrices must match, otherwise an exception is thrown. More...
 
static void ArrayDivide (IMatrix a, IMatrix b, ref IMatrix result)
 Element-by-element division. WARNING: dimensions of operands must match, otherwise an exception is thrown. If dimensions of the result do not match then teh result is re-allocated. More...
 
static void ArrayPowerPlain (IMatrix a, double power, IMatrix result)
 Element-by-element raise to power. This operation can be performed in place. This is a plain version of the method that does not perform any consistency checks. WARNING: dimensions of matrices must match, otherwise an exception is thrown. More...
 
static void ArrayPower (IMatrix a, double power, IMatrix result)
 Element-by-element raise to power. WARNING: dimensions of matrices must match, otherwise an exception is thrown. More...
 
static void ArrayPower (IMatrix a, double power, ref IMatrix result)
 Element-by-element raise to power. WARNING: dimensions of operands must match, otherwise an exception is thrown. If dimensions of the result do not match then teh result is re-allocated. More...
 
static void ArrayMapPlain (IMatrix a, Converter< double, double > mapping, IMatrix result)
 Element-by-element mapping of an arbitrary function. This operation can be performed in place. This is a plain version of the method that does not perform any consistency checks. WARNING: dimensions of matrices must match, otherwise an exception is thrown. More...
 
static void ArrayMap (IMatrix a, Converter< double, double > mapping, IMatrix result)
 Element-by-element mapping of an arbitrary function. WARNING: dimensions of matrices must match, otherwise an exception is thrown. More...
 
static void ArrayMap (IMatrix a, Converter< double, double > mapping, ref IMatrix result)
 Element-by-element mapping of an arbitrary function. WARNING: dimensions of operands must match, otherwise an exception is thrown. If dimensions of the result do not match then teh result is re-allocated. More...
 
static void MultiplyPlain (IMatrix a, IMatrix b, IMatrix result)
 R=A*B. Multiplies two matrices and stores the result in the specified result matrix. This is a plain version of the method that does not perform any consistency checks. WARNING: dimensions of matrices must match, otherwise an exception is thrown. WARNING: This operation can not be performed in place. More...
 
static void Multiply (IMatrix a, IMatrix b, IMatrix result)
 R=A*B. Multiplies two matrices and stores the result in the specified result matrix. WARNING: dimensions of matrices must match, otherwise an exception is thrown. WARNING: This operation can not be performed in place. More...
 
static void Multiply (IMatrix a, IMatrix b, ref IMatrix result)
 R=A*B. Multiplies two matrices and stores the result in the specified result matrix. WARNING: dimensions of operands must match, otherwise an exception is thrown. WARNING: This operation can not be performed in place. If dimensions of the result do not match then the result is re-allocated. More...
 
static void MultiplyTranspMatPlain (IMatrix a, IMatrix b, IMatrix result)
 R=A^T*B Calculates product of transposed matrix and a matrix, and stores the result in the specified result matrix. This is a plain version of the method that does not perform any consistency checks. WARNING: dimensions of matrices must match, otherwise an exception is thrown. WARNING: This operation can not be performed in place. More...
 
static void MultiplyTranspMat (IMatrix a, IMatrix b, IMatrix result)
 R=A^T*B Multiplies two matrices and stores the result in the specified result matrix. WARNING: dimensions of matrices must match, otherwise an exception is thrown. WARNING: This operation can not be performed in place. More...
 
static void MultiplyTranspMat (IMatrix a, IMatrix b, ref IMatrix result)
 R=A^T*B Multiplies two matrices and stores the result in the specified result matrix. WARNING: dimensions of operands must match, otherwise an exception is thrown. WARNING: This operation can not be performed in place. If dimensions of the result do not match then the result is re-allocated. More...
 
static void MultiplyMatTranspPlain (IMatrix a, IMatrix b, IMatrix result)
 R=A*B^T. Multiplies a matrix by transpose of another matrix and stores the result in the specified result matrix. This is a plain version of the method that does not perform any consistency checks. WARNING: dimensions of matrices must match, otherwise an exception is thrown. WARNING: This operation can not be performed in place. More...
 
static void MultiplyMatTransp (IMatrix a, IMatrix b, IMatrix result)
 R=A*B^T. Multiplies a matrix by transpose of another matrix and stores the result in the specified result matrix. WARNING: dimensions of matrices must match, otherwise an exception is thrown. WARNING: This operation can not be performed in place. More...
 
static void MultiplyMatTransp (IMatrix a, IMatrix b, ref IMatrix result)
 R=A*B^T. Multiplies a matrix by transpose of another matrix and stores the result in the specified result matrix. WARNING: dimensions of operands must match, otherwise an exception is thrown. WARNING: This operation can not be performed in place. If dimensions of the result do not match then the result is re-allocated. More...
 
static void MultiplyTranspTranspPlain (IMatrix a, IMatrix b, IMatrix result)
 R=A^T*B^T. Multiplies transposed matrix by another transposed matrix, and stores the result in the specified result matrix. This is a plain version of the method that does not perform any consistency checks. WARNING: dimensions of matrices must match, otherwise an exception is thrown. WARNING: This operation can not be performed in place. More...
 
static void MultiplyTranspTransp (IMatrix a, IMatrix b, IMatrix result)
 R=A^T*B^T. Multiplies transposed matrix by another transposed matrix, and stores the result in the specified result matrix. WARNING: dimensions of matrices must match, otherwise an exception is thrown. WARNING: This operation can not be performed in place. More...
 
static void MultiplyTranspTransp (IMatrix a, IMatrix b, ref IMatrix result)
 R=A^T*B^T. Multiplies transposed matrix by another transposed matrix, and stores the result in the specified result matrix. WARNING: dimensions of operands must match, otherwise an exception is thrown. WARNING: This operation can not be performed in place. If dimensions of the result do not match then the result is re-allocated. More...
 
static void MultiplyPlain (IMatrix a, IMatrix b, IMatrix c, IMatrix result)
 R=A*B*C. Multiplies three matrices and stores the result in the specified result matrix. This is a plain version of the method that does not perform any consistency checks. WARNING: dimensions of matrices must match, otherwise an exception is thrown. WARNING: This operation can not be performed in place. More...
 
static void Multiply (IMatrix a, IMatrix b, IMatrix c, IMatrix result)
 R=A*B*C. Multiplies three matrices and stores the result in the specified result matrix. WARNING: dimensions of matrices must match, otherwise an exception is thrown. WARNING: This operation can not be performed in place. More...
 
static void Multiply (IMatrix a, IMatrix b, IMatrix c, ref IMatrix result)
 R=A*B*C. Multiplies three matrices and stores the result in the specified result matrix. WARNING: dimensions of operands must match, otherwise an exception is thrown. WARNING: This operation can not be performed in place. If dimensions of the result do not match then the result is re-allocated. More...
 
static void MultiplyTranspMatTranspPlain (IMatrix a, IMatrix b, IMatrix c, IMatrix result)
 R=A^T*B*C^T. Multiplies three matrices (transposed first argument, second argument, and transposed third argument) and stores the result in the specified result matrix. This is a plain version of the method that does not perform any consistency checks. WARNING: dimensions of all arguments must be consistent, otherwise an exception is thrown. WARNING: This operation can not be performed in place. More...
 
static void MultiplyTranspMatTransp (IMatrix a, IMatrix b, IMatrix c, IMatrix result)
 R=A^T*B*C^T. Multiplies three matrices (transposed first argument, second argument, and transposed third argument) and stores the result in the specified result matrix. WARNING: dimensions of all arguments must be consistent, otherwise an exception is thrown. WARNING: This operation can not be performed in place. More...
 
static void MultiplyTranspMatTransp (IMatrix a, IMatrix b, IMatrix c, ref IMatrix result)
 R=A^T*B*C^T. Multiplies three matrices (transposed first argument, second argument, and transposed third argument) and stores the result in the specified result matrix. WARNING: dimensions of operands must be consistent, otherwise an exception is thrown. WARNING: This operation can not be performed in place. If dimensions of the result do not match then the result is re-allocated. More...
 
static void MultiplyTranspMatMatPlain (IMatrix a, IMatrix b, IMatrix c, IMatrix result)
 R=A^T*B*C. Multiplies three matrices (transposed first argument, second argument, and third argument) and stores the result in the specified result matrix. This is a plain version of the method that does not perform any consistency checks. WARNING: dimensions of all arguments must be consistent, otherwise an exception is thrown. WARNING: This operation can not be performed in place. More...
 
static void MultiplyTranspMatMat (IMatrix a, IMatrix b, IMatrix c, IMatrix result)
 R=A^T*B*C. Multiplies three matrices (transposed first argument, second argument, and third argument) and stores the result in the specified result matrix. WARNING: dimensions of all arguments must be consistent, otherwise an exception is thrown. WARNING: This operation can not be performed in place. More...
 
static void MultiplyTranspMatMat (IMatrix a, IMatrix b, IMatrix c, ref IMatrix result)
 R=A^T*B*C. Multiplies three matrices (transposed first argument, second argument, and third argument) and stores the result in the specified result matrix. WARNING: dimensions of operands must be consistent, otherwise an exception is thrown. WARNING: This operation can not be performed in place. If dimensions of the result do not match then the result is re-allocated. More...
 
static void MultiplyMatMatTranspPlain (IMatrix a, IMatrix b, IMatrix c, IMatrix result)
 R=A*B*C^T. Multiplies three matrices (first argumet, second argumet, and transposed third argument) and stores the result in the specified result matrix. This is a plain version of the method that does not perform any consistency checks. WARNING: dimensions of matrices must match, otherwise an exception is thrown. WARNING: This operation can not be performed in place. More...
 
static void MultiplyMatMatTransp (IMatrix a, IMatrix b, IMatrix c, IMatrix result)
 R=A*B*C^T. Multiplies three matrices (first argumet, second argumet, and transposed third argument) and stores the result in the specified result matrix. WARNING: dimensions of matrices must match, otherwise an exception is thrown. WARNING: This operation can not be performed in place. More...
 
static void MultiplyMatMatTransp (IMatrix a, IMatrix b, IMatrix c, ref IMatrix result)
 R=A*B*C^T. Multiplies three matrices (first argumet, second argumet, and transposed third argument) and stores the result in the specified result matrix. WARNING: dimensions of operands must match, otherwise an exception is thrown. WARNING: This operation can not be performed in place. If dimensions of the result do not match then the result is re-allocated. More...
 
static void MultiplyMatTranspMatPlain (IMatrix a, IMatrix b, IMatrix c, IMatrix result)
 R=A*B^T*C. Multiplies three matrices (first argument, transposed second argument, and third argument) and stores the result in the specified result matrix. This is a plain version of the method that does not perform any consistency checks. WARNING: dimensions of matrices must match, otherwise an exception is thrown. WARNING: This operation can not be performed in place. More...
 
static void MultiplyMatTranspMat (IMatrix a, IMatrix b, IMatrix c, IMatrix result)
 R=A*B^T*C. Multiplies three matrices (first argument, transposed second argument, and third argument) and stores the result in the specified result matrix. WARNING: dimensions of matrices must match, otherwise an exception is thrown. WARNING: This operation can not be performed in place. More...
 
static void MultiplyMatTranspMat (IMatrix a, IMatrix b, IMatrix c, ref IMatrix result)
 R=A*B^T*C. Multiplies three matrices (first argument, transposed second argument, and third argument) and stores the result in the specified result matrix. WARNING: dimensions of operands must match, otherwise an exception is thrown. WARNING: This operation can not be performed in place. If dimensions of the result do not match then the result is re-allocated. More...
 
static void MultiplyTranspTranspTranspPlain (IMatrix a, IMatrix b, IMatrix c, IMatrix result)
 R=A^T*B^T*C^T. Multiplies three matrices and stores the result in the specified result matrix. This is a plain version of the method that does not perform any consistency checks. WARNING: dimensions of matrices must match, otherwise an exception is thrown. WARNING: This operation can not be performed in place. More...
 
static void MultiplyTranspTranspTransp (IMatrix a, IMatrix b, IMatrix c, IMatrix result)
 R=A^T*B^T*C^T. Multiplies three matrices and stores the result in the specified result matrix. WARNING: dimensions of matrices must match, otherwise an exception is thrown. WARNING: This operation can not be performed in place. More...
 
static void MultiplyTranspTranspTransp (IMatrix a, IMatrix b, IMatrix c, ref IMatrix result)
 R=A^T*B^T*C^T. Multiplies three matrices and stores the result in the specified result matrix. WARNING: dimensions of operands must match, otherwise an exception is thrown. WARNING: This operation can not be performed in place. If dimensions of the result do not match then the result is re-allocated. More...
 
static void MultiplyPlain (IMatrix a, IVector b, IVector result)
 R=A*b. Multiplies a matrix with a vector and stores the result in the specified result vector. Operation can not be performed in place. This is a plain version of the method that does not perform any consistency checks. WARNING: dimensions of matrices must match, otherwise an exception is thrown. More...
 
static void Multiply (IMatrix a, IVector b, IVector result)
 R=A*b. Multiplies a matrix with a vector and stores the result in the specified result vector. Operation can not be performed in place. WARNING: dimensions of matrices must match, otherwise an exception is thrown. More...
 
static void Multiply (IMatrix a, IVector b, ref IVector result)
 R=A*b. Multiplies matrix by scalar and stores the result in the specified result matrix. Operation can not be performed in place. WARNING: dimensions of operands must match, otherwise an exception is thrown. If dimensions of the result do not match then the result is re-allocated. More...
 
static void MultiplyTranspVecPlain (IMatrix a, IVector b, IVector result)
 R=A^T*b. Multiplies a transposed matrix with a vector and stores the result in the specified result vector. Operation can not be performed in place. This is a plain version of the method that does not perform any consistency checks. WARNING: dimensions of matrices must match, otherwise an exception is thrown. More...
 
static void MultiplyTranspVec (IMatrix a, IVector b, IVector result)
 R=A^T*b. Multiplies a transposed matrix with a vector and stores the result in the specified result vector. Operation can not be performed in place. WARNING: dimensions of matrices must match, otherwise an exception is thrown. More...
 
static void MultiplyTranspVec (IMatrix a, IVector b, ref IVector result)
 R=A^T*b. Multiplies transposed matrix by scalar and stores the result in the specified result matrix. Operation can not be performed in place. WARNING: dimensions of operands must match, otherwise an exception is thrown. If dimensions of the result do not match then the result is re-allocated. More...
 
static double MultiplyPlain (IVector left, IMatrix a, IVector right)
 R=a^T*M*b. Left-multiplies a matrix with a vector (transposed), right multiplies the result vith another vector, and returns the final result. Can be performed in place. This is a plain version of the method that does not perform any consistency checks. WARNING: dimensions of matrices must match, otherwise an exception is thrown. More...
 
static double Multiply (IVector left, IMatrix a, IVector right)
 R=a^T*M*b. Left-multiplies a matrix with a vector (transposed), right multiplies the result vith another vector, and returns the final result. Can be performed in place. WARNING: dimensions of matrices must match, otherwise an exception is thrown. More...
 
static double Multiply (IVector left, IMatrix a, IVector right, ref IVector result)
 R=a^T*M*b. Left-multiplies a matrix with a vector (transposed), right multiplies the result vith another vector, and returns the final result. Can be performed in place. WARNING: dimensions of operands must match, otherwise an exception is thrown. If dimensions of the result do not match then the result is re-allocated. More...
 
static void MultiplyPlain (IMatrix a, double b, IMatrix result)
 Multiplies matrix by scalar and stores the result in the specified result matrix. This is a plain version of the method that does not perform any consistency checks. This operation can be performed in place. WARNING: dimensions of matrices must match, otherwise an exception is thrown. More...
 
static void Multiply (IMatrix a, double b, IMatrix result)
 Multiplies matrix by scalar and stores the result in the specified result matrix. This operation can be performed in place. WARNING: dimensions of matrices must match, otherwise an exception is thrown. More...
 
static void Multiply (IMatrix a, double b, ref IMatrix result)
 Multiplies matrix by scalar and stores the result in the specified result matrix. This operation can be performed in place. WARNING: dimensions of operands must match, otherwise an exception is thrown. If dimensions of the result do not match then the result is re-allocated. More...
 
static void DividePlain (IMatrix a, double b, IMatrix result)
 Divides matrix by scalar and stores the result in the specified result matrix. This is a plain version of the method that does not perform any consistency checks. This operation can be performed in place. WARNING: dimensions of matrices must match, otherwise an exception is thrown. More...
 
static void Divide (IMatrix a, double b, IMatrix result)
 Divides matrix by scalar and stores the result in the specified result matrix. This operation can be performed in place. WARNING: dimensions of matrices must match, otherwise an exception is thrown. More...
 
static void Divide (IMatrix a, double b, ref IMatrix result)
 Divides matrix by scalar and stores the result in the specified result matrix. This operation can be performed in place. WARNING: dimensions of operands must match, otherwise an exception is thrown. If dimensions of the result do not match then the result is re-allocated. More...
 
static void MultiplyDiagonalPlain (IVector diag, IMatrix a, IMatrix result)
 Left-multiplies a matrix with a diagonal matrix, and stores the result in the specified result matrix. R=diag(d)*A This is a plain version of the method that does not perform any consistency checks. The operation can be done in place. WARNING: dimensions of matrices must match, otherwise an exception is thrown. More...
 
static void MultiplyDiagonal (IVector diag, IMatrix a, IMatrix result)
 Right-multiplies a matrix with a diagonal matrix, and stores the result in the specified result matrix. R=diag(d)*A WARNING: dimensions of matrices must match, otherwise an exception is thrown. More...
 
static void MultiplyDiagonal (IVector diag, IMatrix a, ref IMatrix result)
 Right-multiplies a matrix with a diagonal matrix, and stores the result in the specified result matrix. R=diag(d)*A WARNING: dimensions of operands must match, otherwise an exception is thrown. If dimensions of the result do not match then the result is re-allocated. More...
 
static void MultiplyInverseDiagonalPlain (IVector diag, IMatrix a, IMatrix result)
 Left-multiplies a matrix with inverse of a diagonal matrix, and stores the result in the specified result matrix. R=diag(d)^-1*A This is a plain version of the method that does not perform any consistency checks. The operation can be done in place. WARNING: dimensions of matrices must match, otherwise an exception is thrown. More...
 
static void MultiplyInverseDiagonal (IVector diag, IMatrix a, IMatrix result)
 Right-multiplies a matrix with inverse of a diagonal matrix, and stores the result in the specified result matrix. R=diag(d)^-1*A WARNING: dimensions of matrices must match, otherwise an exception is thrown. More...
 
static void MultiplyInverseDiagonal (IVector diag, IMatrix a, ref IMatrix result)
 Right-multiplies a matrix with inverse of a diagonal matrix, and stores the result in the specified result matrix. R=diag(d)^-1*A WARNING: dimensions of operands must match, otherwise an exception is thrown. If dimensions of the result do not match then the result is re-allocated. More...
 
static void MultiplyDiagonalPlain (IMatrix a, IVector diag, IMatrix result)
 Right-multiplies a matrix with a diagonal matrix, and stores the result in the specified result matrix. R=A*diag(d) This is a plain version of the method that does not perform any consistency checks. The operation can be done in place. WARNING: dimensions of matrices must match, otherwise an exception is thrown. More...
 
static void MultiplyDiagonal (IMatrix a, IVector diag, IMatrix result)
 Right-multiplies a matrix with a diagonal matrix, and stores the result in the specified result matrix. R=A*diag(d) WARNING: dimensions of matrices must match, otherwise an exception is thrown. More...
 
static void MultiplyDiagonal (IMatrix a, IVector diag, ref IMatrix result)
 Right-multiplies a matrix with a diagonal matrix, and stores the result in the specified result matrix. R=A*diag(d) WARNING: dimensions of operands must match, otherwise an exception is thrown. If dimensions of the result do not match then the result is re-allocated. More...
 
static void MultiplyInverseDiagonalPlain (IMatrix a, IVector diag, IMatrix result)
 Right-multiplies a matrix with inverse of a diagonal matrix, and stores the result in the specified result matrix. R=A*diag(d)^-1 This is a plain version of the method that does not perform any consistency checks. The operation can be done in place. WARNING: dimensions of matrices must match, otherwise an exception is thrown. More...
 
static void MultiplyInverseDiagonal (IMatrix a, IVector diag, IMatrix result)
 Right-multiplies a matrix with inverse of a diagonal matrix, and stores the result in the specified result matrix. R=A*diag(d)^-1 WARNING: dimensions of matrices must match, otherwise an exception is thrown. More...
 
static void MultiplyInverseDiagonal (IMatrix a, IVector diag, ref IMatrix result)
 Right-multiplies a matrix with inverse of a diagonal matrix, and stores the result in the specified result matrix. R=A*diag(d)^-1 WARNING: dimensions of operands must match, otherwise an exception is thrown. If dimensions of the result do not match then the result is re-allocated. More...
 
static int GetHashCode (IMatrix mat)
 Returns hashRet code of the specified matrix. More...
 
static bool Equals (IMatrix m1, IMatrix m2)
 Returns true if the specified matrices are equal, false if not. More...
 
static int GetHashFunctionInt (IMatrix mat)
 Returns an integer valued hashRet function of the specified matrix object. More...
 
static string GetHashFunctionString (IMatrix mat)
 Returns a string valued hashRet function of the specified matrix object. More...
 
static string ToStringReadable (IMatrix mat, int accuracy=4, int padding=8)
 Returns a readable string form of a matrix, accuracy and padding can be set. More...
 
static string ToStringNewlines (IMatrix mat)
 Returns a string representation of the specified matrix with newlines inserted after each row. Rows and elements are printed in comma separated lists in curly brackets. More...
 
static string ToStringNewlines (IMatrix mat, string elementFormat)
 Returns a string representation of the specified matrix with newlines inserted after each row, with the specified format for elements of the matrix. Rows and elements are printed in comma separated lists in curly brackets. More...
 
static string ToString (IMatrix mat)
 Returns string representation of the current matrix in the standard IGLib form (Mathematica-like format but with C representation of numbers). Rows and elements are printed in comma separated lists in curly brackets. More...
 
static string ToStringMath (IMatrix mat)
 Returns string representation of the current matrix in the standard IGLib form (Mathematica-like format but with C representation of numbers). Rows and elements are printed in comma separated lists in curly brackets. More...
 
static string ToString (IMatrix mat, string elementFormat)
 Returns string representation of the current matrix in the standard IGLib form (Mathematica-like format but with C representation of numbers), with the specified format for elements of the matrix. Rows and elements are printed in comma separated lists in curly brackets. More...
 
static string ToStringMath (IMatrix mat, string elementFormat)
 Returns string representation of the current matrix in the standard IGLib form (Mathematica-like format but with C representation of numbers), with the specified format for elements of the matrix. Rows and elements are printed in comma separated lists in curly brackets. More...
 
static void SaveJson (IMatrix mat, string filePath)
 Saves (serializes) the specified matrix to the specified JSON file. File is owerwritten if it exists. More...
 
static void SaveJson (IMatrix mat, string filePath, bool append)
 Saves (serializes) the specified matrix to the specified JSON file. More...
 
static void LoadJson (string filePath, ref IMatrix matRestored)
 Restores (deserializes) a matrix object from the specified file in JSON format. More...
 
static MatrixBase operator+ (MatrixBase m)
 Unary plus, returns the operand. More...
 
static MatrixBase operator- (MatrixBase m)
 Unary negation, returns the negative operand. More...
 
static MatrixBase operator+ (MatrixBase a, MatrixBase b)
 Matrix addition. More...
 
static MatrixBase operator- (MatrixBase a, MatrixBase b)
 Matrix subtraction. More...
 
static MatrixBase operator* (MatrixBase a, MatrixBase b)
 Product of two matrices. More...
 
static VectorBase operator* (MatrixBase a, VectorBase b)
 Product of a matrix and a vector. More...
 
static MatrixBase operator* (MatrixBase a, double b)
 Product of a matrix by a scalar. More...
 
static MatrixBase operator* (double a, MatrixBase b)
 Product of a matrix by a scalar. More...
 
static MatrixBase operator/ (MatrixBase a, double b)
 Matrix subtraction. More...
 
static double DeterminantSlow (IMatrix A)
 Simpler but slower (compared to Determinant) implementation of determinant calculation of an arbitrary square real matrix. More...
 
static double Determinant (IMatrix A, ref int[] auxPermutations, ref IMatrix auxLU)
 Calculates and returns determinant of a real-valued square matrix. More...
 
static void LuDecompose (IMatrix A, out int toggle, ref int[] perm, ref IMatrix result)
 Calculates thr Doolittle LU decomposition with partial pivoting (LUP) of a square real matrix. More...
 
static void LuSolve (IMatrix luMatrix, int[] perm, IVector b, ref IVector auxVec, ref IVector x)
 Solves a system of equations with the specified right-hand sides and the specified LU decomposition of the system matrix. More...
 
static void LuSolve (IMatrix luMatrix, int[] perm, IMatrix B, ref IVector auxVec, ref IVector auxRight, ref IVector auxX, ref IMatrix X)
 Calculates inverse of the matrix from its specified LU decomposition. More...
 
static void LuInverse (IMatrix luMatrix, int[] perm, ref IVector auxRight, ref IVector auxX, ref IMatrix res)
 Calculates inverse of the matrix from its specified LU decomposition. More...
 
static double LuDeterminant (IMatrix luMatrix, int toggle)
 Calculates and returns matrix determinant form its specified LU decomposition. More...
 
static void LuExtractLower (IMatrix matLu, ref IMatrix result)
 Extracts the lower part of the Doolittle specified LU decomposition (1s on diagonal, 0s in above diagonal) and stores it in the specified result matrix. More...
 
static IMatrix LuExtractUpper (IMatrix matLu, ref IMatrix result)
 Extracts the upper part of the specified Doolittle LU decomposition 0s below diagonal) and stores it in the specified result matrix. More...
 
static void PermutationArrayToMatrix (int[] perm, ref IMatrix res)
 Calculates and stores permutation matrix that correspond to the specified permutation array. More...
 
static void Permute (IMatrix A, int[] permutations, ref IMatrix result)
 Permutes rows of the specified aquare matrix according to the specified permutations array. More...
 
static void UnPermute (IMatrix Apermuted, int[] permutations, ref int[] auxArray, ref IMatrix result)
 Unpermutes the product of the specified DooLittle LU decomposition according to permutations array. More...
 
static bool TestLuDecomposition (int dim, int numRepetitions=1, double tol=1e-6, int outputLevel=0, IRandomGenerator randomGenerator=null, IMatrix A=null, IVector b=null)
 Performs a test of calculatons performed via LU decomposition of a matrix. Calculation times and error extents are measured and reported (if specified). More...
 
static void TestLuDecompositionDemo ()
 Demonstration of usae of LU decomposition. More...
 
static bool LdltDecompose (IMatrix A, ref IMatrix result, double tol=1e-12)
 Calculates LDLT decomposition of a real symmetric square matrix. More...
 
static void LdltSolve (IMatrix decomposed, IVector b, ref IVector x)
 Solves a system of eauations with the specified LDLT decomposition of a real symmetric square matrix. More...
 
static void LdltSolve (IMatrix ldltMatrix, IMatrix B, ref IVector auxX, ref IMatrix X)
 Calculates inverse of the matrix from its specified LDLT-decomposed matrix. More...
 
static void LdltInverse (IMatrix ldltMatrix, ref IVector auxX, ref IMatrix res)
 Calculates inverse of the matrix from its specified LDLT decomposition. More...
 
static double LdltDeterminant (IMatrix ldltMatrix)
 Calculates and returns determinant of a square symmetric matrix form its specified LDLT decomposition. More...
 
static void LdltExtractLower (IMatrix matLdlt, ref IMatrix result)
 Extracts the lower part of the specified LDLT decomposition (1s on diagonal, 0s above diagonal) and stores it in the specified result matrix. More...
 
static IMatrix LdltExtractUpper (IMatrix matLdlt, ref IMatrix result)
 Extracts the upper part of the specified LDLT decomposition (1s on diagonal, 0s in below diagonal) and stores it in the specified result matrix. More...
 
static IMatrix LdltExtractDiagonal (IMatrix matLdlt, ref IMatrix result)
 Extracts the diagonal part of the specified LDLT decomposition and stores it in the specified result matrix. More...
 
static bool TestLdltDecomposition (int dim, int numRepetitions=1, double tol=1e-6, int outputLevel=0, IRandomGenerator randomGenerator=null, IMatrix A=null, IVector b=null)
 Performs a test of calculatons performed via LDLT decomposition of a matrix. Calculation times and error extents are measured and reported (if specified). More...
 
static bool CholeskyDecompose (IMatrix A, ref IMatrix result, double tol=1e-12)
 Calculates Cholesky decomposition of a real symmetric square matrix. More...
 
static void CholeskySolve (IMatrix decomposed, IVector b, ref IVector x)
 Solves a system of eauations with the specified Cholesky decomposition of a real symmetric square matrix. More...
 
static void CholeskySolve (IMatrix CholeskyMatrix, IMatrix B, ref IVector auxX, ref IMatrix X)
 Calculates inverse of the matrix from its specified Cholesky-decomposed matrix. More...
 
static void CholeskyInverse (IMatrix CholeskyMatrix, ref IVector auxX, ref IMatrix res)
 Calculates inverse of the matrix from its specified Cholesky decomposition. More...
 
static double CholeskyDeterminant (IMatrix CholeskyMatrix)
 Calculates and returns determinant of a square symmetric matrix form its specified Cholesky decomposition. More...
 
static void CholeskyExtractLower (IMatrix matCholesky, ref IMatrix result)
 Extracts the lower part of the specified Cholesky decomposition (0s above diagonal) and stores it in the specified result matrix. More...
 
static IMatrix CholeskyExtractUpper (IMatrix matCholesky, ref IMatrix result)
 Extracts the upper part of the specified Cholesky decomposition (0s in below diagonal) and stores it in the specified result matrix. More...
 
static bool TestCholeskyDecomposition (int dim, int numRepetitions=1, double tol=1e-6, int outputLevel=0, IRandomGenerator randomGenerator=null, IMatrix A=null, IVector b=null)
 Performs test of calculatons performed via Cholesky decomposition of a matrix. Calculation times and error extents are measured and reported (if specified so). More...
 
static void TestCholeskyDecompositionDemo ()
 Demonstration of usae of Cholesky decomposition. More...
 
static bool QrDecomposeGrammSchmidt (IMatrix A, ref IMatrix resQ, ref IMatrix resR, double tol=1e-12)
 Calculates QR decomposition of a real invertible matrix by using Gramm-Schmidt orthogonalization. More...
 
static bool QrDecompose (IMatrix A, ref IMatrix resQ, ref IMatrix resR, double tol=1e-12)
 Calculates QR decomposition of a real invertible matrix. More...
 
static void QrSolve (IMatrix factorQ, IMatrix factorR, IVector b, ref IVector x)
 Solves a system of eauations with the specified QR decomposition of a real symmetric square matrix. More...
 
static void QrSolve (IMatrix factorQ, IMatrix factorR, IMatrix B, ref IVector auxB, ref IVector auxX, ref IMatrix X)
 Calculates inverse of the matrix from its specified LDLT-decomposed matrix. More...
 
static void QrInverse (IMatrix factorQ, IMatrix factorR, ref IVector auxB, ref IVector auxX, ref IMatrix res)
 Calculates inverse of the matrix from its specified LDLT decomposition. More...
 
static bool TestMatrixProducts (bool printReports)
 Tests various matrix and vector products with fixed tolerance of 1.0E-6. More...
 
static bool TestMatrixProducts (double tolerance)
 Tests various matrix and vector products, without printing reports. More...
 
static bool TestMatrixProducts ()
 Tests various matrix and vector products with fixed tolerance of 1.0E-6 and without printing reports. More...
 
static bool TestMatrixProducts (double tolerance, bool printReports)
 Tests various matrix and vector products. More...
 
static void TestStaticMethodCommon ()
 A test method, just prints some output. More...
 
static void TestStaticMethodSpecific ()
 A test method, just prints some output. More...
 
static bool TestIndices (int dim1=3, int dim2=4, IMatrix providedMatrix=null)
 Performs test of converson between double indexing and flat indexing of matric elements,. Returns true if successful, false othwrwise. More...
 

Static Protected Member Functions

static void LuSolveNoPermutationsPlain (IMatrix luMatrix, IVector b, IVector x)
 Solves a system of equations with the specified LU decomposition with already permuted b. More...
 
static bool CheckTestResult (IMatrix result, IMatrix referenceResult, double tolerance, bool printReports)
 Checks whether the difference between matrix result of the tested operation and some reference result is within the specified tolerance. More...
 
static bool CheckTestResult (IVector result, IVector referenceResult, double tolerance, bool printReports)
 Checks whether the difference between matrix result of the tested operation and some reference result is within the specified tolerance. More...
 

Properties

abstract int RowCount [get]
 Gets the number of rows of the current matrix. More...
 
abstract int ColumnCount [get]
 Gets the number of columns of the current matrix. More...
 
virtual int Count [get]
 Gets total number of elements. More...
 
virtual IMatrix T [get]
 Returns a new matrix that is transpose of the current matrix. More...
 
virtual double this[int flatIndex] [get, set]
 Gets or set the element indexed by a flat index in the Matrix. More...
 
virtual double this[int row, int column] [get, set]
 Gets or set the element indexed by (i, j) in the Matrix. More...
 
virtual double Trace [get]
 Gets matrix trace (sum of diagonal terms). More...
 
virtual double NormForbenius [get]
 Gets Forbenious (or Euclidean) norm of the matrix - square root of sum of squares of elements. More...
 
virtual double NormEuclidean [get]
 Gets Forbenious (or Euclidean) norm of the matrix - square root of sum of squares of elements. More...
 
virtual double Norm [get]
 Gets Forbenious (or Euclidean) norm of the matrix - square root of sum of squares of elements. More...
 
static MatrixStore MatrixStore [get]
 Gets the matrix store for recycling auxiliary matrices. More...
 

Static Private Member Functions

static bool TestMultiplyTranspMat (double tolerance, bool printReports)
 Tests product A^T*B. More...
 
static bool TestMultiplyMatTransp (double tolerance, bool printReports)
 Tests product A*B^T. More...
 
static bool TestMultiplyTranspTransp (double tolerance, bool printReports)
 Tests product A^T*B^T. More...
 
static bool TestMultiply3 (double tolerance, bool printReports)
 Tests product A*B*C. More...
 
static bool TestMultiplyTranspMatTransp (double tolerance, bool printReports)
 Tests product A^T*B*C^T. More...
 
static bool TestMultiplyTranspMatMat (double tolerance, bool printReports)
 Tests product A^T*B*C. More...
 
static bool TestMultiplyMatMatTransp (double tolerance, bool printReports)
 Tests product A*B*C^T. More...
 
static bool TestMultiplyMatTranspMat (double tolerance, bool printReports)
 Tests product A*B^T*C. More...
 
static bool TestMultiplyTranspTranspTransp (double tolerance, bool printReports)
 Tests product A^T*B^T*C^T. More...
 

Static Private Attributes

static MatrixStore _matrixStore
 

Detailed Description

Base class for matrices.

$A Igor Jan08 Jul10 Nov10;

Member Function Documentation

abstract MatrixBase IG.Num.MatrixBase.GetCopyBase ( )
pure virtual

Creates and returns a copy of the current matrix.

Returns
A new copy of the current matrix. The copy is supposed to be of the same type as the current matrix.

Implemented in IG.Num.Matrix, IG.Num.Matrix3d, and IG.Num.Matrix2d.

Referenced by IG.Num.MatrixBase.operator+(), and IG.Num.MatrixBase.operator-().

abstract MatrixBase IG.Num.MatrixBase.GetNewBase ( int  rowCount,
int  columnCount 
)
pure virtual

Creates and returns a new matrix with the specified dimensions, and of the same type as the current matrix.

Parameters
rowCountNumber fo rows of the newly created matrix.
columnCountNumber of columns of the newly created matrix.
Returns
A newly created matrix of the specified dimensions and of the same type as the current matrix.

Implemented in IG.Num.Matrix, IG.Num.Matrix3d, and IG.Num.Matrix2d.

Referenced by IG.Num.MatrixBase.operator*(), and IG.Num.MatrixBase.operator/().

abstract MatrixBase IG.Num.MatrixBase.GetNewBase ( )
pure virtual

Creates and returns a new matrix with the same dimensions and of the same type as the current matrix.

Implemented in IG.Num.Matrix, IG.Num.Matrix3d, and IG.Num.Matrix2d.

abstract VectorBase IG.Num.MatrixBase.GetNewVectorBase ( int  length)
pure virtual

Creates and returns a new vector with the specified dimension, and of the type that is consistent with the type of the current vector.

Parameters
lengthDimension of the newly created vector.
Returns
A newly created vector of the specified dimension and of the same type as the current vector.

Implemented in IG.Num.Matrix, IG.Num.Matrix3d, and IG.Num.Matrix2d.

virtual IMatrix IG.Num.MatrixBase.GetCopy ( )
inlinevirtual

Creates and returns a copy of the current matrix.

Returns
A new copy of the current matrix. The copy is supposed to be of the same type as the current matrix.

Implements IG.Num.IMatrix.

virtual IMatrix IG.Num.MatrixBase.GetNew ( int  rowCount,
int  columnCount 
)
inlinevirtual

Creates and returns a new matrix with the specified dimensions, and of the same type as the current matrix.

Parameters
rowCountNumber fo rows of the newly created matrix.
columnCountNumber of columns of the newly created matrix.
Returns
A newly created matrix of the specified dimensions and of the same type as the current matrix.

Implements IG.Num.IMatrix.

virtual IMatrix IG.Num.MatrixBase.GetNew ( )
inlinevirtual

Creates and returns a new matrix with the same dimensions and of the same type as the current matrix.

Implements IG.Num.IMatrix.

virtual IVector IG.Num.MatrixBase.GetNewVector ( int  length)
inlinevirtual

Creates and returns a new vector with the specified dimension, and of the type that is consistent with the type of the current vector.

Parameters
lengthDimension of the newly created vector.
Returns
A newly created vector of the specified dimension and of the same type as the current vector.

Implements IG.Num.IMatrix.

virtual double [,] IG.Num.MatrixBase.ToArray ( )
inlinevirtual

Creates and returns a rectangular 2D array that contains a component-wise copy of the matrix.

virtual double [][] IG.Num.MatrixBase.ToJaggedArray ( )
inlinevirtual

Creates and returns a jagged 2D array that contains a component-wise copy of the matrix.

static int IG.Num.MatrixBase.Index ( int  dim1,
int  dim2,
int  row,
int  column 
)
inlinestatic

Returns flat index corresponding to the specified row and column indices of a matrix with specified dimensions.

Parameters
dim1First index.
dim2Second index.
rowRow number (0-based).
columnCoolumn number (0-based).

Referenced by IG.Num.MatrixBase.TestIndices().

static int IG.Num.MatrixBase.Index ( IMatrix  mat,
int  row,
int  column 
)
inlinestatic

Calculates and returns flat index corresponding to the specified row and column indices of the specified matrix.

Parameters
matMatrix for which flat index is calculated.
rowRow number (0-based).
columnCoolumn number (0-based).
virtual int IG.Num.MatrixBase.Index ( int  row,
int  column 
)
inlinevirtual

Calculates and returns flat index corresponding to the specified row and column indices of the current matrix.

Parameters
rowRow number (0-based).
columnCoolumn number (0-based).
static void IG.Num.MatrixBase.Indices ( int  dim1,
int  dim2,
int  flatIndex,
out int  row,
out int  column 
)
inlinestatic

Returns (through output arguments) row and column indices corresponding to the specified flat index in a matrix with the specified dimensions.

Parameters
dim1First dimension of the matrix (number of rows).
dim2Second dimension of the matrix (number of columns).
flatIndexFlat element index, i.e. one dimensional index of a matrix element when elements are expanded to one dimensional array.
rowRow index corresponding to the specified flat index.
columnColumn index corresponding to the specified flat index.

Referenced by IG.Num.MatrixBase.TestIndices().

static void IG.Num.MatrixBase.Indices ( IMatrix  mat,
int  flatIndex,
out int  row,
out int  column 
)
inlinestatic

Returns (through output arguments) row and column indices corresponding to the specified flat index in the specified matrix.

Parameters
matMatrix for which flat index is calculated.
flatIndexFlat element index, i.e. one dimensional index of a matrix element obtained as if elements were expanded to one dimensional array.
rowRow index corresponding to the specified flat index.
columnColumn index corresponding to the specified flat index.
virtual void IG.Num.MatrixBase.Indices ( int  flatIndex,
out int  row,
out int  column 
)
inlinevirtual

Returns (through output arguments) row and column indices corresponding to the specified flat index in the current matrix.

Parameters
flatIndexFlat element index, i.e. one dimensional index of a matrix element obtained as if elements were expanded to one dimensional array.
rowRow index corresponding to the specified flat index.
columnColumn index corresponding to the specified flat index.
virtual void IG.Num.MatrixBase.SetZero ( )
inlinevirtual
virtual void IG.Num.MatrixBase.SetConstant ( double  elementValue)
inlinevirtual

Sets all components of the current matrix to the specified value.

Parameters
elementValueValue to which elements are set.

Implements IG.Num.IMatrix.

virtual void IG.Num.MatrixBase.SetIdentity ( )
inlinevirtual

Sets the current matrix to identity matrix. WARNING: Exception is thrown if a matrix is not square. For nonsquare matrices, use SetDiagonal(1.0)!

Implements IG.Num.IMatrix.

Referenced by IG.Num.MatrixBase.TestCholeskyDecomposition(), IG.Num.MatrixBase.TestCholeskyDecompositionDemo(), IG.Num.MatrixBase.TestLdltDecomposition(), and IG.Num.MatrixBase.TestLuDecompositionDemo().

virtual void IG.Num.MatrixBase.SetRandom ( )
inlinevirtual

Sets the current matrix such that it contains random elements on the interval (0,1].

Implements IG.Num.IMatrix.

Referenced by IG.Neural.NeuralAllpicationCommands.CmdTestJson(), IG.Num.Matrix2d.Random(), IG.Num.Matrix3d.Random(), IG.Num.Matrix.Random(), and IG.Num.MatrixBase.TestIndices().

virtual void IG.Num.MatrixBase.SetRandom ( IRandomGenerator  rnd)
inlinevirtual

Sets the current matrix such that it contains random elements on the interval (0,1].

Parameters
rndRandom generator used to generate matrix elements.

Implements IG.Num.IMatrix.

virtual void IG.Num.MatrixBase.SetDiagonal ( double  diagonalElement)
inlinevirtual

Sets the current matrix to the diagonal matrix with all diagonal elements equal to the specified value. Matrix does not need to be a square matrix.

Parameters
diagonalElementValue of diagonal elements.

Implements IG.Num.IMatrix.

virtual void IG.Num.MatrixBase.SetDiagonal ( IVector  diagonal)
inlinevirtual

Sets the current matrix to the diagonal matrix with diagonal element specified by a vector.

Parameters
diagonalVector of diagonal elements.

Implements IG.Num.IMatrix.

virtual bool IG.Num.MatrixBase.IsSquare ( )
inlinevirtual

Returns true if the current matrix is a square matrix, and false if not.

Implements IG.Num.IMatrix.

virtual bool IG.Num.MatrixBase.IsSymmetric ( )
inlinevirtual

Returns true if the current matrix is symmetric, and false if not. If the matrix is not a square matrix then false is returned.

Implements IG.Num.IMatrix.

Referenced by IG.Num.MatrixBase.TestCholeskyDecomposition(), and IG.Num.MatrixBase.TestLdltDecomposition().

virtual bool IG.Num.MatrixBase.IsSymmetric ( double  relativeRMSTolerance = 0.0)
inlinevirtual

Returns true if the specified matrix is symmetric within some tolerance, and false if not. If the matrix is null then false is returned.

Parameters
relativeRMSToleranceTolerance on the ratio between RMS of differences between out of diagonal terms and their transposes and between RMS of out of diagonal terms, below which matrix is considered symmetric.

Implements IG.Num.IMatrix.

virtual void IG.Num.MatrixBase.Negate ( )
inlinevirtual

Negates the current matrix.

Referenced by IG.Num.MatrixBase.operator-().

virtual void IG.Num.MatrixBase.Transpose ( )
inlinevirtual
override int IG.Num.MatrixBase.GetHashCode ( )
inline

Returns the hashRet code (hashRet function) of the current matrix.

This method calls the MatrixBase.GetHashCode(IMatrix) to calculate the hashRet code, which is standard for all implementations of the IMatrix interface.

Two matrices that have the same dimensions and equal elements will produce the same hashRet codes.

Probability that two different matrices will produce the same hashRet code is small but it exists.

Overrides the object.GetHashCode method.

References IG.Num.MatrixBase.GetHashCode().

Referenced by IG.Num.Matrix2d.GetHashCode(), IG.Num.Matrix3d.GetHashCode(), IG.Num.MatrixBase.GetHashCode(), and IG.Num.Matrix.GetHashCode().

override bool IG.Num.MatrixBase.Equals ( Object  obj)
inline

Returns a value indicating whether the specified object is equal to the current matrix.

True is returned if the object is a non-null matrix (i.e. it implements the IMatrix interface), and has the same dimension and equal elements as the current matrix.

This method calls the MatrixBase.Equals(IMatrix, IMatrix) to obtain the returned value, which is standard for all implementations of the IMatrix interface.

Overrides the object.Equals(Object) method.

References IG.Num.MatrixBase.Equals().

Referenced by IG.Num.Matrix2d.Equals(), IG.Num.Matrix3d.Equals(), IG.Num.MatrixBase.Equals(), and IG.Num.Matrix.Equals().

int IG.Num.MatrixBase.GetHashFunctionInt ( )
inline

Returns an integer valued hashRet function of the current matrix object.

The returned value is calculated by the Util.GetHashFunctionInt method.

See also
Util.GetHashFunctionInt

Implements IG.Num.IMatrix.

References IG.Lib.Util.GetHashFunctionInt().

string IG.Num.MatrixBase.GetHashFunctionString ( )
inline

Returns a string valued hashRet function of the current matrix object.

The returned value is calculated by the Util.GetHashFunctionString method.

The returned string is always of the same length, and is based on the ToString() method. Therefore it is convenient for use in file or directory names that have one part related to a specific matrix.

See also
Util.GetHashFunctionString

Implements IG.Num.IMatrix.

References IG.Lib.Util.GetHashFunctionString().

static void IG.Num.MatrixBase.SetZero ( IMatrix  mat)
inlinestatic

Sets all components of the specified matrix to 0.

Parameters
matMatrix whose components are set.
static void IG.Num.MatrixBase.SetConstant ( IMatrix  mat,
double  elementValue 
)
inlinestatic

Sets all components of the specified matrix to the specified value.

Parameters
matMatrix whose components are set.
elementValueValue to which elements are set.
static void IG.Num.MatrixBase.SetIdentity ( IMatrix  mat)
inlinestatic

Sets the specified matrix to identity matrix. WARNING: Works only for square matrices (exception is thrown if matrix is not square). For nonsquare matrices, use SetDiagonal(1.0)!

Parameters
matMatrix whose components are set.
static void IG.Num.MatrixBase.SetDiagonal ( IMatrix  mat,
IVector  diagonal 
)
inlinestatic

Sets the current matrix to the diagonal matrix with diagonal element specified by a vector.

Parameters
matMatrix whose components are set.
diagonalVector of diagonal elements.
static void IG.Num.MatrixBase.SetDiagonal ( IMatrix  mat,
double  diagonalElement 
)
inlinestatic

Sets the current matrix to the diagonal matrix with all diagonal elements equal to the specified value. Matrix does not need to be a square matrix.

Parameters
matMatrix whose components are set.
diagonalElementValue of diagonal elements.
static void IG.Num.MatrixBase.SetRandom ( IMatrix  mat)
inlinestatic

Sets the specified matrix such that it contains random elements on the interval (0,1].

Parameters
matMatrix whose components are set.

References IG.Num.RandomGenerator.Global.

static void IG.Num.MatrixBase.SetRandom ( IMatrix  mat,
IRandomGenerator  rnd = null 
)
inlinestatic

Sets the current matrix such that it contains random elements on the interval (0,1].

Parameters
matMatrix whose components are set.
rndRandom generator used to generate matrix elements. If null then the default (global) random generator iis taken.

References IG.Num.RandomGenerator.Global.

static void IG.Num.MatrixBase.SetRandomSymmetric ( IMatrix  mat)
inlinestatic

Sets the specified matrix such that it is symmetric and contains random elements on the interval (0,1].

Parameters
matMatrix whose components are set.

References IG.Num.RandomGenerator.Global.

static void IG.Num.MatrixBase.SetRandomSymmetric ( IMatrix  mat,
IRandomGenerator  rnd 
)
inlinestatic

Sets the specified matrix such that it is symmetric and contains random elements on the interval (0,1].

Parameters
matMatrix whose components are set.
rndRandom generator used to generate matrix elements. If null then the default (global) random generator iis taken.

References IG.Num.RandomGenerator.Global, and IG.Num.IRandomGenerator.NextDouble().

static void IG.Num.MatrixBase.SetRandomAntiSymmetric ( IMatrix  mat)
inlinestatic

Sets the specified matrix such that it is antisymmetric and contains random elements on the interval (0,1].

Parameters
matMatrix whose components are set.

References IG.Num.RandomGenerator.Global.

static void IG.Num.MatrixBase.SetRandomAntiSymmetric ( IMatrix  mat,
IRandomGenerator  rnd 
)
inlinestatic

Sets the specified matrix such that it is antisymmetric and contains random elements on the interval (0,1].

Matrix will have zero elements on the diagonal.

Parameters
matMatrix whose components are set.
rndRandom generator used to generate matrix elements. If null then the default (global) random generator iis taken.

References IG.Num.RandomGenerator.Global, and IG.Num.IRandomGenerator.NextDouble().

static void IG.Num.MatrixBase.SetRandomLowerTriangular ( IMatrix  mat)
inlinestatic

Sets the specified matrix such that it is lower triangular and contains random elements on the interval (0,1].

Parameters
matMatrix whose components are set.

References IG.Num.RandomGenerator.Global.

static void IG.Num.MatrixBase.SetRandomLowerTriangular ( IMatrix  mat,
IRandomGenerator  rnd 
)
inlinestatic

Sets the specified matrix such that it is lower triangular and contains random elements on the interval (0,1].

Parameters
matMatrix whose components are set.
rndRandom generator used to generate matrix elements. If null then the default (global) random generator iis taken.

References IG.Num.RandomGenerator.Global, and IG.Num.IRandomGenerator.NextDouble().

static void IG.Num.MatrixBase.SetRandomUpperTriangular ( IMatrix  mat)
inlinestatic

Sets the specified matrix such that it is upper triangular and contains random elements on the interval (0,1].

Parameters
matMatrix whose components are set.

References IG.Num.RandomGenerator.Global.

static void IG.Num.MatrixBase.SetRandomUpperTriangular ( IMatrix  mat,
IRandomGenerator  rnd 
)
inlinestatic

Sets the specified matrix such that it is upper triangular and contains random elements on the interval (0,1].

Parameters
matMatrix whose components are set.
rndRandom generator used to generate matrix elements. If null then the default (global) random generator iis taken.

References IG.Num.RandomGenerator.Global, and IG.Num.IRandomGenerator.NextDouble().

static void IG.Num.MatrixBase.SetRandomSymmetricPositiveDefinite ( IMatrix  mat)
inlinestatic

Sets the specified matrix such that it is positive definite and contains random elements on the interval (0,1].

Parameters
matMatrix whose components are set.

References IG.Num.RandomGenerator.Global.

static void IG.Num.MatrixBase.SetRandomSymmetricPositiveDefinite ( IMatrix  mat,
IRandomGenerator  rnd 
)
inlinestatic

Sets the specified matrix such that it is positive definite and contains random elements.

Parameters
matMatrix whose components are set.
rndRandom generator used to generate matrix elements.

This method is relativley slow because of multiplication of two matrices. For quicker method use SetRandomPositiveDiagonallyDominantSymmetric(IMatrix, IRandomGenerator, double).

Matrix is created in such a way that a random lower triangular matrix with positive diagonal elements is created first, then it is multiplied by its transpose.

It seems that generation of positive definite matrices in this way is not stable when elements of the lower triangular matrix are random on the interval [0,1). For this reason, 1 is added to all diagonal elements of the lower triangular matrix.

static void IG.Num.MatrixBase.SetRandomPositiveDiagonallyDominant ( IMatrix  mat,
IRandomGenerator  rnd = null,
double  dominancyFactor = 100.0 
)
inlinestatic

Sets the specified matrix such that it is has random elements and is diagonally dominant with positive diagonal elements, i.e. any diagonal element is greater by absolute value than sum of absolute values of nondiagonal elements in the corresponding column.

Parameters
matMatrix whose components are set.
rndRandom generator used to generate matrix elements. If null then global ranom generator is taken.
dominancyFactorFactor such that any diagonal element is by absolute value at least by this factor greater than the sum of absolute values of nondiagonal elements in the corresponding column.

References IG.Num.RandomGenerator.Global.

static void IG.Num.MatrixBase.SetRandomPositiveDiagonallyDominant ( IMatrix  mat,
double  dominancyFactor 
)
inlinestatic

Sets the specified matrix such that it is has random elements and is diagonally dominant with positive diagonal elements, i.e. any diagonal element is greater by absolute value than sum of absolute values of nondiagonal elements in the corresponding column.

Parameters
matMatrix whose components are set.
dominancyFactorThe average ratio between absolute value of any diagonal term and the sum of absolute values of out of diagonal terms in the same column. Should be greater than 1.
static void IG.Num.MatrixBase.SetRandomPositiveDiagonallyDominantSymmetric ( IMatrix  mat,
IRandomGenerator  rnd = null,
double  dominancyFactor = 100.0 
)
inlinestatic

Sets the specified matrix such that it is has random elements and is symmetric diagonally dominant with positive diagonal elements, i.e. any diagonal element is greater by absolute value than sum of absolute values of nondiagonal elements in the corresponding column.

Parameters
matMatrix whose components are set.
rndRandom generator used to generate matrix elements. If null then global random generator is taken.
dominancyFactorFactor such that any diagonal element is by absolute value at least by this factor greater than the sum of absolute values of nondiagonal elements in the corresponding column.

Referenced by IG.Num.SpeedTestCpu.TestComputationalTimesCholesky_Base(), IG.Num.SpeedTestCpu.TestComputationalTimesCholesky_IGLib(), and IG.Num.SpeedTestCpu.TestComputationalTimesLdlt_Base().

static void IG.Num.MatrixBase.SetRandomPositiveDiagonallyDominantSymmetric ( IMatrix  mat,
double  dominancyFactor 
)
inlinestatic

Sets the specified matrix such that it is has random elements and is symmetric diagonally dominant with positive diagonal elements, i.e. any diagonal element is greater by absolute value than sum of absolute values of nondiagonal elements in the corresponding column.

Parameters
matMatrix whose components are set.
dominancyFactorThe average ratio between absolute value of any diagonal term and the sum of absolute values of out of diagonal terms in the same column. Should be greater than 1.
static double IG.Num.MatrixBase.SetRandomInvertible ( IMatrix  mat,
IRandomGenerator  rnd = null 
)
inlinestatic

Sets the specified QUADRATIC matrix such that it is has random elements and is nonsingular.

Matrix elements are generated from a product of random lower triangular matrix with 1 on diagonal and a random upper triangular matrix with elements on the diagonal betweeen 1 and 2, both with nondiagonal terms between 0 (inclusive) and 1.

Determminant of the generated matrix is returned.

Parameters
matMatrix whose components are set.
rndRandom generator used to generate matrix elements. If null then global random generator is taken.
Returns
Determinant of the generated matrix, so it can be used in checks.

References IG.Num.RandomGenerator.Global.

Referenced by IG.Num.MatrixBase.TestLuDecomposition().

static double IG.Num.MatrixBase.SetRandomPositiveDefiniteSymmetric ( IMatrix  mat,
IRandomGenerator  rnd = null 
)
inlinestatic

Sets the specified QUADRATIC matrix such that it is has random elements and is a symmetric positive definite matrix.

Matrix elements are generated from a product of random lower triangular matrix with diagonal elements betweeen 1 and 2, and below diagonal elements between 0 (inclusive) and 1, and its transpose (i.e. from random Cholesky factors).

Determminant of the generated matrix is returned.

Parameters
matMatrix whose components are set.
rndRandom generator used to generate matrix elements. If null then global random generator is taken.
Returns
Determinant of the generated matrix, so it can be used in checks.

References IG.Num.RandomGenerator.Global.

Referenced by IG.Num.MatrixBase.TestCholeskyDecomposition(), and IG.Num.MatrixBase.TestLdltDecomposition().

static bool IG.Num.MatrixBase.IsSquare ( IMatrix  mat)
inlinestatic

Returns true if the specified matrix is a square matrix, and false if not. If the matrix is null then false is returned.

Parameters
matMatrix that is tested for being square.
static bool IG.Num.MatrixBase.IsSymmetric ( IMatrix  mat)
inlinestatic

Returns true if the specified matrix is symmetric, and false if not. If the matrix is null then false is returned.

Parameters
matMatrix that is tested for being symmetric.
static bool IG.Num.MatrixBase.IsSymmetric ( IMatrix  mat,
double  relativeRMSTolerance 
)
inlinestatic

Returns true if the specified matrix is symmetric within some tolerance, and false if not. If the matrix is null then false is returned.

Parameters
matMatrix that is tested for being symmetric.
relativeRMSToleranceTolerance on the ratio between RMS of differences between out of diagonal terms and their transposes and between RMS of out of diagonal terms, below which matrix is considered symmetric.
static int IG.Num.MatrixBase.Compare ( IMatrix  m1,
IMatrix  m2 
)
inlinestatic

Compares two matrices and returns -1 if the first matrix is smaller than the second one, 0 if matrices are equal, and 1 if the first matrix is greater. Matrix that is null is considered smaller than a matrix that is not null. Two null matrices are considered equal. Matrix with smaller dimension is considered smaller than a matrix with greater dimension. Matrices with equal dimensions ar compared by elements. The first element that is different decides which matrix is considered greater.

Parameters
m1First matrix to be compared.
m2Second matrix to be compared.
Returns
-1 if the first matrix is smaller than the second one, 0 if matrices are equal, and 1 if the second is greater.

This comparison does not have any mathematical meaning, it is just used for sotting of matrices in data structures.

static void IG.Num.MatrixBase.Resize ( ref IMatrix  mat,
IMatrix  template,
int  rowCount,
int  columnCount 
)
inlinestatic

Resizes, if necessary, the specified matrix according to the required dimensions. If the matrix is initially null then a new matrix is created. If in this case a template matrix is specified then the newly created matrix will be of the same type as that template matrix, because it is created by the GetNew() method on that matrix. If dimensions of the initial matrix do not match the required dim., then matrix is resized. If the specified matrix dimension is less or equal to 0 then matrix is resized with the same dimensions as those of the template matirx. If in this case the template matrix is null, an exception is thrown. WARNINGS: Components are NOT preserved and have in general undefined values after operation is performed. If matrix and template are both null then the type of nawly created matrix is Matrix.

Parameters
matMatrix that is resized.
templateMatrix that is taken as template (for type of a newly created matrix or for dimensions if they are not specified).
rowCountIf greater than 0 then it specifies the number of rows to which matrix is resized.
columnCountIf greater than 0 then it specifies the number of columns to which matrix is resized.

Referenced by IG.Num.AnalysisResults.PrepareResultStorage(), IG.Lib.UtilConsole.Read(), and IG.Num.LinearSolverBase.Solve().

static void IG.Num.MatrixBase.Resize ( ref IMatrix  mat,
int  rowCount,
int  columnCount 
)
inlinestatic

Resizes, if necessary, the specified matrix according to the required dimensions. If the matrix is initially null then a new matrix (of type Matrix) is created. If dimensions of the initial matrix do not match the required dimensions, then matrix is resized. Components are NOT preserved and have in general undefined values after operation is performed. WARNING: If the matrix is initially null then the type of the newly created matrix is Matrix.

Parameters
matVMatrix that is resized.
rowCountDimension to which matrix is resized (if less than 1 then exception is thrown).
columnCountDimension to which matrix is resized (if less than 1 then exception is thrown).
static void IG.Num.MatrixBase.Resize ( ref IMatrix  mat,
IMatrix  template 
)
inlinestatic

Resizes, if necessary, the specified matrix according to the dimensions of the specified template matrix. If the matrix is initially null then a new matrix is created. In this case the newly created matrix will be of the same type as that template matrix, because it is created by the GetNew() method on that matrix. If dimensions of the initial matrix do not match the dimensions of the template matrix, then matrix is resized. If the template matrix is null, then an exception is thrown. WARNINGS: Components are NOT preserved and have in general undefined values after operation is performed. If matrix and template are null then the type of newly created matrix is Matrix.

Parameters
matMatrix that is resized.
templateMatrix that is taken as template (for type of a newly created matrix or for dimensions).
static void IG.Num.MatrixBase.CopyPlain ( IMatrix  a,
IMatrix  result 
)
inlinestatic

Copies components of a matrix to another matrix. This is a plain version of the method that does not perform any consistency checks. WARNING: dimensions of the copied matrix and result storage must match.

Parameters
aOriginal matrix.
resultMatrix where copy will be stored. Dimensions must match dimensions of original.

Referenced by IG.Num.AffineTransformationSquare.CalculateInverseTransformationMatrix(), IG.Num.AffineTransformationSquare.CalculateTransformationMatrix(), IG.Num.MatrixBase.CholeskyDecompose(), IG.Num.MatrixBase.LdltDecompose(), IG.Num.AffineTransformationSquare.TransformBackHessianPlain(), and IG.Num.AffineTransformationSquare.TransformHessianPlain().

static void IG.Num.MatrixBase.Copy ( IMatrix  a,
IMatrix  result 
)
inlinestatic

Copies components of a matrix to another matrix. WARNING: dimensions of the copied matrix and result storage must match.

Parameters
aOriginal matrix.
resultMatrix where copy will be stored. Dimensions must match dimensions of original.

Referenced by IG.Num.MatrixBase.LuDecompose().

static void IG.Num.MatrixBase.Copy ( IMatrix  a,
ref IMatrix  result 
)
inlinestatic

Copies components of a matrix to another matrix. Resulting matrix is allocated or reallocated if necessary.

Parameters
aOriginal matrix.
resultMatrix where copy is stored.

References IG.Num.IMatrix.GetNew().

static void IG.Num.MatrixBase.CopyPlain ( MatrixBase_MathNetNumerics  a,
IMatrix  result 
)
inlinestatic

Copies components of a matrix to another matrix. This is a plain version of the method that does not perform any consistency checks. WARNING: dimensions of the copied matrix and result storage must match.

Parameters
aOriginal matrix.
resultMatrix where copy will be stored. Dimensions must match dimensions of original.
static void IG.Num.MatrixBase.Copy ( MatrixBase_MathNetNumerics  a,
IMatrix  result 
)
inlinestatic

Copies components of a matrix to another matrix. WARNING: dimensions of the copied matrix and result storage must match.

Parameters
aOriginal matrix.
resultMatrix where copy will be stored. Dimensions must match dimensions of original.
static void IG.Num.MatrixBase.Copy ( MatrixBase_MathNetNumerics  a,
ref IMatrix  result 
)
inlinestatic

Copies components of a matrix to another matrix. Resulting matrix is allocated or reallocated if necessary.

Parameters
aOriginal matrix.
resultMatrix where copy is stored.
static void IG.Num.MatrixBase.CopyPlain ( IMatrix  a,
Matrix_MathNetNumercs  result 
)
inlinestatic

Copies components of a matrix to another matrix. This is a plain version of the method that does not perform any consistency checks. WARNING: dimensions of the copied matrix and result storage must match.

Parameters
aOriginal matrix.
resultMatrix where copy will be stored. Dimensions must match dimensions of original.
static void IG.Num.MatrixBase.Copy ( IMatrix  a,
Matrix_MathNetNumercs  result 
)
inlinestatic

Copies components of a matrix to another matrix. WARNING: dimensions of the copied matrix and result storage must match.

Parameters
aOriginal matrix.
resultMatrix where copy will be stored. Dimensions must match dimensions of original.
static void IG.Num.MatrixBase.Copy ( IMatrix  a,
ref Matrix_MathNetNumercs  result 
)
inlinestatic

Copies components of a matrix to another matrix. Resulting matrix is allocated or reallocated if necessary.

Parameters
aOriginal matrix.
resultMatrix where copy is stored.
static void IG.Num.MatrixBase.NegatePlain ( IMatrix  a,
IMatrix  result 
)
inlinestatic

Stores a negative matrix of the operand in another matrix. Can be done in-place. This is a plain version of the method that does not perform any consistency checks. WARNING: dimensions of the operand and result storage must match.

Parameters
aOperand.
resultMatrix where result is stored. Dimensions must match dimensions of operand.
static void IG.Num.MatrixBase.Negate ( IMatrix  a,
IMatrix  result 
)
inlinestatic

Stores a negative matrix of the operand in another matrix. Can be done in-place. WARNING: dimensions of the operand and result storage must match.

Parameters
aOperand.
resultMatrix where result is stored. Dimensions must match dimensions of operand.
static void IG.Num.MatrixBase.Negate ( IMatrix  a,
ref IMatrix  result 
)
inlinestatic

Stores a negative matrix of the operand in another matrix. Can be done in-place. Resulting matrix is allocated or reallocated if necessary.

Parameters
aOriginal matrix.
resultMatrix where result of negation is be stored.

References IG.Num.IMatrix.GetNew().

static void IG.Num.MatrixBase.TransposePlain ( IMatrix  a,
IMatrix  result 
)
inlinestatic

Stores transpose of the operand in another matrix. Can be done in-place. This is a plain version of the method that does not perform any consistency checks. WARNING: dimensions of the operand and result storage must match.

Parameters
aOperand.
resultMatrix where result is stored. Dimensions must match dimensions of operand.
static void IG.Num.MatrixBase.Transpose ( IMatrix  a,
IMatrix  result 
)
inlinestatic

Stores transpose of the operand in another matrix. Can be done in-place. WARNING: dimensions of the operand and result storage must match.

Parameters
aOperand.
resultMatrix where result is stored. Dimensions must match dimensions of operand.
static void IG.Num.MatrixBase.Transpose ( IMatrix  a,
ref IMatrix  result 
)
inlinestatic

Stores transpose of the matrix operand in another matrix. Can be done in-place. Resulting matrix is allocated or reallocated if necessary.

Parameters
aOriginal matrix.
resultMatrix where result of negation is be stored.

References IG.Num.IMatrix.GetNew().

static void IG.Num.MatrixBase.SymmetrizePlain ( IMatrix  a,
IMatrix  sym,
IMatrix  antiSym 
)
inlinestatic

Calculates symmetric and antisymmetric part of the specified matrix (symmetric part is stored in the first result argument but is calculated last, such that it overrides antisymmetric when both arguments point to the same matrix object).

Can be done in-place.

When both symmetric and antisymmetric result arguments point to the same matrix, symmetric part is stored in the matrix.

This is a plain version of the method that does not perform any consistency checks. WARNING: dimensions of the operand and result storage must match.

WARNING: If this antiSym points to the same matrix object as sym then symmetric part is stored in this matrix (because it overrides antisymmetric part).

Parameters
aMatrix whose symmetric and antisymmetric part are calculated.
symMatrix where symmetric part of a is stored.
antiSymMatrix where antisymmetric part of a is stored.

WARNING: If this argument points to the same matrix object as sym then symmetric part is stored in this matrix (because it overrides antisymmetric part).

static void IG.Num.MatrixBase.Symmetrize ( IMatrix  a,
IMatrix  sym,
IMatrix  antiSym 
)
inlinestatic

Calculates symmetric and antisymmetric part of the specified matrix (symmetric part is stored in the first result argument but is calculated last, such that it overrides antisymmetric when both arguments point to the same matrix object).

Can be done in-place.

When both symmetric and antisymmetric result arguments point to the same matrix, exception is thrown.

Dimensions of the operand and result storage must match, otherwise exception is thrown.

Parameters
aMatrix whose symmetric and antisymmetric part are calculated.
symMatrix where symmetric part of a is stored.
antiSymMatrix where antisymmetric part of a is stored.

WARNING: If this argument points to the same matrix object as sym then exception is thrown.

static void IG.Num.MatrixBase.Symmetrize ( IMatrix  a,
ref IMatrix  sym,
ref IMatrix  antiSym 
)
inlinestatic

Stores symmetrized and antisymmetirzed matrix obtained from the specified matrix. Resulting matrix is allocated or reallocated if necessary.

Parameters
aOriginal matrix.
symMatrix where result of symmetrization is stored.
antiSymMatrix where result of antisymmetrization is stored.

References IG.Num.IMatrix.GetNew().

static void IG.Num.MatrixBase.SymmetricPartPlain ( IMatrix  a,
IMatrix  result 
)
inlinestatic

Stores symmetric part of a square matrix operand in another matrix. Symmetrization is performed by averaging of non-diagonal terms and their transposed terms. Can be done in-place. This is a plain version of the method that does not perform any consistency checks. WARNING: dimensions of the operand and result storage must match.

Parameters
aOperand, must be a square matrix.
resultMatrix where result is stored. Dimensions must match dimensions of operand.

Referenced by IG.Num.SampledDataSet.CreateExampleQuadratic().

static void IG.Num.MatrixBase.SymmetricPart ( IMatrix  a,
IMatrix  result 
)
inlinestatic

Stores symmetric part of a square matrix operand in another matrix. Symmetrization is performed by averaging of non-diagonal terms and their transposed terms. Can be done in-place. WARNING: dimensions of the operand and result storage must match.

Parameters
aOperand, must be a square matrix.
resultMatrix where result is stored. Dimensions must match dimensions of operand.
static void IG.Num.MatrixBase.SymmetricPart ( IMatrix  a,
ref IMatrix  result 
)
inlinestatic

Stores symmetric part of a square matrix operand in another matrix. Symmetrization is performed by averaging of non-diagonal terms and their transposed terms. Can be done in-place. Resulting matrix is allocated or reallocated if necessary.

Parameters
aOriginal matrix, must be a square matrix.
resultMatrix where result of negation is be stored.

References IG.Num.IMatrix.GetNew().

static void IG.Num.MatrixBase.AntisymmetricPartPlain ( IMatrix  a,
IMatrix  result 
)
inlinestatic

Stores antisymmetric part of a square matrix operand in another matrix. Antisymmetrization is performed by subtracting non-diagonal terms and their transposed terms, division by 2 and storing result in one matrix element and its negative value in another element. Can be done in-place. This is a plain version of the method that does not perform any consistency checks. WARNING: dimensions of the operand and result storage must match.

Parameters
aOperand; must be a square matrix.
resultMatrix where result is stored. Dimensions must match dimensions of operand.
static void IG.Num.MatrixBase.AntisymmetricPart ( IMatrix  a,
IMatrix  result 
)
inlinestatic

Stores antisymmetric part of a square matrix operand in another matrix. Antisymmetrization is performed by subtracting non-diagonal terms and their transposed terms, division by 2 and storing result in one matrix element and its negative value in another element. Can be done in-place. WARNING: dimensions of the operand and result storage must match.

Parameters
aOperand, must be a square matrix.
resultMatrix where result is stored. Dimensions must match dimensions of operand.
static void IG.Num.MatrixBase.AntisymmetricPart ( IMatrix  a,
ref IMatrix  result 
)
inlinestatic

Stores antisymmetric part of a square matrix operand in another matrix. Antisymmetrization is performed by subtracting non-diagonal terms and their transposed terms, division by 2 and storing result in one matrix element and its negative value in another element. Can be done in-place. Resulting matrix is allocated or reallocated if necessary.

Parameters
aOriginal matrix, must be a square matrix.
resultMatrix where result of negation is be stored.

References IG.Num.IMatrix.GetNew().

static void IG.Num.MatrixBase.AddPlain ( IMatrix  a,
IMatrix  b,
IMatrix  result 
)
inlinestatic

Sums two matrices and stores the result in the specified result matrix. Operation can be performed in place. This is a plain version of the method that does not perform any consistency checks. WARNING: dimensions of matrices must match, otherwise an exception is thrown.

Parameters
aFirst operand.
bSecond operand.
resultMatrix where result is stored. Dimensions must match dimensions of operands.
static void IG.Num.MatrixBase.Add ( IMatrix  a,
IMatrix  b,
IMatrix  result 
)
inlinestatic

Sums two matrices and stores the result in the specified result matrix. WARNING: dimensions of matrices must match, otherwise an exception is thrown.

Parameters
aFirst operand.
bSecond operand.
resultMatrix where result is stored. Dimensions must match dimensions of operands.
static void IG.Num.MatrixBase.Add ( IMatrix  a,
IMatrix  b,
ref IMatrix  result 
)
inlinestatic

Sums two matrices and stores the result in the specified result matrix. Operation can be performed in place. WARNING: dimensions of operands must match, otherwise an exception is thrown. If dimensions of the result do not match then teh result is re-allocated.

Parameters
aFirst operand.
bSecond operand.
resultMatrix where result is stored.

References IG.Num.IMatrix.GetNew().

static void IG.Num.MatrixBase.SubtractPlain ( IMatrix  a,
IMatrix  b,
IMatrix  result 
)
inlinestatic

Subtracts two matrices and stores the result in the specified result matrix. Operation can be performed in place. This is a plain version of the method that does not perform any consistency checks. WARNING: dimensions of matrices must match, otherwise an exception is thrown.

Parameters
aFirst operand.
bSecond operand.
resultMatrix where the result is stored. Dimensions must match dimensions of operands.
static void IG.Num.MatrixBase.Subtract ( IMatrix  a,
IMatrix  b,
ref IMatrix  result 
)
inlinestatic

Subtracts two matrices and stores the result in the specified result matrix. Operation can be performed in place. WARNING: dimensions of operands must match, otherwise an exception is thrown. If dimensions of the result do not match then teh result is re-allocated.

Parameters
aFirst operand.
bSecond operand.
resultMatrix where result is stored.

References IG.Num.IMatrix.GetNew().

static void IG.Num.MatrixBase.ArrayMultiplyPlain ( IMatrix  a,
IMatrix  b,
IMatrix  result 
)
inlinestatic

Element-by-element multiplication. This operation can be performed in place. This is a plain version of the method that does not perform any consistency checks. WARNING: dimensions of matrices must match, otherwise an exception is thrown.

Parameters
aFirst operand.
bSecond operand.
resultMatrix where the result is stored. Dimensions must match dimensions of operands.
static void IG.Num.MatrixBase.ArrayMultiply ( IMatrix  a,
IMatrix  b,
IMatrix  result 
)
inlinestatic

Element-by-element multiplication. WARNING: dimensions of matrices must match, otherwise an exception is thrown.

Parameters
aFirst operand.
bSecond operand.
resultMatrix where the result is stored. Dimensions must match dimensions of operands.
static void IG.Num.MatrixBase.ArrayMultiply ( IMatrix  a,
IMatrix  b,
ref IMatrix  result 
)
inlinestatic

Element-by-element multiplication. WARNING: dimensions of operands must match, otherwise an exception is thrown. If dimensions of the result do not match then teh result is re-allocated.

Parameters
aFirst operand.
bSecond operand.
resultMatrix where result is stored.

References IG.Num.IMatrix.GetNew().

static void IG.Num.MatrixBase.ArrayDividePlain ( IMatrix  a,
IMatrix  b,
IMatrix  result 
)
inlinestatic

Element-by-element division. This operation can be performed in place. This is a plain version of the method that does not perform any consistency checks. WARNING: dimensions of matrices must match, otherwise an exception is thrown.

Parameters
aFirst operand.
bSecond operand.
resultMatrix where the result is stored. Dimensions must match dimensions of operands.
static void IG.Num.MatrixBase.ArrayDivide ( IMatrix  a,
IMatrix  b,
IMatrix  result 
)
inlinestatic

Element-by-element division. WARNING: dimensions of matrices must match, otherwise an exception is thrown.

Parameters
aFirst operand.
bSecond operand.
resultMatrix where the result is stored. Dimensions must match dimensions of operands.
static void IG.Num.MatrixBase.ArrayDivide ( IMatrix  a,
IMatrix  b,
ref IMatrix  result 
)
inlinestatic

Element-by-element division. WARNING: dimensions of operands must match, otherwise an exception is thrown. If dimensions of the result do not match then teh result is re-allocated.

Parameters
aFirst operand.
bSecond operand.
resultMatrix where result is stored.

References IG.Num.IMatrix.GetNew().

static void IG.Num.MatrixBase.ArrayPowerPlain ( IMatrix  a,
double  power,
IMatrix  result 
)
inlinestatic

Element-by-element raise to power. This operation can be performed in place. This is a plain version of the method that does not perform any consistency checks. WARNING: dimensions of matrices must match, otherwise an exception is thrown.

Parameters
aFirst operand.
powerPower to which elements of the matrix are raised.
resultMatrix where the result is stored. Dimensions must match dimensions of operands.
static void IG.Num.MatrixBase.ArrayPower ( IMatrix  a,
double  power,
IMatrix  result 
)
inlinestatic

Element-by-element raise to power. WARNING: dimensions of matrices must match, otherwise an exception is thrown.

Parameters
aFirst operand.
powerPower to which elements of the matrix are raised.
resultMatrix where the result is stored. Dimensions must match dimensions of operands.
static void IG.Num.MatrixBase.ArrayPower ( IMatrix  a,
double  power,
ref IMatrix  result 
)
inlinestatic

Element-by-element raise to power. WARNING: dimensions of operands must match, otherwise an exception is thrown. If dimensions of the result do not match then teh result is re-allocated.

Parameters
aFirst operand.
powerPower to which elements of the matrix are raised.
resultMatrix where result is stored.

References IG.Num.IMatrix.GetNew().

static void IG.Num.MatrixBase.ArrayMapPlain ( IMatrix  a,
Converter< double, double >  mapping,
IMatrix  result 
)
inlinestatic

Element-by-element mapping of an arbitrary function. This operation can be performed in place. This is a plain version of the method that does not perform any consistency checks. WARNING: dimensions of matrices must match, otherwise an exception is thrown.

Parameters
aFirst operand.
mappingMapping applied to each element.
resultMatrix where the result is stored. Dimensions must match dimensions of operands.
static void IG.Num.MatrixBase.ArrayMap ( IMatrix  a,
Converter< double, double >  mapping,
IMatrix  result 
)
inlinestatic

Element-by-element mapping of an arbitrary function. WARNING: dimensions of matrices must match, otherwise an exception is thrown.

Parameters
aFirst operand.
mappingMapping applied to each element.
resultMatrix where the result is stored. Dimensions must match dimensions of operands.
static void IG.Num.MatrixBase.ArrayMap ( IMatrix  a,
Converter< double, double >  mapping,
ref IMatrix  result 
)
inlinestatic

Element-by-element mapping of an arbitrary function. WARNING: dimensions of operands must match, otherwise an exception is thrown. If dimensions of the result do not match then teh result is re-allocated.

Parameters
aFirst operand.
mappingMapping applied to each element.
resultMatrix where result is stored.

References IG.Num.IMatrix.GetNew().

static void IG.Num.MatrixBase.MultiplyPlain ( IMatrix  a,
IMatrix  b,
IMatrix  result 
)
inlinestatic

R=A*B. Multiplies two matrices and stores the result in the specified result matrix. This is a plain version of the method that does not perform any consistency checks. WARNING: dimensions of matrices must match, otherwise an exception is thrown. WARNING: This operation can not be performed in place.

Parameters
aFirst operand.
bSecond operand.
resultMatrix where the result is stored. Dimensions must match dimensions of operands.

Referenced by IG.Num.ScalarFunctionQuadratic.GradientPlain(), IG.Num.AffineTransformationSquare.TransformBackCoordinatesPlain(), and IG.Num.AffineTransformationSquare.TransformCoordinatesPlain().

static void IG.Num.MatrixBase.Multiply ( IMatrix  a,
IMatrix  b,
IMatrix  result 
)
inlinestatic
static void IG.Num.MatrixBase.Multiply ( IMatrix  a,
IMatrix  b,
ref IMatrix  result 
)
inlinestatic

R=A*B. Multiplies two matrices and stores the result in the specified result matrix. WARNING: dimensions of operands must match, otherwise an exception is thrown. WARNING: This operation can not be performed in place. If dimensions of the result do not match then the result is re-allocated.

Parameters
aFirst operand.
bSecond operand.
resultMatrix where result is stored.

References IG.Num.IMatrix.GetNew().

static void IG.Num.MatrixBase.MultiplyTranspMatPlain ( IMatrix  a,
IMatrix  b,
IMatrix  result 
)
inlinestatic

R=A^T*B Calculates product of transposed matrix and a matrix, and stores the result in the specified result matrix. This is a plain version of the method that does not perform any consistency checks. WARNING: dimensions of matrices must match, otherwise an exception is thrown. WARNING: This operation can not be performed in place.

Parameters
aFirst operand.
bSecond operand.
resultMatrix where the result is stored. Dimensions must match dimensions of operands.
static void IG.Num.MatrixBase.MultiplyTranspMat ( IMatrix  a,
IMatrix  b,
IMatrix  result 
)
inlinestatic

R=A^T*B Multiplies two matrices and stores the result in the specified result matrix. WARNING: dimensions of matrices must match, otherwise an exception is thrown. WARNING: This operation can not be performed in place.

Parameters
aFirst operand.
bSecond operand.
resultMatrix where the result is stored. Dimensions must match dimensions of operands.
static void IG.Num.MatrixBase.MultiplyTranspMat ( IMatrix  a,
IMatrix  b,
ref IMatrix  result 
)
inlinestatic

R=A^T*B Multiplies two matrices and stores the result in the specified result matrix. WARNING: dimensions of operands must match, otherwise an exception is thrown. WARNING: This operation can not be performed in place. If dimensions of the result do not match then the result is re-allocated.

Parameters
aFirst operand.
bSecond operand.
resultMatrix where result is stored.

References IG.Num.IMatrix.GetNew().

static bool IG.Num.MatrixBase.TestMultiplyTranspMat ( double  tolerance,
bool  printReports 
)
inlinestaticprivate

Tests product A^T*B.

Parameters
toleranceTolerance (on norm of the difference) for the test to pass
printReportsSpecifies whether to print reports or not.
Returns
true if the test passes, false if not.

References IG.Num.A, IG.Num.IMatrix.SetRandom(), and IG.Num.MatrixBase.Transpose().

static void IG.Num.MatrixBase.MultiplyMatTranspPlain ( IMatrix  a,
IMatrix  b,
IMatrix  result 
)
inlinestatic

R=A*B^T. Multiplies a matrix by transpose of another matrix and stores the result in the specified result matrix. This is a plain version of the method that does not perform any consistency checks. WARNING: dimensions of matrices must match, otherwise an exception is thrown. WARNING: This operation can not be performed in place.

Parameters
aFirst operand.
bSecond operand.
resultMatrix where the result is stored. Dimensions must match dimensions of operands.
static void IG.Num.MatrixBase.MultiplyMatTransp ( IMatrix  a,
IMatrix  b,
IMatrix  result 
)
inlinestatic

R=A*B^T. Multiplies a matrix by transpose of another matrix and stores the result in the specified result matrix. WARNING: dimensions of matrices must match, otherwise an exception is thrown. WARNING: This operation can not be performed in place.

Parameters
aFirst operand.
bSecond operand.
resultMatrix where the result is stored. Dimensions must match dimensions of operands.
static void IG.Num.MatrixBase.MultiplyMatTransp ( IMatrix  a,
IMatrix  b,
ref IMatrix  result 
)
inlinestatic

R=A*B^T. Multiplies a matrix by transpose of another matrix and stores the result in the specified result matrix. WARNING: dimensions of operands must match, otherwise an exception is thrown. WARNING: This operation can not be performed in place. If dimensions of the result do not match then the result is re-allocated.

Parameters
aFirst operand.
bSecond operand.
resultMatrix where result is stored.

References IG.Num.IMatrix.GetNew().

static bool IG.Num.MatrixBase.TestMultiplyMatTransp ( double  tolerance,
bool  printReports 
)
inlinestaticprivate

Tests product A*B^T.

Parameters
toleranceTolerance (on norm of the difference) for the test to pass
printReportsSpecifies whether to print reports or not.
Returns
true if the test passes, false if not.

References IG.Num.A, IG.Num.IMatrix.SetRandom(), and IG.Num.MatrixBase.Transpose().

static void IG.Num.MatrixBase.MultiplyTranspTranspPlain ( IMatrix  a,
IMatrix  b,
IMatrix  result 
)
inlinestatic

R=A^T*B^T. Multiplies transposed matrix by another transposed matrix, and stores the result in the specified result matrix. This is a plain version of the method that does not perform any consistency checks. WARNING: dimensions of matrices must match, otherwise an exception is thrown. WARNING: This operation can not be performed in place.

Parameters
aFirst operand.
bSecond operand.
resultMatrix where the result is stored. Dimensions must match dimensions of operands.
static void IG.Num.MatrixBase.MultiplyTranspTransp ( IMatrix  a,
IMatrix  b,
IMatrix  result 
)
inlinestatic

R=A^T*B^T. Multiplies transposed matrix by another transposed matrix, and stores the result in the specified result matrix. WARNING: dimensions of matrices must match, otherwise an exception is thrown. WARNING: This operation can not be performed in place.

Parameters
aFirst operand.
bSecond operand.
resultMatrix where the result is stored. Dimensions must match dimensions of operands.
static void IG.Num.MatrixBase.MultiplyTranspTransp ( IMatrix  a,
IMatrix  b,
ref IMatrix  result 
)
inlinestatic

R=A^T*B^T. Multiplies transposed matrix by another transposed matrix, and stores the result in the specified result matrix. WARNING: dimensions of operands must match, otherwise an exception is thrown. WARNING: This operation can not be performed in place. If dimensions of the result do not match then the result is re-allocated.

Parameters
aFirst operand.
bSecond operand.
resultMatrix where result is stored.

References IG.Num.IMatrix.GetNew().

static bool IG.Num.MatrixBase.TestMultiplyTranspTransp ( double  tolerance,
bool  printReports 
)
inlinestaticprivate

Tests product A^T*B^T.

Parameters
toleranceTolerance (on norm of the difference) for the test to pass
printReportsSpecifies whether to print reports or not.
Returns
true if the test passes, false if not.

References IG.Num.A, IG.Num.IMatrix.SetRandom(), and IG.Num.MatrixBase.Transpose().

static void IG.Num.MatrixBase.MultiplyPlain ( IMatrix  a,
IMatrix  b,
IMatrix  c,
IMatrix  result 
)
inlinestatic

R=A*B*C. Multiplies three matrices and stores the result in the specified result matrix. This is a plain version of the method that does not perform any consistency checks. WARNING: dimensions of matrices must match, otherwise an exception is thrown. WARNING: This operation can not be performed in place.

Parameters
aFirst operand.
bSecond operand.
cThird operand.
resultMatrix where the result is stored. Dimensions must match dimensions of operands.

References IG.Num.m.

static void IG.Num.MatrixBase.Multiply ( IMatrix  a,
IMatrix  b,
IMatrix  c,
IMatrix  result 
)
inlinestatic

R=A*B*C. Multiplies three matrices and stores the result in the specified result matrix. WARNING: dimensions of matrices must match, otherwise an exception is thrown. WARNING: This operation can not be performed in place.

Parameters
aFirst operand.
bSecond operand.
cThird operand.
resultMatrix where the result is stored. Dimensions must match dimensions of operands.

References IG.Num.m.

static void IG.Num.MatrixBase.Multiply ( IMatrix  a,
IMatrix  b,
IMatrix  c,
ref IMatrix  result 
)
inlinestatic

R=A*B*C. Multiplies three matrices and stores the result in the specified result matrix. WARNING: dimensions of operands must match, otherwise an exception is thrown. WARNING: This operation can not be performed in place. If dimensions of the result do not match then the result is re-allocated.

Parameters
aFirst operand.
bSecond operand.
cThird operand.
resultMatrix where result is stored.

References IG.Num.IMatrix.GetNew(), and IG.Num.m.

static bool IG.Num.MatrixBase.TestMultiply3 ( double  tolerance,
bool  printReports 
)
inlinestaticprivate

Tests product A*B*C.

Parameters
toleranceTolerance (on norm of the difference) for the test to pass
printReportsSpecifies whether to print reports or not.
Returns
true if the test passes, false if not.

References IG.Num.A, and IG.Num.IMatrix.SetRandom().

static void IG.Num.MatrixBase.MultiplyTranspMatTranspPlain ( IMatrix  a,
IMatrix  b,
IMatrix  c,
IMatrix  result 
)
inlinestatic

R=A^T*B*C^T. Multiplies three matrices (transposed first argument, second argument, and transposed third argument) and stores the result in the specified result matrix. This is a plain version of the method that does not perform any consistency checks. WARNING: dimensions of all arguments must be consistent, otherwise an exception is thrown. WARNING: This operation can not be performed in place.

Parameters
aFirst operand, transpose of the first matrix factor.
bSecond operand, the second matrix factor.
cThird operand, transpose of the third matrix factor.
resultMatrix where the result is stored. Dimensions must be consistent with dimensions of operands.

References IG.Num.m.

static void IG.Num.MatrixBase.MultiplyTranspMatTransp ( IMatrix  a,
IMatrix  b,
IMatrix  c,
IMatrix  result 
)
inlinestatic

R=A^T*B*C^T. Multiplies three matrices (transposed first argument, second argument, and transposed third argument) and stores the result in the specified result matrix. WARNING: dimensions of all arguments must be consistent, otherwise an exception is thrown. WARNING: This operation can not be performed in place.

Parameters
aFirst operand.
bSecond operand.
cThird operand.
resultMatrix where the result is stored. Dimensions must match dimensions of operands.

References IG.Num.m.

static void IG.Num.MatrixBase.MultiplyTranspMatTransp ( IMatrix  a,
IMatrix  b,
IMatrix  c,
ref IMatrix  result 
)
inlinestatic

R=A^T*B*C^T. Multiplies three matrices (transposed first argument, second argument, and transposed third argument) and stores the result in the specified result matrix. WARNING: dimensions of operands must be consistent, otherwise an exception is thrown. WARNING: This operation can not be performed in place. If dimensions of the result do not match then the result is re-allocated.

Parameters
aFirst operand.
bSecond operand.
cThird operand.
resultMatrix where result is stored. Allocated or reallocated if necessary.

References IG.Num.IMatrix.GetNew(), and IG.Num.m.

static bool IG.Num.MatrixBase.TestMultiplyTranspMatTransp ( double  tolerance,
bool  printReports 
)
inlinestaticprivate

Tests product A^T*B*C^T.

Parameters
toleranceTolerance (on norm of the difference) for the test to pass
printReportsSpecifies whether to print reports or not.
Returns
true if the test passes, false if not.

References IG.Num.A, IG.Num.IMatrix.SetRandom(), and IG.Num.MatrixBase.Transpose().

static void IG.Num.MatrixBase.MultiplyTranspMatMatPlain ( IMatrix  a,
IMatrix  b,
IMatrix  c,
IMatrix  result 
)
inlinestatic

R=A^T*B*C. Multiplies three matrices (transposed first argument, second argument, and third argument) and stores the result in the specified result matrix. This is a plain version of the method that does not perform any consistency checks. WARNING: dimensions of all arguments must be consistent, otherwise an exception is thrown. WARNING: This operation can not be performed in place.

Parameters
aFirst operand, transpose of the first matrix factor.
bSecond operand, the second matrix factor.
cThird operand, transpose of the third matrix factor.
resultMatrix where the result is stored. Dimensions must be consistent with dimensions of operands.

References IG.Num.m.

Referenced by IG.Num.AffineTransformationSquare.TransformBackHessianPlain(), and IG.Num.AffineTransformationSquare.TransformHessianPlain().

static void IG.Num.MatrixBase.MultiplyTranspMatMat ( IMatrix  a,
IMatrix  b,
IMatrix  c,
IMatrix  result 
)
inlinestatic

R=A^T*B*C. Multiplies three matrices (transposed first argument, second argument, and third argument) and stores the result in the specified result matrix. WARNING: dimensions of all arguments must be consistent, otherwise an exception is thrown. WARNING: This operation can not be performed in place.

Parameters
aFirst operand.
bSecond operand.
cThird operand.
resultMatrix where the result is stored. Dimensions must match dimensions of operands.

References IG.Num.m.

static void IG.Num.MatrixBase.MultiplyTranspMatMat ( IMatrix  a,
IMatrix  b,
IMatrix  c,
ref IMatrix  result 
)
inlinestatic

R=A^T*B*C. Multiplies three matrices (transposed first argument, second argument, and third argument) and stores the result in the specified result matrix. WARNING: dimensions of operands must be consistent, otherwise an exception is thrown. WARNING: This operation can not be performed in place. If dimensions of the result do not match then the result is re-allocated.

Parameters
aFirst operand.
bSecond operand.
cThird operand.
resultMatrix where result is stored. Allocated or reallocated if necessary.

References IG.Num.IMatrix.GetNew(), and IG.Num.m.

static bool IG.Num.MatrixBase.TestMultiplyTranspMatMat ( double  tolerance,
bool  printReports 
)
inlinestaticprivate

Tests product A^T*B*C.

Parameters
toleranceTolerance (on norm of the difference) for the test to pass
printReportsSpecifies whether to print reports or not.
Returns
true if the test passes, false if not.

References IG.Num.A, IG.Num.IMatrix.SetRandom(), and IG.Num.MatrixBase.Transpose().

static void IG.Num.MatrixBase.MultiplyMatMatTranspPlain ( IMatrix  a,
IMatrix  b,
IMatrix  c,
IMatrix  result 
)
inlinestatic

R=A*B*C^T. Multiplies three matrices (first argumet, second argumet, and transposed third argument) and stores the result in the specified result matrix. This is a plain version of the method that does not perform any consistency checks. WARNING: dimensions of matrices must match, otherwise an exception is thrown. WARNING: This operation can not be performed in place.

Parameters
aFirst operand.
bSecond operand.
cThird operand.
resultMatrix where the result is stored. Dimensions must match dimensions of operands.

References IG.Num.m.

static void IG.Num.MatrixBase.MultiplyMatMatTransp ( IMatrix  a,
IMatrix  b,
IMatrix  c,
IMatrix  result 
)
inlinestatic

R=A*B*C^T. Multiplies three matrices (first argumet, second argumet, and transposed third argument) and stores the result in the specified result matrix. WARNING: dimensions of matrices must match, otherwise an exception is thrown. WARNING: This operation can not be performed in place.

Parameters
aFirst operand.
bSecond operand.
cThird operand.
resultMatrix where the result is stored. Dimensions must match dimensions of operands.

References IG.Num.m.

static void IG.Num.MatrixBase.MultiplyMatMatTransp ( IMatrix  a,
IMatrix  b,
IMatrix  c,
ref IMatrix  result 
)
inlinestatic

R=A*B*C^T. Multiplies three matrices (first argumet, second argumet, and transposed third argument) and stores the result in the specified result matrix. WARNING: dimensions of operands must match, otherwise an exception is thrown. WARNING: This operation can not be performed in place. If dimensions of the result do not match then the result is re-allocated.

Parameters
aFirst operand.
bSecond operand.
cThird operand.
resultMatrix where result is stored.

References IG.Num.IMatrix.GetNew(), and IG.Num.m.

static bool IG.Num.MatrixBase.TestMultiplyMatMatTransp ( double  tolerance,
bool  printReports 
)
inlinestaticprivate

Tests product A*B*C^T.

Parameters
toleranceTolerance (on norm of the difference) for the test to pass
printReportsSpecifies whether to print reports or not.
Returns
true if the test passes, false if not.

References IG.Num.A, and IG.Num.IMatrix.SetRandom().

static void IG.Num.MatrixBase.MultiplyMatTranspMatPlain ( IMatrix  a,
IMatrix  b,
IMatrix  c,
IMatrix  result 
)
inlinestatic

R=A*B^T*C. Multiplies three matrices (first argument, transposed second argument, and third argument) and stores the result in the specified result matrix. This is a plain version of the method that does not perform any consistency checks. WARNING: dimensions of matrices must match, otherwise an exception is thrown. WARNING: This operation can not be performed in place.

Parameters
aFirst operand.
bSecond operand.
cThird operand.
resultMatrix where the result is stored. Dimensions must match dimensions of operands.

References IG.Num.m.

static void IG.Num.MatrixBase.MultiplyMatTranspMat ( IMatrix  a,
IMatrix  b,
IMatrix  c,
IMatrix  result 
)
inlinestatic

R=A*B^T*C. Multiplies three matrices (first argument, transposed second argument, and third argument) and stores the result in the specified result matrix. WARNING: dimensions of matrices must match, otherwise an exception is thrown. WARNING: This operation can not be performed in place.

Parameters
aFirst operand.
bSecond operand.
cThird operand.
resultMatrix where the result is stored. Dimensions must match dimensions of operands.

References IG.Num.m.

static void IG.Num.MatrixBase.MultiplyMatTranspMat ( IMatrix  a,
IMatrix  b,
IMatrix  c,
ref IMatrix  result 
)
inlinestatic

R=A*B^T*C. Multiplies three matrices (first argument, transposed second argument, and third argument) and stores the result in the specified result matrix. WARNING: dimensions of operands must match, otherwise an exception is thrown. WARNING: This operation can not be performed in place. If dimensions of the result do not match then the result is re-allocated.

Parameters
aFirst operand.
bSecond operand.
cThird operand.
resultMatrix where result is stored.

References IG.Num.IMatrix.GetNew(), and IG.Num.m.

static bool IG.Num.MatrixBase.TestMultiplyMatTranspMat ( double  tolerance,
bool  printReports 
)
inlinestaticprivate

Tests product A*B^T*C.

Parameters
toleranceTolerance (on norm of the difference) for the test to pass
printReportsSpecifies whether to print reports or not.
Returns
true if the test passes, false if not.

References IG.Num.A, and IG.Num.IMatrix.SetRandom().

static void IG.Num.MatrixBase.MultiplyTranspTranspTranspPlain ( IMatrix  a,
IMatrix  b,
IMatrix  c,
IMatrix  result 
)
inlinestatic

R=A^T*B^T*C^T. Multiplies three matrices and stores the result in the specified result matrix. This is a plain version of the method that does not perform any consistency checks. WARNING: dimensions of matrices must match, otherwise an exception is thrown. WARNING: This operation can not be performed in place.

Parameters
aFirst operand.
bSecond operand.
cThird operand.
resultMatrix where the result is stored. Dimensions must match dimensions of operands.

References IG.Num.m.

static void IG.Num.MatrixBase.MultiplyTranspTranspTransp ( IMatrix  a,
IMatrix  b,
IMatrix  c,
IMatrix  result 
)
inlinestatic

R=A^T*B^T*C^T. Multiplies three matrices and stores the result in the specified result matrix. WARNING: dimensions of matrices must match, otherwise an exception is thrown. WARNING: This operation can not be performed in place.

Parameters
aFirst operand.
bSecond operand.
cThird operand.
resultMatrix where the result is stored. Dimensions must match dimensions of operands.

References IG.Num.m.

static void IG.Num.MatrixBase.MultiplyTranspTranspTransp ( IMatrix  a,
IMatrix  b,
IMatrix  c,
ref IMatrix  result 
)
inlinestatic

R=A^T*B^T*C^T. Multiplies three matrices and stores the result in the specified result matrix. WARNING: dimensions of operands must match, otherwise an exception is thrown. WARNING: This operation can not be performed in place. If dimensions of the result do not match then the result is re-allocated.

Parameters
aFirst operand.
bSecond operand.
cThird operand.
resultMatrix where result is stored.

References IG.Num.IMatrix.GetNew(), and IG.Num.m.

static bool IG.Num.MatrixBase.TestMultiplyTranspTranspTransp ( double  tolerance,
bool  printReports 
)
inlinestaticprivate

Tests product A^T*B^T*C^T.

Parameters
toleranceTolerance (on norm of the difference) for the test to pass
printReportsSpecifies whether to print reports or not.
Returns
true if the test passes, false if not.

References IG.Num.A, and IG.Num.IMatrix.SetRandom().

static void IG.Num.MatrixBase.MultiplyPlain ( IMatrix  a,
IVector  b,
IVector  result 
)
inlinestatic

R=A*b. Multiplies a matrix with a vector and stores the result in the specified result vector. Operation can not be performed in place. This is a plain version of the method that does not perform any consistency checks. WARNING: dimensions of matrices must match, otherwise an exception is thrown.

Parameters
aFirst operand.
bSecond operand.
resultVector where the result is stored. Dimensions must match dimensions of operands.
static void IG.Num.MatrixBase.Multiply ( IMatrix  a,
IVector  b,
IVector  result 
)
inlinestatic

R=A*b. Multiplies a matrix with a vector and stores the result in the specified result vector. Operation can not be performed in place. WARNING: dimensions of matrices must match, otherwise an exception is thrown.

Parameters
aFirst operand.
bSecond operand.
resultVector where the result is stored. Dimensions must match dimensions of operands.
static void IG.Num.MatrixBase.Multiply ( IMatrix  a,
IVector  b,
ref IVector  result 
)
inlinestatic

R=A*b. Multiplies matrix by scalar and stores the result in the specified result matrix. Operation can not be performed in place. WARNING: dimensions of operands must match, otherwise an exception is thrown. If dimensions of the result do not match then the result is re-allocated.

Parameters
aFirst operand.
bSecond operand.
resultMatrix where result is stored.

References IG.Num.IMatrix.GetNewVector().

static void IG.Num.MatrixBase.MultiplyTranspVecPlain ( IMatrix  a,
IVector  b,
IVector  result 
)
inlinestatic

R=A^T*b. Multiplies a transposed matrix with a vector and stores the result in the specified result vector. Operation can not be performed in place. This is a plain version of the method that does not perform any consistency checks. WARNING: dimensions of matrices must match, otherwise an exception is thrown.

Parameters
aFirst operand.
bSecond operand.
resultVector where the result is stored. Dimensions must match dimensions of operands.

Referenced by IG.Num.MatrixBase.QrSolve(), IG.Num.AffineTransformationSquare.TransformBackGradientPlain(), and IG.Num.AffineTransformationSquare.TransformGradientPlain().

static void IG.Num.MatrixBase.MultiplyTranspVec ( IMatrix  a,
IVector  b,
IVector  result 
)
inlinestatic

R=A^T*b. Multiplies a transposed matrix with a vector and stores the result in the specified result vector. Operation can not be performed in place. WARNING: dimensions of matrices must match, otherwise an exception is thrown.

Parameters
aFirst operand.
bSecond operand.
resultVector where the result is stored. Dimensions must match dimensions of operands.
static void IG.Num.MatrixBase.MultiplyTranspVec ( IMatrix  a,
IVector  b,
ref IVector  result 
)
inlinestatic

R=A^T*b. Multiplies transposed matrix by scalar and stores the result in the specified result matrix. Operation can not be performed in place. WARNING: dimensions of operands must match, otherwise an exception is thrown. If dimensions of the result do not match then the result is re-allocated.

Parameters
aFirst operand.
bSecond operand.
resultMatrix where result is stored.

References IG.Num.IMatrix.GetNewVector().

static double IG.Num.MatrixBase.MultiplyPlain ( IVector  left,
IMatrix  a,
IVector  right 
)
inlinestatic

R=a^T*M*b. Left-multiplies a matrix with a vector (transposed), right multiplies the result vith another vector, and returns the final result. Can be performed in place. This is a plain version of the method that does not perform any consistency checks. WARNING: dimensions of matrices must match, otherwise an exception is thrown.

Parameters
leftLeft vector factor (transpose vector as one row matrix).
aMatrix factor.
rightRight factor (vector as one column matrix).
static double IG.Num.MatrixBase.Multiply ( IVector  left,
IMatrix  a,
IVector  right 
)
inlinestatic

R=a^T*M*b. Left-multiplies a matrix with a vector (transposed), right multiplies the result vith another vector, and returns the final result. Can be performed in place. WARNING: dimensions of matrices must match, otherwise an exception is thrown.

Parameters
leftLeft factor (vector as one row matrix).
aMatrix factor.
rightRight factor (vector as one column matrix).
static double IG.Num.MatrixBase.Multiply ( IVector  left,
IMatrix  a,
IVector  right,
ref IVector  result 
)
inlinestatic

R=a^T*M*b. Left-multiplies a matrix with a vector (transposed), right multiplies the result vith another vector, and returns the final result. Can be performed in place. WARNING: dimensions of operands must match, otherwise an exception is thrown. If dimensions of the result do not match then the result is re-allocated.

Parameters
leftLeft factor (vector as one row matrix).
aMatrix factor.
rightRight factor (vector as one column matrix).
resultVector where result of operation is stored. Reallocated if necessary.
static void IG.Num.MatrixBase.MultiplyPlain ( IMatrix  a,
double  b,
IMatrix  result 
)
inlinestatic

Multiplies matrix by scalar and stores the result in the specified result matrix. This is a plain version of the method that does not perform any consistency checks. This operation can be performed in place. WARNING: dimensions of matrices must match, otherwise an exception is thrown.

Parameters
aFirst operand.
bSecond operand.
resultMatrix where the result is stored. Dimensions must match dimensions of operands.
static void IG.Num.MatrixBase.Multiply ( IMatrix  a,
double  b,
IMatrix  result 
)
inlinestatic

Multiplies matrix by scalar and stores the result in the specified result matrix. This operation can be performed in place. WARNING: dimensions of matrices must match, otherwise an exception is thrown.

Parameters
aFirst operand.
bSecond operand.
resultMatrix where the result is stored. Dimensions must match dimensions of operands.
static void IG.Num.MatrixBase.Multiply ( IMatrix  a,
double  b,
ref IMatrix  result 
)
inlinestatic

Multiplies matrix by scalar and stores the result in the specified result matrix. This operation can be performed in place. WARNING: dimensions of operands must match, otherwise an exception is thrown. If dimensions of the result do not match then the result is re-allocated.

Parameters
aFirst operand.
bSecond operand.
resultMatrix where result is stored.

References IG.Num.IMatrix.GetNew().

static void IG.Num.MatrixBase.DividePlain ( IMatrix  a,
double  b,
IMatrix  result 
)
inlinestatic

Divides matrix by scalar and stores the result in the specified result matrix. This is a plain version of the method that does not perform any consistency checks. This operation can be performed in place. WARNING: dimensions of matrices must match, otherwise an exception is thrown.

Parameters
aFirst operand.
bSecond operand.
resultMatrix where the result is stored. Dimensions must match dimensions of operands.
static void IG.Num.MatrixBase.Divide ( IMatrix  a,
double  b,
IMatrix  result 
)
inlinestatic

Divides matrix by scalar and stores the result in the specified result matrix. This operation can be performed in place. WARNING: dimensions of matrices must match, otherwise an exception is thrown.

Parameters
aFirst operand.
bSecond operand.
resultMatrix where the result is stored. Dimensions must match dimensions of operands.
static void IG.Num.MatrixBase.Divide ( IMatrix  a,
double  b,
ref IMatrix  result 
)
inlinestatic

Divides matrix by scalar and stores the result in the specified result matrix. This operation can be performed in place. WARNING: dimensions of operands must match, otherwise an exception is thrown. If dimensions of the result do not match then the result is re-allocated.

Parameters
aFirst operand.
bSecond operand.
resultMatrix where result is stored.

References IG.Num.IMatrix.GetNew().

static void IG.Num.MatrixBase.MultiplyDiagonalPlain ( IVector  diag,
IMatrix  a,
IMatrix  result 
)
inlinestatic

Left-multiplies a matrix with a diagonal matrix, and stores the result in the specified result matrix. R=diag(d)*A This is a plain version of the method that does not perform any consistency checks. The operation can be done in place. WARNING: dimensions of matrices must match, otherwise an exception is thrown.

Parameters
diagFirst operand (a vector representing a diagonal matrix).
aFirst operand.
resultMatrix where the result is stored. Dimensions must match dimensions of operands.
static void IG.Num.MatrixBase.MultiplyDiagonal ( IVector  diag,
IMatrix  a,
IMatrix  result 
)
inlinestatic

Right-multiplies a matrix with a diagonal matrix, and stores the result in the specified result matrix. R=diag(d)*A WARNING: dimensions of matrices must match, otherwise an exception is thrown.

Parameters
diagFirst operand (a vector representing a diagonal matrix).
aFirst operand.
resultMatrix where the result is stored. Dimensions must match dimensions of operands.
static void IG.Num.MatrixBase.MultiplyDiagonal ( IVector  diag,
IMatrix  a,
ref IMatrix  result 
)
inlinestatic

Right-multiplies a matrix with a diagonal matrix, and stores the result in the specified result matrix. R=diag(d)*A WARNING: dimensions of operands must match, otherwise an exception is thrown. If dimensions of the result do not match then the result is re-allocated.

Parameters
diagFirst operand (a vector representing a diagonal matrix).
aFirst operand.
resultMatrix where result is stored.

References IG.Num.IMatrix.GetNew().

static void IG.Num.MatrixBase.MultiplyInverseDiagonalPlain ( IVector  diag,
IMatrix  a,
IMatrix  result 
)
inlinestatic

Left-multiplies a matrix with inverse of a diagonal matrix, and stores the result in the specified result matrix. R=diag(d)^-1*A This is a plain version of the method that does not perform any consistency checks. The operation can be done in place. WARNING: dimensions of matrices must match, otherwise an exception is thrown.

Parameters
diagFirst operand (a vector representing a diagonal matrix).
aSecond operand.
resultMatrix where the result is stored. Dimensions must match dimensions of operands.
static void IG.Num.MatrixBase.MultiplyInverseDiagonal ( IVector  diag,
IMatrix  a,
IMatrix  result 
)
inlinestatic

Right-multiplies a matrix with inverse of a diagonal matrix, and stores the result in the specified result matrix. R=diag(d)^-1*A WARNING: dimensions of matrices must match, otherwise an exception is thrown.

Parameters
diagFirst operand (a vector representing a diagonal matrix).
aFirst operand.
resultMatrix where the result is stored. Dimensions must match dimensions of operands.
static void IG.Num.MatrixBase.MultiplyInverseDiagonal ( IVector  diag,
IMatrix  a,
ref IMatrix  result 
)
inlinestatic

Right-multiplies a matrix with inverse of a diagonal matrix, and stores the result in the specified result matrix. R=diag(d)^-1*A WARNING: dimensions of operands must match, otherwise an exception is thrown. If dimensions of the result do not match then the result is re-allocated.

Parameters
diagFirst operand (a vector representing a diagonal matrix).
aFirst operand.
resultMatrix where result is stored.

References IG.Num.IMatrix.GetNew().

static void IG.Num.MatrixBase.MultiplyDiagonalPlain ( IMatrix  a,
IVector  diag,
IMatrix  result 
)
inlinestatic

Right-multiplies a matrix with a diagonal matrix, and stores the result in the specified result matrix. R=A*diag(d) This is a plain version of the method that does not perform any consistency checks. The operation can be done in place. WARNING: dimensions of matrices must match, otherwise an exception is thrown.

Parameters
aFirst operand.
diagSecond operand (a vector representing a diagonal matrix).
resultMatrix where the result is stored. Dimensions must match dimensions of operands.
static void IG.Num.MatrixBase.MultiplyDiagonal ( IMatrix  a,
IVector  diag,
IMatrix  result 
)
inlinestatic

Right-multiplies a matrix with a diagonal matrix, and stores the result in the specified result matrix. R=A*diag(d) WARNING: dimensions of matrices must match, otherwise an exception is thrown.

Parameters
aFirst operand.
diagSecond operand (a vector representing a diagonal matrix).
resultMatrix where the result is stored. Dimensions must match dimensions of operands.
static void IG.Num.MatrixBase.MultiplyDiagonal ( IMatrix  a,
IVector  diag,
ref IMatrix  result 
)
inlinestatic

Right-multiplies a matrix with a diagonal matrix, and stores the result in the specified result matrix. R=A*diag(d) WARNING: dimensions of operands must match, otherwise an exception is thrown. If dimensions of the result do not match then the result is re-allocated.

Parameters
aFirst operand.
diagSecond operand (a vector representing a diagonal matrix).
resultMatrix where result is stored.

References IG.Num.IMatrix.GetNew().

static void IG.Num.MatrixBase.MultiplyInverseDiagonalPlain ( IMatrix  a,
IVector  diag,
IMatrix  result 
)
inlinestatic

Right-multiplies a matrix with inverse of a diagonal matrix, and stores the result in the specified result matrix. R=A*diag(d)^-1 This is a plain version of the method that does not perform any consistency checks. The operation can be done in place. WARNING: dimensions of matrices must match, otherwise an exception is thrown.

Parameters
aFirst operand.
diagSecond operand (a vector representing a diagonal matrix).
resultMatrix where the result is stored. Dimensions must match dimensions of operands.
static void IG.Num.MatrixBase.MultiplyInverseDiagonal ( IMatrix  a,
IVector  diag,
IMatrix  result 
)
inlinestatic

Right-multiplies a matrix with inverse of a diagonal matrix, and stores the result in the specified result matrix. R=A*diag(d)^-1 WARNING: dimensions of matrices must match, otherwise an exception is thrown.

Parameters
aFirst operand.
diagSecond operand (a vector representing a diagonal matrix).
resultMatrix where the result is stored. Dimensions must match dimensions of operands.
static void IG.Num.MatrixBase.MultiplyInverseDiagonal ( IMatrix  a,
IVector  diag,
ref IMatrix  result 
)
inlinestatic

Right-multiplies a matrix with inverse of a diagonal matrix, and stores the result in the specified result matrix. R=A*diag(d)^-1 WARNING: dimensions of operands must match, otherwise an exception is thrown. If dimensions of the result do not match then the result is re-allocated.

Parameters
aFirst operand.
diagSecond operand (a vector representing a diagonal matrix).
resultMatrix where result is stored.

References IG.Num.IMatrix.GetNew().

static int IG.Num.MatrixBase.GetHashCode ( IMatrix  mat)
inlinestatic

Returns hashRet code of the specified matrix.

Parameters
matMatrix whose hath code is returned.

This method should be used when overriding the GetHashCode() in vector classes, in order to unify calculation of hashRet code over different vector classes.

static bool IG.Num.MatrixBase.Equals ( IMatrix  m1,
IMatrix  m2 
)
inlinestatic

Returns true if the specified matrices are equal, false if not.

Parameters
m1The first of the two matrices that are checked for equality.
m2The second of the two matrices that are checked for equality.

This method should be used when overriding the Equals() method in matrix classes, in order to unify the equality check over different matrix classes.

If both matrices are null or both have one dimension less than 1 and the other dimension the same then then they considered equal.

This method is consistent with the MatrixBase.Compare method, i.e. it returns the same value as the expression MatrixBase.Compare(m1 , m2 ==0).

static int IG.Num.MatrixBase.GetHashFunctionInt ( IMatrix  mat)
inlinestatic

Returns an integer valued hashRet function of the specified matrix object.

The returned value is calculated by the Util.GetHashFunctionInt method.

Parameters
matMatrix object whose hashRet function is calculated and returned.
See also
Util.GetHashFunctionInt

References IG.Lib.Util.GetHashFunctionInt().

static string IG.Num.MatrixBase.GetHashFunctionString ( IMatrix  mat)
inlinestatic

Returns a string valued hashRet function of the specified matrix object.

The returned value is calculated by the Util.GetHashFunctionString method.

Parameters
matMatrix object whose hashRet function is calculated and returned.
See also
Util.GetHashFunctionString

References IG.Lib.Util.GetHashFunctionString().

static string IG.Num.MatrixBase.ToStringReadable ( IMatrix  mat,
int  accuracy = 4,
int  padding = 8 
)
inlinestatic

Returns a readable string form of a matrix, accuracy and padding can be set.

Parameters
matMatrix whose string representation is returned.
accuracyAccuracy of matrix elments representations.
paddingPadding of matrix elements.
Returns
A readable string representation in tabular form, with the specified accuracy and padding of elements.

References IG.Lib.Util.NullRepresentationString, and IG.Num.IMatrix.ToString().

Referenced by IG.Num.MatrixExtensions.ToStringReadable(), and IG.Num.MatrixBase.ToStringReadable().

static string IG.Num.MatrixBase.ToStringNewlines ( IMatrix  mat)
inlinestatic

Returns a string representation of the specified matrix with newlines inserted after each row. Rows and elements are printed in comma separated lists in curly brackets.

Parameters
matMatrix whose string representation is returned.

References IG.Num.IMatrix.ToString().

Referenced by IG.Num.MatrixExtensions.ToStringNewlines().

static string IG.Num.MatrixBase.ToStringNewlines ( IMatrix  mat,
string  elementFormat 
)
inlinestatic

Returns a string representation of the specified matrix with newlines inserted after each row, with the specified format for elements of the matrix. Rows and elements are printed in comma separated lists in curly brackets.

Parameters
matMatrix whose string representation is returned.
elementFormatFormat specification for printing individual element.

References IG.Num.IMatrix.ToString().

static string IG.Num.MatrixBase.ToString ( IMatrix  mat)
inlinestatic

Returns string representation of the current matrix in the standard IGLib form (Mathematica-like format but with C representation of numbers). Rows and elements are printed in comma separated lists in curly brackets.

Parameters
matMatrix whose string representation is returned.

Referenced by IG.Num.MatrixExtensions.ToString().

static string IG.Num.MatrixBase.ToStringMath ( IMatrix  mat)
inlinestatic

Returns string representation of the current matrix in the standard IGLib form (Mathematica-like format but with C representation of numbers). Rows and elements are printed in comma separated lists in curly brackets.

Parameters
matMatrix whose string representation is returned.

References IG.Num.IMatrix.ToString().

Referenced by IG.Num.MatrixExtensions.ToStringMath(), and IG.Num.MatrixExtensions.ToStringMath1().

static string IG.Num.MatrixBase.ToString ( IMatrix  mat,
string  elementFormat 
)
inlinestatic

Returns string representation of the current matrix in the standard IGLib form (Mathematica-like format but with C representation of numbers), with the specified format for elements of the matrix. Rows and elements are printed in comma separated lists in curly brackets.

Parameters
matMatrix whose string representation is returned.
elementFormatFormat specification for printing individual element.
static string IG.Num.MatrixBase.ToStringMath ( IMatrix  mat,
string  elementFormat 
)
inlinestatic

Returns string representation of the current matrix in the standard IGLib form (Mathematica-like format but with C representation of numbers), with the specified format for elements of the matrix. Rows and elements are printed in comma separated lists in curly brackets.

Parameters
matMatrix whose string representation is returned.
elementFormatFormat specification for printing individual element.

References IG.Num.IMatrix.ToString().

static void IG.Num.MatrixBase.SaveJson ( IMatrix  mat,
string  filePath 
)
inlinestatic

Saves (serializes) the specified matrix to the specified JSON file. File is owerwritten if it exists.

Parameters
matObject that is saved to a file.
filePathPath to the file in which object is is saved.

Referenced by IG.Neural.NeuralAllpicationCommands.CmdTestJson().

static void IG.Num.MatrixBase.SaveJson ( IMatrix  mat,
string  filePath,
bool  append 
)
inlinestatic

Saves (serializes) the specified matrix to the specified JSON file.

Parameters
matObject that is saved to a file.
filePathPath to the file in which object is is saved.
appendSpecifies whether serialized data is appended at the end of the file in the case that the file already exists.
static void IG.Num.MatrixBase.LoadJson ( string  filePath,
ref IMatrix  matRestored 
)
inlinestatic

Restores (deserializes) a matrix object from the specified file in JSON format.

Parameters
filePathFile from which object data is restored.
matRestoredObject that is restored by deserialization.

Referenced by IG.Neural.NeuralAllpicationCommands.CmdTestJson().

override string IG.Num.MatrixBase.ToString ( )
inline

Returns string representation of the current matrix in the standard IGLib form. Rows and elements are printed in comma separated lists in curly brackets.

Implements IG.Num.IMatrix.

virtual string IG.Num.MatrixBase.ToStringReadable ( int  accuracy = 4,
int  padding = 8 
)
inlinevirtual

Returns a readable an easily string form of a matrix, accuracy and padding can be set.

Parameters
accuracyAccuracy of matrix elments representations.
paddingPaddind of matrix elements.
Returns
A readable string representation in tabular form.

Implements IG.Num.IMatrix.

References IG.Num.MatrixBase.ToStringReadable().

virtual string IG.Num.MatrixBase.ToStringNewlines ( )
inlinevirtual

Returns a string representation of this matrix with newlines inserted after each row. Rows and elements are printed in comma separated lists in curly brackets.

Implements IG.Num.IMatrix.

virtual string IG.Num.MatrixBase.ToStringNewlines ( string  elementFormat)
inlinevirtual

Returns a string representation of this matrix with newlines inserted after each row, with the specified format for elements of the matrix. Rows and elements are printed in comma separated lists in curly brackets.

Parameters
elementFormatFormat specification for printing individual element.

Implements IG.Num.IMatrix.

virtual string IG.Num.MatrixBase.ToStringMath ( )
inlinevirtual

Returns string representation of the current matrix in the standard IGLib form (Mathematica-like format but with C representation of numbers). Rows and elements are printed in comma separated lists in curly brackets.

Implements IG.Num.IMatrix.

virtual string IG.Num.MatrixBase.ToString ( string  elementFormat)
inlinevirtual

Returns a string representation of the current matrix in a standard IGLib form (Mathematica-like format but with C representation of numbers), with the specified format for elements of the matrix.

Parameters
elementFormatFormat specification for printing individual element.

Implements IG.Num.IMatrix.

virtual string IG.Num.MatrixBase.ToStringMath ( string  elementFormat)
inlinevirtual

Returns a string representation of the current matrix in a standard IGLib form (Mathematica-like format but with C representation of numbers), with the specified format for elements of the matrix.

Parameters
elementFormatFormat specification for printing individual element.

Implements IG.Num.IMatrix.

static MatrixBase IG.Num.MatrixBase.operator+ ( MatrixBase  m)
inlinestatic

Unary plus, returns the operand.

References IG.Num.MatrixBase.GetCopyBase().

static MatrixBase IG.Num.MatrixBase.operator- ( MatrixBase  m)
inlinestatic

Unary negation, returns the negative operand.

References IG.Num.MatrixBase.GetCopyBase(), and IG.Num.MatrixBase.Negate().

static MatrixBase IG.Num.MatrixBase.operator+ ( MatrixBase  a,
MatrixBase  b 
)
inlinestatic

Matrix addition.

References IG.Num.MatrixBase.GetCopyBase().

static MatrixBase IG.Num.MatrixBase.operator- ( MatrixBase  a,
MatrixBase  b 
)
inlinestatic

Matrix subtraction.

References IG.Num.MatrixBase.GetCopyBase().

static MatrixBase IG.Num.MatrixBase.operator* ( MatrixBase  a,
MatrixBase  b 
)
inlinestatic
static VectorBase IG.Num.MatrixBase.operator* ( MatrixBase  a,
VectorBase  b 
)
inlinestatic

Product of a matrix and a vector.

References IG.Num.VectorBase.GetNewBase().

static MatrixBase IG.Num.MatrixBase.operator* ( MatrixBase  a,
double  b 
)
inlinestatic

Product of a matrix by a scalar.

References IG.Num.MatrixBase.GetNewBase(), and IG.Num.MatrixBase.Multiply().

static MatrixBase IG.Num.MatrixBase.operator* ( double  a,
MatrixBase  b 
)
inlinestatic

Product of a matrix by a scalar.

References IG.Num.MatrixBase.GetNewBase().

static MatrixBase IG.Num.MatrixBase.operator/ ( MatrixBase  a,
double  b 
)
inlinestatic

Matrix subtraction.

References IG.Num.MatrixBase.GetNewBase().

static double IG.Num.MatrixBase.DeterminantSlow ( IMatrix  A)
inlinestatic

Simpler but slower (compared to Determinant) implementation of determinant calculation of an arbitrary square real matrix.

Auxiliary variable are allocated internally by the function, which makes it slower with respect to Determinant where auxiliary parameters can be provided by the caller.

Parameters
AMatrix whose determinant is calculated.
Returns
The calculated determinant of the specified matrix.
static double IG.Num.MatrixBase.Determinant ( IMatrix  A,
ref int[]  auxPermutations,
ref IMatrix  auxLU 
)
inlinestatic

Calculates and returns determinant of a real-valued square matrix.

This function is efficient when auxiliary parameters auxPermutations and auxLU are provided that are already initialized with the same dimensions as the matrix whose determinant is calculated.

Parameters
AMatrix whose determinant is to be calculated.
auxPermutationsAuxiliary array where row permutations of LU decomposition of A will be stored. For best performance, caller should pass an array that is alredy initialized with the same dimensions.
auxLUAuxiliary matrix where LU decomposition of A will be stored. For best performance, caller should pass a matrix that is alredy initialized with the same dimensions.
Returns
The calculated determinant of the specified matrix.
static void IG.Num.MatrixBase.LuDecompose ( IMatrix  A,
out int  toggle,
ref int[]  perm,
ref IMatrix  result 
)
inlinestatic

Calculates thr Doolittle LU decomposition with partial pivoting (LUP) of a square real matrix.

Throws InvalidOperationException if the matrix is singular.

http://en.wikipedia.org/wiki/LU_decomposition#Doolittle_algorithm

Parameters
ASquare matrix whose decomposition is calculated.
toggleAttains value 1 for even number of row swaps, or -1 for odd number of row swaps (important for calculation of matrix determinant).
permArray where the performed row permutations are stored. Reallocated if necessary.
resultMatrix where the resulting LU decomposition is stored. Reallocated if necessary.

Result is lower triangular matrix L with 1s on diagonal (stored below diagonal), and upper triangular matrix.

$A Igor Dec14;

References IG.Num.MatrixBase.Copy().

Referenced by IG.Num.SpeedTestCpu.TestComputationalTimesLU_Base().

static void IG.Num.MatrixBase.LuSolveNoPermutationsPlain ( IMatrix  luMatrix,
IVector  b,
IVector  x 
)
inlinestaticprotected

Solves a system of equations with the specified LU decomposition with already permuted b.

Helper method. Before it is used, right-hand side vector must be permuted according to row permutations contained in LU decomposition.

Parameters must be of correct dimensions. No reallocations are performed.

No consistency checks are performed on arguments.

Parameters
luMatrixMatrix containing LU decomposition of the originall system matrix.
bVector containing right-hand sides permuted according to permutations of LU decomposition.
xVector where permuted results are stored.

$A Igor Dec14;

References IG.Num.VectorBase.CopyPlain().

static void IG.Num.MatrixBase.LuSolve ( IMatrix  luMatrix,
int[]  perm,
IVector  b,
ref IVector  auxVec,
ref IVector  x 
)
inlinestatic

Solves a system of equations with the specified right-hand sides and the specified LU decomposition of the system matrix.

Parameters
luMatrixMatrix containing LU decomposition of the original matrix with permuted rows.
permPermutation array containing information about row permutations performed during LU decomposition.
bVextor of right-hand sides.
auxVecAuxiliary vector of the same dimension as the system matrix.
xVector where the solution is stored.

$A Igor Dec14;

References IG.Num.IMatrix.GetNewVector().

Referenced by IG.Num.SpeedTestCpu.TestComputationalTimesLU_Base().

static void IG.Num.MatrixBase.LuSolve ( IMatrix  luMatrix,
int[]  perm,
IMatrix  B,
ref IVector  auxVec,
ref IVector  auxRight,
ref IVector  auxX,
ref IMatrix  X 
)
inlinestatic

Calculates inverse of the matrix from its specified LU decomposition.

Parameters
luMatrixMatrix containing the LU decomposition of the original matrix (with partial pivoting).
permArray containing information of row permutations from the LU decomposition procedure.
BMatrix whose columns are right-hand sides of equations to be solved.
auxVecAuxiliary vector of the same dimension as dimensions of the decomposed matrix. Reallocated if necessary.
auxRightAuxiliary vector of the same dimension as dimensions of the decomposed matrix. Reallocated if necessary.
auxXAnother auxiliary vector of the same dimension as dimensions of the decomposed matrix. Reallocated if necessary.
XMatrix where result will be stored. Reallocated if necessary.

$A Igor Dec14;

References IG.Num.IMatrix.GetNew(), and IG.Num.IMatrix.GetNewVector().

static void IG.Num.MatrixBase.LuInverse ( IMatrix  luMatrix,
int[]  perm,
ref IVector  auxRight,
ref IVector  auxX,
ref IMatrix  res 
)
inlinestatic

Calculates inverse of the matrix from its specified LU decomposition.

Parameters
luMatrixMatrix containing the LU decomposition of the original matrix (with partial pivoting).
permArray containing information of row permutations from the LU decomposition procedure.
auxRightAuxiliary vector of the same dimension as dimensions of the decomposed matrix. Reallocated if necessary.
auxXAnother auxiliary vector of the same dimension as dimensions of the decomposed matrix. Reallocated if necessary.
resMatrix where result will be stored. Reallocated if necessary.

$A Igor Dec14;

References IG.Num.IMatrix.GetNew(), and IG.Num.IMatrix.GetNewVector().

static double IG.Num.MatrixBase.LuDeterminant ( IMatrix  luMatrix,
int  toggle 
)
inlinestatic

Calculates and returns matrix determinant form its specified LU decomposition.

Parameters
luMatrixMatrix containing the LU decomposition of the matrix whose determinant is to be calculated.
toggleToggle that contains information about number of row permutations when building LU decomposittion, 1 for even and -1 for odd number of permutations.
Returns
Determinant calculated from matrix LU decomposition.

$A Igor Dec14;

static void IG.Num.MatrixBase.LuExtractLower ( IMatrix  matLu,
ref IMatrix  result 
)
inlinestatic

Extracts the lower part of the Doolittle specified LU decomposition (1s on diagonal, 0s in above diagonal) and stores it in the specified result matrix.

Although operatioin can be done in place, it is not allowed for input and output matrix to be the same. Reason is that the operation always done in in combination (with extracting all parts).

Parameters
matLuMatrix containng the LU decomposition of some matrix.
resultMatrix where the lower part of the specified matrix is stored.

$A Igor Dec14;

References IG.Num.IMatrix.GetNew().

Referenced by IG.Num.SpeedTestCpu.TestComputationalTimesLU_Base().

static IMatrix IG.Num.MatrixBase.LuExtractUpper ( IMatrix  matLu,
ref IMatrix  result 
)
inlinestatic

Extracts the upper part of the specified Doolittle LU decomposition 0s below diagonal) and stores it in the specified result matrix.

Although operatioin can be done in place, it is not allowed for input and output matrix to be the same. Reason is that the operation always done in in combination (with extracting all parts).

Parameters
matLuMatrix containng the LU decomposition of some matrix.
resultMatrix where the upper part of the specified matrix is stored.

$A Igor Dec14;

References IG.Num.IMatrix.GetNew().

Referenced by IG.Num.SpeedTestCpu.TestComputationalTimesLU_Base().

static void IG.Num.MatrixBase.PermutationArrayToMatrix ( int[]  perm,
ref IMatrix  res 
)
inlinestatic

Calculates and stores permutation matrix that correspond to the specified permutation array.

Used only for testing.

Parameters
permPermutation array, contains information on how matrix rows were permted.
resMatrix where the corresponding permutation matrix is sttored. Reallocated if necessary.

$A Igor Dec14;

References IG.Num.MatrixBase.SetZero().

static void IG.Num.MatrixBase.Permute ( IMatrix  A,
int[]  permutations,
ref IMatrix  result 
)
inlinestatic

Permutes rows of the specified aquare matrix according to the specified permutations array.

Mainly used for testing.

Parameters
AMatrix to be Permuted.
permutationsArray that contains information on row permutations that must be performed.
resultMatrix where resultt is stored, i.e. the original matrix with permuted rows.

$A Igor Dec14;

References IG.Num.IMatrix.GetNew().

static void IG.Num.MatrixBase.UnPermute ( IMatrix  Apermuted,
int[]  permutations,
ref int[]  auxArray,
ref IMatrix  result 
)
inlinestatic

Unpermutes the product of the specified DooLittle LU decomposition according to permutations array.

The method can be used for reversing any row permutation performed on a sqyare matrix.

Parameters
ApermutedMatrix containing the permuted LU decomposition of some decomposed original matrix. Must be a square matrix.
permutationsArray that contains information on row permutations that were perfomed during the LU decomposition.
auxArrayAuxilliary array, should have the same dimension as permutations .
resultMatrix where resultt is stored, i.e. the unpermuted LU product.

$A Igor Dec14;

References IG.Num.IMatrix.GetNew().

Referenced by IG.Num.SpeedTestCpu.TestComputationalTimesLU_Base().

static bool IG.Num.MatrixBase.TestLuDecomposition ( int  dim,
int  numRepetitions = 1,
double  tol = 1e-6,
int  outputLevel = 0,
IRandomGenerator  randomGenerator = null,
IMatrix  A = null,
IVector  b = null 
)
inlinestatic

Performs a test of calculatons performed via LU decomposition of a matrix. Calculation times and error extents are measured and reported (if specified).

If relative errors are below the specified tolerance, true is returned, otherwise false is returned.

Parameters
dimDimension of the problems generated for tests.
numRepetitionsNumber of repetitions of the tests. If greater than 1 then tests are repeated with inputs generated anew each time.
tolTolerance on relative errors of test results.
outputLevelLevel of output. If 0 then no reports are launched to the console.
randomGeneratorRandom generator used for generation of test inputs.
ASystem matrix used in the test. If specified (i.e., not null) then this matrix is LU decomposed and used in the first repetition of tests instead of a randomly generated matrix. In this case, its dimension overrides (when not the same) the specified dimension dim of test matrices and vectors. If there are more than one repetitions (parameter numRepetitions ) then subsequent repetitions still use randomly generated inputs. If specified (i.e., not null) then this vector is used in the first repetition of tests instead of a a randomly generated vector. Similar rules apply as for A .
bVector of right-hand sides used in the test.
Returns
True if all tests passed successfully (i.e., if errors are below the specified tolerance).

$A Igor Dec14;

References IG.Num.A, IG.Lib.StopWatch1.CpuTime, IG.Num.RandomGenerator.Global, IG.Num.Matrix.Identity(), IG.Num.MatrixBase.Multiply(), IG.Num.VectorBase.SetRandom(), IG.Num.MatrixBase.SetRandomInvertible(), IG.Num.MatrixBase.SetZero(), IG.Lib.StopWatch1.Start(), IG.Lib.StopWatch1.Stop(), IG.Num.VectorBase.Subtract(), IG.Num.MatrixBase.Subtract(), IG.Lib.StopWatch1.Time, IG.Lib.StopWatch1.TotalCpuTime, and IG.Lib.StopWatch1.TotalTime.

static void IG.Num.MatrixBase.TestLuDecompositionDemo ( )
inlinestatic
static bool IG.Num.MatrixBase.LdltDecompose ( IMatrix  A,
ref IMatrix  result,
double  tol = 1e-12 
)
inlinestatic

Calculates LDLT decomposition of a real symmetric square matrix.

L is lower triangular matrix with 1s on diagonal, and D is a diagonal matrix.

Decomposition can be done in place.

Can be done in place (input and result matrices can reference the same object).

Parameters
AMatrix whose decomposition is calculated.
tolTolerance for detection of singularity (must be a small positive number greater or equal to 0).
resultMatrix where the result of calculation is stored.

$A Igor Dec14;

References IG.Num.MatrixBase.CopyPlain(), and IG.Num.IMatrix.GetNew().

Referenced by IG.Num.SpeedTestCpu.TestComputationalTimesLdlt_Base().

static void IG.Num.MatrixBase.LdltSolve ( IMatrix  decomposed,
IVector  b,
ref IVector  x 
)
inlinestatic

Solves a system of eauations with the specified LDLT decomposition of a real symmetric square matrix.

Used in conjunction with the LdltDecompose method for calculation of decomposition.

Can be done in place (input and result vectors can reference the same object).

Parameters
decomposedDecomposed original matrix (obtained by LdltDecompose).

Matrix is in form of 1D flat arrat with row-wise element arrangement.

Parameters
bVector of the right-hand sides of the system of equations.
xVector where result is stored.

$A Igor Dec14;

References IG.Num.VectorBase.Copy(), and IG.Num.IVector.GetNew().

Referenced by IG.Num.SpeedTestCpu.TestComputationalTimesLdlt_Base().

static void IG.Num.MatrixBase.LdltSolve ( IMatrix  ldltMatrix,
IMatrix  B,
ref IVector  auxX,
ref IMatrix  X 
)
inlinestatic

Calculates inverse of the matrix from its specified LDLT-decomposed matrix.

Parameters
ldltMatrixMatrix containing the LDLT decomposition of the original matrix.
BMatrix whose columns are right-hand sides of equations to be solved.
auxXAuxiliary vector of the same dimension as dimensions of the decomposed matrix. Reallocated if necessary.
XMatrix where result will be stored. Reallocated if necessary.

$A Igor Dec14;

References IG.Num.IMatrix.GetNew(), and IG.Num.IMatrix.GetNewVector().

static void IG.Num.MatrixBase.LdltInverse ( IMatrix  ldltMatrix,
ref IVector  auxX,
ref IMatrix  res 
)
inlinestatic

Calculates inverse of the matrix from its specified LDLT decomposition.

Parameters
ldltMatrixMatrix containing the LDLT decomposition of the original matrix (with partial pivoting).
auxXAnother auxiliary vector of the same dimension as dimensions of the decomposed matrix. Reallocated if necessary.
resMatrix where result will be stored. Reallocated if necessary.

$A Igor Dec14;

References IG.Num.IMatrix.GetNew(), and IG.Num.IMatrix.GetNewVector().

static double IG.Num.MatrixBase.LdltDeterminant ( IMatrix  ldltMatrix)
inlinestatic

Calculates and returns determinant of a square symmetric matrix form its specified LDLT decomposition.

Parameters
ldltMatrixMatrix containing the LDLT decomposition of the matrix whose determinant is to be calculated.
Returns
Determinant calculated from the precalculated LDLT decomposition of a symmetric matrix.

$A Igor Dec14;

static void IG.Num.MatrixBase.LdltExtractLower ( IMatrix  matLdlt,
ref IMatrix  result 
)
inlinestatic

Extracts the lower part of the specified LDLT decomposition (1s on diagonal, 0s above diagonal) and stores it in the specified result matrix.

Although operatioin can be done in place, it is not allowed for input and output matrix to be the same. Reason is that the operation always done in in combination (with extracting all parts).

Parameters
matLdltMatrix containng the LDLT decomposition of some matrix.
resultMatrix where the lower part of the decomposition is stored.

$A Igor Dec14;

References IG.Num.IMatrix.GetNew().

Referenced by IG.Num.SpeedTestCpu.TestComputationalTimesLdlt_Base().

static IMatrix IG.Num.MatrixBase.LdltExtractUpper ( IMatrix  matLdlt,
ref IMatrix  result 
)
inlinestatic

Extracts the upper part of the specified LDLT decomposition (1s on diagonal, 0s in below diagonal) and stores it in the specified result matrix.

Although operatioin can be done in place, it is not allowed for input and output matrix to be the same. Reason is that the operation always done in in combination (with extracting all parts).

Parameters
matLdltMatrix containng the LDLT decomposition of some matrix.
resultMatrix where the upper part of the specified matrix is stored.

$A Igor Dec14;

References IG.Num.IMatrix.GetNew().

Referenced by IG.Num.SpeedTestCpu.TestComputationalTimesLdlt_Base().

static IMatrix IG.Num.MatrixBase.LdltExtractDiagonal ( IMatrix  matLdlt,
ref IMatrix  result 
)
inlinestatic

Extracts the diagonal part of the specified LDLT decomposition and stores it in the specified result matrix.

Although operatioin can be done in place, it is not allowed for input and output matrix to be the same. Reason is that the operation always done in in combination (with extracting all parts).

Parameters
matLdltMatrix containng the LDLT decomposition of some matrix.
resultMatrix where the upper part of the specified matrix is stored.

$A Igor Dec14;

References IG.Num.IMatrix.GetNew().

static bool IG.Num.MatrixBase.TestLdltDecomposition ( int  dim,
int  numRepetitions = 1,
double  tol = 1e-6,
int  outputLevel = 0,
IRandomGenerator  randomGenerator = null,
IMatrix  A = null,
IVector  b = null 
)
inlinestatic

Performs a test of calculatons performed via LDLT decomposition of a matrix. Calculation times and error extents are measured and reported (if specified).

If relative errors are below the specified tolerance, true is returned, otherwise false is returned.

Parameters
dimDimension of the problems generated for tests.
numRepetitionsNumber of repetitions of the tests. If greater than 1 then tests are repeated with inputs generated anew each time.
tolTolerance on relative errors of test results.
outputLevelLevel of output. If 0 then no reports are launched to the console.
randomGeneratorRandom generator used for generation of test inputs.
ASystem matrix used in the test. If specified (i.e., not null) then this matrix is LDLT decomposed and used in the first repetition of tests instead of a randomly generated matrix. In this case, its dimension overrides (when not the same) the specified dimension dim of test matrices and vectors. If there are more than one repetitions (parameter numRepetitions ) then subsequent repetitions still use randomly generated inputs. If specified (i.e., not null) then this vector is used in the first repetition of tests instead of a a randomly generated vector. Similar rules apply as for A .
bVector of right-hand sides used in the test.
Returns
True if all tests passed successfully (i.e., if errors are below the specified tolerance).

$A Igor Dec14;

References IG.Num.A, IG.Lib.StopWatch1.CpuTime, IG.Num.RandomGenerator.Global, IG.Num.MatrixBase.IsSymmetric(), IG.Num.MatrixBase.Multiply(), IG.Num.MatrixBase.SetIdentity(), IG.Num.VectorBase.SetRandom(), IG.Num.MatrixBase.SetRandomPositiveDefiniteSymmetric(), IG.Num.MatrixBase.SetZero(), IG.Lib.StopWatch1.Start(), IG.Lib.StopWatch1.Stop(), IG.Num.VectorBase.Subtract(), IG.Num.MatrixBase.Subtract(), IG.Lib.StopWatch1.Time, IG.Lib.StopWatch1.TotalCpuTime, and IG.Lib.StopWatch1.TotalTime.

static bool IG.Num.MatrixBase.CholeskyDecompose ( IMatrix  A,
ref IMatrix  result,
double  tol = 1e-12 
)
inlinestatic

Calculates Cholesky decomposition of a real symmetric square matrix.

L is lower triangular matrix with 1s on diagonal, and D is a diagonal matrix.

Decomposition can be done in place.

Can be done in place (input and result matrices can reference the same object).

Parameters
AMatrix whose decomposition is calculated.
tolTolerance for detection of singularity (must be a small positive number greater or equal to 0).
resultMatrix where the result of calculation is stored.

$A Igor Dec14;

References IG.Num.MatrixBase.CopyPlain(), and IG.Num.IMatrix.GetNew().

Referenced by IG.Num.SpeedTestCpu.TestComputationalTimesCholesky_Base().

static void IG.Num.MatrixBase.CholeskySolve ( IMatrix  decomposed,
IVector  b,
ref IVector  x 
)
inlinestatic

Solves a system of eauations with the specified Cholesky decomposition of a real symmetric square matrix.

Used in conjunction with the CholeskyDecompose method for calculation of decomposition.

Can be done in place (input and result vectors can reference the same object).

Parameters
decomposedDecomposed original matrix (obtained by CholeskyDecompose).

Matrix is in form of 1D flat arrat with row-wise element arrangement.

Parameters
bVector of the right-hand sides of the system of equations.
xVector where result is stored.

$A Igor Dec14;

References IG.Num.VectorBase.Copy(), IG.Num.IVector.GetNew(), and IG.Num.IMatrix.GetNewVector().

Referenced by IG.Num.SpeedTestCpu.TestComputationalTimesCholesky_Base().

static void IG.Num.MatrixBase.CholeskySolve ( IMatrix  CholeskyMatrix,
IMatrix  B,
ref IVector  auxX,
ref IMatrix  X 
)
inlinestatic

Calculates inverse of the matrix from its specified Cholesky-decomposed matrix.

Parameters
CholeskyMatrixMatrix containing the Cholesky decomposition of the original matrix.
BMatrix whose columns are right-hand sides of equations to be solved.
auxXAuxiliary vector of the same dimension as dimensions of the decomposed matrix. Reallocated if necessary.
XMatrix where result will be stored. Reallocated if necessary.

$A Igor Dec14;

References IG.Num.IMatrix.GetNew(), and IG.Num.IMatrix.GetNewVector().

static void IG.Num.MatrixBase.CholeskyInverse ( IMatrix  CholeskyMatrix,
ref IVector  auxX,
ref IMatrix  res 
)
inlinestatic

Calculates inverse of the matrix from its specified Cholesky decomposition.

Parameters
CholeskyMatrixMatrix containing the Cholesky decomposition of the original matrix (with partial pivoting).
auxXAnother auxiliary vector of the same dimension as dimensions of the decomposed matrix. Reallocated if necessary.
resMatrix where result will be stored. Reallocated if necessary.

$A Igor Dec14;

References IG.Num.IMatrix.GetNew(), and IG.Num.IMatrix.GetNewVector().

static double IG.Num.MatrixBase.CholeskyDeterminant ( IMatrix  CholeskyMatrix)
inlinestatic

Calculates and returns determinant of a square symmetric matrix form its specified Cholesky decomposition.

Parameters
CholeskyMatrixMatrix containing the Cholesky decomposition of the matrix whose determinant is to be calculated.
Returns
Determinant calculated from the precalculated Cholesky decomposition of a symmetric matrix.

$A Igor Dec14;

static void IG.Num.MatrixBase.CholeskyExtractLower ( IMatrix  matCholesky,
ref IMatrix  result 
)
inlinestatic

Extracts the lower part of the specified Cholesky decomposition (0s above diagonal) and stores it in the specified result matrix.

Although operatioin can be done in place, it is not allowed for input and output matrix to be the same. Reason is that the operation always done in in combination (with extracting all parts).

Parameters
matCholeskyMatrix containng the Cholesky decomposition of some matrix.
resultMatrix where the lower part of the decomposition is stored.

$A Igor Dec14;

References IG.Num.IMatrix.GetNew().

Referenced by IG.Num.SpeedTestCpu.TestComputationalTimesCholesky_Base().

static IMatrix IG.Num.MatrixBase.CholeskyExtractUpper ( IMatrix  matCholesky,
ref IMatrix  result 
)
inlinestatic

Extracts the upper part of the specified Cholesky decomposition (0s in below diagonal) and stores it in the specified result matrix.

Although operatioin can be done in place, it is not allowed for input and output matrix to be the same. Reason is that the operation always done in in combination (with extracting all parts).

Parameters
matCholeskyMatrix containng the Cholesky decomposition of some matrix.
resultMatrix where the upper part of the specified matrix is stored.

$A Igor Dec14;

References IG.Num.IMatrix.GetNew().

Referenced by IG.Num.SpeedTestCpu.TestComputationalTimesCholesky_Base().

static bool IG.Num.MatrixBase.TestCholeskyDecomposition ( int  dim,
int  numRepetitions = 1,
double  tol = 1e-6,
int  outputLevel = 0,
IRandomGenerator  randomGenerator = null,
IMatrix  A = null,
IVector  b = null 
)
inlinestatic

Performs test of calculatons performed via Cholesky decomposition of a matrix. Calculation times and error extents are measured and reported (if specified so).

If relative errors are below the specified tolerance, true is returned, otherwise false is returned.

Parameters
dimDimension of the problems generated for tests.
numRepetitionsNumber of repetitions of the tests. If greater than 1 then tests are repeated with inputs generated anew each time.
tolTolerance on relative errors of test results.
outputLevelLevel of output. If 0 then no reports are launched to the console.
randomGeneratorRandom generator used for generation of test inputs.
ASystem matrix used in the test. If specified (i.e., not null) then this matrix is Cholesky decomposed and used in the first repetition of tests instead of a randomly generated matrix. In this case, its dimension overrides (when not the same) the specified dimension dim of test matrices and vectors. If there are more than one repetitions (parameter numRepetitions ) then subsequent repetitions still use randomly generated inputs. If specified (i.e., not null) then this vector is used in the first repetition of tests instead of a a randomly generated vector. Similar rules apply as for A .
bVector of right-hand sides used in the test.
Returns
True if all tests passed successfully (i.e., if errors are below the specified tolerance).

$A Igor Dec14;

References IG.Num.A, IG.Lib.StopWatch1.CpuTime, IG.Num.RandomGenerator.Global, IG.Num.MatrixBase.IsSymmetric(), IG.Num.MatrixBase.Multiply(), IG.Num.MatrixBase.SetIdentity(), IG.Num.VectorBase.SetRandom(), IG.Num.MatrixBase.SetRandomPositiveDefiniteSymmetric(), IG.Num.MatrixBase.SetZero(), IG.Lib.StopWatch1.Start(), IG.Lib.StopWatch1.Stop(), IG.Num.VectorBase.Subtract(), IG.Num.MatrixBase.Subtract(), IG.Lib.StopWatch1.Time, IG.Lib.StopWatch1.TotalCpuTime, and IG.Lib.StopWatch1.TotalTime.

static void IG.Num.MatrixBase.TestCholeskyDecompositionDemo ( )
inlinestatic
static bool IG.Num.MatrixBase.QrDecomposeGrammSchmidt ( IMatrix  A,
ref IMatrix  resQ,
ref IMatrix  resR,
double  tol = 1e-12 
)
inlinestatic

Calculates QR decomposition of a real invertible matrix by using Gramm-Schmidt orthogonalization.

Q is orthogonal matrix (dot product of distinct columns is 0 and that of the same columns is 1), and R is upper triangular.

Decomposition can NOT be done in place.

Parameters
AMatrix whose decomposition is calculated.
resQMatrix where the orthogonal factor Q is stored.
resRMatrix where the uppker triangular factor R is stored.
tolTolerance for detection of singularity (must be a small positive number greater or equal to 0).

See also:

http://en.wikipedia.org/wiki/QR_decomposition#Using_the_Gram.E2.80.93Schmidt_process

$A Igor Mar15;

References IG.Num.IMatrix.GetNew().

static bool IG.Num.MatrixBase.QrDecompose ( IMatrix  A,
ref IMatrix  resQ,
ref IMatrix  resR,
double  tol = 1e-12 
)
inlinestatic

Calculates QR decomposition of a real invertible matrix.

Q is orthogonal matrix (dot product of distinct columns is 0 and that of the same columns is 1), and R is upper triangular.

Decomposition can NOT be done in place.

Parameters
AMatrix whose decomposition is calculated.
resQMatrix where the orthogonal factor Q is stored.
resRMatrix where the uppker triangular factor R is stored.
tolTolerance for detection of singularity (must be a small positive number greater or equal to 0).

See also:

http://en.wikipedia.org/wiki/QR_decomposition

$A Igor Mar15;

static void IG.Num.MatrixBase.QrSolve ( IMatrix  factorQ,
IMatrix  factorR,
IVector  b,
ref IVector  x 
)
inlinestatic

Solves a system of eauations with the specified QR decomposition of a real symmetric square matrix.

Used in conjunction with the QrDecompose method for calculation of decomposition.

Can NOT be done in place (input and result vectors can reference the same object).

Parameters
factorQFirst factor of QR decomposition (orthogonal Q, obtained by QrDecompose).
factorRSecond factor of QR decomposition (upper triangular R, obtained by QrDecompose).
bVector of the right-hand sides of the system of equations.
xVector where result is stored.

$A Igor Mar15;

References IG.Num.IVector.GetNew(), and IG.Num.MatrixBase.MultiplyTranspVecPlain().

static void IG.Num.MatrixBase.QrSolve ( IMatrix  factorQ,
IMatrix  factorR,
IMatrix  B,
ref IVector  auxB,
ref IVector  auxX,
ref IMatrix  X 
)
inlinestatic

Calculates inverse of the matrix from its specified LDLT-decomposed matrix.

Parameters
factorQFirst factor of QR decomposition (orthogonal Q, obtained by QrDecompose).
factorRSecond factor of QR decomposition (upper triangular R, obtained by QrDecompose).
BMatrix whose columns are right-hand sides of equations to be solved.
auxBAuxiliary vector of the same dimension as dimensions of the decomposed matrix. Reallocated if necessary.
auxXAnother auxiliary vector of the same dimension as dimensions of the decomposed matrix. Reallocated if necessary. May not be the same as auxB .
XMatrix where result will be stored. Reallocated if necessary.

$A Igor Dec14;

References IG.Num.IMatrix.GetNew(), and IG.Num.IMatrix.GetNewVector().

static void IG.Num.MatrixBase.QrInverse ( IMatrix  factorQ,
IMatrix  factorR,
ref IVector  auxB,
ref IVector  auxX,
ref IMatrix  res 
)
inlinestatic

Calculates inverse of the matrix from its specified LDLT decomposition.

Parameters
factorQMatrix containing the Q factor of the QR decomposition of the original matrix.
factorRMatrix containing the R factor of the QR decomposition of the original matrix.
auxBAuxiliary vector of the same dimension as dimensions of the decomposed matrix.
auxXAnother auxiliary vector of the same dimension as dimensions of the decomposed matrix. Reallocated if necessary.
resMatrix where result will be stored. Reallocated if necessary.

$A Igor Dec14;

References IG.Num.IMatrix.GetNew(), and IG.Num.IMatrix.GetNewVector().

static bool IG.Num.MatrixBase.CheckTestResult ( IMatrix  result,
IMatrix  referenceResult,
double  tolerance,
bool  printReports 
)
inlinestaticprotected

Checks whether the difference between matrix result of the tested operation and some reference result is within the specified tolerance.

Parameters
resultMatrix that is the result of the tested operation.
referenceResultReference result obtained in a different way.
toleranceTolerance on norm of the difference. Must be greater than 0. If norm is less or equal to the tolerance then the test passes.
printReportsIf true then short reports are printed to console.
Returns
true if norm of the difference between the result matrix and the reference result is less or equal to tolerance.
static bool IG.Num.MatrixBase.CheckTestResult ( IVector  result,
IVector  referenceResult,
double  tolerance,
bool  printReports 
)
inlinestaticprotected

Checks whether the difference between matrix result of the tested operation and some reference result is within the specified tolerance.

Parameters
resultMatrix that is the result of the tested operation.
referenceResultReference result obtained in a different way.
toleranceTolerance on norm of the difference. Must be greater than 0. If norm is less or equal to the tolerance then the test passes.
printReportsIf true then short reports are printed to console.
Returns
true if norm of the difference between the result matrix and the reference result is less or equal to tolerance.

References IG.Num.VectorBase.Subtract().

static bool IG.Num.MatrixBase.TestMatrixProducts ( bool  printReports)
inlinestatic

Tests various matrix and vector products with fixed tolerance of 1.0E-6.

Parameters
printReportsSpecifies whether to print short reports to console or not.
Returns
True if all tests have passed, and false if there is an error.
static bool IG.Num.MatrixBase.TestMatrixProducts ( double  tolerance)
inlinestatic

Tests various matrix and vector products, without printing reports.

Parameters
toleranceTolerance for difference between product and test expression below which any individual test passes. Must be greater than 0.
Returns
True if all tests have passed, and false if there is an error.
static bool IG.Num.MatrixBase.TestMatrixProducts ( )
inlinestatic

Tests various matrix and vector products with fixed tolerance of 1.0E-6 and without printing reports.

Returns
True if all tests have passed, and false if there is an error.
static bool IG.Num.MatrixBase.TestMatrixProducts ( double  tolerance,
bool  printReports 
)
inlinestatic

Tests various matrix and vector products.

Parameters
toleranceTolerance for difference between product and test expression below which any individual test passes. Must be greater than 0.
printReportsSpecifies whether to print short reports to console or not.
Returns
True if all tests have passed, and false if there is an error.
static void IG.Num.MatrixBase.TestStaticMethodCommon ( )
inlinestatic

A test method, just prints some output.

static void IG.Num.MatrixBase.TestStaticMethodSpecific ( )
inlinestatic

A test method, just prints some output.

static bool IG.Num.MatrixBase.TestIndices ( int  dim1 = 3,
int  dim2 = 4,
IMatrix  providedMatrix = null 
)
inlinestatic

Performs test of converson between double indexing and flat indexing of matric elements,. Returns true if successful, false othwrwise.

Parameters
dim1Number of rows.
dim2Number of columns.
providedMatrixIf not null, this matrix will be taken for testing indices.
Returns
true if successful, false if not.

References IG.Num.MatrixBase.Index(), IG.Num.MatrixBase.Indices(), and IG.Num.MatrixBase.SetRandom().

Member Data Documentation

MatrixStore IG.Num.MatrixBase._matrixStore
staticprivate

Property Documentation

abstract int IG.Num.MatrixBase.RowCount
get

Gets the number of rows of the current matrix.

Referenced by IG.Num.MatrixBase.operator*().

abstract int IG.Num.MatrixBase.ColumnCount
get

Gets the number of columns of the current matrix.

Referenced by IG.Num.MatrixBase.operator*().

virtual int IG.Num.MatrixBase.Count
get

Gets total number of elements.

Warning: this is usually done by multiplying RowCount and ColumnCount, so it is not a priceless operation.

virtual IMatrix IG.Num.MatrixBase.T
get

Returns a new matrix that is transpose of the current matrix.

virtual double IG.Num.MatrixBase.this[int flatIndex]
getset

Gets or set the element indexed by a flat index in the Matrix.

This method just provides a mechanism of addressing elements by a single (flat) index in derived classes where implementation adheres to addressing by a single index (e.g. where elements are stored in a two dimensional array). In other cases, this indexing operator will be overridden.

Parameters
flatIndexFlat element index, i.e. one dimensional index of a matrix element when elements are expanded to one dimensional array.
virtual double IG.Num.MatrixBase.this[int row, int column]
getset

Gets or set the element indexed by (i, j) in the Matrix.

This method just provides a mechanism of addressing elements by two indices in derived classes where implementation adheres to addressing by a single index (e.g. where elements are stored in a one dimensional array). In other cases, this indexing operator will be overridden.

Parameters
rowRow index of the element.
columnColumn index of the element.
virtual double IG.Num.MatrixBase.Trace
get

Gets matrix trace (sum of diagonal terms).

virtual double IG.Num.MatrixBase.NormForbenius
get

Gets Forbenious (or Euclidean) norm of the matrix - square root of sum of squares of elements.

virtual double IG.Num.MatrixBase.NormEuclidean
get

Gets Forbenious (or Euclidean) norm of the matrix - square root of sum of squares of elements.

virtual double IG.Num.MatrixBase.Norm
get

Gets Forbenious (or Euclidean) norm of the matrix - square root of sum of squares of elements.

MatrixStore IG.Num.MatrixBase.MatrixStore
staticget

Gets the matrix store for recycling auxiliary matrices.

Matrix store is created only once, on the first access.


The documentation for this class was generated from the following file: