C# Class SharpMath.Matrix

Double-precision NxN matrix class
Exibir arquivo Open project: Patapom/GodComplex

Public Properties

Property Type Description
N int
m ].double[

Public Methods

Method Description
Determinant ( ) : double

Computes the determinant of the matrix

Invert ( ) : Matrix

Inverts the current matrix using LU decomposition

LUBackwardSubstitution ( Matrix _LUDecomposition, double _B, int _PivotedIndices ) : double[]

Performs Forward/Backward substitution of a vector of unknowns with a LU decomposed matrix to find the solution of a system of linear equations A.x = b

LUDecomposition ( int &_PivotedIndices, double &_Parity ) : Matrix

Performs LU decomposition of that matrix Borrowed from the Numerical Recipes (chapter 2 pp. 46)

Matrix ( Matrix _Other ) : System
Matrix ( double _Array ) : System
Matrix ( float _Array ) : System
Matrix ( int _Dimensions ) : System
Solve ( double y ) : double[]

Solve A.x = y with A and y being known This methods uses LU decomposition and back substitution

operator ( ) : Matrix
operator ( ) : double[]
this ( int i, int j ) : double

Value access

Method Details

Determinant() public method

Computes the determinant of the matrix
public Determinant ( ) : double
return double

Invert() public method

Inverts the current matrix using LU decomposition
Throws if the matrix is not inversible
public Invert ( ) : Matrix
return Matrix

LUBackwardSubstitution() public method

Performs Forward/Backward substitution of a vector of unknowns with a LU decomposed matrix to find the solution of a system of linear equations A.x = b
public LUBackwardSubstitution ( Matrix _LUDecomposition, double _B, int _PivotedIndices ) : double[]
_LUDecomposition Matrix
_B double
_PivotedIndices int
return double[]

LUDecomposition() public method

Performs LU decomposition of that matrix Borrowed from the Numerical Recipes (chapter 2 pp. 46)
Throws if the matrix is singular and connot be decomposed
public LUDecomposition ( int &_PivotedIndices, double &_Parity ) : Matrix
_PivotedIndices int The array of pivoted indices. You should access your vector of coefficients to solve with an indirection through that array (cf. the Solve() method)
_Parity double The parity sign (-1 if indices were pivoted an odd number of times, +1 otherwise) (cf. Solve() to see how to deal with that)
return Matrix

Matrix() public method

public Matrix ( Matrix _Other ) : System
_Other Matrix
return System

Matrix() public method

public Matrix ( double _Array ) : System
_Array double
return System

Matrix() public method

public Matrix ( float _Array ) : System
_Array float
return System

Matrix() public method

public Matrix ( int _Dimensions ) : System
_Dimensions int
return System

Solve() public method

Solve A.x = y with A and y being known This methods uses LU decomposition and back substitution
Throws if the matrix is singular and connot be decomposed
public Solve ( double y ) : double[]
y double
return double[]

operator() public static method

public static operator ( ) : Matrix
return Matrix

operator() public static method

public static operator ( ) : double[]
return double[]

this() public method

Value access
public this ( int i, int j ) : double
i int Row index in [0,N[
j int Column index in [0,N[
return double

Property Details

N public_oe property

public int N
return int

m public_oe property

public double[,] m
return ].double[