IGLib  1.7.2
The IGLib base library EXTENDED - with other lilbraries and applications.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros
Meta.Numerics.Matrices.RectangularMatrix Class Reference

A rectangular matrix of real numbers. More...

+ Inheritance diagram for Meta.Numerics.Matrices.RectangularMatrix:
+ Collaboration diagram for Meta.Numerics.Matrices.RectangularMatrix:

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.
Returns
||M||1
The 1-norm of a matrix is the largest column sum. More...
 
override double InfinityNorm ()
 Computes the ∞-norm of the matrix.
Returns
||M||∞
The ∞-norm of a matrix is the largest row sum. More...
 
override ColumnVector Column (int c)
 Gets a copy of the specified column.
Parameters
cThe (zero-based) column index.
Returns
An independent copy of the specified column.
More...
 
override RowVector Row (int r)
 Gets a copy of the specified row.
Parameters
rThe (zero-based) row index.
Returns
An independent copy of the specified row.
More...
 
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...
 
- Public Member Functions inherited from Meta.Numerics.Matrices.AnyRectangularMatrix
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...
 
- Public Member Functions inherited from Meta.Numerics.Matrices.AnyMatrix< T >
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 Public Member Functions inherited from Meta.Numerics.Matrices.AnyRectangularMatrix
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]
 
- Properties inherited from Meta.Numerics.Matrices.AnyMatrix< T >
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

- Protected Member Functions inherited from Meta.Numerics.Matrices.AnyRectangularMatrix
 AnyRectangularMatrix ()
 
- Protected Member Functions inherited from Meta.Numerics.Matrices.AnyMatrix< T >
 AnyMatrix ()
 

Detailed Description

A rectangular matrix of real numbers.

Constructor & Destructor Documentation

Meta.Numerics.Matrices.RectangularMatrix.RectangularMatrix ( int  rowCount,
int  columnCount 
)
inline

Initializes a rectangular matrix with the given dimensions.

Parameters
rowCountThe number of rows.
columnCountThe number of columns.
Exceptions
ArgumentOutOfRangeExceptionrowCount or columnCount is less than one.
Meta.Numerics.Matrices.RectangularMatrix.RectangularMatrix ( double  source[,])
inline

Initializes a rectangular matrix from the given 2D array.

Parameters
sourceThe source 2D array.

Member Function Documentation

override double Meta.Numerics.Matrices.RectangularMatrix.OneNorm ( )
inlinevirtual

Computes the 1-norm of the matrix.

Returns
||M||1
The 1-norm of a matrix is the largest column sum.

Reimplemented from Meta.Numerics.Matrices.AnyRectangularMatrix.

Referenced by Test.RectangularMatrixTest.RectangularMatrixNorms().

override double Meta.Numerics.Matrices.RectangularMatrix.InfinityNorm ( )
inlinevirtual

Computes the &#x221E;-norm of the matrix.

Returns
||M||&#x221E;
The &#x221E;-norm of a matrix is the largest row sum.

Reimplemented from Meta.Numerics.Matrices.AnyRectangularMatrix.

Referenced by Test.RectangularMatrixTest.RectangularMatrixNorms().

override ColumnVector Meta.Numerics.Matrices.RectangularMatrix.Column ( int  c)
inlinevirtual

Gets a copy of the specified column.

Parameters
cThe (zero-based) column index.
Returns
An independent copy of the specified column.

Reimplemented from Meta.Numerics.Matrices.AnyRectangularMatrix.

override RowVector Meta.Numerics.Matrices.RectangularMatrix.Row ( int  r)
inlinevirtual

Gets a copy of the specified row.

Parameters
rThe (zero-based) row index.
Returns
An independent copy of the specified row.

Reimplemented from Meta.Numerics.Matrices.AnyRectangularMatrix.

static RectangularMatrix Meta.Numerics.Matrices.RectangularMatrix.operator+ ( RectangularMatrix  A,
RectangularMatrix  B 
)
inlinestatic

Adds two real, rectangular matrices.

Parameters
AThe first matrix.
BThe second matrix.
Returns
The sum matrix A + B .

References Meta.Numerics.Matrices.RectangularMatrix.cols, Meta.Numerics.Matrices.RectangularMatrix.rows, and Meta.Numerics.Matrices.RectangularMatrix.store.

static RectangularMatrix Meta.Numerics.Matrices.RectangularMatrix.operator- ( RectangularMatrix  A,
RectangularMatrix  B 
)
inlinestatic

Subtracts two real, rectangular matrices.

Parameters
AThe first matrix.
BThe second matrix.
Returns
The sum matrix A - B .

References Meta.Numerics.Matrices.RectangularMatrix.cols, Meta.Numerics.Matrices.RectangularMatrix.rows, and Meta.Numerics.Matrices.RectangularMatrix.store.

static RectangularMatrix Meta.Numerics.Matrices.RectangularMatrix.operator* ( RectangularMatrix  A,
RectangularMatrix  B 
)
inlinestatic

Multiplies two real, rectangular matrices.

Parameters
AThe first matrix.
BThe second matrix.
Returns
The product matrix AB.

References Meta.Numerics.Matrices.RectangularMatrix.cols, Meta.Numerics.Matrices.RectangularMatrix.rows, and Meta.Numerics.Matrices.RectangularMatrix.store.

static RectangularMatrix Meta.Numerics.Matrices.RectangularMatrix.operator* ( double  alpha,
RectangularMatrix  A 
)
inlinestatic

Multiply a real, rectangular matrix by a real constant.

Parameters
alphaThe constant.
AThe matrix.
Returns
The product aA.

References Meta.Numerics.Matrices.RectangularMatrix.cols, Meta.Numerics.Matrices.RectangularMatrix.rows, and Meta.Numerics.Matrices.RectangularMatrix.store.

static RectangularMatrix Meta.Numerics.Matrices.RectangularMatrix.operator* ( RectangularMatrix  A,
double  alpha 
)
inlinestatic

Divides a real, rectangular matrix by a real constant.

Parameters
AThe matrix.
alphaThe constant.
Returns
The quotient A/a.

References Meta.Numerics.Matrices.RectangularMatrix.cols, Meta.Numerics.Matrices.RectangularMatrix.rows, and Meta.Numerics.Matrices.RectangularMatrix.store.

static RectangularMatrix Meta.Numerics.Matrices.RectangularMatrix.operator- ( RectangularMatrix  A)
inlinestatic

Negates a real, rectangular matrix.

Parameters
AThe matrix.
Returns
The matrix -A.

References Meta.Numerics.Matrices.RectangularMatrix.cols, Meta.Numerics.Matrices.RectangularMatrix.rows, and Meta.Numerics.Matrices.RectangularMatrix.store.

RectangularMatrix Meta.Numerics.Matrices.RectangularMatrix.Copy ( )
inline
QRDecomposition Meta.Numerics.Matrices.RectangularMatrix.QRDecomposition ( )
inline

Computes the QR decomposition of the matrix.

Returns
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.

See also
QRDecomposition

Referenced by Test.RectangularMatrixTest.RectangularQRDecomposition().

SingularValueDecomposition Meta.Numerics.Matrices.RectangularMatrix.SingularValueDecomposition ( )
inline
static ColumnVector Meta.Numerics.Matrices.RectangularMatrix.operator* ( RectangularMatrix  A,
ColumnVector  v 
)
inlinestatic

Computes the product of a rectangular matrix and a column vector.

Parameters
AThe matrix.
vThe column vector.
Returns
The column vector Av.
Exceptions
ArgumentNullExceptionA or v is null.
DimensionMismatchExceptionThe 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.

static Meta.Numerics.Matrices.RectangularMatrix.operator SquareMatrix ( RectangularMatrix  A)
inlineexplicitstatic

Casts a rectangular matrix to a square matrix.

Parameters
AThe matrix to cast, which must have an equal number of rows and columns.
Returns
A square matrix, not independent of the original matrix.

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.

Exceptions
InvalidCastExceptionThe 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.

Member Data Documentation

Property Documentation

override double Meta.Numerics.Matrices.RectangularMatrix.this[int r, int c]
getset


The documentation for this class was generated from the following file: