Spiking Neuron Network Simulator  1.0
Simulation and training of spiking neuron networks, primarily theta neurons
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties Pages
SpikingNeuronNetwork.Lib.Matrix Class Reference

Matrix Class More...

Public Member Functions

 Matrix (int iRows, int iCols)
 Creates a new instance of Matrix of size iRows and iCols More...
 
override bool Equals (object obj)
 Indicates if a matrix is equal to an object More...
 
override int GetHashCode ()
 Gets a hash code representation of the matrix More...
 
Matrix GetRow (int k)
 Gets a row matrix More...
 
Matrix GetCol (int k)
 Gets a column matrix More...
 
List< int > FindAllIndexOf (double val)
 Gets a list of a indices where the value is equal to val within epsilon More...
 
List< int > FindAllIndexOfNot (double val)
 Gets a list of a indices where the value is not equal to val within epsilon More...
 
void SetCol (Matrix v, int k)
 Sets a column of the matrix to a given column matrix More...
 
void MakeLU ()
 Perform LU Decomposition More...
 
Matrix SolveWith (Matrix v)
 Solve Ax = v for x, where A is the current matrix More...
 
Matrix Invert ()
 Inverts the current matrix More...
 
double Det ()
 Calculates the matrix determinant More...
 
Matrix GetPermutationMatrix ()
 Gets a permutation matrix "P" due to permutation vector "pi" More...
 
Matrix Clone ()
 Gets a deep copy of the matrix More...
 
override string ToString ()
 Returns a string representation of the matrix More...
 

Static Public Member Functions

static Matrix SubsForth (Matrix mA, Matrix b)
 Solves Ax = b for A as a lower triangular matrix More...
 
static Matrix SubsBack (Matrix mA, Matrix b)
 Solves Ax = b for A as an upper triangular matrix More...
 
static Matrix ZeroMatrix (int iRows, int iCols)
 Gets a matrix of zeros of size iRows by iCols More...
 
static Matrix ConstantMatrix (int iRows, int iCols, double val)
 Gets a matrix of constant values equal to val of size iRows by iCols More...
 
static Matrix IdentityMatrix (int iRows, int iCols)
 Gets an indentity matrix of size iRows by iCols More...
 
static Matrix RandomMatrix (int iRows, int iCols, double dispersion, double probability=1.0)
 Gets a matrix of random numbers of size iRows by iCols More...
 
static Matrix Parse (string ps)
 Gets a matrix as parsed from a string delimited by spaces and newlines More...
 
static Matrix Transpose (Matrix m)
 Gets a transposed matrix More...
 
static Matrix Power (Matrix m, int pow)
 Gets a matrix raised to an integer power More...
 
static Matrix operator- (Matrix m)
 Gets the negation of matrix m More...
 
static Matrix operator+ (double m1, Matrix m2)
 Gets the sum of double m1 and matrix m2 More...
 
static Matrix operator+ (Matrix m1, double m2)
 Gets the sum of matrix m1 and double m2 More...
 
static Matrix operator+ (Matrix m1, Matrix m2)
 Gets the sum of matrix m1 and matrix m2 More...
 
static Matrix operator- (Matrix m1, Matrix m2)
 Gets the difference of matrix m1 and double m2 More...
 
static Matrix operator* (Matrix m1, Matrix m2)
 Gets the product of matrix m1 and matrix m2 More...
 
static Matrix operator* (double n, Matrix m)
 Gets the product of double n and matrix m More...
 
static bool operator== (Matrix m1, Matrix m2)
 Indicates whether matrices m1 and m2 are equal More...
 
static bool operator!= (Matrix m1, Matrix m2)
 Indicates whether matrices m1 and m2 are not equal More...
 

Protected Member Functions

bool Equals (Matrix m1)
 

Properties

int Rows [get]
 Gets the number of rows in the matrix More...
 
int Cols [get]
 Gets the number of columns in the matrix More...
 
bool IsSquare [get]
 Indicates if the matrix is square More...
 
double this[int iRow, int iCol] [get, set]
 Gets or sets the matrix value at the row and column index More...
 

Detailed Description

Matrix Class

Definition at line 53 of file Matrix.cs.

Constructor & Destructor Documentation

SpikingNeuronNetwork.Lib.Matrix.Matrix ( int  iRows,
int  iCols 
)

Creates a new instance of Matrix of size iRows and iCols

Parameters
iRowsThe number of rows
iColsThe number of columns

Definition at line 67 of file Matrix.cs.

Member Function Documentation

Matrix SpikingNeuronNetwork.Lib.Matrix.Clone ( )

Gets a deep copy of the matrix

Returns

Definition at line 343 of file Matrix.cs.

static Matrix SpikingNeuronNetwork.Lib.Matrix.ConstantMatrix ( int  iRows,
int  iCols,
double  val 
)
static

Gets a matrix of constant values equal to val of size iRows by iCols

Parameters
iRowsThe number of rows
iColsThe number of columns
valThe constant value
Returns
A matrix of constant values equal to val of size iRows by iCols

Definition at line 416 of file Matrix.cs.

double SpikingNeuronNetwork.Lib.Matrix.Det ( )

Calculates the matrix determinant

Returns
The matrix determinant

Definition at line 318 of file Matrix.cs.

override bool SpikingNeuronNetwork.Lib.Matrix.Equals ( object  obj)

Indicates if a matrix is equal to an object

Parameters
objThe object
Returns
An indicator for if a matrix is equal to an object

Definition at line 113 of file Matrix.cs.

bool SpikingNeuronNetwork.Lib.Matrix.Equals ( Matrix  m1)
protected

Definition at line 120 of file Matrix.cs.

List<int> SpikingNeuronNetwork.Lib.Matrix.FindAllIndexOf ( double  val)

Gets a list of a indices where the value is equal to val within epsilon

Parameters
valThe comparison value
Returns
A list of a indices where the value is equal to val within epsilon

Definition at line 169 of file Matrix.cs.

List<int> SpikingNeuronNetwork.Lib.Matrix.FindAllIndexOfNot ( double  val)

Gets a list of a indices where the value is not equal to val within epsilon

Parameters
valThe comparison value
Returns
A list of a indices where the value is not equal to val within epsilon

Definition at line 190 of file Matrix.cs.

Matrix SpikingNeuronNetwork.Lib.Matrix.GetCol ( int  k)

Gets a column matrix

Parameters
kThe column index
Returns
The column matrix

Definition at line 157 of file Matrix.cs.

override int SpikingNeuronNetwork.Lib.Matrix.GetHashCode ( )

Gets a hash code representation of the matrix

Returns
The hash code

Definition at line 129 of file Matrix.cs.

Matrix SpikingNeuronNetwork.Lib.Matrix.GetPermutationMatrix ( )

Gets a permutation matrix "P" due to permutation vector "pi"

Returns
The permutation matrix "P" due to permutation vector "pi"

Definition at line 330 of file Matrix.cs.

Matrix SpikingNeuronNetwork.Lib.Matrix.GetRow ( int  k)

Gets a row matrix

Parameters
kThe row index
Returns
The row matrix

Definition at line 145 of file Matrix.cs.

static Matrix SpikingNeuronNetwork.Lib.Matrix.IdentityMatrix ( int  iRows,
int  iCols 
)
static

Gets an indentity matrix of size iRows by iCols

Parameters
iRowsThe number of rows
iColsThe number of columns
Returns
An indentity matrix of size iRows by iCols

Definition at line 431 of file Matrix.cs.

Matrix SpikingNeuronNetwork.Lib.Matrix.Invert ( )

Inverts the current matrix

Returns
The inverted matrix

Definition at line 298 of file Matrix.cs.

void SpikingNeuronNetwork.Lib.Matrix.MakeLU ( )

Perform LU Decomposition

Definition at line 219 of file Matrix.cs.

static bool SpikingNeuronNetwork.Lib.Matrix.operator!= ( Matrix  m1,
Matrix  m2 
)
static

Indicates whether matrices m1 and m2 are not equal

Parameters
m1An input matrix
m2An input matrix
Returns
Indicates whether matrices m1 and m2 are not equal

Definition at line 906 of file Matrix.cs.

static Matrix SpikingNeuronNetwork.Lib.Matrix.operator* ( Matrix  m1,
Matrix  m2 
)
static

Gets the product of matrix m1 and matrix m2

Parameters
m1An input matrix
m2An input matrix
Returns
The product of m1 and m2

Definition at line 868 of file Matrix.cs.

static Matrix SpikingNeuronNetwork.Lib.Matrix.operator* ( double  n,
Matrix  m 
)
static

Gets the product of double n and matrix m

Parameters
nAn input double
mAn input matrix
Returns
The product of n and m

Definition at line 879 of file Matrix.cs.

static Matrix SpikingNeuronNetwork.Lib.Matrix.operator+ ( double  m1,
Matrix  m2 
)
static

Gets the sum of double m1 and matrix m2

Parameters
m1An input double
m2An input matrix
Returns
The sum of m1 and m2

Definition at line 820 of file Matrix.cs.

static Matrix SpikingNeuronNetwork.Lib.Matrix.operator+ ( Matrix  m1,
double  m2 
)
static

Gets the sum of matrix m1 and double m2

Parameters
m1An input matrix
m2An input double
Returns
The sum of m1 and m2

Definition at line 835 of file Matrix.cs.

static Matrix SpikingNeuronNetwork.Lib.Matrix.operator+ ( Matrix  m1,
Matrix  m2 
)
static

Gets the sum of matrix m1 and matrix m2

Parameters
m1An input matrix
m2An input matrix
Returns
The sum of m1 and m2

Definition at line 846 of file Matrix.cs.

static Matrix SpikingNeuronNetwork.Lib.Matrix.operator- ( Matrix  m)
static

Gets the negation of matrix m

Parameters
mThe input matrix
Returns
The negation of matrix m

Definition at line 809 of file Matrix.cs.

static Matrix SpikingNeuronNetwork.Lib.Matrix.operator- ( Matrix  m1,
Matrix  m2 
)
static

Gets the difference of matrix m1 and double m2

Parameters
m1The minuend
m2The subtrahend
Returns
The difference of m1 and m2

Definition at line 857 of file Matrix.cs.

static bool SpikingNeuronNetwork.Lib.Matrix.operator== ( Matrix  m1,
Matrix  m2 
)
static

Indicates whether matrices m1 and m2 are equal

Parameters
m1An input matrix
m2An input matrix
Returns
Indicates whether matrices m1 and m2 are equal

Definition at line 890 of file Matrix.cs.

static Matrix SpikingNeuronNetwork.Lib.Matrix.Parse ( string  ps)
static

Gets a matrix as parsed from a string delimited by spaces and newlines

Parameters
psThe matrix string
Returns
The parsed matrix

Definition at line 462 of file Matrix.cs.

static Matrix SpikingNeuronNetwork.Lib.Matrix.Power ( Matrix  m,
int  pow 
)
static

Gets a matrix raised to an integer power

Parameters
mThe original matrix
powThe power to raise it to
Returns
The matrix raised to an integer power

Definition at line 518 of file Matrix.cs.

static Matrix SpikingNeuronNetwork.Lib.Matrix.RandomMatrix ( int  iRows,
int  iCols,
double  dispersion,
double  probability = 1.0 
)
static

Gets a matrix of random numbers of size iRows by iCols

Parameters
iRowsThe number of rows
iColsThe number of columns
dispersionThe absolute min and max value of generated random numbers
probabilityThe probability a generated value is non-zero
Returns
A matrix of random numbers of size iRows by iCols

Definition at line 447 of file Matrix.cs.

void SpikingNeuronNetwork.Lib.Matrix.SetCol ( Matrix  v,
int  k 
)

Sets a column of the matrix to a given column matrix

Parameters
vThe column matrix
kThe column index

Definition at line 211 of file Matrix.cs.

Matrix SpikingNeuronNetwork.Lib.Matrix.SolveWith ( Matrix  v)

Solve Ax = v for x, where A is the current matrix

Parameters
vThe linear equation solution
Returns
The solution of Ax=v

Definition at line 279 of file Matrix.cs.

static Matrix SpikingNeuronNetwork.Lib.Matrix.SubsBack ( Matrix  mA,
Matrix  b 
)
static

Solves Ax = b for A as an upper triangular matrix

Parameters
mAThe A matrix
bThe b matrix
Returns
The x matrix

Definition at line 379 of file Matrix.cs.

static Matrix SpikingNeuronNetwork.Lib.Matrix.SubsForth ( Matrix  mA,
Matrix  b 
)
static

Solves Ax = b for A as a lower triangular matrix

Parameters
mAThe A matrix
bThe b matrix
Returns
The x matrix

Definition at line 358 of file Matrix.cs.

override string SpikingNeuronNetwork.Lib.Matrix.ToString ( )

Returns a string representation of the matrix

Returns
A string representation of the matrix

Definition at line 487 of file Matrix.cs.

static Matrix SpikingNeuronNetwork.Lib.Matrix.Transpose ( Matrix  m)
static

Gets a transposed matrix

Parameters
mThe original matrix
Returns
The transposed matrix

Definition at line 503 of file Matrix.cs.

static Matrix SpikingNeuronNetwork.Lib.Matrix.ZeroMatrix ( int  iRows,
int  iCols 
)
static

Gets a matrix of zeros of size iRows by iCols

Parameters
iRowsThe number of rows
iColsThe number of columns
Returns
A matrix of zeros of size iRows by iCols

Definition at line 400 of file Matrix.cs.

Property Documentation

int SpikingNeuronNetwork.Lib.Matrix.Cols
get

Gets the number of columns in the matrix

Definition at line 84 of file Matrix.cs.

bool SpikingNeuronNetwork.Lib.Matrix.IsSquare
get

Indicates if the matrix is square

Definition at line 92 of file Matrix.cs.

int SpikingNeuronNetwork.Lib.Matrix.Rows
get

Gets the number of rows in the matrix

Definition at line 76 of file Matrix.cs.

double SpikingNeuronNetwork.Lib.Matrix.this[int iRow, int iCol]
getset

Gets or sets the matrix value at the row and column index

Parameters
iRowThe row index
iColThe column index
Returns
The matrix value at the row and column index

Definition at line 103 of file Matrix.cs.


The documentation for this class was generated from the following file: