C# Class Encog.MathUtil.Matrices.Matrix

Afficher le fichier Open project: encog/encog-silverlight-core Class Usage Examples

Méthodes publiques

Méthode Description
Add ( Matrix matrix ) : void

Add the specified matrix to this matrix. This will modify the matrix to hold the result of the addition.

Add ( int row, int col, double value_ren ) : void

Add the specified value to the specified row and column of the matrix.

Clear ( ) : void

Clear the matrix.

Clone ( ) : object

Clone the matrix.

CreateColumnMatrix ( double input ) : Matrix

Create a matrix that is a single column.

CreateRowMatrix ( double input ) : Matrix

Create a matrix that is a single row.

Equals ( Object other ) : bool

Determine if this matrix is equal to another. Use a precision of 10 decimal places.

FromPackedArray ( double array, int index ) : int

Take the values of thie matrix from a packed array.

GetArrayCopy ( ) : double[][]

Make a copy of this matrix as an array.

GetCol ( int col ) : Matrix

Get one column from this matrix as a column matrix.

GetHashCode ( ) : int

Generate a hash code, this is just rows+cols. Probably a better way to do this, but I really don't see the Matrix class being used as the key to a hash table.

GetMatrix ( int r, int c ) : Matrix

Get a submatrix.

GetMatrix ( int i0, int i1, int c ) : Matrix

Get a submatrix.

GetMatrix ( int i0, int i1, int j0, int j1 ) : Matrix

Get a submatrix.

GetRow ( int row ) : Matrix

Get the specified row as a row matrix.

Inverse ( ) : Matrix

The matrix inverted.

IsVector ( ) : bool

Determine if this matrix is a vector. A vector matrix only has a single row or column.

IsZero ( ) : bool

Determine if all of the values in the matrix are zero.

Matrix ( bool sourceMatrix ) : System

Construct a matrix from a 2D boolean array. Translate true to 1, false to -1.

Matrix ( double sourceMatrix ) : System

Construct a matrix from a 2D double array.

Matrix ( int rows, int cols ) : System

Construct a blank matrix with the specified number of rows and columns.

Multiply ( double vector, double result ) : void

Multiply every row by the specified vector.

Ramdomize ( double min, double max ) : void

Fill the matrix with random values in the specified range.

Randomize ( double min, double max ) : void

Randomize the matrix.

Set ( Matrix other ) : void

Set the values from the other matrix into this one.

Set ( double value_ren ) : void

Set every value in the matrix to the specified value.

SetMatrix ( int r, int c, Matrix x ) : void

Set a submatrix.

SetMatrix ( int r, int j0, int j1, Matrix x ) : void

Set a submatrix.

SetMatrix ( int i0, int i1, int j0, int j1, Matrix x ) : void

Set a submatrix.

Solve ( Matrix b ) : Matrix

Solve A*X = B

Sum ( ) : double

Sum all of the values in the matrix.

ToPackedArray ( ) : double[]

Convert the matrix to a packed array.

equals ( Matrix matrix, int precision ) : bool

Compare the matrix to another with the specified level of precision.

this ( int row, int col ) : double

Allows index access to the elements of the matrix. Warning: This can be a somewhat slow way to access the matrix. Do not put this in performance critical loops. Make sure to use the Data property and access the matrix array directly.

Private Methods

Méthode Description
Validate ( int row, int col ) : void

Validate that the specified row and column are inside of the range of the matrix.

Method Details

Add() public méthode

Add the specified matrix to this matrix. This will modify the matrix to hold the result of the addition.
public Add ( Matrix matrix ) : void
matrix Matrix The matrix to add.
Résultat void

Add() public méthode

Add the specified value to the specified row and column of the matrix.
public Add ( int row, int col, double value_ren ) : void
row int The row to add to.
col int The column to add to.
value_ren double The value to add.
Résultat void

Clear() public méthode

Clear the matrix.
public Clear ( ) : void
Résultat void

Clone() public méthode

Clone the matrix.
public Clone ( ) : object
Résultat object

CreateColumnMatrix() public static méthode

Create a matrix that is a single column.
public static CreateColumnMatrix ( double input ) : Matrix
input double A 1D array to make the matrix from.
Résultat Matrix

CreateRowMatrix() public static méthode

Create a matrix that is a single row.
public static CreateRowMatrix ( double input ) : Matrix
input double A 1D array to make the matrix from.
Résultat Matrix

Equals() public méthode

Determine if this matrix is equal to another. Use a precision of 10 decimal places.
public Equals ( Object other ) : bool
other Object The other matrix to compare.
Résultat bool

FromPackedArray() public méthode

Take the values of thie matrix from a packed array.
public FromPackedArray ( double array, int index ) : int
array double The packed array to read the matrix from.
index int The index to begin reading at in the array.
Résultat int

GetArrayCopy() public méthode

Make a copy of this matrix as an array.
public GetArrayCopy ( ) : double[][]
Résultat double[][]

GetCol() public méthode

Get one column from this matrix as a column matrix.
public GetCol ( int col ) : Matrix
col int The desired column.
Résultat Matrix

GetHashCode() public méthode

Generate a hash code, this is just rows+cols. Probably a better way to do this, but I really don't see the Matrix class being used as the key to a hash table.
public GetHashCode ( ) : int
Résultat int

GetMatrix() public méthode

Get a submatrix.
public GetMatrix ( int r, int c ) : Matrix
r int Array of row indices.
c int Array of column indices.
Résultat Matrix

GetMatrix() public méthode

Get a submatrix.
public GetMatrix ( int i0, int i1, int c ) : Matrix
i0 int Initial row index.
i1 int Final row index.
c int Array of column indices.
Résultat Matrix

GetMatrix() public méthode

Get a submatrix.
public GetMatrix ( int i0, int i1, int j0, int j1 ) : Matrix
i0 int Initial row index.
i1 int Final row index.
j0 int Initial column index.
j1 int Final column index.
Résultat Matrix

GetRow() public méthode

Get the specified row as a row matrix.
public GetRow ( int row ) : Matrix
row int The desired row.
Résultat Matrix

Inverse() public méthode

The matrix inverted.
public Inverse ( ) : Matrix
Résultat Matrix

IsVector() public méthode

Determine if this matrix is a vector. A vector matrix only has a single row or column.
public IsVector ( ) : bool
Résultat bool

IsZero() public méthode

Determine if all of the values in the matrix are zero.
public IsZero ( ) : bool
Résultat bool

Matrix() public méthode

Construct a matrix from a 2D boolean array. Translate true to 1, false to -1.
public Matrix ( bool sourceMatrix ) : System
sourceMatrix bool A 2D array to construcat the matrix from.
Résultat System

Matrix() public méthode

Construct a matrix from a 2D double array.
public Matrix ( double sourceMatrix ) : System
sourceMatrix double A 2D double array.
Résultat System

Matrix() public méthode

Construct a blank matrix with the specified number of rows and columns.
public Matrix ( int rows, int cols ) : System
rows int How many rows.
cols int How many columns.
Résultat System

Multiply() public méthode

Multiply every row by the specified vector.
public Multiply ( double vector, double result ) : void
vector double The vector to multiply by.
result double The result to hold the values.
Résultat void

Ramdomize() public méthode

Fill the matrix with random values in the specified range.
public Ramdomize ( double min, double max ) : void
min double The minimum value for the random numbers.
max double The maximum value for the random numbers.
Résultat void

Randomize() public méthode

Randomize the matrix.
public Randomize ( double min, double max ) : void
min double Minimum random value.
max double Maximum random value.
Résultat void

Set() public méthode

Set the values from the other matrix into this one.
public Set ( Matrix other ) : void
other Matrix The source matrix.
Résultat void

Set() public méthode

Set every value in the matrix to the specified value.
public Set ( double value_ren ) : void
value_ren double The value to set the matrix to.
Résultat void

SetMatrix() public méthode

Set a submatrix.
public SetMatrix ( int r, int c, Matrix x ) : void
r int Array of row indices.
c int Array of column indices.
x Matrix The matrix to set.
Résultat void

SetMatrix() public méthode

Set a submatrix.
public SetMatrix ( int r, int j0, int j1, Matrix x ) : void
r int Array of row indices.
j0 int Initial column index
j1 int Final column index
x Matrix A(r(:),j0:j1)
Résultat void

SetMatrix() public méthode

Set a submatrix.
public SetMatrix ( int i0, int i1, int j0, int j1, Matrix x ) : void
i0 int Initial row index
i1 int Final row index
j0 int Initial column index
j1 int Final column index
x Matrix A(i0:i1,j0:j1)
Résultat void

Solve() public méthode

Solve A*X = B
public Solve ( Matrix b ) : Matrix
b Matrix right hand side.
Résultat Matrix

Sum() public méthode

Sum all of the values in the matrix.
public Sum ( ) : double
Résultat double

ToPackedArray() public méthode

Convert the matrix to a packed array.
public ToPackedArray ( ) : double[]
Résultat double[]

equals() public méthode

Compare the matrix to another with the specified level of precision.
public equals ( Matrix matrix, int precision ) : bool
matrix Matrix The other matrix to compare.
precision int The number of decimal places of precision to use.
Résultat bool

this() public méthode

Allows index access to the elements of the matrix. Warning: This can be a somewhat slow way to access the matrix. Do not put this in performance critical loops. Make sure to use the Data property and access the matrix array directly.
public this ( int row, int col ) : double
row int The row to access.
col int The column to access.
Résultat double