Skip to main content
Part of tmath Standard matrix class.

Public Types

Public Member Functions

Public Attributes

Detailed Description

Standard matrix class. A class that represents storage for dense linalg objects. The storage scheme is column_major (FORTRAN). It is derived from Eigen::Matrix. Many operations have been added/overwritten for compatibility with scripting requirements. Most operations of Eigen2 are still available. Basic Eigen linalg operators have been overloaded. To access a linalg operator from C++, for example the matrix product, type
This will give you the fastest operation possible within the Eigen library. The overloaded operators have some if-clauses and do not make use of expression templates what may harm performance. Matrix offers a handling for complex numbers which differs from Eigen: The odd columns are the real parts and the odd columns contain the imaginary parts. Some of the underlying Eigen methods are available for SWIG. They are not integrated into the error chacking system, though! neverthelesse, ften they are the most efficient methods. To distuingish between Eigen and own methods, the Eigen methods identifiers start with a noncapital first letter, our own methods start with a capital letter. Operators for SWIG are provided using the methods add, etc., The SWIG-operators must be safeguarded, whereas the C++-operators should be the original Eigen2 operators. Therefore they must be defined separately on C++ level. Matrix is useing a reference counter system. It is advised not to use ‘delete Matrix();’ to remove it from memory, but to use removeReference.

Constructor & Destructor Documentation

Matrix() [1/6]

destructor default constructor

Matrix() [2/6]

copy constructor Parameters

Matrix() [3/6]

constructs a matrix and allocates nrow*ncol elements Parameters

Matrix() [4/6]

constructs a matrix from a matrix block Parameters

Matrix() [5/6]

copies from a sparse matrix Parameters

Matrix() [6/6]

copies from a symmetric sparse matrix Parameters

Member Function Documentation

__neg__()

Returns unary minus (B=-A) Used by SWIG.

__str__()

transforms this objects into a string, required by SWIG Returns a string

Add() [1/2]

modifies this matrix by the matrix sum A+B Parameters

Add() [2/2]

modifies this matrix by the matrix sum A+B Parameters

AppendCols()

returns an object with modified data Parameters Returns Matrix with columns appended

AppendRows()

returns an object with modified data Parameters Returns Matrix with rows appended

Assign() [1/2]

The assignment operator for matrices (data only) Parameters

Assign() [2/2]

The assignment operator for blocks (data only) Parameters

Block()

returns a reference to a block starting at ‘row’,‘column’ with size ‘numrows’*‘numcols’ Parameters Returns a matrix block serving as a reference to the specified matrix part

Col()

returns a reference to the ‘col’th column Parameters Returns a matrix block serving as a reference to the column

Cols() [1/2]

Returns the number of cols

Cols() [2/2]

returns a block containing the ncol columns starting at column index col1 Parameters Returns a matrix block serving as a reference to the specified matrix part

ConservativeResize()

resizes the matrix to its new dimensions without destroying the contents. Parameters

CW()

Returns an object providing cwise access

Div()

modifies this matrix by the scalar matrix quotient A/s Parameters

Dot() [1/2]

returns the scalar product of two vectors (a’b) Parameters Returns the result of the operation

Dot() [2/2]

returns the scalar product of two vectors (a’b) Parameters Returns the result of the operation

Dott() [1/2]

returns the weighted scalar product of this matrix and the given vector multiplied once from left and once from right (b’Ab) Parameters Returns the result of the operation

Dott() [2/2]

returns the weighted scalar product of this matrix and the given vector multiplied once from left and once from right (b’Ab) Parameters Returns the result of the operation

InnerProduct() [1/2]

returns the inner product of two matrices/vectors (a’*b) Parameters Returns the result of the operation

InnerProduct() [2/2]

returns the inner product of two matrices/vectors (a’*b) Parameters Returns the result of the operation

IsApprox()

returns true if other and this are approx. identical Parameters Returns the result of the operation

IsApproxToConstant()

returns true if array is constant and approx. equal s Parameters Returns the result of the operation

IsDiagonal()

returns true if array is a diagonal matrix by precision s Parameters Returns the result of the operation

IsIdentity()

returns true if array is the identity matrix by precision s Parameters Returns the result of the operation

IsLowerTriangular()

returns true if array is a lower triangular matrix by precision s Parameters Returns the result of the operation

IsScalar()

Returns true if array is a scalar

IsUnitary()

returns true if array is a unitary matrix by precision s (is an orthonormal basis) Parameters Returns the result of the operation

IsUpperTriangular()

returns true if array is an upper triangular matrix by precision s Parameters Returns the result of the operation

IsVector()

Returns true if array is a vector

IsZero()

Returns true if array is a zero matrix by precision s Parameters

MinCoeff()

find the smallest element in the array returns the minimum element in the array Parameters Returns smallest elment

Mul()

modifies this matrix by the scalar matrix product A*s Parameters

operator*() [1/3]

returns the matrix product A*B Parameters Returns the result of the operation

operator*() [2/3]

returns the matrix product A*B Parameters Returns the result of the operation

operator*() [3/3]

returns the scalar matrix product A*s Parameters Returns the result of the operation

operator+() [1/2]

returns the matrix sum A+B Parameters Returns the result of the operation

operator+() [2/2]

returns the matrix sum A+B Parameters Returns the result of the operation

operator-() [1/2]

returns the matrix difference A-B Parameters Returns the result of the operation

operator-() [2/2]

returns the matrix difference A-B Parameters Returns the result of the operation

operator/()

returns the scalar matrix quotient A/s Parameters Returns the result of the operation

operator<()

returns a matrix of 1 and 0 indicating which element is less than x Parameters Returns the result of the operation

operator=()

copy assignment operator Parameters

OuterProduct() [1/2]

returns the outer product of two matrices/vectors (a*b’) Parameters Returns the result of the operation

OuterProduct() [2/2]

returns the outer product of two matrices/vectors (a*b’) Parameters Returns the result of the operation

Print()

prints the matrix up to the given rows and columns Parameters

Row()

returns a reference to the ‘row’th row Parameters Returns a matrix block serving as a reference to the row

Rows() [1/2]

Returns the number of rows

Rows() [2/2]

returns a block containing the nrow columns starting at column index row1 Parameters Returns a matrix block serving as a reference to the specified matrix part

SetCols()

returns an object providing copy of data changes object data in place

SetConstant()

initializes the matrix with constant values Parameters

SetLinearCols()

initializes the matrix with linear columns Parameters

SetLinearRows()

initializes the matrix with linear rows Parameters

Sub() [1/2]

modifies this matrix by the matrix difference A-B Parameters

Sub() [2/2]

modifies this matrix by the matrix difference A-B Parameters

Swap()

The swap operator for matrices (data only) Parameters

Transpose()

Returns the transpose

Member Data Documentation

int

find the largest element in the array returns the maximum element in the array Parameters Returns largest elment