Class Matrix
Class defining a matrix.
Implements
Namespace: BRIDGES.LinearAlgebra.Matrices
Assembly: BRIDGES.dll
Syntax
public abstract class Matrix : object, IGroupAction<Matrix, double>
Constructors
| Improve this Doc View SourceMatrix(Int32, Int32)
Initialises a new instance of the Matrix class.
Declaration
protected Matrix(int rowCount, int columnCount)
Parameters
Type | Name | Description |
---|---|---|
Int32 | rowCount | Number of rows of the Matrix. |
Int32 | columnCount | Number of columns of the Matrix. |
Properties
| Improve this Doc View SourceColumnCount
Gets the number of columns in this matrix.
Declaration
public abstract int ColumnCount { get; }
Property Value
Type | Description |
---|---|
Int32 |
RowCount
Gets the number of rows in this matrix.
Declaration
public abstract int RowCount { get; }
Property Value
Type | Description |
---|---|
Int32 |
Methods
| Improve this Doc View SourceAdd(Matrix, Matrix)
Computes the addition of two Matrix.
Declaration
public static Matrix Add(Matrix left, Matrix right)
Parameters
Type | Name | Description |
---|---|---|
Matrix | left | Left Matrix for the addition. |
Matrix | right | Right Matrix for the addition. |
Returns
Type | Description |
---|---|
Matrix | The Matrix resulting from the addition. |
At(Int32, Int32)
Get the value of the matrix at the given row and column index.
Declaration
public abstract double At(int row, int column)
Parameters
Type | Name | Description |
---|---|---|
Int32 | row | Row index of the value to get. |
Int32 | column | Column index of the value to get. |
Returns
Type | Description |
---|---|
Double | The value at the given row and column index. |
Divide(Matrix, Double)
Computes the scalar division of a Matrix with a
Declaration
public static Matrix Divide(Matrix operand, double divisor)
Parameters
Type | Name | Description |
---|---|---|
Matrix | operand | Matrix to divide. |
Double | divisor |
Returns
Type | Description |
---|---|
Matrix | The new Matrix resulting from the scalar division. |
Multiply(Matrix, Matrix)
Computes the multiplication of two Matrix.
Declaration
public static Matrix Multiply(Matrix left, Matrix right)
Parameters
Type | Name | Description |
---|---|---|
Matrix | left | Left Matrix for the multiplication. |
Matrix | right | Right Matrix for the multiplication. |
Returns
Type | Description |
---|---|
Matrix | The Matrix resulting from the multiplication. |
Multiply(Matrix, DenseVector)
Computes the right multiplication of a Matrix with a DenseVector : A·V
.
Declaration
public static DenseVector Multiply(Matrix matrix, DenseVector vector)
Parameters
Type | Name | Description |
---|---|---|
Matrix | matrix | Matrix to multiply on the right. |
DenseVector | vector | DenseVector to multiply with. |
Returns
Type | Description |
---|---|
DenseVector | The new DenseVector resulting from the multiplication. |
Multiply(Matrix, SparseVector)
Computes the right multiplication of a Matrix with a SparseVector : A·V
.
Declaration
public static Vector Multiply(Matrix matrix, SparseVector vector)
Parameters
Type | Name | Description |
---|---|---|
Matrix | matrix | Matrix to multiply on the right. |
SparseVector | vector | SparseVector to multiply with. |
Returns
Type | Description |
---|---|
Vector | The new SparseVector resulting from the multiplication. |
Multiply(Matrix, Vector)
Declaration
public static Vector Multiply(Matrix matrix, Vector vector)
Parameters
Type | Name | Description |
---|---|---|
Matrix | matrix | Matrix to multiply on the right. |
Vector | vector | Vector to multiply with. |
Returns
Type | Description |
---|---|
Vector | The new Vector resulting from the multiplication. |
Multiply(Matrix, Double)
Computes the right scalar multiplication of a Matrix with a
Declaration
public static Matrix Multiply(Matrix operand, double factor)
Parameters
Type | Name | Description |
---|---|---|
Matrix | operand | Matrix to multiply on the right. |
Double | factor |
Returns
Type | Description |
---|---|
Matrix | The new Matrix resulting from the right scalar multiplication. |
Multiply(Double, Matrix)
Computes the left scalar multiplication of a Matrix with a
Declaration
public static Matrix Multiply(double factor, Matrix operand)
Parameters
Type | Name | Description |
---|---|---|
Double | factor | |
Matrix | operand | Matrix to multiply on the left. |
Returns
Type | Description |
---|---|
Matrix | The new Matrix resulting from the left scalar multiplication. |
Opposite(Matrix)
Computes the opposite of the Matrix.
Declaration
public static Matrix Opposite(Matrix operand)
Parameters
Type | Name | Description |
---|---|---|
Matrix | operand | Matrix whose opposite is to be computed. |
Returns
Type | Description |
---|---|
Matrix | The Matrix, opposite of the initial one. |
Subtract(Matrix, Matrix)
Computes the subtraction of two Matrix.
Declaration
public static Matrix Subtract(Matrix left, Matrix right)
Parameters
Type | Name | Description |
---|---|---|
Matrix | left | Left Matrix to subtract. |
Matrix | right | Right Matrix to subtract with. |
Returns
Type | Description |
---|---|
Matrix | The Matrix resulting from the subtraction. |
ToArray()
Translates this matrix into its bi-dimensional array representation.
Declaration
public abstract double[, ] ToArray()
Returns
Type | Description |
---|---|
Double[,] | The bi-dimensional array representing the matrix. |
Transpose(Matrix)
Transposes the Matrix
Declaration
public static Matrix Transpose(Matrix matrix)
Parameters
Type | Name | Description |
---|---|---|
Matrix | matrix | Matrix to tranpose. |
Returns
Type | Description |
---|---|
Matrix | The new Matrix, transposed of the initial one. |
TransposeMultiply(Matrix, DenseVector)
Computes the right multiplication of a transposed Matrix with a DenseVector : At·V
.
Declaration
public static DenseVector TransposeMultiply(Matrix matrix, DenseVector vector)
Parameters
Type | Name | Description |
---|---|---|
Matrix | matrix | Matrix to transpose then multiply on the right. |
DenseVector | vector | DenseVector to multiply with. |
Returns
Type | Description |
---|---|
DenseVector | The new DenseVector resulting from the multiplication. |
TransposeMultiply(Matrix, SparseVector)
Computes the right multiplication of a transposed Matrix with a SparseVector : At·V
.
Declaration
public static Vector TransposeMultiply(Matrix matrix, SparseVector vector)
Parameters
Type | Name | Description |
---|---|---|
Matrix | matrix | Matrix to transpose then multiply on the right. |
SparseVector | vector | SparseVector to multiply with. |
Returns
Type | Description |
---|---|
Vector | The new SparseVector resulting from the multiplication. |
TransposeMultiply(Matrix, Vector)
Declaration
public static Vector TransposeMultiply(Matrix matrix, Vector vector)
Parameters
Type | Name | Description |
---|---|---|
Matrix | matrix | Matrix to transpose then multiply on the right. |
Vector | vector | Vector to multiply with. |
Returns
Type | Description |
---|---|
Vector | The new Vector resulting from the multiplication. |
TransposeMultiplySelf(Matrix)
Computes the left multiplication of a Matrix with its transposition : At·A
.
Declaration
public static Matrix TransposeMultiplySelf(Matrix operand)
Parameters
Type | Name | Description |
---|---|---|
Matrix | operand | Matrix for the operation. |
Returns
Type | Description |
---|---|
Matrix | The new Matrix resulting from the operation. |
Operators
| Improve this Doc View SourceAddition(Matrix, Matrix)
Computes the addition of two Matrix.
Declaration
public static Matrix operator +(Matrix left, Matrix right)
Parameters
Type | Name | Description |
---|---|---|
Matrix | left | Left Matrix for the addition. |
Matrix | right | Right Matrix for the addition. |
Returns
Type | Description |
---|---|
Matrix | The Matrix resulting from the addition. |
Division(Matrix, Double)
Computes the scalar division of a Matrix with a
Declaration
public static Matrix operator /(Matrix operand, double divisor)
Parameters
Type | Name | Description |
---|---|---|
Matrix | operand | Matrix to divide. |
Double | divisor |
Returns
Type | Description |
---|---|
Matrix | The new Matrix resulting from the scalar division. |
Multiply(Matrix, Matrix)
Computes the multiplication of two Matrix.
Declaration
public static Matrix operator *(Matrix left, Matrix right)
Parameters
Type | Name | Description |
---|---|---|
Matrix | left | Left Matrix for the multiplication. |
Matrix | right | Right Matrix for the multiplication. |
Returns
Type | Description |
---|---|
Matrix | The Matrix resulting from the multiplication. |
Multiply(Matrix, DenseVector)
Computes the right multiplication of a Matrix with a DenseVector : A·V
.
Declaration
public static DenseVector operator *(Matrix matrix, DenseVector vector)
Parameters
Type | Name | Description |
---|---|---|
Matrix | matrix | Matrix to multiply on the right. |
DenseVector | vector | DenseVector to multiply with. |
Returns
Type | Description |
---|---|
DenseVector | The new DenseVector resulting from the multiplication. |
Multiply(Matrix, SparseVector)
Computes the right multiplication of a Matrix with a SparseVector : A·V
.
Declaration
public static Vector operator *(Matrix matrix, SparseVector vector)
Parameters
Type | Name | Description |
---|---|---|
Matrix | matrix | Matrix to multiply on the right. |
SparseVector | vector | SparseVector to multiply with. |
Returns
Type | Description |
---|---|
Vector | The new SparseVector resulting from the multiplication. |
Multiply(Matrix, Vector)
Declaration
public static Vector operator *(Matrix matrix, Vector vector)
Parameters
Type | Name | Description |
---|---|---|
Matrix | matrix | Matrix to multiply on the right. |
Vector | vector | Vector to multiply with. |
Returns
Type | Description |
---|---|
Vector | The new Vector resulting from the multiplication. |
Multiply(Matrix, Double)
Computes the right scalar multiplication of a Matrix with a
Declaration
public static Matrix operator *(Matrix operand, double factor)
Parameters
Type | Name | Description |
---|---|---|
Matrix | operand | Matrix to multiply on the right. |
Double | factor |
Returns
Type | Description |
---|---|
Matrix | The new Matrix resulting from the right scalar multiplication. |
Multiply(Double, Matrix)
Computes the left scalar multiplication of a Matrix with a
Declaration
public static Matrix operator *(double factor, Matrix operand)
Parameters
Type | Name | Description |
---|---|---|
Double | factor | |
Matrix | operand | Matrix to multiply on the left. |
Returns
Type | Description |
---|---|
Matrix | The new Matrix resulting from the left scalar multiplication. |
Subtraction(Matrix, Matrix)
Computes the subtraction of two Matrix.
Declaration
public static Matrix operator -(Matrix left, Matrix right)
Parameters
Type | Name | Description |
---|---|---|
Matrix | left | Left Matrix to subtract. |
Matrix | right | Right Matrix to subtract with. |
Returns
Type | Description |
---|---|
Matrix | The Matrix resulting from the subtraction. |
UnaryNegation(Matrix)
Computes the opposite of the Matrix.
Declaration
public static Matrix operator -(Matrix operand)
Parameters
Type | Name | Description |
---|---|---|
Matrix | operand | Matrix whose opposite is to be computed. |
Returns
Type | Description |
---|---|
Matrix | The Matrix, opposite of the initial one. |
Explicit Interface Implementations
| Improve this Doc View SourceIGroupAction<Matrix, Double>.Divide(Double)
Computes the right scalar division of the current element.
Declaration
Matrix IGroupAction<Matrix, double>.Divide(double divisor)
Parameters
Type | Name | Description |
---|---|---|
Double | divisor |
Returns
Type | Description |
---|---|
Matrix | The new element resulting from the scalar dividion. |
IGroupAction<Matrix, Double>.Multiply(Double)
Computes the right scalar multiplication of the current element.
Declaration
Matrix IGroupAction<Matrix, double>.Multiply(double factor)
Parameters
Type | Name | Description |
---|---|---|
Double | factor |
Returns
Type | Description |
---|---|
Matrix | The new element resulting from the scalar multiplication. |