VIS2 SS2013 CVD DVR
 All Classes Namespaces Functions Enumerations Properties
Public Member Functions | Static Public Member Functions | Properties | List of all members
MatrixLibrary.Matrix Class Reference

Matrix Library .Net v2.0 By Anas Abidi, 2004. More...

Public Member Functions

 Matrix (int noRows, int noCols)
 Matrix object constructor, constructs an empty matrix with dimensions: rows = noRows and cols = noCols. More...
 
 Matrix (double[,] Mat)
 Matrix object constructor, constructs a matrix from an already defined array object. More...
 
override bool Equals (Object obj)
 Tests whether the specified object is a MatrixLibrary.Matrix object and is identical to this MatrixLibrary.Matrix object. More...
 
override string ToString ()
 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. More...
 

Static Public Member Functions

static double[,] OneD_2_TwoD (double[] Mat)
 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. More...
 
static double[] TwoD_2_OneD (double[,] Mat)
 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. More...
 
static double[,] Identity (int n)
 Returns an Identity matrix with dimensions [n,n] in the from of an array. More...
 
static double[,] Add (double[,] Mat1, double[,] Mat2)
 Returns the summation of two matrices with compatible dimensions. In case of an error the error is raised as an exception. More...
 
static Matrix Add (Matrix Mat1, Matrix Mat2)
 Returns the summation of two matrices with compatible dimensions. In case of an error the error is raised as an exception. More...
 
static Matrix operator+ (Matrix Mat1, Matrix Mat2)
 Returns the summation of two matrices with compatible dimensions. In case of an error the error is raised as an exception. More...
 
static double[,] Subtract (double[,] Mat1, double[,] Mat2)
 Returns the difference of two matrices with compatible dimensions. In case of an error the error is raised as an exception. More...
 
static Matrix Subtract (Matrix Mat1, Matrix Mat2)
 Returns the difference of two matrices with compatible dimensions. In case of an error the error is raised as an exception. More...
 
static Matrix operator- (Matrix Mat1, Matrix Mat2)
 Returns the difference of two matrices with compatible dimensions. In case of an error the error is raised as an exception. More...
 
static double[,] Multiply (double[,] Mat1, double[,] Mat2)
 Returns the multiplication of two matrices with compatible dimensions. In case of an error the error is raised as an exception. More...
 
static Matrix Multiply (Matrix Mat1, Matrix Mat2)
 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. More...
 
static Matrix operator* (Matrix Mat1, Matrix Mat2)
 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. More...
 
static double Det (double[,] Mat)
 Returns the determinant of a matrix with [n,n] dimension. In case of an error the error is raised as an exception. More...
 
static double Det (Matrix Mat)
 Returns the determinant of a matrix with [n,n] dimension. In case of an error the error is raised as an exception. More...
 
static double[,] Inverse (double[,] Mat)
 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. More...
 
static Matrix Inverse (Matrix Mat)
 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. More...
 
static double[,] Transpose (double[,] Mat)
 Returns the transpose of a matrix. In case of an error the error is raised as an exception. More...
 
static Matrix Transpose (Matrix Mat)
 Returns the transpose of a matrix. In case of an error the error is raised as an exception. More...
 
static void SVD (double[,] Mat_, out double[,] S_, out double[,] U_, out double[,] V_)
 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. More...
 
static void SVD (Matrix Mat, out Matrix S, out Matrix U, out Matrix V)
 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. More...
 
static void LU (double[,]Mat, out double[,]L, out double[,] U, out double[,] P)
 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. More...
 
static void LU (Matrix Mat, out Matrix L, out Matrix U, out Matrix P)
 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. More...
 
static double[,] SolveLinear (double[,]MatA, double[,] MatB)
 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. More...
 
static Matrix SolveLinear (Matrix MatA, Matrix MatB)
 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. More...
 
static int Rank (double[,] Mat)
 Returns the rank of a matrix. In case of an error the error is raised as an exception. More...
 
static int Rank (Matrix Mat)
 Returns the rank of a matrix. In case of an error the error is raised as an exception. More...
 
static double[,] PINV (double[,] Mat)
 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. More...
 
static Matrix PINV (Matrix Mat)
 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. More...
 
static void Eigen (double[,] Mat, out double[,] d, out double[,] v)
 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. More...
 
static void Eigen (Matrix Mat, out Matrix d, out Matrix v)
 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. More...
 
static double[,] ScalarMultiply (double Value, double[,] Mat)
 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. More...
 
static Matrix ScalarMultiply (double Value, Matrix Mat)
 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. More...
 
static Matrix operator* (Matrix Mat, double Value)
 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. More...
 
static Matrix operator* (double Value, Matrix Mat)
 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. More...
 
static double[,] ScalarDivide (double Value, double[,] Mat)
 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. More...
 
static Matrix ScalarDivide (double Value, Matrix Mat)
 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. More...
 
static Matrix operator/ (Matrix Mat, double Value)
 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. More...
 
static double[] CrossProduct (double[] V1, double[] V2)
 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. More...
 
static double[,] CrossProduct (double[,] V1, double[,] V2)
 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. More...
 
static Matrix CrossProduct (Matrix V1, Matrix V2)
 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. More...
 
static double DotProduct (double[] V1, double[] V2)
 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. More...
 
static double DotProduct (double[,] V1, double[,] V2)
 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. More...
 
static double DotProduct (Matrix V1, Matrix V2)
 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. More...
 
static double VectorMagnitude (double[] V)
 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. More...
 
static double VectorMagnitude (double[,] V)
 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. More...
 
static double VectorMagnitude (Matrix V)
 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. More...
 
static bool IsEqual (double[,] Mat1, double[,] Mat2)
 Checks if two Arrays of equal dimensions are equal or not. In case of an error the error is raised as an exception. More...
 
static bool IsEqual (Matrix Mat1, Matrix Mat2)
 Checks if two matrices of equal dimensions are equal or not. In case of an error the error is raised as an exception. More...
 
static bool operator== (Matrix Mat1, Matrix Mat2)
 Checks if two matrices of equal dimensions are equal or not. In case of an error the error is raised as an exception. More...
 
static bool operator!= (Matrix Mat1, Matrix Mat2)
 Checks if two matrices of equal dimensions are not equal. In case of an error the error is raised as an exception. More...
 
static string PrintMat (double[,] Mat)
 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. More...
 
static string PrintMat (Matrix Mat)
 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. More...
 

Properties

double this[int Row, int Col] [get, set]
 Set or get an element from the matrix More...
 
int NoRows [get, set]
 Set or get the no. of rows in the matrix. Warning: Setting this property will delete all of the elements of the matrix and set them to zero. More...
 
int NoCols [get, set]
 Set or get the no. of columns in the matrix. Warning: Setting this property will delete all of the elements of the matrix and set them to zero. More...
 
double[,] toArray [get]
 This property returns the matrix as an array. More...
 

Detailed Description

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.

Definition at line 59 of file cMatrixLib.cs.

Constructor & Destructor Documentation

MatrixLibrary.Matrix.Matrix ( int  noRows,
int  noCols 
)

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

Parameters
noRowsno. of rows in this matrix
noColsno. of columns in this matrix

Definition at line 70 of file cMatrixLib.cs.

MatrixLibrary.Matrix.Matrix ( doubleMat  [,])

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

Parameters
Matthe array the matrix will contain

Definition at line 80 of file cMatrixLib.cs.

Member Function Documentation

static double [,] MatrixLibrary.Matrix.Add ( double  Mat1[,],
double  Mat2[,] 
)
static

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

Parameters
Mat1First array in the summation
Mat2Second array in the summation
Returns
Sum of Mat1 and Mat2 as an array

Definition at line 220 of file cMatrixLib.cs.

static Matrix MatrixLibrary.Matrix.Add ( Matrix  Mat1,
Matrix  Mat2 
)
static

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

Parameters
Mat1First matrix in the summation
Mat2Second matrix in the summation
Returns
Sum of Mat1 and Mat2 as a Matrix object

Definition at line 259 of file cMatrixLib.cs.

static double [] MatrixLibrary.Matrix.CrossProduct ( double[]  V1,
double[]  V2 
)
static

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.

Parameters
V1First vector array (dimension [3]) in the cross product
V2Second vector array (dimension [3]) in the cross product
Returns
Cross product of V1 and V2 as an array (dimension [3])

Definition at line 1687 of file cMatrixLib.cs.

static double [,] MatrixLibrary.Matrix.CrossProduct ( double  V1[,],
double  V2[,] 
)
static

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.

Parameters
V1First vector array (dimensions [3,1]) in the cross product
V2Second vector array (dimensions [3,1]) in the cross product
Returns
Cross product of V1 and V2 as an array (dimension [3,1])

Definition at line 1722 of file cMatrixLib.cs.

static Matrix MatrixLibrary.Matrix.CrossProduct ( Matrix  V1,
Matrix  V2 
)
static

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.

Parameters
V1First Matrix (dimensions [3,1]) in the cross product
V2Second Matrix (dimensions [3,1]) in the cross product
Returns
Cross product of V1 and V2 as a matrix (dimension [3,1])

Definition at line 1757 of file cMatrixLib.cs.

static double MatrixLibrary.Matrix.Det ( double  Mat[,])
static

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

Parameters
MatArray with [n,n] dimension whose determinant is to be found
Returns
Determinant of the array

Definition at line 441 of file cMatrixLib.cs.

static double MatrixLibrary.Matrix.Det ( Matrix  Mat)
static

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

Parameters
MatMatrix object with [n,n] dimension whose determinant is to be found
Returns
Determinant of the Matrix object

Definition at line 501 of file cMatrixLib.cs.

static double MatrixLibrary.Matrix.DotProduct ( double[]  V1,
double[]  V2 
)
static

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.

Parameters
V1First vector array (dimension [3]) in the dot product
V2Second vector array (dimension [3]) in the dot product
Returns
Dot product of V1 and V2

Definition at line 1770 of file cMatrixLib.cs.

static double MatrixLibrary.Matrix.DotProduct ( double  V1[,],
double  V2[,] 
)
static

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.

Parameters
V1First vector array (dimension [3,1]) in the dot product
V2Second vector array (dimension [3,1]) in the dot product
Returns
Dot product of V1 and V2

Definition at line 1797 of file cMatrixLib.cs.

static double MatrixLibrary.Matrix.DotProduct ( Matrix  V1,
Matrix  V2 
)
static

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.

Parameters
V1First Matrix object (dimension [3,1]) in the dot product
V2Second Matrix object (dimension [3,1]) in the dot product
Returns
Dot product of V1 and V2

Definition at line 1824 of file cMatrixLib.cs.

static void MatrixLibrary.Matrix.Eigen ( double  Mat[,],
out double  d[,],
out double  v[,] 
)
static

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.

Parameters
MatThe array whose Eigenvalues and Eigenvectors are to be found
dAn array where the eigenvalues are returned
vAn array where the eigenvectors are returned

Definition at line 1421 of file cMatrixLib.cs.

static void MatrixLibrary.Matrix.Eigen ( Matrix  Mat,
out Matrix  d,
out Matrix  v 
)
static

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.

Parameters
MatThe Matrix object whose Eigenvalues and Eigenvectors are to be found
dA Matrix object where the eigenvalues are returned
vA Matrix object where the eigenvectors are returned

Definition at line 1553 of file cMatrixLib.cs.

override bool MatrixLibrary.Matrix.Equals ( Object  obj)

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

Parameters
objThe object to compare with the current object
Returns
This method returns true if obj is the specified Matrix object identical to this Matrix object; otherwise, false.

Definition at line 1947 of file cMatrixLib.cs.

static double [,] MatrixLibrary.Matrix.Identity ( int  n)
static

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

Parameters
nthe no. of rows or no. cols in the matrix
Returns
An identity Matrix with dimensions [n,n] in the form of an array

Definition at line 203 of file cMatrixLib.cs.

static double [,] MatrixLibrary.Matrix.Inverse ( double  Mat[,])
static

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.

Parameters
MatArray with [n,n] dimension whose inverse is to be found
Returns
Inverse of the array as an array

Definition at line 515 of file cMatrixLib.cs.

static Matrix MatrixLibrary.Matrix.Inverse ( Matrix  Mat)
static

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.

Parameters
MatMatrix object with [n,n] dimension whose inverse is to be found
Returns
Inverse of the matrix as a Matrix object

Definition at line 590 of file cMatrixLib.cs.

static bool MatrixLibrary.Matrix.IsEqual ( double  Mat1[,],
double  Mat2[,] 
)
static

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

Parameters
Mat1First array in equality check
Mat2Second array in equality check
Returns
If two matrices are equal or not

Definition at line 1883 of file cMatrixLib.cs.

static bool MatrixLibrary.Matrix.IsEqual ( Matrix  Mat1,
Matrix  Mat2 
)
static

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

Parameters
Mat1First Matrix in equality check
Mat2Second Matrix in equality check
Returns
If two matrices are equal or not

Definition at line 1918 of file cMatrixLib.cs.

static void MatrixLibrary.Matrix.LU ( doubleMat  [,],
out  doubleL[,],
out double  U[,],
out double  P[,] 
)
static

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.

Parameters
MatArray which will be LU Decomposed
LAn array where the lower traingular matrix is returned
UAn array where the upper traingular matrix is returned
PAn array where the permutation matrix is returned

Definition at line 987 of file cMatrixLib.cs.

static void MatrixLibrary.Matrix.LU ( Matrix  Mat,
out Matrix  L,
out Matrix  U,
out Matrix  P 
)
static

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.

Parameters
MatMatrix object which will be LU Decomposed
LA Matrix object where the lower traingular matrix is returned
UA Matrix object where the upper traingular matrix is returned
PA Matrix object where the permutation matrix is returned

Definition at line 1124 of file cMatrixLib.cs.

static double [,] MatrixLibrary.Matrix.Multiply ( double  Mat1[,],
double  Mat2[,] 
)
static

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

Parameters
Mat1First array in multiplication
Mat2Second array in multiplication
Returns
Mat1 multiplied by Mat2 as an array

Definition at line 348 of file cMatrixLib.cs.

static Matrix MatrixLibrary.Matrix.Multiply ( Matrix  Mat1,
Matrix  Mat2 
)
static

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.

Parameters
Mat1First matrix or vector (i.e: dimension [3,1]) object in multiplication
Mat2Second matrix or vector (i.e: dimension [3,1]) object in multiplication
Returns
Mat1 multiplied by Mat2 as a Matrix object

Definition at line 395 of file cMatrixLib.cs.

static double [,] MatrixLibrary.Matrix.OneD_2_TwoD ( double[]  Mat)
static

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.

Parameters
Matthe array to convert, with dimesion [n]
Returns
the same array but with [n,1] dimension

Definition at line 151 of file cMatrixLib.cs.

static bool MatrixLibrary.Matrix.operator!= ( Matrix  Mat1,
Matrix  Mat2 
)
static

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

Parameters
Mat1First Matrix object in equality check
Mat2Second Matrix object in equality check
Returns
If two matrices are not equal

Definition at line 1938 of file cMatrixLib.cs.

static Matrix MatrixLibrary.Matrix.operator* ( Matrix  Mat1,
Matrix  Mat2 
)
static

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.

Parameters
Mat1First matrix or vector (i.e: dimension [3,1]) object in multiplication
Mat2Second matrix or vector (i.e: dimension [3,1]) object in multiplication
Returns
Mat1 multiplied by Mat2 as a Matrix object

Definition at line 418 of file cMatrixLib.cs.

static Matrix MatrixLibrary.Matrix.operator* ( Matrix  Mat,
double  Value 
)
static

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.

Parameters
MatMatrix object which is to be multiplied by a scalar
ValueThe scalar value to multiply the Matrix object
Returns
The multiplication of the scalar and the Matrix object as a Matrix object

Definition at line 1609 of file cMatrixLib.cs.

static Matrix MatrixLibrary.Matrix.operator* ( double  Value,
Matrix  Mat 
)
static

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.

Parameters
ValueThe scalar value to multiply the Matrix object
MatMatrix object which is to be multiplied by a scalar
Returns
The multiplication of the scalar and the Matrix object as a Matrix object

Definition at line 1623 of file cMatrixLib.cs.

static Matrix MatrixLibrary.Matrix.operator+ ( Matrix  Mat1,
Matrix  Mat2 
)
static

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

Parameters
Mat1First Matrix object in the summation
Mat2Second Matrix object in the summation
Returns
Sum of Mat1 and Mat2 as a Matrix object

Definition at line 270 of file cMatrixLib.cs.

static Matrix MatrixLibrary.Matrix.operator- ( Matrix  Mat1,
Matrix  Mat2 
)
static

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

Parameters
Mat1First Matrix object in the subtraction
Mat2Second Matrix object in the subtraction
Returns
Difference of Mat1 and Mat2 as a Matrix object

Definition at line 334 of file cMatrixLib.cs.

static Matrix MatrixLibrary.Matrix.operator/ ( Matrix  Mat,
double  Value 
)
static

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.

Parameters
ValueThe scalar value to divide the Matrix object with
MatMatrix object which is to be divided by a scalar
Returns
The division of the Matrix object and the scalar as a Matrix object

Definition at line 1674 of file cMatrixLib.cs.

static bool MatrixLibrary.Matrix.operator== ( Matrix  Mat1,
Matrix  Mat2 
)
static

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

Parameters
Mat1First Matrix object in equality check
Mat2Second Matrix object in equality check
Returns
If two matrices are equal or not

Definition at line 1928 of file cMatrixLib.cs.

static double [,] MatrixLibrary.Matrix.PINV ( double  Mat[,])
static

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.

Parameters
MatAn array whose pseudoinverse is to be found
Returns
The pseudoinverse of the array as an array

Definition at line 1328 of file cMatrixLib.cs.

static Matrix MatrixLibrary.Matrix.PINV ( Matrix  Mat)
static

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.

Parameters
Mata Matrix object whose pseudoinverse is to be found
Returns
The pseudoinverse of the Matrix object as a Matrix Object

Definition at line 1402 of file cMatrixLib.cs.

static string MatrixLibrary.Matrix.PrintMat ( double  Mat[,])
static

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.

Parameters
MatThe array to be viewed
Returns
The string view of the array

Definition at line 1962 of file cMatrixLib.cs.

static string MatrixLibrary.Matrix.PrintMat ( Matrix  Mat)
static

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.

Parameters
MatThe Matrix object to be viewed
Returns
The string view of the Matrix object

Definition at line 2042 of file cMatrixLib.cs.

static int MatrixLibrary.Matrix.Rank ( double  Mat[,])
static

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

Parameters
MatAn array whose rank is to be found
Returns
The rank of the array

Definition at line 1290 of file cMatrixLib.cs.

static int MatrixLibrary.Matrix.Rank ( Matrix  Mat)
static

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

Parameters
Mata Matrix object whose rank is to be found
Returns
The rank of the Matrix object

Definition at line 1315 of file cMatrixLib.cs.

static double [,] MatrixLibrary.Matrix.ScalarDivide ( double  Value,
double  Mat[,] 
)
static

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.

Parameters
ValueThe scalar value to divide the array with
MatArray which is to be divided by a scalar
Returns
The division of the array and the scalar as an array

Definition at line 1636 of file cMatrixLib.cs.

static Matrix MatrixLibrary.Matrix.ScalarDivide ( double  Value,
Matrix  Mat 
)
static

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.

Parameters
ValueThe scalar value to divide the array with
MatMatrix which is to be divided by a scalar
Returns
The division of the array and the scalar as an array

Definition at line 1661 of file cMatrixLib.cs.

static double [,] MatrixLibrary.Matrix.ScalarMultiply ( double  Value,
double  Mat[,] 
)
static

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.

Parameters
ValueThe scalar value to multiply the array
MatArray which is to be multiplied by a scalar
Returns
The multiplication of the scalar and the array as an array

Definition at line 1571 of file cMatrixLib.cs.

static Matrix MatrixLibrary.Matrix.ScalarMultiply ( double  Value,
Matrix  Mat 
)
static

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.

Parameters
ValueThe scalar value to multiply the array
MatMatrix which is to be multiplied by a scalar
Returns
The multiplication of the scalar and the array as an array

Definition at line 1595 of file cMatrixLib.cs.

static double [,] MatrixLibrary.Matrix.SolveLinear ( doubleMatA  [,],
double  MatB[,] 
)
static

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.

Parameters
MatAThe array 'A' on the left side of the equations A.X = B
MatBThe array 'B' on the right side of the equations A.X = B
Returns
Array 'X' in the system of equations A.X = B

Definition at line 1149 of file cMatrixLib.cs.

static Matrix MatrixLibrary.Matrix.SolveLinear ( Matrix  MatA,
Matrix  MatB 
)
static

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.

Parameters
MatAMatrix object 'A' on the left side of the equations A.X = B
MatBMatrix object 'B' on the right side of the equations A.X = B
Returns
Matrix object 'X' in the system of equations A.X = B

Definition at line 1279 of file cMatrixLib.cs.

static double [,] MatrixLibrary.Matrix.Subtract ( double  Mat1[,],
double  Mat2[,] 
)
static

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

Parameters
Mat1First array in the subtraction
Mat2Second array in the subtraction
Returns
Difference of Mat1 and Mat2 as an array

Definition at line 284 of file cMatrixLib.cs.

static Matrix MatrixLibrary.Matrix.Subtract ( Matrix  Mat1,
Matrix  Mat2 
)
static

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

Parameters
Mat1First matrix in the subtraction
Mat2Second matrix in the subtraction
Returns
Difference of Mat1 and Mat2 as a Matrix object

Definition at line 323 of file cMatrixLib.cs.

static void MatrixLibrary.Matrix.SVD ( double  Mat_[,],
out double  S_[,],
out double  U_[,],
out double  V_[,] 
)
static

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.

Parameters
Mat_Array whose SVD is to be computed
S_An array where the S matrix is returned
U_An array where the U matrix is returned
V_An array where the V matrix is returned

Definition at line 642 of file cMatrixLib.cs.

static void MatrixLibrary.Matrix.SVD ( Matrix  Mat,
out Matrix  S,
out Matrix  U,
out Matrix  V 
)
static

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.

Parameters
MatMatrix object whose SVD is to be computed
SA Matrix object where the S matrix is returned
UA Matrix object where the U matrix is returned
VA Matrix object where the V matrix is returned

Definition at line 961 of file cMatrixLib.cs.

override string MatrixLibrary.Matrix.ToString ( )

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.

Returns
The string view of the Matrix object

Definition at line 2051 of file cMatrixLib.cs.

static double [,] MatrixLibrary.Matrix.Transpose ( double  Mat[,])
static

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

Parameters
MatArray whose transpose is to be found
Returns
Transpose of the array as an array

Definition at line 601 of file cMatrixLib.cs.

static Matrix MatrixLibrary.Matrix.Transpose ( Matrix  Mat)
static

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

Parameters
MatMatrix object whose transpose is to be found
Returns
Transpose of the Matrix object as a Matrix object

Definition at line 623 of file cMatrixLib.cs.

static double [] MatrixLibrary.Matrix.TwoD_2_OneD ( double  Mat[,])
static

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.

Parameters
Matthe array to convert, with dimesions [n,1]
Returns
the same array but with [n] dimension

Definition at line 177 of file cMatrixLib.cs.

static double MatrixLibrary.Matrix.VectorMagnitude ( double[]  V)
static

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.

Parameters
VThe vector array (dimension [3]) whose magnitude is to be found
Returns
The magnitude of the vector array

Definition at line 1835 of file cMatrixLib.cs.

static double MatrixLibrary.Matrix.VectorMagnitude ( double  V[,])
static

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.

Parameters
VThe vector array (dimension [3,1]) whose magnitude is to be found
Returns
The magnitude of the vector array

Definition at line 1853 of file cMatrixLib.cs.

static double MatrixLibrary.Matrix.VectorMagnitude ( Matrix  V)
static

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.

Parameters
VMatrix object (dimension [3,1]) whose magnitude is to be found
Returns
The magnitude of the Matrix object

Definition at line 1871 of file cMatrixLib.cs.

Property Documentation

int MatrixLibrary.Matrix.NoCols
getset

Set or get the no. of columns in the matrix. Warning: Setting this property will delete all of the elements of the matrix and set them to zero.

Definition at line 113 of file cMatrixLib.cs.

int MatrixLibrary.Matrix.NoRows
getset

Set or get the no. of rows in the matrix. Warning: Setting this property will delete all of the elements of the matrix and set them to zero.

Definition at line 102 of file cMatrixLib.cs.

double MatrixLibrary.Matrix.this[int Row, int Col]
getset

Set or get an element from the matrix

Definition at line 89 of file cMatrixLib.cs.

double [,] MatrixLibrary.Matrix.toArray
get

This property returns the matrix as an array.

Definition at line 122 of file cMatrixLib.cs.


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