C# Class SimShift.Map.Splines.TriDiagonalMatrixF

A tri-diagonal matrix has non-zero entries only on the main diagonal, the diagonal above the main (super), and the diagonal below the main (sub).

This is based on the wikipedia article: http://en.wikipedia.org/wiki/Tridiagonal_matrix_algorithm

The entries in the matrix on a particular row are A[i], B[i], and C[i] where i is the row index. B is the main diagonal, and so for an NxN matrix B is length N and all elements are used. So for row 0, the first two values are B[0] and C[0]. And for row N-1, the last two values are A[N-1] and B[N-1]. That means that A[0] is not actually on the matrix and is therefore never used, and same with C[N-1].

Mostrar archivo Open project: nlhans/SimShift Class Usage Examples

Public Properties

Property Type Description
A float[]
B float[]
C float[]

Public Methods

Method Description
Solve ( float d ) : float[]

Solve the system of equations this*x=d given the specified d.

Uses the Thomas algorithm described in the wikipedia article: http://en.wikipedia.org/wiki/Tridiagonal_matrix_algorithm Not optimized. Not destructive.

ToDisplayString ( string fmt = "", string prefix = "" ) : string

Produce a string representation of the contents of this matrix.

TriDiagonalMatrixF ( int n ) : System

Construct an NxN matrix.

this ( int row, int col ) : float

Indexer. Setter throws an exception if you try to set any not on the super, main, or sub diagonals.

Method Details

Solve() public method

Solve the system of equations this*x=d given the specified d.
Uses the Thomas algorithm described in the wikipedia article: http://en.wikipedia.org/wiki/Tridiagonal_matrix_algorithm Not optimized. Not destructive.
public Solve ( float d ) : float[]
d float Right side of the equation.
return float[]

ToDisplayString() public method

Produce a string representation of the contents of this matrix.
public ToDisplayString ( string fmt = "", string prefix = "" ) : string
fmt string Optional. For String.Format. Must include the colon. Examples are ':0.000' and ',5:0.00'
prefix string Optional. Per-line indentation prefix.
return string

TriDiagonalMatrixF() public method

Construct an NxN matrix.
public TriDiagonalMatrixF ( int n ) : System
n int
return System

this() public method

Indexer. Setter throws an exception if you try to set any not on the super, main, or sub diagonals.
public this ( int row, int col ) : float
row int
col int
return float

Property Details

A public_oe property

The values for the sub-diagonal. A[0] is never used.
public float[] A
return float[]

B public_oe property

The values for the main diagonal.
public float[] B
return float[]

C public_oe property

The values for the super-diagonal. C[C.Length-1] is never used.
public float[] C
return float[]