| IGLib 1.7.2 The IGLib base library for development of numerical, technical and business applications.

- Main Page
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros
Public Member Functions | List of all members
IG.Num.IMatrix Interface Reference

Real matrix interface. More...

Inheritance diagram for IG.Num.IMatrix:
[legend]

## Public Member Functions
IMatrix | GetCopy ()
| Creates and returns a copy of the current matrix. More...
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...
IMatrix | GetNew ()
| Creates and returns a new matrix with the same dimensions and of the same type as the current matrix. More...
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...
void | SetConstant (double elementValue)
| Sets all components of the current matrix to the specified value. More...
void | SetIdentity ()
| Sets the current matrix to identity matrix. More...
void | SetRandom ()
| Sets the current matrix such that it contains random elements on the interval (0,1]. More...
void | SetRandom (IRandomGenerator rnd)
| Sets the current matrix such that it contains random elements on the interval (0,1]. More...
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...
void | SetDiagonal (IVector diagonal)
| Sets the current matrix to the diagonal matrix with diagonal element specified by a vector. More...
bool | IsSquare ()
| Returns true if the current matrix is a square matrix, and false if not. More...
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...
bool | IsSymmetric (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...
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...
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...
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...
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...
string | ToString ()
| 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...
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...
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...
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...

## Detailed Description

Real matrix interface.

$A Igor Sep08 Dec09;

## Member Function Documentation

IMatrix IG.Num.IMatrix.GetCopy | ( |  | ) |

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.MatrixBase.

Referenced by IG.Num.AnalysisResults.SetConstraintHessian(), and IG.Num.VectorFunctionResults.SetHessian().

IMatrix IG.Num.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.

Parameters

  rowCount | Number fo rows of the newly created matrix.
  columnCount | Number 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.MatrixBase.

Referenced by IG.Num.MatrixBase.Add(), IG.Num.MatrixBase.AntisymmetricPart(), IG.Num.MatrixBase.ArrayDivide(), IG.Num.MatrixBase.ArrayMap(), IG.Num.MatrixBase.ArrayMultiply(), IG.Num.MatrixBase.ArrayPower(), IG.Num.MatrixBase.CholeskyDecompose(), IG.Num.MatrixBase.CholeskyExtractLower(), IG.Num.MatrixBase.CholeskyExtractUpper(), IG.Num.MatrixBase.CholeskyInverse(), IG.Num.MatrixBase.CholeskySolve(), IG.Num.MatrixBase.Copy(), IG.Num.MatrixBase.Divide(), IG.Num.MatrixBase.LdltDecompose(), IG.Num.MatrixBase.LdltExtractDiagonal(), IG.Num.MatrixBase.LdltExtractLower(), IG.Num.MatrixBase.LdltExtractUpper(), IG.Num.MatrixBase.LdltInverse(), IG.Num.MatrixBase.LdltSolve(), IG.Num.MatrixBase.LuExtractLower(), IG.Num.MatrixBase.LuExtractUpper(), IG.Num.MatrixBase.LuInverse(), IG.Num.MatrixBase.LuSolve(), IG.Num.MatrixBase.Multiply(), IG.Num.MatrixBase.MultiplyDiagonal(), IG.Num.MatrixBase.MultiplyInverseDiagonal(), IG.Num.MatrixBase.MultiplyMatMatTransp(), IG.Num.MatrixBase.MultiplyMatTransp(), IG.Num.MatrixBase.MultiplyMatTranspMat(), IG.Num.MatrixBase.MultiplyTranspMat(), IG.Num.MatrixBase.MultiplyTranspMatMat(), IG.Num.MatrixBase.MultiplyTranspMatTransp(), IG.Num.MatrixBase.MultiplyTranspTransp(), IG.Num.MatrixBase.MultiplyTranspTranspTransp(), IG.Num.MatrixBase.Negate(), IG.Num.MatrixBase.Permute(), IG.Num.MatrixBase.QrDecomposeGrammSchmidt(), IG.Num.MatrixBase.QrInverse(), IG.Num.MatrixBase.QrSolve(), IG.Num.MatrixBase.Subtract(), IG.Num.MatrixBase.SymmetricPart(), IG.Num.MatrixBase.Symmetrize(), IG.Num.MatrixBase.TestCholeskyDecompositionDemo(), IG.Num.MatrixBase.TestLuDecompositionDemo(), IG.Num.AffineTransformationSquare.TransformBackHessian(), IG.Num.AffineTransformationSquare.TransformHessian(), IG.Num.MatrixBase.Transpose(), and IG.Num.MatrixBase.UnPermute().

IMatrix IG.Num.IMatrix.GetNew | ( |  | ) |

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

Implemented in IG.Num.MatrixBase.

IVector IG.Num.IMatrix.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.

Parameters

  length | Dimension 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.MatrixBase.

Referenced by IG.Num.MatrixBase.CholeskyInverse(), IG.Num.MatrixBase.CholeskySolve(), IG.Num.MatrixBase.LdltInverse(), IG.Num.MatrixBase.LdltSolve(), IG.Num.MatrixBase.LuInverse(), IG.Num.MatrixBase.LuSolve(), IG.Num.MatrixBase.Multiply(), IG.Num.MatrixBase.MultiplyTranspVec(), IG.Num.MatrixBase.QrInverse(), and IG.Num.MatrixBase.QrSolve().

void IG.Num.IMatrix.SetConstant | ( | double | elementValue | ) |

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

Parameters

  elementValue | Value to which elements are set.

Implemented in IG.Num.MatrixBase.

Referenced by IG.Num.ScalarFunctionUntransformedBase.TestHessian().

void IG.Num.IMatrix.SetIdentity | ( |  | ) |

Sets the current matrix to identity matrix.

Implemented in IG.Num.MatrixBase.

void IG.Num.IMatrix.SetRandom | ( |  | ) |

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

Implemented in IG.Num.MatrixBase.

Referenced by IG.Num.SampledDataSet.CreateExampleQuadratic(), IG.Num.MatrixBase.TestMultiply3(), IG.Num.MatrixBase.TestMultiplyMatMatTransp(), IG.Num.MatrixBase.TestMultiplyMatTransp(), IG.Num.MatrixBase.TestMultiplyMatTranspMat(), IG.Num.MatrixBase.TestMultiplyTranspMat(), IG.Num.MatrixBase.TestMultiplyTranspMatMat(), IG.Num.MatrixBase.TestMultiplyTranspMatTransp(), IG.Num.MatrixBase.TestMultiplyTranspTransp(), and IG.Num.MatrixBase.TestMultiplyTranspTranspTransp().

void IG.Num.IMatrix.SetRandom | ( | IRandomGenerator | rnd | ) |

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

Parameters

  rnd | Random generator used to generate matrix elements.

Implemented in IG.Num.MatrixBase.

void IG.Num.IMatrix.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.

Parameters

  diagonalElement | Value of diagonal elements.

Implemented in IG.Num.MatrixBase.

void IG.Num.IMatrix.SetDiagonal | ( | IVector | diagonal | ) |

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

Parameters

  diagonal | Vector of diagonal elements.

Implemented in IG.Num.MatrixBase.

bool IG.Num.IMatrix.IsSquare | ( |  | ) |

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

Implemented in IG.Num.MatrixBase.

bool IG.Num.IMatrix.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.

Implemented in IG.Num.MatrixBase.

bool IG.Num.IMatrix.IsSymmetric | ( | 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.

Parameters

  relativeRMSTolerance | Tolerance 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.

Implemented in IG.Num.MatrixBase.

string IG.Num.IMatrix.ToStringReadable | ( | int | accuracy = `4`,
|  | int | padding = `8`
| ) |  |

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

Parameters

  accuracy | Accuracy of matrix elments representations.
  padding | Paddind of matrix elements.

Returns
  A readable string representation in tabular form.

Implemented in IG.Num.MatrixBase.

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

string IG.Num.IMatrix.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.

Implemented in IG.Num.MatrixBase.

string IG.Num.IMatrix.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.

Parameters

  elementFormat | Format specification for printing individual element.

Implemented in IG.Num.MatrixBase.

string IG.Num.IMatrix.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.

Implemented in IG.Num.MatrixBase.

string IG.Num.IMatrix.ToString | ( |  | ) |

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.

Implemented in IG.Num.MatrixBase.

Referenced by IG.Lib.InterfaceInverse.AppendValue(), IG.Num.ScalarFunctionUntransformedBase.TestSpeed(), IG.Num.MatrixBase.ToStringMath(), IG.Num.MatrixBase.ToStringNewlines(), and IG.Num.MatrixBase.ToStringReadable().

string IG.Num.IMatrix.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.

Parameters

  elementFormat | Format specification for printing individual element.

Implemented in IG.Num.MatrixBase.

string IG.Num.IMatrix.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.

Parameters

  elementFormat | Format specification for printing individual element.

Implemented in IG.Num.MatrixBase.

int IG.Num.IMatrix.GetHashFunctionInt | ( |  | ) |

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

Implemented in IG.Num.MatrixBase.

string IG.Num.IMatrix.GetHashFunctionString | ( |  | ) |

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 on 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

Implemented in IG.Num.MatrixBase.

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

- igbase/numeric/MatrixBase.cs