C# Класс MatrixLibrary.NMatrix

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.
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
Add ( NMatrix Mat1, NMatrix Mat2 ) : NMatrix

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.

Copy ( ) : NMatrix
CrossProduct ( NMatrix V1, NMatrix V2 ) : NMatrix

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 ( NMatrix 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 ( NMatrix V1, NMatrix 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 ( NMatrix Mat, NMatrix &d, NMatrix &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.

GetColumn ( int col ) : double[]
GetHashCode ( ) : int
GetRow ( int row ) : double[]
Identity ( int n ) : ].double[

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

Inverse ( NMatrix Mat ) : NMatrix

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 ( NMatrix Mat1, NMatrix 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 ( NMatrix Mat, NMatrix &L, NMatrix &U, NMatrix &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.

Multiply ( NMatrix Mat1, NMatrix Mat2 ) : NMatrix

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.

NMatrix ( double Mat ) : System

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

NMatrix ( int noRows, int noCols ) : System

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

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 ( NMatrix Mat ) : NMatrix

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 ( NMatrix 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 ( NMatrix 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 ( NMatrix Mat, NMatrix &S, NMatrix &U, NMatrix &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, NMatrix Mat ) : NMatrix

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, NMatrix Mat ) : NMatrix

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 ( NMatrix MatA, NMatrix MatB ) : NMatrix

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 ( NMatrix Mat1, NMatrix Mat2 ) : NMatrix

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 ( NMatrix Mat ) : NMatrix

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.

TryGaussJordanElimination ( NMatrix a, NMatrix b, NMatrix &result ) : bool
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 ( NMatrix 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 ( ) : NMatrix

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

Приватные методы

Метод Описание
Find_R_C ( double Mat, int &Row ) : void
Find_R_C ( double Mat, int &Row, int &Col ) : void
IsZero ( double value ) : bool
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
swaprows ( double arr, long row0, long row1 ) : void

Описание методов

Add() публичный статический Метод

Returns the summation of two matrices with compatible dimensions. In case of an error the error is raised as an exception.
public static Add ( NMatrix Mat1, NMatrix Mat2 ) : NMatrix
Mat1 NMatrix First matrix in the summation
Mat2 NMatrix Second matrix in the summation
Результат NMatrix

Add() публичный статический Метод

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
Результат ].double[

Copy() публичный Метод

public Copy ( ) : NMatrix
Результат NMatrix

CrossProduct() публичный статический Метод

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 ( NMatrix V1, NMatrix V2 ) : NMatrix
V1 NMatrix First Matrix (dimensions [3,1]) in the cross product
V2 NMatrix Second Matrix (dimensions [3,1]) in the cross product
Результат NMatrix

CrossProduct() публичный статический Метод

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
Результат ].double[

CrossProduct() публичный статический Метод

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
Результат double[]

Det() публичный статический Метод

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 ( NMatrix Mat ) : double
Mat NMatrix /// Matrix object with [n,n] dimension whose determinant is to be found ///
Результат double

Det() публичный статический Метод

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 ///
Результат double

DotProduct() публичный статический Метод

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 ( NMatrix V1, NMatrix V2 ) : double
V1 NMatrix First Matrix object (dimension [3,1]) in the dot product
V2 NMatrix Second Matrix object (dimension [3,1]) in the dot product
Результат double

DotProduct() публичный статический Метод

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
Результат double

Eigen() публичный статический Метод

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 ( NMatrix Mat, NMatrix &d, NMatrix &v ) : void
Mat NMatrix /// The Matrix object whose Eigenvalues and Eigenvectors are to be found ///
d NMatrix A Matrix object where the eigenvalues are returned
v NMatrix A Matrix object where the eigenvectors are returned
Результат void

Eigen() публичный статический Метод

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
Результат void

Equals() публичный Метод

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
Результат bool

GetColumn() публичный Метод

public GetColumn ( int col ) : double[]
col int
Результат double[]

GetHashCode() публичный Метод

public GetHashCode ( ) : int
Результат int

GetRow() публичный Метод

public GetRow ( int row ) : double[]
row int
Результат double[]

Identity() публичный статический Метод

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
Результат ].double[

Inverse() публичный статический Метод

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 ( NMatrix Mat ) : NMatrix
Mat NMatrix /// Matrix object with [n,n] dimension whose inverse is to be found ///
Результат NMatrix

Inverse() публичный статический Метод

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 ///
Результат ].double[

IsEqual() публичный статический Метод

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 ( NMatrix Mat1, NMatrix Mat2 ) : bool
Mat1 NMatrix First Matrix in equality check
Mat2 NMatrix Second Matrix in equality check
Результат bool

IsEqual() публичный статический Метод

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
Результат bool

LU() публичный статический Метод

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 ( NMatrix Mat, NMatrix &L, NMatrix &U, NMatrix &P ) : void
Mat NMatrix Matrix object which will be LU Decomposed
L NMatrix A Matrix object where the lower traingular matrix is returned
U NMatrix A Matrix object where the upper traingular matrix is returned
P NMatrix A Matrix object where the permutation matrix is returned
Результат void

LU() публичный статический Метод

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
Результат void

Multiply() публичный статический Метод

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 ( NMatrix Mat1, NMatrix Mat2 ) : NMatrix
Mat1 NMatrix /// First matrix or vector (i.e: dimension [3,1]) object in /// multiplication ///
Mat2 NMatrix /// Second matrix or vector (i.e: dimension [3,1]) object in /// multiplication ///
Результат NMatrix

Multiply() публичный статический Метод

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
Результат ].double[

NMatrix() публичный Метод

Matrix object constructor, constructs a matrix from an already defined array object.
public NMatrix ( double Mat ) : System
Mat double the array the matrix will contain
Результат System

NMatrix() публичный Метод

Matrix object constructor, constructs an empty matrix with dimensions: rows = noRows and cols = noCols.
public NMatrix ( int noRows, int noCols ) : System
noRows int no. of rows in this matrix
noCols int no. of columns in this matrix
Результат System

OneD_2_TwoD() публичный статический Метод

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] ///
Результат ].double[

PINV() публичный статический Метод

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 ( NMatrix Mat ) : NMatrix
Mat NMatrix a Matrix object whose pseudoinverse is to be found
Результат NMatrix

PINV() публичный статический Метод

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
Результат ].double[

PrintMat() публичный статический Метод

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 ( NMatrix Mat ) : string
Mat NMatrix The Matrix object to be viewed
Результат string

PrintMat() публичный статический Метод

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
Результат string

Rank() публичный статический Метод

Returns the rank of a matrix. In case of an error the error is raised as an exception.
public static Rank ( NMatrix Mat ) : int
Mat NMatrix a Matrix object whose rank is to be found
Результат int

Rank() публичный статический Метод

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
Результат int

SVD() публичный статический Метод

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 ( NMatrix Mat, NMatrix &S, NMatrix &U, NMatrix &V ) : void
Mat NMatrix Matrix object whose SVD is to be computed
S NMatrix A Matrix object where the S matrix is returned
U NMatrix A Matrix object where the U matrix is returned
V NMatrix A Matrix object where the V matrix is returned
Результат void

SVD() публичный статический Метод

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
Результат void

ScalarDivide() публичный статический Метод

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, NMatrix Mat ) : NMatrix
Value double The scalar value to divide the array with
Mat NMatrix Matrix which is to be divided by a scalar
Результат NMatrix

ScalarDivide() публичный статический Метод

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
Результат ].double[

ScalarMultiply() публичный статический Метод

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, NMatrix Mat ) : NMatrix
Value double The scalar value to multiply the array
Mat NMatrix Matrix which is to be multiplied by a scalar
Результат NMatrix

ScalarMultiply() публичный статический Метод

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
Результат ].double[

SolveLinear() публичный статический Метод

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 ( NMatrix MatA, NMatrix MatB ) : NMatrix
MatA NMatrix Matrix object 'A' on the left side of the equations A.X = B
MatB NMatrix Matrix object 'B' on the right side of the equations A.X = B
Результат NMatrix

SolveLinear() публичный статический Метод

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
Результат ].double[

Subtract() публичный статический Метод

Returns the difference of two matrices with compatible dimensions. In case of an error the error is raised as an exception.
public static Subtract ( NMatrix Mat1, NMatrix Mat2 ) : NMatrix
Mat1 NMatrix First matrix in the subtraction
Mat2 NMatrix Second matrix in the subtraction
Результат NMatrix

Subtract() публичный статический Метод

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
Результат ].double[

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.
public ToString ( ) : string
Результат string

Transpose() публичный статический Метод

Returns the transpose of a matrix. In case of an error the error is raised as an exception.
public static Transpose ( NMatrix Mat ) : NMatrix
Mat NMatrix Matrix object whose transpose is to be found
Результат NMatrix

Transpose() публичный статический Метод

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
Результат ].double[

TryGaussJordanElimination() публичный статический Метод

public static TryGaussJordanElimination ( NMatrix a, NMatrix b, NMatrix &result ) : bool
a NMatrix
b NMatrix
result NMatrix
Результат bool

TwoD_2_OneD() публичный статический Метод

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] ///
Результат double[]

VectorMagnitude() публичный статический Метод

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 ( NMatrix V ) : double
V NMatrix Matrix object (dimension [3,1]) whose magnitude is to be found
Результат double

VectorMagnitude() публичный статический Метод

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
Результат double

operator() публичный статический Метод

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 ( ) : NMatrix
Результат NMatrix

operator() публичный статический Метод

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
Результат bool

this() публичный Метод

Set or get an element from the matrix
public this ( int Row, int Col ) : double
Row int
Col int
Результат double