C# Class numl.Math.LinearAlgebra.Matrix

A matrix.
Mostra file Open project: sethjuarez/numl Class Usage Examples

Public Methods

Method Description
Center ( VectorType t ) : Matrix

In place centering. WARNING: WILL UPDATE MATRIX!

Cholesky ( Matrix m ) : Matrix

Cholesky Factorization of a Matrix.

Col ( int i ) : Vector

Cols.

Copy ( ) : Matrix

create deep copy of matrix.

Correlation ( Matrix source, VectorType t = VectorType.Col ) : Matrix

Correlations.

Covariance ( Matrix source, VectorType t = VectorType.Col ) : Matrix

Covariances.

CovarianceDiag ( Matrix source, VectorType t = VectorType.Col ) : Vector

Covariance diagram.

Create ( int n, Func f ) : Matrix

Creates a new Matrix.

Create ( int n, Func f ) : Matrix

Creates a new Matrix.

Create ( int n, int d, Func f ) : Matrix

Creates a new Matrix.

Create ( int n, int d, Func f ) : Matrix

Creates a new Matrix.

Det ( Matrix x ) : double

Dets the given x coordinate.

Diag ( Matrix m ) : Vector

Diagrams the given m.

Dot ( Matrix x, Vector v ) : Vector

Dot product between a matrix and a vector.

Dot ( Vector v, Matrix x ) : Vector

Dot product between a matrix and a vector.

Each ( Matrix m, double>.Func fnElementWiseOp ) : Matrix

Performs an element wise operation on the input Matrix.

Each ( Matrix m, Func fnElementWiseOp ) : Matrix

Performs an element wise operation on the input Matrix.

Each ( Matrix m1, Matrix m2, Func fnElementWiseOp ) : Matrix

Performs an element-wise operation on the input Matrices.

Equals ( Matrix m, double tol ) : bool

Determines whether the specified T:System.Object is equal to the current T:System.Object.

Equals ( object obj ) : bool

Determines whether the specified T:System.Object is equal to the current T:System.Object.

Evd ( Matrix A ) : Matrix>.Tuple

Eigen Decomposition.

Extract ( Matrix m, int x, int y, int width, int height, bool safe = true ) : Matrix

Extracts this object.

FrobeniusNorm ( Matrix A ) : double

Matrix Frobenius Norm.

GetCols ( ) : IEnumerable

Gets the cols in this collection.

GetHashCode ( ) : int

Serves as a hash function for a particular type.

GetMatrix ( int d1, int d2, int n1, int n2 ) : Matrix

Gets a matrix.

GetRows ( ) : IEnumerable

Gets the rows in this collection.

GetVector ( int index, int from, int to, VectorType type ) : Vector

Gets a vector.

Identity ( int n ) : Matrix

n x n identity matrix.

Identity ( int n, int d ) : Matrix

n x d identity matrix.

Indices ( Matrix source, bool>.Func f ) : IEnumerable

Enumerates indices in this collection.

Indices ( Matrix source, bool>.Func f, VectorType t ) : IEnumerable

Enumerates indices in this collection.

Insert ( Vector v, int index, VectorType t, bool insertAfter = true ) : Matrix

Returns a new Matrix with the Vector inserted at the specified position

Inverse ( ) : Matrix

Creates an inverse of the current matrix

LU ( Matrix A ) : Tuple

NOT IMPLEMENTED!

Load ( string file ) : Matrix

Loads the given stream.

Matrix ( double m ) : System

Create new matrix with prepopulated vals.

Matrix ( int n ) : System

Create matrix n x n matrix.

Matrix ( int n, int d ) : System

Create new n x d matrix.

Max ( Matrix source, VectorType t = VectorType.Col ) : Vector

Returns a vector of the maximum values for each row/column.

Max ( Matrix source ) : double

Determines the maximum of the given parameters.

Mean ( Matrix source, VectorType t ) : Vector

Determines the mean of the given parameters.

Median ( Matrix source, VectorType t = VectorType.Col ) : Vector

Returns a vector of the median values for each row or column.

Min ( Matrix source, VectorType t = VectorType.Col ) : Vector

Returns a vector of the minimum values for each row/column.

Min ( Matrix source ) : double

Determines the minimum of the given parameters.

Norm ( Matrix A, double p ) : double

Standard Matrix Norm.

NormRand ( Vector means, Vector stdDev, int n ) : Matrix

Normalise random.

NormRand ( int n, double min ) : Matrix

Normalise random.

NormRand ( int n, int d, double min ) : Matrix

Normalise random.

Normalize ( VectorType t ) : void

In place normalization. WARNING: WILL UPDATE MATRIX!

Parse ( string text ) : Matrix

Parses a string containing MATLAB style Matrix syntax, i.e. "[[1, 2, 3]; [3, 4, 5]]"

Pivot ( Matrix M ) : Matrix

Pivots the given m.

QR ( Matrix A ) : Matrix>.Tuple

Modified Gram-Schmidt QR Factorization.

Rand ( int n, double min ) : Matrix

Generate a matrix n x d with numbers 0 less than x less than 1 drawn uniformly at random.

Rand ( int n, int d, double min ) : Matrix

Generate a matrix n x d with numbers 0 less than x less than 1 drawn uniformly at random.

Remove ( int index, VectorType t ) : Matrix

Removes this object.

Reshape ( Matrix m, int rows, int cols ) : Matrix

Reshapes the supplied matrix into a new matrix shape.

Reshape ( Vector v, int dimension, VectorType dimensionType = VectorType.Col, VectorType byVector = VectorType.Row ) : Matrix

Reshapes the supplied Vector into a Matrix form.

Reshape ( Vector v, int rows, int columns, VectorType byVector = VectorType.Row ) : Matrix

Reshapes the supplied Vector into a Matrix form.

Reverse ( Matrix source, VectorType t = VectorType.Row ) : IEnumerable

Enumerates reverse in this collection.

Round ( Matrix m, int decimals ) : Matrix

Matrix Roundoff.

Row ( int i ) : Vector

Rows.

SVD ( Matrix A ) : Tuple

Singular Value Decomposition.

Save ( string file ) : void

Save matrix to file

Slice ( Matrix m, IEnumerable indices ) : Matrix

Slices.

Slice ( Matrix m, IEnumerable indices, VectorType t ) : Matrix

Slices.

Sort ( Matrix source, double>.Func keySelector, VectorType t, bool ascending = true ) : Matrix

Sorts the given Matrix by the specified row or column selector and returns the new Matrix

Sort ( Matrix source, double>.Func keySelector, VectorType t, bool ascending, Vector &indices ) : Matrix

Sorts the given Matrix by the specified row or column selector and returns the new Matrix along with the original indices.

Stack ( ) : Matrix

Stack a set of vectors into a matrix.

Stack ( Matrix m, Matrix t ) : Matrix

Stack a set of vectors into a matrix.

Stats ( Matrix x, VectorType t = VectorType.Row ) : Matrix[]

Statistics.

StdDev ( Matrix source, VectorType t = VectorType.Col ) : Vector

Computes the standard deviation of the given matrix

Sum ( Matrix m, VectorType t ) : Vector

Computes the sum of either the rows or columns of a matrix and returns a vector.

Sum ( Matrix m ) : double

Computes the sum of every element of the matrix.

Sum ( Matrix m, int i, VectorType t ) : double

Computes the sum of every element of the matrix.

Swap ( int from, int to, VectorType t ) : void

Swaps.

SwapCol ( int from, int to ) : void

Swap col.

SwapRow ( int from, int to ) : void

Swap row.

ToString ( ) : string

Returns a string that represents the current object.

ToVector ( ) : Vector

Converts this object to a vector.

Trace ( Matrix m ) : double

Computes the trace of a matrix.

Transpose ( ) : Matrix

Deep copy transpose.

Unshape ( Matrix m, VectorType dimensionType = VectorType.Col ) : Vector

Unshapes the given Matrix into a Vector form along the dimensionType axis.

Reads from the source Matrix and stacks from right to left when dimensionType equals 'Col' otherwise uses a bottom up approach.

VStack ( ) : Matrix

Stacks.

VStack ( Matrix m, Matrix t ) : Matrix

Stacks.

Zeros ( int n ) : Matrix

Initial Zero Matrix (n by n)

Zeros ( int n, int d ) : Matrix

Initial zero matrix.

operator ( ) : IEnumerable

Returns an array of index (i, j) pairs matching indices that are not equal to the supplied value.

operator ( ) : Matrix

matrix multiplication.

operator ( ) : Vector

Solves Ax = b for x If A is not square or the system is overdetermined, this operation solves the linear least squares A.T * A x = A.T * b.

operator ( ) : bool

Inequality operator.

this ( bool>.Func f, VectorType t ) : Matrix

Indexer to get items within this collection using array index syntax.

this ( int i ) : Vector

Returns row vector specified at index i.

this ( int i, VectorType t ) : Vector

returns col/row vector at index j.

this ( bool>.Func f ) : double

Indexer to set items within this collection using array index syntax.

this ( IEnumerable slice ) : double

Indexer to set items within this collection using an n x 2 array of indices to set.

this ( int i, int j ) : double

Accessor.

Private Methods

Method Description
Backward ( Matrix A, Vector b ) : Vector

Backwards.

Forward ( Matrix A, Vector b ) : Vector

Forwards.

Inverse ( Matrix mat ) : Matrix

Inverses the given matrix.

Matrix ( ) : System

Used only internally.

Stack ( VectorType type ) : Matrix

Stack a set of vectors into a matrix.

ToArray ( ) : double[][]

Performs a deep copy of the underlying matrix and returns a 2D array.

ToTransposeArray ( ) : double[][]

Performs a deep copy of the underlying matrix, transpose it and returns a 2D array.

Method Details

Center() public method

In place centering. WARNING: WILL UPDATE MATRIX!
public Center ( VectorType t ) : Matrix
t VectorType .
return Matrix

Cholesky() public static method

Cholesky Factorization of a Matrix.
Thrown when the requested operation is invalid. Thrown when a Singular Matrix error condition occurs.
public static Cholesky ( Matrix m ) : Matrix
m Matrix Input Matrix.
return Matrix

Col() public method

Cols.
public Col ( int i ) : Vector
i int Zero-based index of the.
return Vector

Copy() public method

create deep copy of matrix.
public Copy ( ) : Matrix
return Matrix

Correlation() public static method

Correlations.
public static Correlation ( Matrix source, VectorType t = VectorType.Col ) : Matrix
source Matrix Source for the.
t VectorType (Optional) Row or Column sum.
return Matrix

Covariance() public static method

Covariances.
public static Covariance ( Matrix source, VectorType t = VectorType.Col ) : Matrix
source Matrix Source for the.
t VectorType (Optional) Row or Column sum.
return Matrix

CovarianceDiag() public static method

Covariance diagram.
public static CovarianceDiag ( Matrix source, VectorType t = VectorType.Col ) : Vector
source Matrix Source for the.
t VectorType (Optional) Row or Column sum.
return Vector

Create() public static method

Creates a new Matrix.
public static Create ( int n, Func f ) : Matrix
n int Size.
f Func The Func<int,int,double> to process.
return Matrix

Create() public static method

Creates a new Matrix.
public static Create ( int n, Func f ) : Matrix
n int Size.
f Func The Func<int,int,double> to process.
return Matrix

Create() public static method

Creates a new Matrix.
public static Create ( int n, int d, Func f ) : Matrix
n int Size.
d int cols.
f Func The Func<int,int,double> to process.
return Matrix

Create() public static method

Creates a new Matrix.
public static Create ( int n, int d, Func f ) : Matrix
n int Size.
d int cols.
f Func The Func<int,int,double> to process.
return Matrix

Det() public static method

Dets the given x coordinate.
Thrown when the requested operation is invalid.
public static Det ( Matrix x ) : double
x Matrix Matrix x.
return double

Diag() public static method

Diagrams the given m.
public static Diag ( Matrix m ) : Vector
m Matrix Input Matrix.
return Vector

Dot() public static method

Dot product between a matrix and a vector.
Thrown when the requested operation is invalid.
public static Dot ( Matrix x, Vector v ) : Vector
x Matrix Matrix x.
v Vector Vector v.
return Vector

Dot() public static method

Dot product between a matrix and a vector.
Thrown when the requested operation is invalid.
public static Dot ( Vector v, Matrix x ) : Vector
v Vector Vector v.
x Matrix Matrix x.
return Vector

Each() public static method

Performs an element wise operation on the input Matrix.
public static Each ( Matrix m, double>.Func fnElementWiseOp ) : Matrix
m Matrix Matrix.
fnElementWiseOp double>.Func Function to apply.
return Matrix

Each() public static method

Performs an element wise operation on the input Matrix.
public static Each ( Matrix m, Func fnElementWiseOp ) : Matrix
m Matrix Matrix.
fnElementWiseOp Func Function to update each cell specified by the value and cell coordinates.
return Matrix

Each() public static method

Performs an element-wise operation on the input Matrices.
public static Each ( Matrix m1, Matrix m2, Func fnElementWiseOp ) : Matrix
m1 Matrix First Matrix.
m2 Matrix Second Matrix.
fnElementWiseOp Func Operation to perform on the value from the first and second matrices.
return Matrix

Equals() public method

Determines whether the specified T:System.Object is equal to the current T:System.Object.
public Equals ( Matrix m, double tol ) : bool
m Matrix initial matrix.
tol double Double to be compared.
return bool

Equals() public method

Determines whether the specified T:System.Object is equal to the current T:System.Object.
public Equals ( object obj ) : bool
obj object The object to compare with the current object.
return bool

Evd() public static method

Eigen Decomposition.
public static Evd ( Matrix A ) : Matrix>.Tuple
A Matrix Input Matrix.
return Matrix>.Tuple

Extract() public static method

Extracts this object.
public static Extract ( Matrix m, int x, int y, int width, int height, bool safe = true ) : Matrix
m Matrix Input Matrix.
x int Matrix x.
y int The y coordinate.
width int The width.
height int The height.
safe bool (Optional) true to safe.
return Matrix

FrobeniusNorm() public static method

Matrix Frobenius Norm.
public static FrobeniusNorm ( Matrix A ) : double
A Matrix Input Matrix.
return double

GetCols() public method

Gets the cols in this collection.
public GetCols ( ) : IEnumerable
return IEnumerable

GetHashCode() public method

Serves as a hash function for a particular type.
public GetHashCode ( ) : int
return int

GetMatrix() public method

Gets a matrix.
public GetMatrix ( int d1, int d2, int n1, int n2 ) : Matrix
d1 int The first int.
d2 int The second int.
n1 int The first int.
n2 int The second int.
return Matrix

GetRows() public method

Gets the rows in this collection.
public GetRows ( ) : IEnumerable
return IEnumerable

GetVector() public method

Gets a vector.
public GetVector ( int index, int from, int to, VectorType type ) : Vector
index int Zero-based index of the.
from int Source for the.
to int to.
type VectorType The type.
return Vector

Identity() public static method

n x n identity matrix.
public static Identity ( int n ) : Matrix
n int Size.
return Matrix

Identity() public static method

n x d identity matrix.
public static Identity ( int n, int d ) : Matrix
n int rows.
d int cols.
return Matrix

Indices() public static method

Enumerates indices in this collection.
public static Indices ( Matrix source, bool>.Func f ) : IEnumerable
source Matrix Source for the.
f bool>.Func The Func<Vector,bool> to process.
return IEnumerable

Indices() public static method

Enumerates indices in this collection.
public static Indices ( Matrix source, bool>.Func f, VectorType t ) : IEnumerable
source Matrix Source for the.
f bool>.Func The Func<Vector,bool> to process.
t VectorType Row or Column sum.
return IEnumerable

Insert() public method

Returns a new Matrix with the Vector inserted at the specified position
public Insert ( Vector v, int index, VectorType t, bool insertAfter = true ) : Matrix
v Vector Vector to insert
index int The zero based row / column.
t VectorType Vector orientation
insertAfter bool Insert after or before the last row / column
return Matrix

Inverse() public method

Creates an inverse of the current matrix
public Inverse ( ) : Matrix
return Matrix

LU() public static method

NOT IMPLEMENTED!
Thrown when the requested operation is invalid.
public static LU ( Matrix A ) : Tuple
A Matrix .
return Tuple

Load() public static method

Loads the given stream.
Thrown when the requested file is not present.
public static Load ( string file ) : Matrix
file string The file to load.
return Matrix

Matrix() public method

Create new matrix with prepopulated vals.
public Matrix ( double m ) : System
m double initial matrix.
return System

Matrix() public method

Create matrix n x n matrix.
public Matrix ( int n ) : System
n int size.
return System

Matrix() public method

Create new n x d matrix.
public Matrix ( int n, int d ) : System
n int rows.
d int cols.
return System

Max() public static method

Returns a vector of the maximum values for each row/column.
public static Max ( Matrix source, VectorType t = VectorType.Col ) : Vector
source Matrix
t VectorType Use column or row (default: Col)
return Vector

Max() public static method

Determines the maximum of the given parameters.
public static Max ( Matrix source ) : double
source Matrix Source for the.
return double

Mean() public static method

Determines the mean of the given parameters.
public static Mean ( Matrix source, VectorType t ) : Vector
source Matrix Source for the.
t VectorType Row or Column sum.
return Vector

Median() public static method

Returns a vector of the median values for each row or column.
public static Median ( Matrix source, VectorType t = VectorType.Col ) : Vector
source Matrix Matrix.
t VectorType VectorType.
return Vector

Min() public static method

Returns a vector of the minimum values for each row/column.
public static Min ( Matrix source, VectorType t = VectorType.Col ) : Vector
source Matrix
t VectorType Use column or row (default: Col)
return Vector

Min() public static method

Determines the minimum of the given parameters.
public static Min ( Matrix source ) : double
source Matrix Source for the.
return double

Norm() public static method

Standard Matrix Norm.
public static Norm ( Matrix A, double p ) : double
A Matrix Input Matrix.
p double The double to process.
return double

NormRand() public static method

Normalise random.
Thrown when the requested operation is invalid.
public static NormRand ( Vector means, Vector stdDev, int n ) : Matrix
means Vector The means.
stdDev Vector The standard development.
n int Size.
return Matrix

NormRand() public static method

Normalise random.
public static NormRand ( int n, double min ) : Matrix
n int Size.
min double (Optional) the minimum.
return Matrix

NormRand() public static method

Normalise random.
public static NormRand ( int n, int d, double min ) : Matrix
n int Size.
d int cols.
min double (Optional) the minimum.
return Matrix

Normalize() public method

In place normalization. WARNING: WILL UPDATE MATRIX!
public Normalize ( VectorType t ) : void
t VectorType .
return void

Parse() public static method

Parses a string containing MATLAB style Matrix syntax, i.e. "[[1, 2, 3]; [3, 4, 5]]"
public static Parse ( string text ) : Matrix
text string Input string to parse.
return Matrix

Pivot() public static method

Pivots the given m.
Thrown when the requested operation is invalid.
public static Pivot ( Matrix M ) : Matrix
M Matrix The Matrix to process.
return Matrix

QR() public static method

Modified Gram-Schmidt QR Factorization.
public static QR ( Matrix A ) : Matrix>.Tuple
A Matrix Matrix A.
return Matrix>.Tuple

Rand() public static method

Generate a matrix n x d with numbers 0 less than x less than 1 drawn uniformly at random.
public static Rand ( int n, double min ) : Matrix
n int rows.
min double (Optional) the minimum.
return Matrix

Rand() public static method

Generate a matrix n x d with numbers 0 less than x less than 1 drawn uniformly at random.
public static Rand ( int n, int d, double min ) : Matrix
n int rows.
d int cols.
min double (Optional) the minimum.
return Matrix

Remove() public method

Removes this object.
public Remove ( int index, VectorType t ) : Matrix
index int Zero-based index of the.
t VectorType .
return Matrix

Reshape() public static method

Reshapes the supplied matrix into a new matrix shape.
public static Reshape ( Matrix m, int rows, int cols ) : Matrix
m Matrix Matrix to reshape.
rows int Number of rows of the new matrix.
cols int Number of columns of the new matrix.
return Matrix

Reshape() public static method

Reshapes the supplied Vector into a Matrix form.
public static Reshape ( Vector v, int dimension, VectorType dimensionType = VectorType.Col, VectorType byVector = VectorType.Row ) : Matrix
v Vector Source vector to act on.
dimension int Length of the specified dimension.
dimensionType VectorType Dimension type to use for creating a by n matrix.
byVector VectorType Direction to process, i.e. Row = Fill Down then Right, or Col = Fill Right then Down
return Matrix

Reshape() public static method

Reshapes the supplied Vector into a Matrix form.
public static Reshape ( Vector v, int rows, int columns, VectorType byVector = VectorType.Row ) : Matrix
v Vector Vector to reshape.
rows int Height of the matrix to return
columns int Width of the matrix to return
byVector VectorType Direction to process, i.e. Row = Fill Down then Right, or Col = Fill Right then Down
return Matrix

Reverse() public static method

Enumerates reverse in this collection.
public static Reverse ( Matrix source, VectorType t = VectorType.Row ) : IEnumerable
source Matrix Source for the.
t VectorType (Optional) Row or Column sum.
return IEnumerable

Round() public static method

Matrix Roundoff.
public static Round ( Matrix m, int decimals ) : Matrix
m Matrix Input Matrix.
decimals int (Optional) Max number of decimals (default 0 - integral members)
return Matrix

Row() public method

Rows.
public Row ( int i ) : Vector
i int Zero-based index of the.
return Vector

SVD() public static method

Singular Value Decomposition.
Thrown when the requested operation is unimplemented.
public static SVD ( Matrix A ) : Tuple
A Matrix Input Matrix.
return Tuple

Save() public method

Save matrix to file
public Save ( string file ) : void
file string file to save
return void

Slice() public static method

Slices.
public static Slice ( Matrix m, IEnumerable indices ) : Matrix
m Matrix Input Matrix.
indices IEnumerable The indices.
return Matrix

Slice() public static method

Slices.
public static Slice ( Matrix m, IEnumerable indices, VectorType t ) : Matrix
m Matrix Input Matrix.
indices IEnumerable The indices.
t VectorType Row or Column sum.
return Matrix

Sort() public static method

Sorts the given Matrix by the specified row or column selector and returns the new Matrix
public static Sort ( Matrix source, double>.Func keySelector, VectorType t, bool ascending = true ) : Matrix
source Matrix The Matrix
keySelector double>.Func Property selector to sort by.
t VectorType Specifies whether to sort horizontally or vertically.
ascending bool Determines whether to sort ascending or descending (Default: True)
return Matrix

Sort() public static method

Sorts the given Matrix by the specified row or column selector and returns the new Matrix along with the original indices.
public static Sort ( Matrix source, double>.Func keySelector, VectorType t, bool ascending, Vector &indices ) : Matrix
source Matrix The Matrix
keySelector double>.Func Property selector to sort by.
t VectorType Specifies whether to sort horizontally or vertically.
ascending bool Determines whether to sort ascending or descending (Default: True)
indices Vector Vector of indices in the original Matrix before the sort operation.
return Matrix

Stack() public static method

Stack a set of vectors into a matrix.
public static Stack ( ) : Matrix
return Matrix

Stack() public static method

Stack a set of vectors into a matrix.
Thrown when the requested operation is invalid.
public static Stack ( Matrix m, Matrix t ) : Matrix
m Matrix Input Matrix.
t Matrix Row or Column sum.
return Matrix

Stats() public static method

Statistics.
public static Stats ( Matrix x, VectorType t = VectorType.Row ) : Matrix[]
x Matrix Matrix x.
t VectorType (Optional) Row or Column sum.
return Matrix[]

StdDev() public static method

Computes the standard deviation of the given matrix
public static StdDev ( Matrix source, VectorType t = VectorType.Col ) : Vector
source Matrix
t VectorType Use column or row (default: Col)
return Vector

Sum() public static method

Computes the sum of either the rows or columns of a matrix and returns a vector.
public static Sum ( Matrix m, VectorType t ) : Vector
m Matrix Input Matrix.
t VectorType Row or Column sum.
return Vector

Sum() public static method

Computes the sum of every element of the matrix.
public static Sum ( Matrix m ) : double
m Matrix Input Matrix.
return double

Sum() public static method

Computes the sum of every element of the matrix.
public static Sum ( Matrix m, int i, VectorType t ) : double
m Matrix Input Matrix.
i int Zero-based index of the.
t VectorType Row or Column sum.
return double

Swap() public method

Swaps.
public Swap ( int from, int to, VectorType t ) : void
from int Source for the.
to int to.
t VectorType .
return void

SwapCol() public method

Swap col.
public SwapCol ( int from, int to ) : void
from int Source for the.
to int to.
return void

SwapRow() public method

Swap row.
public SwapRow ( int from, int to ) : void
from int Source for the.
to int to.
return void

ToString() public method

Returns a string that represents the current object.
public ToString ( ) : string
return string

ToVector() public method

Converts this object to a vector.
Thrown when the requested operation is invalid.
public ToVector ( ) : Vector
return Vector

Trace() public static method

Computes the trace of a matrix.
public static Trace ( Matrix m ) : double
m Matrix Input Matrix.
return double

Transpose() public method

Deep copy transpose.
public Transpose ( ) : Matrix
return Matrix

Unshape() public static method

Unshapes the given Matrix into a Vector form along the dimensionType axis.

Reads from the source Matrix and stacks from right to left when dimensionType equals 'Col' otherwise uses a bottom up approach.

public static Unshape ( Matrix m, VectorType dimensionType = VectorType.Col ) : Vector
m Matrix The Matrix to act on.
dimensionType VectorType Type of the dimension to use when unrolling the Matrix.
return Vector

VStack() public static method

Stacks.
public static VStack ( ) : Matrix
return Matrix

VStack() public static method

Stacks.
Thrown when the requested operation is invalid.
public static VStack ( Matrix m, Matrix t ) : Matrix
m Matrix Input Matrix.
t Matrix Row or Column sum.
return Matrix

Zeros() public static method

Initial Zero Matrix (n by n)
public static Zeros ( int n ) : Matrix
n int Size.
return Matrix

Zeros() public static method

Initial zero matrix.
public static Zeros ( int n, int d ) : Matrix
n int .
d int .
return Matrix

operator() public static method

Returns an array of index (i, j) pairs matching indices that are not equal to the supplied value.
public static operator ( ) : IEnumerable
return IEnumerable

operator() public static method

matrix multiplication.
Thrown when the requested operation is invalid.
public static operator ( ) : Matrix
return Matrix

operator() public static method

Solves Ax = b for x If A is not square or the system is overdetermined, this operation solves the linear least squares A.T * A x = A.T * b.
Thrown when the requested operation is invalid.
public static operator ( ) : Vector
return Vector

operator() public static method

Inequality operator.
public static operator ( ) : bool
return bool

this() public method

Indexer to get items within this collection using array index syntax.
public this ( bool>.Func f, VectorType t ) : Matrix
f bool>.Func The Func<Vector,bool> to process.
t VectorType The VectorType to process.
return Matrix

this() public method

Returns row vector specified at index i.
public this ( int i ) : Vector
i int row index.
return Vector

this() public method

returns col/row vector at index j.
public this ( int i, VectorType t ) : Vector
i int Col/Row.
t VectorType Row or Column.
return Vector

this() public method

Indexer to set items within this collection using array index syntax.
public this ( bool>.Func f ) : double
f bool>.Func The Func<double,bool> to process.
return double

this() public method

Indexer to set items within this collection using an n x 2 array of indices to set.
public this ( IEnumerable slice ) : double
slice IEnumerable An n x 2 array of indices to set.
return double

this() public method

Accessor.
public this ( int i, int j ) : double
i int Row.
j int Column.
return double