Types in MathNet.Numerics.LinearAlgebra.Complex
Public Constructors
DenseMatrix(int rows, int columns, Complex[] storage)
Create a new dense matrix with the given number of rows and columns directly binding to a raw array.
The array is assumed to be in column-major order (column by column) and is used directly without copying.
Very efficient, but changes to the array and the matrix will affect each other.
DenseMatrix(int rows, int columns)
Create a new dense matrix with the given number of rows and columns.
All cells of the matrix will be initialized to zero.
DenseMatrix(int order)
Create a new square dense matrix with the given number of rows and columns.
All cells of the matrix will be initialized to zero.
Create a new dense matrix straight from an initialized matrix storage instance.
The storage is used directly without copying.
Intended for advanced scenarios where you're working directly with
storage for performance or interop reasons.
Public Static Functions
DenseMatrix Create(int rows, int columns, Func<int, int, Complex> init)
Create a new dense matrix and initialize each value using the provided init function.
DenseMatrix Create(int rows, int columns, Complex value)
Create a new dense matrix and initialize each value to the same provided value.
DenseMatrix CreateDiagonal(int rows, int columns, Func<int, Complex> init)
Create a new diagonal dense matrix and initialize each diagonal value using the provided init function.
DenseMatrix CreateDiagonal(int rows, int columns, Complex value)
Create a new diagonal dense matrix and initialize each diagonal value to the same provided value.
DenseMatrix CreateIdentity(int order)
Create a new square sparse identity matrix where each diagonal value is set to One.
Create a new dense matrix with values sampled from the provided random distribution.
DenseMatrix OfColumnArrays(IEnumerable<Complex[]> columns)
Create a new dense matrix as a copy of the given column arrays.
This new matrix will be independent from the arrays.
A new memory block will be allocated for storing the matrix.
DenseMatrix OfColumnMajor(int rows, int columns, IEnumerable<Complex> columnMajor)
Create a new dense matrix as a copy of the given enumerable.
The enumerable is assumed to be in column-major order (column by column).
This new matrix will be independent from the enumerable.
A new memory block will be allocated for storing the matrix.
DenseMatrix OfColumns(IEnumerable<IEnumerable<Complex>> data)
Create a new dense matrix as a copy of the given enumerable of enumerable columns.
Each enumerable in the master enumerable specifies a column.
This new matrix will be independent from the enumerables.
A new memory block will be allocated for storing the matrix.
DenseMatrix OfColumns(int rows, int columns, IEnumerable<IEnumerable<Complex>> data)
Create a new dense matrix as a copy of the given enumerable of enumerable columns.
Each enumerable in the master enumerable specifies a column.
This new matrix will be independent from the enumerables.
A new memory block will be allocated for storing the matrix.
DenseMatrix OfColumnVectors(IEnumerable<Vector<Complex>> columns)
Create a new dense matrix as a copy of the given column vectors.
This new matrix will be independent from the vectors.
A new memory block will be allocated for storing the matrix.
DenseMatrix OfDiagonalArray(Complex[] diagonal)
Create a new dense matrix with the diagonal as a copy of the given array.
This new matrix will be independent from the array.
A new memory block will be allocated for storing the matrix.
DenseMatrix OfDiagonalArray(int rows, int columns, Complex[] diagonal)
Create a new dense matrix with the diagonal as a copy of the given array.
This new matrix will be independent from the array.
A new memory block will be allocated for storing the matrix.
Create a new dense matrix with the diagonal as a copy of the given vector.
This new matrix will be independent from the vector.
A new memory block will be allocated for storing the matrix.
DenseMatrix OfDiagonalVector(int rows, int columns, Vector<T> diagonal)
Create a new dense matrix with the diagonal as a copy of the given vector.
This new matrix will be independent from the vector.
A new memory block will be allocated for storing the matrix.
DenseMatrix OfIndexed(int rows, int columns, IEnumerable<Tuple<int, int, Complex>> enumerable)
Create a new dense matrix as a copy of the given indexed enumerable.
Keys must be provided at most once, zero is assumed if a key is omitted.
This new matrix will be independent from the enumerable.
A new memory block will be allocated for storing the matrix.
Create a new dense matrix as a copy of the given other matrix.
This new matrix will be independent from the other matrix.
A new memory block will be allocated for storing the matrix.
DenseMatrix OfRowArrays(IEnumerable<Complex[]> rows)
Create a new dense matrix as a copy of the given row arrays.
This new matrix will be independent from the arrays.
A new memory block will be allocated for storing the matrix.
DenseMatrix OfRows(IEnumerable<IEnumerable<Complex>> data)
Create a new dense matrix as a copy of the given enumerable of enumerable rows.
Each enumerable in the master enumerable specifies a row.
This new matrix will be independent from the enumerables.
A new memory block will be allocated for storing the matrix.
DenseMatrix OfRows(int rows, int columns, IEnumerable<IEnumerable<Complex>> data)
Create a new dense matrix as a copy of the given enumerable of enumerable rows.
Each enumerable in the master enumerable specifies a row.
This new matrix will be independent from the enumerables.
A new memory block will be allocated for storing the matrix.
DenseMatrix OfRowVectors(IEnumerable<Vector<Complex>> rows)
Create a new dense matrix as a copy of the given row vectors.
This new matrix will be independent from the vectors.
A new memory block will be allocated for storing the matrix.
Public Methods
Adds another matrix to this matrix.
Adds another matrix to this matrix.
Return
The result of the addition.
Concatenates this matrix with the given matrix and places the result into the result matrix.
Concatenates this matrix with the given matrix.
Return
The combined matrix.
Complex[,] AsArray()
Returns the internal multidimensional array of this matrix if, and only if, this matrix is stored by such an array internally.
Otherwise returns null. Changes to the returned array and the matrix will affect each other.
Use ToArray instead if you always need an independent array.
Complex[][] AsColumnArrays()
Returns the internal column arrays of this matrix if, and only if, this matrix is stored by such arrays internally.
Otherwise returns null. Changes to the returned arrays and the matrix will affect each other.
Use ToColumnArrays instead if you always need an independent array.
Complex[] AsColumnMajorArray()
Returns the internal column by column (column major) array of this matrix if, and only if, this matrix is stored by such arrays internally.
Otherwise returns null. Changes to the returned arrays and the matrix will affect each other.
Use ToColumnMajorArray instead if you always need an independent array.
Return
Complex[]
An array containing the matrix's elements.
Complex[][] AsRowArrays()
Returns the internal row arrays of this matrix if, and only if, this matrix is stored by such arrays internally.
Otherwise returns null. Changes to the returned arrays and the matrix will affect each other.
Use ToRowArrays instead if you always need an independent array.
Complex[] AsRowMajorArray()
Returns the internal row by row (row major) array of this matrix if, and only if, this matrix is stored by such arrays internally.
Otherwise returns null. Changes to the returned arrays and the matrix will affect each other.
Use ToRowMajorArray instead if you always need an independent array.
Return
Complex[]
An array containing the matrix's elements.
Complex At(int row, int column)
Retrieves the requested element without range checking.
Parameters
int
row
int
column
Return
Complex
The requested element.
void At(int row, int column, Complex value)
void Clear()
Sets all values to zero.
void ClearColumn(int columnIndex)
Sets all values of a column to zero.
void ClearColumns(Int32[] columnIndices)
Sets all values for all of the chosen columns to zero.
void ClearRow(int rowIndex)
Sets all values of a row to zero.
void ClearRows(Int32[] rowIndices)
Sets all values for all of the chosen rows to zero.
void ClearSubMatrix(int rowIndex, int rowCount, int columnIndex, int columnCount)
Sets all values of a sub-matrix to zero.
Creates a clone of this instance.
Return
A clone of the instance.
void CoerceZero(double threshold)
Set all values whose absolute value is smaller than the threshold to zero.
void CoerceZero(Func<Complex, bool> zeroPredicate)
Set all values that meet the predicate to zero, in-place.
void Column(int index, Vector<T> result)
Copies a column into to the given Vector.
Vector<T> Column(int columnIndex, int rowIndex, int length)
Copies the requested column elements into a new Vector.
Parameters
int
columnIndex
int
rowIndex
int
length
Return
A Vector containing the requested elements.
void Column(int columnIndex, int rowIndex, int length, Vector<T> result)
Copies the requested column elements into the given vector.
Parameters
int
columnIndex
int
rowIndex
int
length
Copies a column into a new Vector>.
Parameters
int
index
Return
A Vector containing the copied elements.
Vector<T> ColumnAbsoluteSums()
Calculates the absolute value sum of each column vector.
Vector<T> ColumnNorms(double norm)
Calculates the p-norms of all column vectors.
Typical values for p are 1.0 (L1, Manhattan norm), 2.0 (L2, Euclidean norm) and positive infinity (infinity norm)
Calculates the value sum of each column vector.
Complex ConditionNumber()
Calculates the condition number of this matrix.
Return
Complex
The condition number of the matrix.
void Conjugate(Matrix<T> result)
Complex conjugate each element of this matrix and place the results into the result matrix.
Complex conjugate each element of this matrix.
Return
A matrix containing the conjugated values.
void ConjugateTranspose(Matrix<T> result)
Puts the conjugate transpose of this matrix into the result matrix.
Matrix<T> ConjugateTranspose()
Returns the conjugate transpose of this matrix.
Return
The conjugate transpose of this matrix.
Matrix<T> ConjugateTransposeAndMultiply(Matrix<T> other)
Multiplies this matrix with the conjugate transpose of another matrix and returns the result.
Return
The result of the multiplication.
void ConjugateTransposeAndMultiply(Matrix<T> other, Matrix<T> result)
Multiplies this matrix with the conjugate transpose of another matrix and places the results into the result matrix.
Matrix<T> ConjugateTransposeThisAndMultiply(Matrix<T> other)
Multiplies the conjugate transpose of this matrix with another matrix and returns the result.
Return
The result of the multiplication.
void ConjugateTransposeThisAndMultiply(Vector<T> rightSide, Vector<T> result)
Multiplies the conjugate transpose of this matrix with a vector and places the results into the result vector.
Vector<T> ConjugateTransposeThisAndMultiply(Vector<T> rightSide)
Multiplies the conjugate transpose of this matrix by a vector and returns the result.
Return
The result of the multiplication.
void ConjugateTransposeThisAndMultiply(Matrix<T> other, Matrix<T> result)
Multiplies the conjugate transpose of this matrix with another matrix and places the results into the result matrix.
void CopyTo(Matrix<T> target)
Copies the elements of this matrix to the given matrix.
Complex Determinant()
Computes the determinant of this matrix.
Return
Complex
The determinant of this matrix.
Returns the elements of the diagonal in a Vector.
Return
The elements of the diagonal.
Diagonally stacks his matrix on top of the given matrix and places the combined matrix into the result matrix.
Diagonally stacks his matrix on top of the given matrix. The new matrix is a M-by-N matrix,
where M = this.Rows + lower.Rows and N = this.Columns + lower.Columns.
The values of off the off diagonal matrices/blocks are set to zero.
Return
the combined matrix
void Divide(Complex scalar, Matrix<T> result)
void DivideByThis(Complex scalar, Matrix<T> result)
IEnumerable<Complex> Enumerate(Zeros zeros)
Returns an IEnumerable that can be used to iterate through all values of the matrix.
IEnumerable<Complex> Enumerate()
Returns an IEnumerable that can be used to iterate through all values of the matrix.
IEnumerable<Vector<Complex>> EnumerateColumns(int index, int length)
Returns an IEnumerable that can be used to iterate through a subset of all columns of the matrix.
Parameters
int
index
int
length
IEnumerable<Vector<Complex>> EnumerateColumns()
Returns an IEnumerable that can be used to iterate through all columns of the matrix.
IEnumerable<ValueTuple<int, Vector<Complex>>> EnumerateColumnsIndexed()
Returns an IEnumerable that can be used to iterate through all columns of the matrix and their index.
IEnumerable<ValueTuple<int, Vector<Complex>>> EnumerateColumnsIndexed(int index, int length)
Returns an IEnumerable that can be used to iterate through a subset of all columns of the matrix and their index.
Parameters
int
index
int
length
IEnumerable<ValueTuple<int, int, Complex>> EnumerateIndexed(Zeros zeros)
Returns an IEnumerable that can be used to iterate through all values of the matrix and their index.
IEnumerable<ValueTuple<int, int, Complex>> EnumerateIndexed()
Returns an IEnumerable that can be used to iterate through all values of the matrix and their index.
IEnumerable<Vector<Complex>> EnumerateRows()
Returns an IEnumerable that can be used to iterate through all rows of the matrix.
IEnumerable<Vector<Complex>> EnumerateRows(int index, int length)
Returns an IEnumerable that can be used to iterate through a subset of all rows of the matrix.
Parameters
int
index
int
length
IEnumerable<ValueTuple<int, Vector<Complex>>> EnumerateRowsIndexed()
Returns an IEnumerable that can be used to iterate through all rows of the matrix and their index.
IEnumerable<ValueTuple<int, Vector<Complex>>> EnumerateRowsIndexed(int index, int length)
Returns an IEnumerable that can be used to iterate through a subset of all rows of the matrix and their index.
Parameters
int
index
int
length
bool Equals(object obj)
Determines whether the specified
Object is equal to this instance.
Parameters
object
obj
Return
bool
true
if the specified Object is equal to this instance; otherwise, false
.
bool Equals(Matrix<T> other)
Indicates whether the current object is equal to another object of the same type.
Return
bool
true
if the current object is equal to the other parameter; otherwise, false
.
bool Exists(Func<Complex, bool> predicate, Zeros zeros)
Returns true if at least one element satisfies a predicate.
Zero elements may be skipped on sparse data structures if allowed (default).
bool Exists2<TOther>(Func<Complex, TOther, bool> predicate, Matrix<T> other, Zeros zeros)
Returns true if at least one element pairs of two matrices of the same size satisfies a predicate.
Zero elements may be skipped on sparse data structures if allowed (default).
Tuple<int, int, Complex> Find(Func<Complex, bool> predicate, Zeros zeros)
Returns a tuple with the index and value of the first element satisfying a predicate, or null if none is found.
Zero elements may be skipped on sparse data structures if allowed (default).
Tuple<int, int, Complex, TOther> Find2<TOther>(Func<Complex, TOther, bool> predicate, Matrix<T> other, Zeros zeros)
Returns a tuple with the index and values of the first element pair of two matrices of the same size satisfying a predicate, or null if none is found.
Zero elements may be skipped on sparse data structures if allowed (default).
TState Fold2<TOther, TState>(Func<TState, Complex, TOther, TState> f, TState state, Matrix<T> other, Zeros zeros)
Applies a function to update the status with each value pair of two matrices and returns the resulting status.
TU[] FoldByColumn<TU>(Func<TU, Complex, TU> f, TU state, Zeros zeros)
For each column, applies a function f to each element of the column, threading an accumulator argument through the computation.
Returns an array with the resulting accumulator states for each column.
TU[] FoldByRow<TU>(Func<TU, Complex, TU> f, TU state, Zeros zeros)
For each row, applies a function f to each element of the row, threading an accumulator argument through the computation.
Returns an array with the resulting accumulator states for each row.
Vector<T> FoldColumns<TU>(Func<Vector<TU>, Vector<Complex>, Vector<TU>> f, Vector<T> state)
Applies a function f to each column vector, threading an accumulator vector argument through the computation.
Returns the resulting accumulator vector.
Vector<T> FoldRows<TU>(Func<Vector<TU>, Vector<Complex>, Vector<TU>> f, Vector<T> state)
Applies a function f to each row vector, threading an accumulator vector argument through the computation.
Returns the resulting accumulator vector.
bool ForAll(Func<Complex, bool> predicate, Zeros zeros)
Returns true if all elements satisfy a predicate.
Zero elements may be skipped on sparse data structures if allowed (default).
bool ForAll2<TOther>(Func<Complex, TOther, bool> predicate, Matrix<T> other, Zeros zeros)
Returns true if all element pairs of two matrices of the same size satisfy a predicate.
Zero elements may be skipped on sparse data structures if allowed (default).
double FrobeniusNorm()
Calculates the entry-wise Frobenius norm of this matrix.
Return
double
The square root of the sum of the squared values.
int GetHashCode()
Returns a hash code for this instance.
Return
int
A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.
double InfinityNorm()
Calculates the induced infinity norm of this matrix.
Return
double
The maximum absolute row sum of the matrix.
Matrix<T> InsertColumn(int columnIndex, Vector<T> column)
Creates a new matrix and inserts the given column at the given index.
Parameters
int
columnIndex
Return
A new matrix with the inserted column.
Creates a new matrix and inserts the given row at the given index.
Return
A new matrix with the inserted column.
Computes the inverse of this matrix.
Return
The inverse of this matrix.
bool IsHermitian()
Evaluates whether this matrix is Hermitian (conjugate symmetric).
bool IsSymmetric()
Evaluates whether this matrix is symmetric.
Vector`1[] Kernel()
Computes an orthonormal basis for the null space of this matrix,
also known as the kernel of the corresponding matrix transformation.
void KroneckerProduct(Matrix<T> other, Matrix<T> result)
Computes the Kronecker product of this matrix with the given matrix. The new matrix is M-by-N
with M = this.Rows * lower.Rows and N = this.Columns * lower.Columns.
Computes the Kronecker product of this matrix with the given matrix. The new matrix is M-by-N
with M = this.Rows * lower.Rows and N = this.Columns * lower.Columns.
Return
The Kronecker product of the two matrices.
double L1Norm()
Calculates the induced L1 norm of this matrix.
Return
double
The maximum absolute column sum of the matrix.
double L2Norm()
Calculates the induced L2 norm of the matrix.
Return
double
The largest singular value of the matrix.
Left multiply a matrix with a vector ( = vector * matrix ).
Return
The result of the multiplication.
void LeftMultiply(Vector<T> leftSide, Vector<T> result)
Left multiply a matrix with a vector ( = vector * matrix ) and place the result in the result vector.
void LowerTriangle(Matrix<T> result)
Puts the lower triangle of this matrix into the result matrix.
Returns a new matrix containing the lower triangle of this matrix.
Return
The lower triangle of this matrix.
void Map(Func<Complex, Complex> f, Matrix<T> result, Zeros zeros)
Applies a function to each value of this matrix and replaces the value in the result matrix.
If forceMapZero is not set to true, zero values may or may not be skipped depending
on the actual data storage implementation (relevant mostly for sparse matrices).
Matrix<T> Map<TU>(Func<Complex, TU> f, Zeros zeros)
Applies a function to each value of this matrix and returns the results as a new matrix.
If forceMapZero is not set to true, zero values may or may not be skipped depending
on the actual data storage implementation (relevant mostly for sparse matrices).
Matrix<T> Map2(Func<Complex, Complex, Complex> f, Matrix<T> other, Zeros zeros)
Applies a function to each value pair of two matrices and returns the results as a new vector.
void Map2(Func<Complex, Complex, Complex> f, Matrix<T> other, Matrix<T> result, Zeros zeros)
Applies a function to each value pair of two matrices and replaces the value in the result vector.
void MapConvert<TU>(Func<Complex, TU> f, Matrix<T> result, Zeros zeros)
Applies a function to each value of this matrix and replaces the value in the result matrix.
If forceMapZero is not set to true, zero values may or may not be skipped depending
on the actual data storage implementation (relevant mostly for sparse matrices).
void MapIndexed(Func<int, int, Complex, Complex> f, Matrix<T> result, Zeros zeros)
Applies a function to each value of this matrix and replaces the value in the result matrix.
The index of each value (zero-based) is passed as first argument to the function.
If forceMapZero is not set to true, zero values may or may not be skipped depending
on the actual data storage implementation (relevant mostly for sparse matrices).
Matrix<T> MapIndexed<TU>(Func<int, int, Complex, TU> f, Zeros zeros)
Applies a function to each value of this matrix and returns the results as a new matrix.
The index of each value (zero-based) is passed as first argument to the function.
If forceMapZero is not set to true, zero values may or may not be skipped depending
on the actual data storage implementation (relevant mostly for sparse matrices).
void MapIndexedConvert<TU>(Func<int, int, Complex, TU> f, Matrix<T> result, Zeros zeros)
Applies a function to each value of this matrix and replaces the value in the result matrix.
The index of each value (zero-based) is passed as first argument to the function.
If forceMapZero is not set to true, zero values may or may not be skipped depending
on the actual data storage implementation (relevant mostly for sparse matrices).
void MapIndexedInplace(Func<int, int, Complex, Complex> f, Zeros zeros)
Applies a function to each value of this matrix and replaces the value with its result.
The row and column indices of each value (zero-based) are passed as first arguments to the function.
If forceMapZero is not set to true, zero values may or may not be skipped depending
on the actual data storage implementation (relevant mostly for sparse matrices).
void MapInplace(Func<Complex, Complex> f, Zeros zeros)
Applies a function to each value of this matrix and replaces the value with its result.
If forceMapZero is not set to true, zero values may or may not be skipped depending
on the actual data storage implementation (relevant mostly for sparse matrices).
void Modulus(Complex divisor, Matrix<T> result)
void ModulusByThis(Complex dividend, Matrix<T> result)
Multiplies this matrix by a vector and returns the result.
Return
The result of the multiplication.
Multiplies this matrix with another matrix and returns the result.
Return
The result of the multiplication.
Multiplies this matrix with a vector and places the results into the result vector.
Multiplies this matrix with another matrix and places the results into the result matrix.
void Multiply(Complex scalar, Matrix<T> result)
void Negate(Matrix<T> result)
Negate each element of this matrix and place the results into the result matrix.
Negate each element of this matrix.
Return
A matrix containing the negated values.
Matrix<T> NormalizeColumns(double norm)
Normalizes all column vectors to a unit p-norm.
Typical values for p are 1.0 (L1, Manhattan norm), 2.0 (L2, Euclidean norm) and positive infinity (infinity norm)
Matrix<T> NormalizeRows(double norm)
Normalizes all row vectors to a unit p-norm.
Typical values for p are 1.0 (L1, Manhattan norm), 2.0 (L2, Euclidean norm) and positive infinity (infinity norm)
int Nullity()
Calculates the nullity of the matrix.
Return
int
effective numerical nullity, obtained from SVD
void PermuteColumns(Permutation p)
Permute the columns of a matrix according to a permutation.
Permute the rows of a matrix according to a permutation.
Pointwise applies the abs function to each value
void PointwiseAbs(Matrix<T> result)
Pointwise applies the abs function to each value
void PointwiseAbsoluteMaximum(Matrix<T> other, Matrix<T> result)
Pointwise applies the absolute maximum with the values of another matrix to each value.
Pointwise applies the absolute maximum with the values of another matrix to each value.
Matrix<T> PointwiseAbsoluteMaximum(Complex scalar)
void PointwiseAbsoluteMaximum(Complex scalar, Matrix<T> result)
Matrix<T> PointwiseAbsoluteMinimum(Complex scalar)
void PointwiseAbsoluteMinimum(Complex scalar, Matrix<T> result)
Pointwise applies the absolute minimum with the values of another matrix to each value.
void PointwiseAbsoluteMinimum(Matrix<T> other, Matrix<T> result)
Pointwise applies the absolute minimum with the values of another matrix to each value.
Pointwise applies the acos function to each value
void PointwiseAcos(Matrix<T> result)
Pointwise applies the acos function to each value
Pointwise applies the asin function to each value
void PointwiseAsin(Matrix<T> result)
Pointwise applies the asin function to each value
Pointwise applies the atan function to each value
void PointwiseAtan(Matrix<T> result)
Pointwise applies the atan function to each value
Pointwise applies the atan2 function to each value of the current
matrix and a given other matrix being the 'x' of atan2 and the
'this' matrix being the 'y'
Pointwise applies the atan2 function to each value of the current
matrix and a given other matrix being the 'x' of atan2 and the
'this' matrix being the 'y'
void PointwiseCeiling(Matrix<T> result)
Pointwise applies the ceiling function to each value
Matrix<T> PointwiseCeiling()
Pointwise applies the ceiling function to each value
void PointwiseCos(Matrix<T> result)
Pointwise applies the cos function to each value
Pointwise applies the cos function to each value
void PointwiseCosh(Matrix<T> result)
Pointwise applies the cosh function to each value
Pointwise applies the cosh function to each value
void PointwiseDivide(Matrix<T> divisor, Matrix<T> result)
Pointwise divide this matrix by another matrix and stores the result into the result matrix.
Pointwise divide this matrix by another matrix.
Return
A new matrix that is the pointwise division of this matrix and divisor.
void PointwiseExp(Matrix<T> result)
Pointwise applies the exponent function to each value.
Pointwise applies the exponent function to each value.
Pointwise applies the floor function to each value
void PointwiseFloor(Matrix<T> result)
Pointwise applies the floor function to each value
Pointwise applies the natural logarithm function to each value.
void PointwiseLog(Matrix<T> result)
Pointwise applies the natural logarithm function to each value.
void PointwiseLog10(Matrix<T> result)
Pointwise applies the log10 function to each value
Pointwise applies the log10 function to each value
void PointwiseMaximum(Matrix<T> other, Matrix<T> result)
Pointwise applies the maximum with the values of another matrix to each value.
Pointwise applies the maximum with the values of another matrix to each value.
void PointwiseMaximum(Complex scalar, Matrix<T> result)
void PointwiseMinimum(Complex scalar, Matrix<T> result)
Pointwise applies the minimum with the values of another matrix to each value.
void PointwiseMinimum(Matrix<T> other, Matrix<T> result)
Pointwise applies the minimum with the values of another matrix to each value.
Pointwise canonical modulus, where the result has the sign of the divisor,
of this matrix by another matrix.
void PointwiseModulus(Matrix<T> divisor, Matrix<T> result)
Pointwise canonical modulus, where the result has the sign of the divisor,
of this matrix by another matrix and stores the result into the result matrix.
Pointwise multiplies this matrix with another matrix.
Return
A new matrix that is the pointwise multiplication of this matrix and other.
void PointwiseMultiply(Matrix<T> other, Matrix<T> result)
Pointwise multiplies this matrix with another matrix and stores the result into the result matrix.
void PointwisePower(Complex exponent, Matrix<T> result)
void PointwisePower(Matrix<T> exponent, Matrix<T> result)
Pointwise raise this matrix to an exponent.
Pointwise raise this matrix to an exponent and store the result into the result matrix.
void PointwiseRemainder(Matrix<T> divisor, Matrix<T> result)
Pointwise remainder (% operator), where the result has the sign of the dividend,
of this matrix by another matrix and stores the result into the result matrix.
Pointwise remainder (% operator), where the result has the sign of the dividend,
of this matrix by another matrix.
Pointwise applies the round function to each value
void PointwiseRound(Matrix<T> result)
Pointwise applies the round function to each value
Pointwise applies the sign function to each value
void PointwiseSign(Matrix<T> result)
Pointwise applies the sign function to each value
Pointwise applies the sin function to each value
void PointwiseSin(Matrix<T> result)
Pointwise applies the sin function to each value
Pointwise applies the sinh function to each value
void PointwiseSinh(Matrix<T> result)
Pointwise applies the sinh function to each value
void PointwiseSqrt(Matrix<T> result)
Pointwise applies the sqrt function to each value
Pointwise applies the sqrt function to each value
Pointwise applies the tan function to each value
void PointwiseTan(Matrix<T> result)
Pointwise applies the tan function to each value
Pointwise applies the tanh function to each value
void PointwiseTanh(Matrix<T> result)
Pointwise applies the tanh function to each value
Matrix<T> Power(int exponent)
Multiplies this square matrix with another matrix and returns the result.
Parameters
int
exponent
void Power(int exponent, Matrix<T> result)
Raises this square matrix to a positive integer exponent and places the results into the result matrix.
Computes the Moore-Penrose Pseudo-Inverse of this matrix.
Vector`1[] Range()
Computes an orthonormal basis for the column space of this matrix,
also known as the range or image of the corresponding matrix transformation.
int Rank()
Calculates the rank of the matrix.
Return
int
effective numerical rank, obtained from SVD
Vector<T> ReduceColumns(Func<Vector<Complex>, Vector<Complex>, Vector<Complex>> f)
Reduces all column vectors by applying a function between two of them, until only a single vector is left.
Vector<T> ReduceRows(Func<Vector<Complex>, Vector<Complex>, Vector<Complex>> f)
Reduces all row vectors by applying a function between two of them, until only a single vector is left.
void Remainder(Complex divisor, Matrix<T> result)
Matrix<T> Remainder(Complex divisor)
Matrix<T> RemainderByThis(Complex dividend)
void RemainderByThis(Complex dividend, Matrix<T> result)
Matrix<T> RemoveColumn(int columnIndex)
Creates a new matrix with the given column removed.
Parameters
int
columnIndex
Return
A new matrix without the chosen column.
Matrix<T> RemoveRow(int rowIndex)
Creates a new matrix with the given row removed.
Parameters
int
rowIndex
Return
A new matrix without the chosen row.
Matrix<T> Resize(int rowCount, int columnCount)
Creates a new matrix with the desired size and copies this matrix to it.
Values which no longer exist in the new matrix are ignored, new values are set to zero.
Parameters
int
rowCount
int
columnCount
Return
A new matrix with the desired rows and columns.
void Row(int index, Vector<T> result)
Copies a row into to the given Vector.
Vector<T> Row(int rowIndex, int columnIndex, int length)
Copies the requested row elements into a new Vector.
Parameters
int
rowIndex
int
columnIndex
int
length
Return
A Vector containing the requested elements.
void Row(int rowIndex, int columnIndex, int length, Vector<T> result)
Copies the requested row elements into a new Vector.
Parameters
int
rowIndex
int
columnIndex
int
length
Copies a row into an Vector.
Parameters
int
index
Return
A Vector containing the copied elements.
Calculates the absolute value sum of each row vector.
Vector<T> RowNorms(double norm)
Calculates the p-norms of all row vectors.
Typical values for p are 1.0 (L1, Manhattan norm), 2.0 (L2, Euclidean norm) and positive infinity (infinity norm)
Calculates the value sum of each row vector.
void SetColumn(int columnIndex, Vector<T> column)
Copies the values of the given Vector to the specified column.
Parameters
int
columnIndex
void SetColumn(int columnIndex, int rowIndex, int length, Vector<T> column)
Copies the values of the given Vector to the specified sub-column.
Parameters
int
columnIndex
int
rowIndex
int
length
void SetColumn(int columnIndex, Complex[] column)
void SetDiagonal(Complex[] source)
void SetDiagonal(Vector<T> source)
Copies the values of the given Vector to the diagonal.
void SetRow(int rowIndex, Vector<T> row)
Copies the values of the given Vector to the specified row.
void SetRow(int rowIndex, int columnIndex, int length, Vector<T> row)
Copies the values of the given Vector to the specified sub-row.
Parameters
int
rowIndex
int
columnIndex
int
length
void SetRow(int rowIndex, Complex[] row)
void SetSubMatrix(int rowIndex, int sorceRowIndex, int rowCount, int columnIndex, int sourceColumnIndex, int columnCount, Matrix<T> subMatrix)
Copies the values of a given matrix into a region in this matrix.
Parameters
int
rowIndex
int
sorceRowIndex
int
rowCount
int
columnIndex
int
sourceColumnIndex
int
columnCount
void SetSubMatrix(int rowIndex, int rowCount, int columnIndex, int columnCount, Matrix<T> subMatrix)
Copies the values of a given matrix into a region in this matrix.
Parameters
int
rowIndex
int
rowCount
int
columnIndex
int
columnCount
void SetSubMatrix(int rowIndex, int columnIndex, Matrix<T> subMatrix)
Copies the values of a given matrix into a region in this matrix.
Parameters
int
rowIndex
int
columnIndex
Solves a system of linear equations, , with A QR factorized.
Solves a system of linear equations, , with A QR factorized.
Solves a system of linear equations, , with A QR factorized.
Solves a system of linear equations, , with A QR factorized.
Solves the matrix equation Ax = b, where A is the coefficient matrix (this matrix), b is the solution vector and x is the unknown vector.
Return
The result vector x
.
Solves the matrix equation AX = B, where A is the coefficient matrix (this matrix), B is the solution matrix and X is the unknown matrix.
Return
The result matrix X
.
Stacks this matrix on top of the given matrix and places the result into the result matrix.
Stacks this matrix on top of the given matrix and places the result into the result matrix.
Return
The combined matrix.
void StrictlyLowerTriangle(Matrix<T> result)
Puts the strictly lower triangle of this matrix into the result matrix.
Matrix<T> StrictlyLowerTriangle()
Returns a new matrix containing the lower triangle of this matrix. The new matrix
does not contain the diagonal elements of this matrix.
Return
The lower triangle of this matrix.
Matrix<T> StrictlyUpperTriangle()
Returns a new matrix containing the upper triangle of this matrix. The new matrix
does not contain the diagonal elements of this matrix.
Return
The upper triangle of this matrix.
void StrictlyUpperTriangle(Matrix<T> result)
Puts the strictly upper triangle of this matrix into the result matrix.
Matrix<T> SubMatrix(int rowIndex, int rowCount, int columnIndex, int columnCount)
Creates a matrix that contains the values from the requested sub-matrix.
Parameters
int
rowIndex
int
rowCount
int
columnIndex
int
columnCount
Return
The requested sub-matrix.
Subtracts another matrix from this matrix.
void Subtract(Complex scalar, Matrix<T> result)
Subtracts another matrix from this matrix.
Return
The result of the subtraction.
void SubtractFrom(Complex scalar, Matrix<T> result)
Svd<T> Svd(bool computeVectors)
Complex[,] ToArray()
Returns this matrix as a multidimensional array.
The returned array will be independent from this matrix.
A new memory block will be allocated for the array.
Return
Complex[,]
A multidimensional containing the values of this matrix.
Complex[][] ToColumnArrays()
Returns this matrix as array of column arrays.
The returned arrays will be independent from this matrix.
A new memory block will be allocated for the arrays.
Complex[] ToColumnMajorArray()
Returns the matrix's elements as an array with the data laid out column by column (column major).
The returned array will be independent from this matrix.
A new memory block will be allocated for the array.
Return
Complex[]
An array containing the matrix's elements.
string ToMatrixString(string format, IFormatProvider provider)
Returns a string that summarizes the content of this matrix.
string ToMatrixString(int upperRows, int lowerRows, int leftColumns, int rightColumns, string horizontalEllipsis, string verticalEllipsis, string diagonalEllipsis, string columnSeparator, string rowSeparator, Func<Complex, string> formatValue)
string ToMatrixString(int upperRows, int lowerRows, int minLeftColumns, int rightColumns, int maxWidth, string horizontalEllipsis, string verticalEllipsis, string diagonalEllipsis, string columnSeparator, string rowSeparator, Func<Complex, string> formatValue)
string ToMatrixString(int maxRows, int maxColumns, string format, IFormatProvider provider)
Returns a string that summarizes the content of this matrix.
String[,] ToMatrixStringArray(int upperRows, int lowerRows, int minLeftColumns, int rightColumns, int maxWidth, int padding, string horizontalEllipsis, string verticalEllipsis, string diagonalEllipsis, Func<Complex, string> formatValue)
Returns a string 2D array that summarizes the content of this matrix.
String[,] ToMatrixStringArray(int upperRows, int lowerRows, int leftColumns, int rightColumns, string horizontalEllipsis, string verticalEllipsis, string diagonalEllipsis, Func<Complex, string> formatValue)
Returns a string 2D array that summarizes the content of this matrix.
Complex[][] ToRowArrays()
Returns this matrix as array of row arrays.
The returned arrays will be independent from this matrix.
A new memory block will be allocated for the arrays.
Complex[] ToRowMajorArray()
Returns the matrix's elements as an array with the data laid row by row (row major).
The returned array will be independent from this matrix.
A new memory block will be allocated for the array.
Return
Complex[]
An array containing the matrix's elements.
string ToString(string format, IFormatProvider formatProvider)
Returns a string that summarizes this matrix.
The maximum number of cells can be configured in the
Control class.
The format string is ignored.
string ToString()
Returns a string that summarizes this matrix.
The maximum number of cells can be configured in the
Control class.
string ToString(int maxRows, int maxColumns, string format, IFormatProvider formatProvider)
Returns a string that summarizes this matrix.
string ToTypeString()
Returns a string that describes the type, dimensions and shape of this matrix.
Complex Trace()
Computes the trace of this matrix.
Return
Complex
The trace of this matrix
Returns the transpose of this matrix.
Return
The transpose of this matrix.
void Transpose(Matrix<T> result)
Puts the transpose of this matrix into the result matrix.
void TransposeAndMultiply(Matrix<T> other, Matrix<T> result)
Multiplies this matrix with transpose of another matrix and places the results into the result matrix.
Multiplies this matrix with transpose of another matrix and returns the result.
Return
The result of the multiplication.
void TransposeThisAndMultiply(Matrix<T> other, Matrix<T> result)
Multiplies the transpose of this matrix with another matrix and places the results into the result matrix.
void TransposeThisAndMultiply(Vector<T> rightSide, Vector<T> result)
Multiplies the transpose of this matrix with a vector and places the results into the result vector.
Vector<T> TransposeThisAndMultiply(Vector<T> rightSide)
Multiplies the transpose of this matrix by a vector and returns the result.
Return
The result of the multiplication.
Multiplies the transpose of this matrix with another matrix and returns the result.
Return
The result of the multiplication.
Solves the matrix equation Ax = b, where A is the coefficient matrix (this matrix), b is the solution vector and x is the unknown vector.
Solves the matrix equation AX = B, where A is the coefficient matrix (this matrix), B is the solution matrix and X is the unknown matrix.
Returns a new matrix containing the upper triangle of this matrix.
Return
The upper triangle of this matrix.
void UpperTriangle(Matrix<T> result)
Puts the upper triangle of this matrix into the result matrix.
Public Properties
Complex[] Values get;
Gets the matrix's data.
Value: