IGLib
1.7.2
The IGLib base library EXTENDED - with other lilbraries and applications.
|
Describes the form of all real matrices. More...
Public Member Functions | |
virtual double | OneNorm () |
Computes the 1-norm of the matrix. More... | |
virtual double | InfinityNorm () |
Computes the ∞-norm of the matrix. More... | |
virtual double | FrobeniusNorm () |
Computes the Frobenius-norm of the matrix. More... | |
virtual ColumnVector | Column (int c) |
Gets a copy of the specified column. More... | |
virtual RowVector | Row (int r) |
Gets a copy of the specified row. More... | |
virtual SymmetricMatrix | MultiplySelfByTranspose () |
Computes the product of the matrix and its transpose. More... | |
virtual SymmetricMatrix | MultiplyTransposeBySelf () |
Computes the product of the matrix's transpose and itself. More... | |
bool | Equals (AnyRectangularMatrix other) |
Determines whether the given matrix equals the current matrix. More... | |
override bool | Equals (object obj) |
Determines whether the given object is an equal matrix. More... | |
override int | GetHashCode () |
Not a valid operation. More... | |
![]() | |
virtual void | Fill (Func< int, int, T > f) |
Sets all matrix entries according to a supplied fill function. More... | |
virtual T[,] | ToArray () |
Copies the matrix into an array. More... | |
Static Public Member Functions | |
static RectangularMatrix | operator+ (AnyRectangularMatrix A, AnyRectangularMatrix B) |
Adds any two real, rectangular matrices. More... | |
static RectangularMatrix | operator- (AnyRectangularMatrix A, AnyRectangularMatrix B) |
Subtracts any two real, rectangular matrices. More... | |
static RectangularMatrix | operator* (AnyRectangularMatrix A, AnyRectangularMatrix B) |
Multiplies any two real, rectangular matrices. More... | |
static RectangularMatrix | operator* (double alpha, AnyRectangularMatrix A) |
Multiplies any real, rectangular matrix by a real constant. More... | |
static ColumnVector | operator* (AnyRectangularMatrix A, ColumnVector v) |
Multiplies any real, rectangular matrix with a real column vector. More... | |
static bool | operator== (AnyRectangularMatrix A, AnyRectangularMatrix B) |
Determines whether two matrices are equal. More... | |
static bool | operator!= (AnyRectangularMatrix A, AnyRectangularMatrix B) |
Determines whether two matrices are not equal. More... | |
Protected Member Functions | |
AnyRectangularMatrix () | |
![]() | |
AnyMatrix () | |
Static Private Member Functions | |
static bool | InternalEquals (AnyRectangularMatrix A, AnyRectangularMatrix B) |
Additional Inherited Members | |
![]() | |
abstract int | RowCount [get] |
Gets the number of matrix rows. More... | |
abstract int | ColumnCount [get] |
Gets the number of matrix columns. More... | |
abstract T | this[int r, int c] [get, set] |
Gets or sets the value of a matrix entry. More... | |
bool | IsReadOnly [get, set] |
Gets a flag indicating whether the matrix is read-only. More... | |
Describes the form of all real matrices.
This is an abstract class that describes any real matrix. If you wish to create a concrete instance of a real, non-square matrix, use the RectangularMatrix class. If, on the other hand, you wish to write a function that can operate on any real matrix, it's probably a good idea to accept a AnyRectangularMatrix, so that any concrete implementation can also be passed into your function.
|
inlineprotected |
|
inlinevirtual |
Computes the 1-norm of the matrix.
The 1-norm of a matrix is the largest column sum.
Reimplemented in Meta.Numerics.Matrices.SquareMatrix, and Meta.Numerics.Matrices.RectangularMatrix.
Referenced by Test.SymmetricMatrixTest.SymmetricMatrixNorms().
|
inlinevirtual |
Computes the ∞-norm of the matrix.
The ∞-norm of a matrix is the largest row sum.
Reimplemented in Meta.Numerics.Matrices.SquareMatrix, and Meta.Numerics.Matrices.RectangularMatrix.
Referenced by Meta.Numerics.Analysis.FunctionMath.FindZero(), and Test.SymmetricMatrixTest.SymmetricMatrixNorms().
|
inlinevirtual |
Computes the Frobenius-norm of the matrix.
The Frobenius-norm of a matrix the square root of the sum of the squares of all the elements. In the case of a row or column vector, this reduces to the Euclidean vector norm.
References Meta.Numerics.MoreMath.Sqr().
Referenced by Test.RectangularMatrixTest.RectangularMatrixNorms(), Meta.Numerics.Matrices.SparseSquareMatrix.Solve(), Test.SquareMatrixTest.SquareMatrixNorms(), and Test.SymmetricMatrixTest.SymmetricMatrixNorms().
|
inlinevirtual |
Gets a copy of the specified column.
c | The (zero-based) column index. |
Reimplemented in Meta.Numerics.Matrices.SparseSquareMatrix, Meta.Numerics.Matrices.SquareMatrix, and Meta.Numerics.Matrices.RectangularMatrix.
Referenced by Test.RectangularMatrixTest.RectangularMatrixAccess(), and Test.SymmetricMatrixTest.SymmetricMatrixAccess().
|
inlinevirtual |
Gets a copy of the specified row.
r | The (zero-based) row index. |
Reimplemented in Meta.Numerics.Matrices.SparseSquareMatrix, Meta.Numerics.Matrices.RectangularMatrix, and Meta.Numerics.Matrices.SquareMatrix.
Referenced by Test.RectangularMatrixTest.RectangularMatrixAccess(), and Test.SymmetricMatrixTest.SymmetricMatrixAccess().
|
inlinestatic |
Adds any two real, rectangular matrices.
A | The first matrix. |
B | The second matrix. |
Matrix addition is an O(N2) process.
References Meta.Numerics.Matrices.AnyMatrix< T >.ColumnCount, Meta.Numerics.Matrices.RectangularMatrix.ColumnCount, Meta.Numerics.Matrices.AnyMatrix< T >.RowCount, and Meta.Numerics.Matrices.RectangularMatrix.RowCount.
|
inlinestatic |
Subtracts any two real, rectangular matrices.
A | The first matrix. |
B | The second matrix. |
Matrix subtraction is an O(N2) process.
References Meta.Numerics.Matrices.AnyMatrix< T >.ColumnCount, Meta.Numerics.Matrices.RectangularMatrix.ColumnCount, Meta.Numerics.Matrices.AnyMatrix< T >.RowCount, and Meta.Numerics.Matrices.RectangularMatrix.RowCount.
|
inlinestatic |
Multiplies any two real, rectangular matrices.
A | The first matrix. |
B | The second matrix. |
For matrix multiplication, the column count of the first matrix must equal the row count of the second matrix.
Matrix multiplication is an O(N3) process.
References Meta.Numerics.Matrices.AnyMatrix< T >.ColumnCount, and Meta.Numerics.Matrices.AnyMatrix< T >.RowCount.
|
inlinevirtual |
Computes the product of the matrix and its transpose.
Referenced by Test.RectangularMatrixTest.MatrixSelfMultiplication().
|
inlinevirtual |
Computes the product of the matrix's transpose and itself.
Referenced by Test.RectangularMatrixTest.MatrixSelfMultiplication().
|
inlinestatic |
Multiplies any real, rectangular matrix by a real constant.
alpha | The constant. |
A | The matrix. |
References Meta.Numerics.Matrices.AnyMatrix< T >.ColumnCount, and Meta.Numerics.Matrices.AnyMatrix< T >.RowCount.
|
inlinestatic |
Multiplies any real, rectangular matrix with a real column vector.
A | The matrix. |
v | The column vector. |
References Meta.Numerics.Matrices.AnyMatrix< T >.ColumnCount, Meta.Numerics.Matrices.VectorBase.Dimension, and Meta.Numerics.Matrices.AnyMatrix< T >.RowCount.
|
inlinestaticprivate |
|
inlinestatic |
Determines whether two matrices are equal.
A | The first matrix. |
B | The second matrix. |
|
inlinestatic |
Determines whether two matrices are not equal.
A | The first matrix. |
B | The second matrix. |
|
inline |
Determines whether the given matrix equals the current matrix.
other | The matrix to compare. |
Referenced by Test.RectangularMatrixTest.RectangularMatrixEquality().
|
inline |
Determines whether the given object is an equal matrix.
obj | The object to compare. |
|
inline |
Not a valid operation.
The Object.GetHashCode method is used to provide a quick equality test when an object is used as a key in a System.Collections.Generic.Dictionary{TKey,TValue} or System.Collections.Hashtable. Since a useful hash code of a matrix would need to involve all its elements, it is not possible to make this a fast operation. Also, since matrices are not immutable, they should not be used as hash keys. (A matrix might be changed after it had already been used as a key.) For these reasons, requesting a hash code for a matrix is not supported.
NotSupportedException | This method always throws this exception. |