C# Class AnimatGuiCtrls.MatrixLibrary.Matrix

Matrix Library .Net v2.0 By Anas Abidi, 2004. The Matrix Library contains Class Matrix which provides many static methods for making various matrix operations on objects derived from the class or on arrays defined as double. The '+','-','*' operators are overloaded to work with the objects derived from the matrix class.
Show file Open project: NeuroRoboticTech/AnimatLabPublicSource

Public Methods

Method Description
Add ( Matrix Mat1, Matrix Mat2 ) : Matrix

Returns the summation of two matrices with compatible dimensions. In case of an error the error is raised as an exception.

Add ( double Mat1, double Mat2 ) : ].double[

Returns the summation of two matrices with compatible dimensions. In case of an error the error is raised as an exception.

CrossProduct ( Matrix V1, Matrix V2 ) : Matrix

Returns the cross product of two vectors whose dimensions should be [3] or [3x1]. In case of an error the error is raised as an exception.

CrossProduct ( double V1, double V2 ) : ].double[

Returns the cross product of two vectors whose dimensions should be [3] or [3x1]. In case of an error the error is raised as an exception.

CrossProduct ( double V1, double V2 ) : double[]

Returns the cross product of two vectors whose dimensions should be [3] or [3,1]. In case of an error the error is raised as an exception.

Det ( Matrix Mat ) : double

Returns the determinant of a matrix with [n,n] dimension. In case of an error the error is raised as an exception.

Det ( double Mat ) : double

Returns the determinant of a matrix with [n,n] dimension. In case of an error the error is raised as an exception.

DotProduct ( Matrix V1, Matrix V2 ) : double

Returns the dot product of two vectors whose dimensions should be [3] or [3,1]. In case of an error the error is raised as an exception.

DotProduct ( double V1, double V2 ) : double

Returns the dot product of two vectors whose dimensions should be [3] or [3,1]. In case of an error the error is raised as an exception.

Eigen ( Matrix Mat, Matrix &d, Matrix &v ) : void

Returns the Eigenvalues and Eigenvectors of a real symmetric matrix, which is of dimensions [n,n]. In case of an error the error is raised as an exception. Note: This method is based on the 'Eigenvalues and Eigenvectors of a TridiagonalMatrix' section of Numerical Recipes in C by William H. Press, Saul A. Teukolsky, William T. Vetterling and Brian P. Flannery, University of Cambridge Press 1992.

Eigen ( double Mat, double &d, double &v ) : void

Returns the Eigenvalues and Eigenvectors of a real symmetric matrix, which is of dimensions [n,n]. In case of an error the error is raised as an exception. Note: This method is based on the 'Eigenvalues and Eigenvectors of a TridiagonalMatrix' section of Numerical Recipes in C by William H. Press, Saul A. Teukolsky, William T. Vetterling and Brian P. Flannery, University of Cambridge Press 1992.

Equals ( Object obj ) : bool

Tests whether the specified object is a MatrixLibrary.Matrix object and is identical to this MatrixLibrary.Matrix object.

GetHashCode ( ) : int
Identity ( int n ) : ].double[

Returns an Identity matrix with dimensions [n,n] in the from of an array.

Inverse ( Matrix Mat ) : Matrix

Returns the inverse of a matrix with [n,n] dimension and whose determinant is not zero. In case of an error the error is raised as an exception.

Inverse ( double Mat ) : ].double[

Returns the inverse of a matrix with [n,n] dimension and whose determinant is not zero. In case of an error the error is raised as an exception.

IsEqual ( Matrix Mat1, Matrix Mat2 ) : bool

Checks if two matrices of equal dimensions are equal or not. In case of an error the error is raised as an exception.

IsEqual ( double Mat1, double Mat2 ) : bool

Checks if two Arrays of equal dimensions are equal or not. In case of an error the error is raised as an exception.

LU ( Matrix Mat, Matrix &L, Matrix &U, Matrix &P ) : void

Returns the LU Decomposition of a matrix. the output is: lower triangular matrix L, upper triangular matrix U, and permutation matrix P so that P*X = L*U. In case of an error the error is raised as an exception. Note: This method is based on the 'LU Decomposition and Its Applications' section of Numerical Recipes in C by William H. Press, Saul A. Teukolsky, William T. Vetterling and Brian P. Flannery, University of Cambridge Press 1992.

LU ( double Mat, double &L, double &U, double &P ) : void

Returns the LU Decomposition of a matrix. the output is: lower triangular matrix L, upper triangular matrix U, and permutation matrix P so that P*X = L*U. In case of an error the error is raised as an exception. Note: This method is based on the 'LU Decomposition and Its Applications' section of Numerical Recipes in C by William H. Press, Saul A. Teukolsky, William T. Vetterling and Brian P. Flannery, University of Cambridge Press 1992.

Matrix ( double Mat ) : System

Matrix object constructor, constructs a matrix from an already defined array object.

Matrix ( int noRows, int noCols ) : System

Matrix object constructor, constructs an empty matrix with dimensions: rows = noRows and cols = noCols.

Multiply ( Matrix Mat1, Matrix Mat2 ) : Matrix

Returns the multiplication of two matrices with compatible dimensions OR the cross-product of two vectors. In case of an error the error is raised as an exception.

Multiply ( double Mat1, double Mat2 ) : ].double[

Returns the multiplication of two matrices with compatible dimensions. In case of an error the error is raised as an exception.

OneD_2_TwoD ( double Mat ) : ].double[

Returns the 2D form of a 1D array. i.e. array with dimension[n] is returned as an array with dimension [n,1]. In case of an error the error is raised as an exception.

PINV ( Matrix Mat ) : Matrix

Returns the pseudoinverse of a matrix, such that X = PINV(A) produces a matrix 'X' of the same dimensions as A' so that A*X*A = A, X*A*X = X. In case of an error the error is raised as an exception.

PINV ( double Mat ) : ].double[

Returns the pseudoinverse of a matrix, such that X = PINV(A) produces a matrix 'X' of the same dimensions as A' so that A*X*A = A, X*A*X = X. In case of an error the error is raised as an exception.

PrintMat ( Matrix Mat ) : string

Returns a matrix as a string, so it can be viewed in a multi-text textbox or in a richtextBox (preferred). In case of an error the error is raised as an exception.

PrintMat ( double Mat ) : string

Returns a matrix as a string, so it can be viewed in a multi-text textbox or in a richtextBox (preferred). In case of an error the error is raised as an exception.

Rank ( Matrix Mat ) : int

Returns the rank of a matrix. In case of an error the error is raised as an exception.

Rank ( double Mat ) : int

Returns the rank of a matrix. In case of an error the error is raised as an exception.

SVD ( Matrix Mat, Matrix &S, Matrix &U, Matrix &V ) : void

Evaluates the Singular Value Decomposition of a matrix, returns the matrices S, U and V. Such that a given Matrix = U x S x V'. In case of an error the error is raised as an exception. Note: This method is based on the 'Singular Value Decomposition' section of Numerical Recipes in C by William H. Press, Saul A. Teukolsky, William T. Vetterling and Brian P. Flannery, University of Cambridge Press 1992.

SVD ( double Mat_, double &S_, double &U_, double &V_ ) : void

Evaluates the Singular Value Decomposition of a matrix, returns the matrices S, U and V. Such that a given Matrix = U x S x V'. In case of an error the error is raised as an exception. Note: This method is based on the 'Singular Value Decomposition' section of Numerical Recipes in C by William H. Press, Saul A. Teukolsky, William T. Vetterling and Brian P. Flannery, University of Cambridge Press 1992.

ScalarDivide ( double Value, Matrix Mat ) : Matrix

Returns the division of a matrix or a vector (i.e dimension [3,1]) by a scalar quantity. In case of an error the error is raised as an exception.

ScalarDivide ( double Value, double Mat ) : ].double[

Returns the division of a matrix or a vector (i.e dimension [3,1]) by a scalar quantity. In case of an error the error is raised as an exception.

ScalarMultiply ( double Value, Matrix Mat ) : Matrix

Returns the multiplication of a matrix or a vector (i.e dimension [3,1]) with a scalar quantity. In case of an error the error is raised as an exception.

ScalarMultiply ( double Value, double Mat ) : ].double[

Returns the multiplication of a matrix or a vector (i.e dimension [3,1]) with a scalar quantity. In case of an error the error is raised as an exception.

SolveLinear ( Matrix MatA, Matrix MatB ) : Matrix

Solves a set of n linear equations A.X = B, and returns X, where A is [n,n] and B is [n,1]. In the same manner if you need to compute: inverse(A).B, it is better to use this method instead, as it is much faster. In case of an error the error is raised as an exception. Note: This method is based on the 'LU Decomposition and Its Applications' section of Numerical Recipes in C by William H. Press, Saul A. Teukolsky, William T. Vetterling and Brian P. Flannery, University of Cambridge Press 1992.

SolveLinear ( double MatA, double MatB ) : ].double[

Solves a set of n linear equations A.X = B, and returns X, where A is [n,n] and B is [n,1]. In the same manner if you need to compute: inverse(A).B, it is better to use this method instead, as it is much faster. In case of an error the error is raised as an exception. Note: This method is based on the 'LU Decomposition and Its Applications' section of Numerical Recipes in C by William H. Press, Saul A. Teukolsky, William T. Vetterling and Brian P. Flannery, University of Cambridge Press 1992.

Subtract ( Matrix Mat1, Matrix Mat2 ) : Matrix

Returns the difference of two matrices with compatible dimensions. In case of an error the error is raised as an exception.

Subtract ( double Mat1, double Mat2 ) : ].double[

Returns the difference of two matrices with compatible dimensions. In case of an error the error is raised as an exception.

ToString ( ) : string

Returns the matrix as a string, so it can be viewed in a multi-text textbox or in a richtextBox (preferred). In case of an error the error is raised as an exception.

Transpose ( Matrix Mat ) : Matrix

Returns the transpose of a matrix. In case of an error the error is raised as an exception.

Transpose ( double Mat ) : ].double[

Returns the transpose of a matrix. In case of an error the error is raised as an exception.

TwoD_2_OneD ( double Mat ) : double[]

Returns the 1D form of a 2D array. i.e. array with dimension[n,1] is returned as an array with dimension [n]. In case of an error the error is raised as an exception.

VectorMagnitude ( Matrix V ) : double

Returns the magnitude of a vector whose dimension is [3] or [3,1]. In case of an error the error is raised as an exception.

VectorMagnitude ( double V ) : double

Returns the magnitude of a vector whose dimension is [3] or [3,1]. In case of an error the error is raised as an exception.

operator ( ) : Matrix

Returns the multiplication of two matrices with compatible dimensions OR the cross-product of two vectors. In case of an error the error is raised as an exception.

operator ( ) : bool

Checks if two matrices of equal dimensions are not equal. In case of an error the error is raised as an exception.

this ( int Row, int Col ) : double

Set or get an element from the matrix

Private Methods

Method Description
Find_R_C ( double Mat, int &Row ) : void
Find_R_C ( double Mat, int &Row, int &Col ) : void
PYTHAG ( double a, double b ) : double
ROT ( double g, double h, double s, double tau, double a, int i, int j, int k, int l ) : void
SQR ( double a ) : double
Sign ( double a, double b ) : double
SwapRows ( double Mat, int Row, int toRow ) : void

Method Details

Add() public static method

Returns the summation of two matrices with compatible dimensions. In case of an error the error is raised as an exception.
public static Add ( Matrix Mat1, Matrix Mat2 ) : Matrix
Mat1 Matrix First matrix in the summation
Mat2 Matrix Second matrix in the summation
return Matrix

Add() public static method

Returns the summation of two matrices with compatible dimensions. In case of an error the error is raised as an exception.
public static Add ( double Mat1, double Mat2 ) : ].double[
Mat1 double First array in the summation
Mat2 double Second array in the summation
return ].double[

CrossProduct() public static method

Returns the cross product of two vectors whose dimensions should be [3] or [3x1]. In case of an error the error is raised as an exception.
public static CrossProduct ( Matrix V1, Matrix V2 ) : Matrix
V1 Matrix First Matrix (dimensions [3,1]) in the cross product
V2 Matrix Second Matrix (dimensions [3,1]) in the cross product
return Matrix

CrossProduct() public static method

Returns the cross product of two vectors whose dimensions should be [3] or [3x1]. In case of an error the error is raised as an exception.
public static CrossProduct ( double V1, double V2 ) : ].double[
V1 double First vector array (dimensions [3,1]) in the cross product
V2 double Second vector array (dimensions [3,1]) in the cross product
return ].double[

CrossProduct() public static method

Returns the cross product of two vectors whose dimensions should be [3] or [3,1]. In case of an error the error is raised as an exception.
public static CrossProduct ( double V1, double V2 ) : double[]
V1 double First vector array (dimension [3]) in the cross product
V2 double Second vector array (dimension [3]) in the cross product
return double[]

Det() public static method

Returns the determinant of a matrix with [n,n] dimension. In case of an error the error is raised as an exception.
public static Det ( Matrix Mat ) : double
Mat Matrix /// Matrix object with [n,n] dimension whose determinant is to be found ///
return double

Det() public static method

Returns the determinant of a matrix with [n,n] dimension. In case of an error the error is raised as an exception.
public static Det ( double Mat ) : double
Mat double /// Array with [n,n] dimension whose determinant is to be found ///
return double

DotProduct() public static method

Returns the dot product of two vectors whose dimensions should be [3] or [3,1]. In case of an error the error is raised as an exception.
public static DotProduct ( Matrix V1, Matrix V2 ) : double
V1 Matrix First Matrix object (dimension [3,1]) in the dot product
V2 Matrix Second Matrix object (dimension [3,1]) in the dot product
return double

DotProduct() public static method

Returns the dot product of two vectors whose dimensions should be [3] or [3,1]. In case of an error the error is raised as an exception.
public static DotProduct ( double V1, double V2 ) : double
V1 double First vector array (dimension [3]) in the dot product
V2 double Second vector array (dimension [3]) in the dot product
return double

Eigen() public static method

Returns the Eigenvalues and Eigenvectors of a real symmetric matrix, which is of dimensions [n,n]. In case of an error the error is raised as an exception. Note: This method is based on the 'Eigenvalues and Eigenvectors of a TridiagonalMatrix' section of Numerical Recipes in C by William H. Press, Saul A. Teukolsky, William T. Vetterling and Brian P. Flannery, University of Cambridge Press 1992.
public static Eigen ( Matrix Mat, Matrix &d, Matrix &v ) : void
Mat Matrix /// The Matrix object whose Eigenvalues and Eigenvectors are to be found ///
d Matrix A Matrix object where the eigenvalues are returned
v Matrix A Matrix object where the eigenvectors are returned
return void

Eigen() public static method

Returns the Eigenvalues and Eigenvectors of a real symmetric matrix, which is of dimensions [n,n]. In case of an error the error is raised as an exception. Note: This method is based on the 'Eigenvalues and Eigenvectors of a TridiagonalMatrix' section of Numerical Recipes in C by William H. Press, Saul A. Teukolsky, William T. Vetterling and Brian P. Flannery, University of Cambridge Press 1992.
public static Eigen ( double Mat, double &d, double &v ) : void
Mat double /// The array whose Eigenvalues and Eigenvectors are to be found ///
d double An array where the eigenvalues are returned
v double An array where the eigenvectors are returned
return void

Equals() public method

Tests whether the specified object is a MatrixLibrary.Matrix object and is identical to this MatrixLibrary.Matrix object.
public Equals ( Object obj ) : bool
obj Object The object to compare with the current object
return bool

GetHashCode() public method

public GetHashCode ( ) : int
return int

Identity() public static method

Returns an Identity matrix with dimensions [n,n] in the from of an array.
public static Identity ( int n ) : ].double[
n int the no. of rows or no. cols in the matrix
return ].double[

Inverse() public static method

Returns the inverse of a matrix with [n,n] dimension and whose determinant is not zero. In case of an error the error is raised as an exception.
public static Inverse ( Matrix Mat ) : Matrix
Mat Matrix /// Matrix object with [n,n] dimension whose inverse is to be found ///
return Matrix

Inverse() public static method

Returns the inverse of a matrix with [n,n] dimension and whose determinant is not zero. In case of an error the error is raised as an exception.
public static Inverse ( double Mat ) : ].double[
Mat double /// Array with [n,n] dimension whose inverse is to be found ///
return ].double[

IsEqual() public static method

Checks if two matrices of equal dimensions are equal or not. In case of an error the error is raised as an exception.
public static IsEqual ( Matrix Mat1, Matrix Mat2 ) : bool
Mat1 Matrix First Matrix in equality check
Mat2 Matrix Second Matrix in equality check
return bool

IsEqual() public static method

Checks if two Arrays of equal dimensions are equal or not. In case of an error the error is raised as an exception.
public static IsEqual ( double Mat1, double Mat2 ) : bool
Mat1 double First array in equality check
Mat2 double Second array in equality check
return bool

LU() public static method

Returns the LU Decomposition of a matrix. the output is: lower triangular matrix L, upper triangular matrix U, and permutation matrix P so that P*X = L*U. In case of an error the error is raised as an exception. Note: This method is based on the 'LU Decomposition and Its Applications' section of Numerical Recipes in C by William H. Press, Saul A. Teukolsky, William T. Vetterling and Brian P. Flannery, University of Cambridge Press 1992.
public static LU ( Matrix Mat, Matrix &L, Matrix &U, Matrix &P ) : void
Mat Matrix Matrix object which will be LU Decomposed
L Matrix A Matrix object where the lower traingular matrix is returned
U Matrix A Matrix object where the upper traingular matrix is returned
P Matrix A Matrix object where the permutation matrix is returned
return void

LU() public static method

Returns the LU Decomposition of a matrix. the output is: lower triangular matrix L, upper triangular matrix U, and permutation matrix P so that P*X = L*U. In case of an error the error is raised as an exception. Note: This method is based on the 'LU Decomposition and Its Applications' section of Numerical Recipes in C by William H. Press, Saul A. Teukolsky, William T. Vetterling and Brian P. Flannery, University of Cambridge Press 1992.
public static LU ( double Mat, double &L, double &U, double &P ) : void
Mat double Array which will be LU Decomposed
L double An array where the lower traingular matrix is returned
U double An array where the upper traingular matrix is returned
P double An array where the permutation matrix is returned
return void

Matrix() public method

Matrix object constructor, constructs a matrix from an already defined array object.
public Matrix ( double Mat ) : System
Mat double the array the matrix will contain
return System

Matrix() public method

Matrix object constructor, constructs an empty matrix with dimensions: rows = noRows and cols = noCols.
public Matrix ( int noRows, int noCols ) : System
noRows int no. of rows in this matrix
noCols int no. of columns in this matrix
return System

Multiply() public static method

Returns the multiplication of two matrices with compatible dimensions OR the cross-product of two vectors. In case of an error the error is raised as an exception.
public static Multiply ( Matrix Mat1, Matrix Mat2 ) : Matrix
Mat1 Matrix /// First matrix or vector (i.e: dimension [3,1]) object in /// multiplication ///
Mat2 Matrix /// Second matrix or vector (i.e: dimension [3,1]) object in /// multiplication ///
return Matrix

Multiply() public static method

Returns the multiplication of two matrices with compatible dimensions. In case of an error the error is raised as an exception.
public static Multiply ( double Mat1, double Mat2 ) : ].double[
Mat1 double First array in multiplication
Mat2 double Second array in multiplication
return ].double[

OneD_2_TwoD() public static method

Returns the 2D form of a 1D array. i.e. array with dimension[n] is returned as an array with dimension [n,1]. In case of an error the error is raised as an exception.
public static OneD_2_TwoD ( double Mat ) : ].double[
Mat double /// the array to convert, with dimesion [n] ///
return ].double[

PINV() public static method

Returns the pseudoinverse of a matrix, such that X = PINV(A) produces a matrix 'X' of the same dimensions as A' so that A*X*A = A, X*A*X = X. In case of an error the error is raised as an exception.
public static PINV ( Matrix Mat ) : Matrix
Mat Matrix a Matrix object whose pseudoinverse is to be found
return Matrix

PINV() public static method

Returns the pseudoinverse of a matrix, such that X = PINV(A) produces a matrix 'X' of the same dimensions as A' so that A*X*A = A, X*A*X = X. In case of an error the error is raised as an exception.
public static PINV ( double Mat ) : ].double[
Mat double An array whose pseudoinverse is to be found
return ].double[

PrintMat() public static method

Returns a matrix as a string, so it can be viewed in a multi-text textbox or in a richtextBox (preferred). In case of an error the error is raised as an exception.
public static PrintMat ( Matrix Mat ) : string
Mat Matrix The Matrix object to be viewed
return string

PrintMat() public static method

Returns a matrix as a string, so it can be viewed in a multi-text textbox or in a richtextBox (preferred). In case of an error the error is raised as an exception.
public static PrintMat ( double Mat ) : string
Mat double The array to be viewed
return string

Rank() public static method

Returns the rank of a matrix. In case of an error the error is raised as an exception.
public static Rank ( Matrix Mat ) : int
Mat Matrix a Matrix object whose rank is to be found
return int

Rank() public static method

Returns the rank of a matrix. In case of an error the error is raised as an exception.
public static Rank ( double Mat ) : int
Mat double An array whose rank is to be found
return int

SVD() public static method

Evaluates the Singular Value Decomposition of a matrix, returns the matrices S, U and V. Such that a given Matrix = U x S x V'. In case of an error the error is raised as an exception. Note: This method is based on the 'Singular Value Decomposition' section of Numerical Recipes in C by William H. Press, Saul A. Teukolsky, William T. Vetterling and Brian P. Flannery, University of Cambridge Press 1992.
public static SVD ( Matrix Mat, Matrix &S, Matrix &U, Matrix &V ) : void
Mat Matrix Matrix object whose SVD is to be computed
S Matrix A Matrix object where the S matrix is returned
U Matrix A Matrix object where the U matrix is returned
V Matrix A Matrix object where the V matrix is returned
return void

SVD() public static method

Evaluates the Singular Value Decomposition of a matrix, returns the matrices S, U and V. Such that a given Matrix = U x S x V'. In case of an error the error is raised as an exception. Note: This method is based on the 'Singular Value Decomposition' section of Numerical Recipes in C by William H. Press, Saul A. Teukolsky, William T. Vetterling and Brian P. Flannery, University of Cambridge Press 1992.
public static SVD ( double Mat_, double &S_, double &U_, double &V_ ) : void
Mat_ double Array whose SVD is to be computed
S_ double An array where the S matrix is returned
U_ double An array where the U matrix is returned
V_ double An array where the V matrix is returned
return void

ScalarDivide() public static method

Returns the division of a matrix or a vector (i.e dimension [3,1]) by a scalar quantity. In case of an error the error is raised as an exception.
public static ScalarDivide ( double Value, Matrix Mat ) : Matrix
Value double The scalar value to divide the array with
Mat Matrix Matrix which is to be divided by a scalar
return Matrix

ScalarDivide() public static method

Returns the division of a matrix or a vector (i.e dimension [3,1]) by a scalar quantity. In case of an error the error is raised as an exception.
public static ScalarDivide ( double Value, double Mat ) : ].double[
Value double The scalar value to divide the array with
Mat double Array which is to be divided by a scalar
return ].double[

ScalarMultiply() public static method

Returns the multiplication of a matrix or a vector (i.e dimension [3,1]) with a scalar quantity. In case of an error the error is raised as an exception.
public static ScalarMultiply ( double Value, Matrix Mat ) : Matrix
Value double The scalar value to multiply the array
Mat Matrix Matrix which is to be multiplied by a scalar
return Matrix

ScalarMultiply() public static method

Returns the multiplication of a matrix or a vector (i.e dimension [3,1]) with a scalar quantity. In case of an error the error is raised as an exception.
public static ScalarMultiply ( double Value, double Mat ) : ].double[
Value double The scalar value to multiply the array
Mat double Array which is to be multiplied by a scalar
return ].double[

SolveLinear() public static method

Solves a set of n linear equations A.X = B, and returns X, where A is [n,n] and B is [n,1]. In the same manner if you need to compute: inverse(A).B, it is better to use this method instead, as it is much faster. In case of an error the error is raised as an exception. Note: This method is based on the 'LU Decomposition and Its Applications' section of Numerical Recipes in C by William H. Press, Saul A. Teukolsky, William T. Vetterling and Brian P. Flannery, University of Cambridge Press 1992.
public static SolveLinear ( Matrix MatA, Matrix MatB ) : Matrix
MatA Matrix Matrix object 'A' on the left side of the equations A.X = B
MatB Matrix Matrix object 'B' on the right side of the equations A.X = B
return Matrix

SolveLinear() public static method

Solves a set of n linear equations A.X = B, and returns X, where A is [n,n] and B is [n,1]. In the same manner if you need to compute: inverse(A).B, it is better to use this method instead, as it is much faster. In case of an error the error is raised as an exception. Note: This method is based on the 'LU Decomposition and Its Applications' section of Numerical Recipes in C by William H. Press, Saul A. Teukolsky, William T. Vetterling and Brian P. Flannery, University of Cambridge Press 1992.
public static SolveLinear ( double MatA, double MatB ) : ].double[
MatA double The array 'A' on the left side of the equations A.X = B
MatB double The array 'B' on the right side of the equations A.X = B
return ].double[

Subtract() public static method

Returns the difference of two matrices with compatible dimensions. In case of an error the error is raised as an exception.
public static Subtract ( Matrix Mat1, Matrix Mat2 ) : Matrix
Mat1 Matrix First matrix in the subtraction
Mat2 Matrix Second matrix in the subtraction
return Matrix

Subtract() public static method

Returns the difference of two matrices with compatible dimensions. In case of an error the error is raised as an exception.
public static Subtract ( double Mat1, double Mat2 ) : ].double[
Mat1 double First array in the subtraction
Mat2 double Second array in the subtraction
return ].double[

ToString() public method

Returns the matrix as a string, so it can be viewed in a multi-text textbox or in a richtextBox (preferred). In case of an error the error is raised as an exception.
public ToString ( ) : string
return string

Transpose() public static method

Returns the transpose of a matrix. In case of an error the error is raised as an exception.
public static Transpose ( Matrix Mat ) : Matrix
Mat Matrix Matrix object whose transpose is to be found
return Matrix

Transpose() public static method

Returns the transpose of a matrix. In case of an error the error is raised as an exception.
public static Transpose ( double Mat ) : ].double[
Mat double Array whose transpose is to be found
return ].double[

TwoD_2_OneD() public static method

Returns the 1D form of a 2D array. i.e. array with dimension[n,1] is returned as an array with dimension [n]. In case of an error the error is raised as an exception.
public static TwoD_2_OneD ( double Mat ) : double[]
Mat double /// the array to convert, with dimesions [n,1] ///
return double[]

VectorMagnitude() public static method

Returns the magnitude of a vector whose dimension is [3] or [3,1]. In case of an error the error is raised as an exception.
public static VectorMagnitude ( Matrix V ) : double
V Matrix Matrix object (dimension [3,1]) whose magnitude is to be found
return double

VectorMagnitude() public static method

Returns the magnitude of a vector whose dimension is [3] or [3,1]. In case of an error the error is raised as an exception.
public static VectorMagnitude ( double V ) : double
V double The vector array (dimension [3]) whose magnitude is to be found
return double

operator() public static method

Returns the multiplication of two matrices with compatible dimensions OR the cross-product of two vectors. In case of an error the error is raised as an exception.
public static operator ( ) : Matrix
return Matrix

operator() public static method

Checks if two matrices of equal dimensions are not equal. In case of an error the error is raised as an exception.
public static operator ( ) : bool
return bool

this() public method

Set or get an element from the matrix
public this ( int Row, int Col ) : double
Row int
Col int
return double