IGLib
1.7.2
The IGLib base library EXTENDED - with other lilbraries and applications.
|
A rectangular matrix of real numbers. More...
Public Member Functions | |||
RectangularMatrix (int rowCount, int columnCount) | |||
Initializes a rectangular matrix with the given dimensions. More... | |||
RectangularMatrix (double[,] source) | |||
Initializes a rectangular matrix from the given 2D array. More... | |||
override double | OneNorm () | ||
Computes the 1-norm of the matrix.
| |||
override double | InfinityNorm () | ||
Computes the ∞-norm of the matrix.
| |||
override ColumnVector | Column (int c) | ||
Gets a copy of the specified column.
| |||
override RowVector | Row (int r) | ||
Gets a copy of the specified row.
| |||
RectangularMatrix | Copy () | ||
Copies the matrix. More... | |||
RectangularMatrix | Transpose () | ||
Returns the transpose of the matrix. More... | |||
QRDecomposition | QRDecomposition () | ||
Computes the QR decomposition of the matrix. More... | |||
SingularValueDecomposition | SingularValueDecomposition () | ||
Computes the singular value decomposition of the matrix. More... | |||
![]() | |||
virtual double | FrobeniusNorm () | ||
Computes the Frobenius-norm of the matrix. 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+ (RectangularMatrix A, RectangularMatrix B) |
Adds two real, rectangular matrices. More... | |
static RectangularMatrix | operator- (RectangularMatrix A, RectangularMatrix B) |
Subtracts two real, rectangular matrices. More... | |
static RectangularMatrix | operator* (RectangularMatrix A, RectangularMatrix B) |
Multiplies two real, rectangular matrices. More... | |
static RectangularMatrix | operator* (double alpha, RectangularMatrix A) |
Multiply a real, rectangular matrix by a real constant. More... | |
static RectangularMatrix | operator* (RectangularMatrix A, double alpha) |
Divides a real, rectangular matrix by a real constant. More... | |
static RectangularMatrix | operator- (RectangularMatrix A) |
Negates a real, rectangular matrix. More... | |
static ColumnVector | operator* (RectangularMatrix A, ColumnVector v) |
Computes the product of a rectangular matrix and a column vector. More... | |
static | operator SquareMatrix (RectangularMatrix A) |
Casts a rectangular matrix to a square matrix. More... | |
![]() | |
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... | |
Properties | |
override double | this[int r, int c] [get, set] |
override int | RowCount [get] |
override int | ColumnCount [get] |
![]() | |
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... | |
Private Attributes | |
readonly double[] | store |
readonly int | rows |
readonly int | cols |
Additional Inherited Members | |
![]() | |
AnyRectangularMatrix () | |
![]() | |
AnyMatrix () | |
A rectangular matrix of real numbers.
|
inline |
Initializes a rectangular matrix with the given dimensions.
rowCount | The number of rows. |
columnCount | The number of columns. |
ArgumentOutOfRangeException | rowCount or columnCount is less than one. |
|
inline |
Initializes a rectangular matrix from the given 2D array.
source | The source 2D array. |
|
inlinevirtual |
Computes the 1-norm of the matrix.
Reimplemented from Meta.Numerics.Matrices.AnyRectangularMatrix.
Referenced by Test.RectangularMatrixTest.RectangularMatrixNorms().
|
inlinevirtual |
Computes the ∞-norm of the matrix.
Reimplemented from Meta.Numerics.Matrices.AnyRectangularMatrix.
Referenced by Test.RectangularMatrixTest.RectangularMatrixNorms().
|
inlinevirtual |
Gets a copy of the specified column.
c | The (zero-based) column index. |
Reimplemented from Meta.Numerics.Matrices.AnyRectangularMatrix.
|
inlinevirtual |
Gets a copy of the specified row.
r | The (zero-based) row index. |
Reimplemented from Meta.Numerics.Matrices.AnyRectangularMatrix.
|
inlinestatic |
Adds two real, rectangular matrices.
A | The first matrix. |
B | The second matrix. |
References Meta.Numerics.Matrices.RectangularMatrix.cols, Meta.Numerics.Matrices.RectangularMatrix.rows, and Meta.Numerics.Matrices.RectangularMatrix.store.
|
inlinestatic |
Subtracts two real, rectangular matrices.
A | The first matrix. |
B | The second matrix. |
References Meta.Numerics.Matrices.RectangularMatrix.cols, Meta.Numerics.Matrices.RectangularMatrix.rows, and Meta.Numerics.Matrices.RectangularMatrix.store.
|
inlinestatic |
Multiplies two real, rectangular matrices.
A | The first matrix. |
B | The second matrix. |
References Meta.Numerics.Matrices.RectangularMatrix.cols, Meta.Numerics.Matrices.RectangularMatrix.rows, and Meta.Numerics.Matrices.RectangularMatrix.store.
|
inlinestatic |
Multiply a real, rectangular matrix by a real constant.
alpha | The constant. |
A | The matrix. |
References Meta.Numerics.Matrices.RectangularMatrix.cols, Meta.Numerics.Matrices.RectangularMatrix.rows, and Meta.Numerics.Matrices.RectangularMatrix.store.
|
inlinestatic |
Divides a real, rectangular matrix by a real constant.
A | The matrix. |
alpha | The constant. |
References Meta.Numerics.Matrices.RectangularMatrix.cols, Meta.Numerics.Matrices.RectangularMatrix.rows, and Meta.Numerics.Matrices.RectangularMatrix.store.
|
inlinestatic |
Negates a real, rectangular matrix.
A | The matrix. |
References Meta.Numerics.Matrices.RectangularMatrix.cols, Meta.Numerics.Matrices.RectangularMatrix.rows, and Meta.Numerics.Matrices.RectangularMatrix.store.
|
inline |
Copies the matrix.
References Meta.Numerics.Matrices.RectangularMatrix.Copy().
Referenced by Meta.Numerics.Matrices.RectangularMatrix.Copy(), Test.RectangularMatrixTest.RectangularMatrixAccess(), and Test.RectangularMatrixTest.RectangularMatrixEquality().
|
inline |
Returns the transpose of the matrix.
References Meta.Numerics.Matrices.RectangularMatrix.Transpose().
Referenced by Meta.Numerics.Analysis.FunctionMath.FindZero(), Test.RectangularMatrixTest.MatrixSelfMultiplication(), Test.RectangularMatrixTest.RectangularMatrixArithmetic(), and Meta.Numerics.Matrices.RectangularMatrix.Transpose().
|
inline |
Computes the QR decomposition of the matrix.
Only matrices with a number of rows greater than or equal to the number of columns can be QR decomposed. If your matrix has more columns than rows, you can QR decompose its transpose.
Referenced by Test.RectangularMatrixTest.RectangularQRDecomposition().
|
inline |
Computes the singular value decomposition of the matrix.
Referenced by FutureTest.FutureTest.Bell1(), Test.BugTests.Bug7686(), Test.RectangularMatrixTest.PC(), Test.RectangularMatrixTest.RandomRectangularSVD(), Meta.Numerics.Matrices.SquareMatrix.SingularValueDecomposition(), and Test.SquareMatrixTest.SvdOfRankOneMatrix().
|
inlinestatic |
Computes the product of a rectangular matrix and a column vector.
A | The matrix. |
v | The column vector. |
ArgumentNullException | A or v is null. |
DimensionMismatchException | The column count of A is not the same as the dimension of v . |
References Meta.Numerics.Matrices.RectangularMatrix.cols, Meta.Numerics.Matrices.RectangularMatrix.rows, and Meta.Numerics.Matrices.RectangularMatrix.store.
|
inlineexplicitstatic |
Casts a rectangular matrix to a square matrix.
A | The matrix to cast, which must have an equal number of rows and columns. |
It can occur that the mode of construction of a RectangularMatrix guarantees that it is actually square. For example, if you multiply an N X M rectangular matrix by an M X N rectangular matrix, the result is an N X N square matrix. However, when determining the type of the product, the .NET compiler considers only the types of the multiplicants. Since a RectangularMatrix times a RectangularMatrix yields a RectangularMatrix, it will consider the type of the product to be RetangularMatrix, even though its rows and column dimensions will be equal. You can use this explicit cast to obtain a SquareMatrix type.
Note that the output of the cast is not independent of the original matrix. This makes the cast operation fast, but changes to the resulting SquareMatrix will also change the original RectangularMatrix. To obtain an independent matrix, use the Copy method.
InvalidCastException | The row and column dimensions of the matrix are not equal. |
References Meta.Numerics.Matrices.RectangularMatrix.ColumnCount, Meta.Numerics.Matrices.RectangularMatrix.RowCount, and Meta.Numerics.Matrices.RectangularMatrix.store.
|
private |
|
private |
|
private |
|
getset |
|
get |
Referenced by Test.VectorTest.ColumnVectorArithmetic(), Test.RectangularMatrixTest.MatrixArrayConversion(), Test.VectorTest.MixedVectorArithmetic(), Meta.Numerics.Matrices.RectangularMatrix.operator SquareMatrix(), Meta.Numerics.Matrices.AnyRectangularMatrix.operator+(), Meta.Numerics.Matrices.AnyRectangularMatrix.operator-(), Test.RectangularMatrixTest.RandomRectangularSVD(), Test.RectangularMatrixTest.RectangularMatrixAccess(), Test.RectangularMatrixTest.RectangularMatrixArithmetic(), and Test.RectangularMatrixTest.RectangularQRDecomposition().
|
get |
Referenced by Test.RectangularMatrixTest.MatrixArrayConversion(), Test.VectorTest.MixedVectorArithmetic(), Meta.Numerics.Matrices.RectangularMatrix.operator SquareMatrix(), Meta.Numerics.Matrices.AnyRectangularMatrix.operator+(), Meta.Numerics.Matrices.AnyRectangularMatrix.operator-(), Test.RectangularMatrixTest.RandomRectangularSVD(), Test.RectangularMatrixTest.RectangularMatrixAccess(), Test.RectangularMatrixTest.RectangularMatrixArithmetic(), and Test.RectangularMatrixTest.RectangularQRDecomposition().