DenseMatrix Class | Extreme Optimization Numerical Libraries for .NET Professional |

Extreme.Mathematics.LinearAlgebra

Extreme.Mathematics

Extreme.Mathematics.LinearAlgebra

**Namespace:**Extreme.Mathematics.LinearAlgebra

**Assembly:**Extreme.Numerics.Net40 (in Extreme.Numerics.Net40.dll) Version: 6.0.16073.0 (6.0.16312.0)

[SerializableAttribute] public class DenseMatrix : Matrix, IDoubleStorage, ICloneable, ISerializable, IResizableMatrix

The DenseMatrix type exposes the following members.

Name | Description | |
---|---|---|

AbsoluteMax |
Returns the value of the component in this
matrix that has the largest absolute
value.
(Inherited from Matrix.) | |

AbsoluteMin |
Returns the value of the component in this
matrix that has the smallest absolute
value.
(Inherited from Matrix.) | |

Add(Double) | Obsolete.
Adds a constant to a matrix and returns the result.
(Inherited from Matrix.) | |

Add(Matrix) |
Adds a Matrix to this
DenseMatrix.
| |

Add(Double, Matrix) |
Adds a multiple of a Matrix to this
DenseMatrix.
| |

Add(DenseMatrix, DenseMatrix) |
Adds two dense matrix objects and returns the result.
| |

Add(DenseMatrix, Double, DenseMatrix, DenseMatrix) |
Adds two DenseMatrix objects and stores the
result in a third DenseMatrix.
| |

Add(TransposeOperation, TransposeOperation, Double, Matrix) | (Inherited from Matrix.) | |

AddInPlace |
Adds a constant to a matrix.
(Inherited from Matrix.) | |

AddOuterProduct(Vector) |
Updates a matrix with the outer product of a
vector and itself.
| |

AddOuterProduct(Double, Vector) |
Updates a matrix with the scaled outer product of
a vector and itself.
| |

AddOuterProduct(Double, Vector, Vector) |
Updates a matrix with the scaled outer product of two vectors.
| |

AddProduct(DenseMatrix, DenseMatrix) |
Adds the product of two DenseMatrix objects
to this DenseMatrix.
| |

AddProduct(Double, DenseMatrix, DenseMatrix) |
Adds a multiple of the product of two DenseMatrix object
to this DenseMatrix.
| |

AddProductToVector | (Overrides Matrix | |

Apply(Func |
Applies a function to the elements of a matrix.
(Inherited from Matrix.) | |

ApplyInPlace(Func |
Applies a function to the elements of a matrix.
(Inherited from Matrix.) | |

ApplyInPlace(Matrix, Func |
Applies the specified function to each element in a matrix.
(Inherited from Matrix.) | |

ApplyToColumns(Func |
Applies a function to each column in a matrix and returns the result as a vector.
(Inherited from Matrix.) | |

ApplyToColumns(Func |
Applies a function to each column in a matrix and returns the result as a vector.
(Inherited from Matrix.) | |

ApplyToRows(Func |
Applies a function to each column in a matrix and returns the result as a vector.
(Inherited from Matrix.) | |

ApplyToRows(Func |
Applies a function to each column in a matrix and returns the result as a vector.
(Inherited from Matrix.) | |

AsDenseMatrix |
Returns this matrix as a dense matrix.
(Inherited from Matrix.) | |

AsGeneralMatrix | Obsolete.
Returns this matrix as a dense matrix.
(Inherited from Matrix.) | |

Clone |
Constructs a deep copy of this matrix.
(Inherited from Matrix.) | |

Clone(CloningMethod) |
Makes a copy of this vector using the specified
method.
(Inherited from Matrix.) | |

CloneData |
Gives this instance its own copy of its elements.
(Overrides Matrix | |

CloneData(MatrixElementOrder) |
Gives this instance its own copy of its elements.
| |

CloneShape |
Creates a new matrix that has the same number of rows and columns
and optionally preserves the writable structure.
(Inherited from Matrix.) | |

ComponentwiseDivide(Matrix) | Obsolete.
Divides the components of this instance by the corresponding
components of another matrix.
(Inherited from Matrix.) | |

ComponentwiseMultiply(Matrix) | Obsolete.
Multiplies the components of this instance by the corresponding
components of another matrix.
(Inherited from Matrix.) | |

CopyTo(Matrix) |
Copies the components of this matrix
to another matrix.
(Inherited from Matrix.) | |

CopyTo(Matrix, TransposeOperation) |
Copies the components of this matrix
to another matrix.
(Inherited from Matrix.) | |

ElementwiseDivideInPlace |
Divides the components of this instance by the corresponding
components of another matrix.
(Inherited from Matrix.) | |

ElementwiseMultiplyInPlace(Matrix) |
Multiplies the components of this instance by the corresponding
components of another matrix.
(Inherited from Matrix.) | |

Equals(Object) | (Inherited from Matrix.) | |

Equals(Matrix) | (Inherited from Matrix.) | |

Equals(Object, IEqualityComparer) |
Returns whether an object is structurally equal to this instance.
(Inherited from Matrix.) | |

EstimateConditionNumber |
Calculates an estimate for the condition
number of this matrix.
(Inherited from Matrix.) | |

Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) | |

FrobeniusNorm |
Returns the Frobenius norm of this matrix.
(Inherited from Matrix.) | |

GetCholeskyDecomposition |
Returns the Cholesky decomposition of the matrix.
(Inherited from Matrix.) | |

GetCholeskyDecomposition(Boolean) |
Returns the Cholesky decomposition of the matrix.
(Overrides Matrix | |

GetColumn(Int32) |
Returns a column vector for this instance
that points at the specified column.
(Inherited from Matrix.) | |

GetColumn(Int32, Range) |
Returns a column vector for this instance
starting at the specified column and row and of the
specified length.
(Inherited from Matrix.) | |

GetColumn(Int32, Int32, Int32) |
Returns a column vector for this instance
starting at the specified column and row and of the
specified length.
(Inherited from Matrix.) | |

GetColumn(Int32, Int32, Int32, Int32) |
Returns a column vector for this instance
starting at the specified column and row and of the
specified length.
(Inherited from Matrix.) | |

GetColumn(Int32, Int32, Int32, Int32, Intent) | ||

GetColumnEnumerator | Obsolete.
Gets an IEnumerator than can be used to enumerate
the columns of this DenseMatrix.
(Overrides Matrix | |

GetColumnEnumerator(Intent) | Obsolete.
Gets an IEnumerator than can be used to enumerate
the columns of this DenseMatrix.
(Overrides Matrix | |

GetColumnSums |
Returns the sums of the elements of each column of the matrix.
(Inherited from Matrix.) | |

GetComponents | Obsolete.
Gets the components of the vector.
(Inherited from Matrix.) | |

GetComponents(MatrixElementOrder) | Obsolete.
Gets the components of the vector.
(Inherited from Matrix.) | |

GetConditionNumber |
Calculates the condition
number of this matrix.
(Inherited from Matrix.) | |

GetDeterminant |
Calculates the determinant of this matrix.
(Inherited from Matrix.) | |

GetDiagonal |
Gets a vector view of the diagonal elements
of this instance.
(Inherited from Matrix.) | |

GetDiagonal(Int32) |
Gets a vector view of the specified diagonal
of this instance.
(Inherited from Matrix.) | |

GetDiagonal(Int32, Intent) |
Gets a vector view of the specified diagonal
of this instance.
(Overrides Matrix | |

GetEigenvalueDecomposition |
Returns the eigenvalue decomposition for this matrix.
(Inherited from Matrix.) | |

GetEigenvalueDecomposition(Boolean) |
Returns the eigenvalue decomposition for this matrix.
(Overrides Matrix | |

GetExponential |
Computes the matrix exponential of a square matrix.
(Inherited from Matrix.) | |

GetHashCode |
Returns the hash code for this instance.
(Inherited from Matrix.) | |

GetHashCode(IEqualityComparer) |
Returns a hash code for this instance.
(Inherited from Matrix.) | |

GetIdentity |
Returns an identity matrix of the specified dimension.
| |

GetInverse |
Calculates the inverse matrix..
(Inherited from LinearOperator.) | |

GetInverse(Boolean) |
Calculates the inverse of this matrix.
(Inherited from Matrix.) | |

GetLUDecomposition |
Returns the LU decomposition of the matrix.
(Inherited from Matrix.) | |

GetLUDecomposition(Boolean) |
Returns the LU decomposition of the matrix.
(Overrides Matrix | |

GetObjectData |
Populates a SerializationInfo with the values
needed to serialize the target object.
(Overrides Matrix | |

GetParallelColumnEnumerator | Obsolete.
Returns a Partitioner (Overrides Matrix | |

GetParallelRowEnumerator | Obsolete.
Returns a Partitioner (Overrides Matrix | |

GetPseudoInverse |
Calculates the Moore-Penrose pseudo-inverse of this matrix.
(Inherited from Matrix.) | |

GetQRDecomposition |
Returns the QR decomposition of the matrix.
(Inherited from Matrix.) | |

GetQRDecomposition(Boolean) |
Returns the QR decomposition of the matrix.
(Overrides Matrix | |

GetRow(Int32) |
Returns a row vector for this instance
that points at the specified row.
(Inherited from Matrix.) | |

GetRow(Int32, Range) |
Returns a row vector for this instance
starting at the specified row and column and of the
specified length.
(Inherited from Matrix.) | |

GetRow(Int32, Int32, Int32) |
Returns a row vector for this instance
over the specified range.
(Inherited from Matrix.) | |

GetRow(Int32, Int32, Int32, Int32) |
Returns a row vector for this instance
starting at the specified row and column and of the
specified length.
(Inherited from Matrix.) | |

GetRow(Int32, Int32, Int32, Int32, Intent) |
Returns a row vector for this instance
starting at the specified row and column and of the
specified length.
(Overrides Matrix | |

GetRowEnumerator | Obsolete.
Constructs an IEnumerator object that can be used
to enumerate the rows of this DenseMatrix.
(Overrides Matrix | |

GetRowEnumerator(Intent) | Obsolete.
Constructs an IEnumerator object that can be used
to enumerate the rows of this DenseMatrix.
(Overrides Matrix | |

GetRowSums |
Returns the sums of the elements of each row of the matrix.
(Inherited from Matrix.) | |

GetSingularValueDecomposition |
Returns the singular value decomposition of the matrix.
(Inherited from Matrix.) | |

GetSingularValueDecomposition(SingularValueDecompositionFactors) |
Returns the singular value decomposition of the matrix.
(Inherited from Matrix.) | |

GetSingularValueDecomposition(SingularValueDecompositionFactors, Boolean) |
Returns the singular value decomposition of the matrix.
(Overrides Matrix | |

GetSingularValues |
Gets a vector containing the singular values of the matrix.
(Inherited from Matrix.) | |

GetSubmatrix(Range, Range) | (Inherited from Matrix.) | |

GetSubmatrix(Range, Range, TransposeOperation) | (Inherited from Matrix.) | |

GetSubmatrix(Int32, Int32, Int32, Int32) | (Inherited from Matrix.) | |

GetSubmatrix(Int32, Int32, Int32, Int32, Int32, Int32, TransposeOperation) |
Gets a dense matrix that is a submatrix of
this matrix.
(Overrides Matrix | |

GetSymmetricIndefiniteDecomposition |
Returns the symmetric indefinite (Bunch-Kaufman) decomposition of the matrix.
(Inherited from Matrix.) | |

GetSymmetricIndefiniteDecomposition(Boolean) |
Returns the symmetric indefinite (Bunch-Kaufman) decomposition of the matrix.
(Inherited from Matrix.) | |

GetType | Gets the Type of the current instance. (Inherited from Object.) | |

GetValue |
Gets the matrix component at the specified position.
(Overrides Matrix | |

InfinityNorm |
Returns the infinity norm of this matrix.
(Inherited from Matrix.) | |

IsComponentWritable | Obsolete.
Returns whether the value of the component at
the specified row and column can be changed.
(Inherited from Matrix.) | |

IsElementWritable |
Gets a value indicating whether the value of the component at
the specified row and column can be changed.
(Overrides Matrix | |

IsSingular |
Gets a value indicating whether this matrix is singular.
(Inherited from Matrix.) | |

Max |
Returns the value of the largest component in this
matrix.
(Inherited from Matrix.) | |

MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |

Min |
Returns the value of the smallest component in this
matrix.
(Inherited from Matrix.) | |

Multiply(Double) |
Multiplies this matrix by a scalar factor.
(Overrides Matrix | |

Multiply(Matrix) |
Multiplies this DenseMatrix on the right by a square
Matrix.
| |

Multiply(Vector) | Applies the matrix to a vector. (Inherited from Matrix.) | |

Multiply(DenseMatrix, DenseMatrix) |
Multiplies two matrix objects.
| |

Multiply(DenseMatrix, DenseMatrix, DenseMatrix) |
Multiplies two DenseMatrix objects and stores
the result in a third DenseMatrix.
| |

Multiply(MatrixOperationSide, TransposeOperation, TransposeOperation, Matrix) |
Multiplies this matrix by another matrix and returns
the result.
(Overrides Matrix | |

MultiplyByTranspose |
Multiplies this DenseMatrix by its
Transpose | |

MultiplyTranspose(Matrix) | Applies the transpose of the matrix to a matrix. (Inherited from Matrix.) | |

MultiplyTranspose(Vector) | Applies the transpose of the matrix to a vector. (Inherited from Matrix.) | |

NormInternal |
Calculates a matrix norm.
(Overrides Matrix | |

OneNorm |
Returns the 1-norm of this matrix.
(Inherited from Matrix.) | |

PermuteColumns |
Permutes the columns of the matrix using the specified Permutation.
(Inherited from Matrix.) | |

PermuteRows |
Permutes the rows of the matrix using the specified Permutation.
(Inherited from Matrix.) | |

PermuteRowsAndColumns(Permutation) |
Permutes the rows and columns of the matrix using the specified Permutation.
(Inherited from Matrix.) | |

PermuteRowsAndColumns(Permutation, Permutation) |
Permutes the rows and columns of the matrix using the specified row and column Permutation.
(Inherited from Matrix.) | |

PreMultiply |
Multiplies this DenseMatrix on the left by a
Matrix.
| |

Rank |
Returns the numerical rank of a matrix.
(Inherited from LinearOperator.) | |

Rank(Double) |
Returns the numerical rank of a matrix using the specified tolerance.
(Inherited from Matrix.) | |

Reshape |
Returns a matrix that contains the same elements
listed columnwise.
(Overrides Matrix | |

ReshapeAsVector |
Returns a vector that contains the columnwise matrix elements.
(Overrides Matrix | |

ScaleColumns(Vector) |
Scales the columns of the matrix by the values specified by a vector.
(Inherited from Matrix.) | |

ScaleRows(Vector) |
Scales the rows of the matrix by the values specified by a vector.
(Inherited from Matrix.) | |

SetToZero |
Sets all elements of the matrix to zero.
(Overrides Matrix | |

SetValue(Double) |
Sets all elements of the matrix to the specified value.
(Inherited from Matrix.) | |

SetValue(Double, Int32, Int32) |
Sets the matrix component at the specified position to the specified value.
(Overrides Matrix | |

ShallowCopy |
Makes a shallow copy of this matrix.
(Inherited from Matrix.) | |

Solve(Matrix) |
Solves the system of linear equations for the specified
right-hand side matrix.
(Inherited from LinearOperator.) | |

Solve(Vector) |
Solves the system of linear equations for the specified
right-hand side vector.
(Inherited from LinearOperator.) | |

Solve(DenseMatrix, Boolean) |
Solves the system of simultaneous linear equations for the specified
right-hand side dense matrix and overwrites the
right-hand side with the solution.
(Inherited from Matrix.) | |

Solve(DenseVector, Boolean) |
Solves the system of simultaneous linear equations for the specified
right-hand side vector.
(Inherited from Matrix.) | |

SolveTo(DenseVector, DenseVector) |
Solves the system for the specified right-hand side.
(Inherited from LinearOperator.) | |

SolveTo(Vector, DenseVector) |
Solves the system for the specified right-hand side.
(Inherited from LinearOperator.) | |

SolveTranspose(Matrix) |
Solves the transposed system of linear equations for the specified
right-hand side matrix.
(Inherited from LinearOperator.) | |

SolveTranspose(Vector) |
Solves the system of linear equations for the specified
right-hand side vector.
(Inherited from LinearOperator.) | |

SolveTranspose(DenseMatrix, Boolean) |
Solves the transposed system of linear equations for the specified
right-hand side dense matrix and optionally overwrites the
right-hand side with the solution.
(Inherited from Matrix.) | |

SolveTranspose(DenseVector, Boolean) |
Solves the transposed system of linear equations for the specified
right-hand side dense vector and optionally
overwrites the right-hand side with the solution.
(Inherited from Matrix.) | |

SolveTransposeTo |
Solves the transposed system for the specified right-hand side.
(Inherited from LinearOperator.) | |

Sort |
Sorts the matrix by the specified column.
| |

SortColumns |
Sorts each column of the matrix in ascending order.
(Inherited from Matrix.) | |

SortColumns(SortOrder) |
Sorts each column of the matrix in the specified order.
(Inherited from Matrix.) | |

SortRows |
Sorts each row of the matrix in ascending order.
(Inherited from Matrix.) | |

SortRows(SortOrder) |
Sorts each row of the matrix in the specified order.
(Inherited from Matrix.) | |

Subtract(DenseMatrix, DenseMatrix) |
Subtracts two dense matrix objects.
| |

Subtract(DenseMatrix, DenseMatrix, DenseMatrix) |
Subtracts two DenseMatrix objects and stores the
result in a third DenseMatrix.
| |

SubtractProduct |
Subtracts the product of two DenseMatrix object
to this DenseMatrix.
| |

Summarize |
Returns a summary of the contents of the matrix using the default summary options.
(Inherited from Matrix.) | |

Summarize(SummaryOptions) |
Returns a summary of the contents of the matrix using the specified options.
(Inherited from Matrix.) | |

SwapColumns |
Swaps the elements in the specified columns.
(Overrides Matrix | |

SwapRows |
Swaps the elements in the specified rows.
(Overrides Matrix | |

ToArray |
Gets the elements of the vector.
(Inherited from Matrix.) | |

ToArray(MatrixElementOrder) |
Gets the elements of the vector.
(Overrides Matrix | |

ToDenseMatrix |
Makes a copy of this instance and returns it as a
dense matrix.
(Inherited from Matrix.) | |

ToGeneralMatrix | Obsolete.
Makes a copy of this instance and returns it as a
dense matrix.
(Inherited from Matrix.) | |

ToString | (Inherited from Matrix.) | |

ToString(String) | (Inherited from Matrix.) | |

ToString(String, IFormatProvider) | (Inherited from Matrix.) | |

Trace |
Gets the sum of the diagonal elements of this
matrix.
(Inherited from Matrix.) | |

Transpose |
Returns the transpose of this instance.
(Overrides Matrix | |

TwoNorm |
Returns the two-norm of this matrix.
(Inherited from Matrix.) | |

UnscaleColumns(Vector) |
Scales the columns of the matrix by the inverse of the values specified by a vector.
(Inherited from Matrix.) | |

UnscaleRows(Vector) |
Scales the rows of the matrix by the inverse of the values specified by a vector.
(Inherited from Matrix.) |

Name | Description | |
---|---|---|

AsGenericMatrix |
Converts a non-generic matrix to a generic matrix.
(Defined by MatrixExtensions.) |

A matrix is a two-dimensional array of real numbers. Use the DenseMatrix class to represent general, dense matrices. It is the most general implementation of the Matrix class. No components are assumed to have a specific value, and no relationship is assumed to exist between different components.

The components of a DenseMatrix are stored in a one-dimensional array of Double values. By default, components that are adjacent in a column of the matrix are adjacent in the storage array. The components are said to be stored in column major order. It is also possible to have elements stored in row major order.

The DenseMatrix class implements algorithms using the general matrix BLAS and LAPACK routines. These routines assume matrix components are stored in column major order. However, any necessary conversions are performed transparantly. No additional work is needed. In some cases there might be a small performance penalty.

Because DenseMatrix can represent any matrix, it is often used as the return type of matrix operations.

#### Numerical Libraries

Supported in: 5.x, 4.x#### Reference

Copyright © 2004-2021,
Extreme Optimization. All rights reserved.

*Extreme Optimization,* *Complexity made simple*, *M#*, and *M
Sharp* are trademarks of ExoAnalytics Inc.

*Microsoft*, *Visual C#, Visual Basic, Visual Studio*, *Visual
Studio.NET*, and the *Optimized for Visual Studio* logo

are
registered trademarks of Microsoft Corporation.