![]() |
Efficient implementation of a fixed-sized matrix.The StaticMatrix class template is the representation of a fixed-size matrix with statically allocated elements of arbitrary type. The type of the elements, the number of rows and columns and the storage order of the matrix can be specified via the four template parameters: More...
#include <StaticMatrix.h>
Inherits blaze::DenseMatrix< StaticMatrix< Type, M, N, SO >, SO >, and blaze::AlignedStorage< Type >.
Public Types | |
enum | { vectorizable = IsVectorizable<Type>::value } |
Compilation flag for intrinsic optimization. More... | |
typedef StaticMatrix< Type, M, N, SO > | This |
Type of this StaticMatrix instance. | |
typedef This | ResultType |
Result type for expression template evaluations. | |
typedef StaticMatrix< Type, M, N,!SO > | OppositeType |
Result type with opposite storage order for expression template evaluations. | |
typedef StaticMatrix< Type, N, M,!SO > | TransposeType |
Transpose type for expression template evaluations. | |
typedef Type | ElementType |
Type of the matrix elements. | |
typedef IT::Type | IntrinsicType |
Intrinsic type of the matrix elements. | |
typedef const Type & | ReturnType |
Return type for expression template evaluations. | |
typedef const This & | CompositeType |
Data type for composite expression templates. | |
typedef Type & | Reference |
Reference to a non-constant matrix value. | |
typedef const Type & | ConstReference |
Reference to a constant matrix value. | |
typedef Type * | Iterator |
Iterator over non-constant elements. | |
typedef const Type * | ConstIterator |
Iterator over constant elements. | |
typedef MT | MatrixType |
Type of the matrix. | |
Public Member Functions | |
template<typename Other , bool SO2> | |
StaticMatrix< Type, M, N, SO > & | operator= (const StaticMatrix< Other, M, N, SO2 > &rhs) |
Assignment operator for different StaticMatrix instances. More... | |
template<typename MT , bool SO2> | |
StaticMatrix< Type, M, N, SO > & | operator= (const Matrix< MT, SO2 > &rhs) |
Assignment operator for different matrices. More... | |
template<typename MT , bool SO2> | |
StaticMatrix< Type, M, N, SO > & | operator+= (const Matrix< MT, SO2 > &rhs) |
Addition assignment operator for the addition of a matrix ( ![]() | |
template<typename MT , bool SO2> | |
StaticMatrix< Type, M, N, SO > & | operator-= (const Matrix< MT, SO2 > &rhs) |
Subtraction assignment operator for the subtraction of a matrix ( ![]() | |
template<typename MT , bool SO2> | |
StaticMatrix< Type, M, N, SO > & | operator*= (const Matrix< MT, SO2 > &rhs) |
Multiplication assignment operator for the multiplication of a matrix ( ![]() | |
template<typename Other > | |
EnableIf< IsNumeric< Other > , StaticMatrix< Type, M, N, SO > >::Type & | operator*= (Other rhs) |
Multiplication assignment operator for the multiplication between a matrix and a scalar value ( ![]() | |
template<typename Other > | |
EnableIf< IsNumeric< Other > , StaticMatrix< Type, M, N, SO > >::Type & | operator/= (Other rhs) |
Division assignment operator for the division of a matrix by a scalar value ( ![]() | |
template<typename Other > | |
StaticMatrix< Type, M, N, SO > & | scale (const Other &scalar) |
Scaling of the matrix by the scalar value scalar ( ![]() | |
template<typename MT , bool SO2> | |
DisableIf< typename StaticMatrix< Type, M, N, SO > ::BLAZE_TEMPLATE VectorizedAssign< MT > >::Type | assign (const DenseMatrix< MT, SO2 > &rhs) |
Default implementation of the assignment of a dense matrix. More... | |
template<typename MT , bool SO2> | |
EnableIf< typename StaticMatrix< Type, M, N, SO > ::BLAZE_TEMPLATE VectorizedAssign< MT > >::Type | assign (const DenseMatrix< MT, SO2 > &rhs) |
Intrinsic optimized implementation of the assignment of a dense matrix. More... | |
template<typename MT , bool SO2> | |
DisableIf< typename StaticMatrix< Type, M, N, SO > ::BLAZE_TEMPLATE VectorizedAddAssign< MT > >::Type | addAssign (const DenseMatrix< MT, SO2 > &rhs) |
Default implementation of the addition assignment of a row-major dense matrix. More... | |
template<typename MT , bool SO2> | |
EnableIf< typename StaticMatrix< Type, M, N, SO > ::BLAZE_TEMPLATE VectorizedAddAssign< MT > >::Type | addAssign (const DenseMatrix< MT, SO2 > &rhs) |
Intrinsic optimized implementation of the addition assignment of a dense matrix. More... | |
template<typename MT , bool SO2> | |
DisableIf< typename StaticMatrix< Type, M, N, SO > ::BLAZE_TEMPLATE VectorizedSubAssign< MT > >::Type | subAssign (const DenseMatrix< MT, SO2 > &rhs) |
Default implementation of the subtraction assignment of a dense matrix. More... | |
template<typename MT , bool SO2> | |
EnableIf< typename StaticMatrix< Type, M, N, SO > ::BLAZE_TEMPLATE VectorizedSubAssign< MT > >::Type | subAssign (const DenseMatrix< MT, SO2 > &rhs) |
Intrinsic optimized implementation of the subtraction assignment of a dense matrix. More... | |
MatrixType & | operator~ () |
Conversion operator for non-constant matrices. More... | |
const MatrixType & | operator~ () const |
Conversion operator for constant matrices. More... | |
Constructors | |
StaticMatrix () | |
The default constructor for StaticMatrix. More... | |
StaticMatrix (const Type &init) | |
Constructor for a homogenous initialization of all elements. More... | |
StaticMatrix (const StaticMatrix &m) | |
The copy constructor for StaticMatrix. More... | |
template<typename Other , bool SO2> | |
StaticMatrix (const StaticMatrix< Other, M, N, SO2 > &m) | |
Conversion constructor from different StaticMatrix instances. More... | |
template<typename MT , bool SO2> | |
StaticMatrix (const Matrix< MT, SO2 > &m) | |
Conversion constructor from different matrices. More... | |
StaticMatrix (const Type &v1, const Type &v2) | |
Constructor for ![]() ![]() | |
StaticMatrix (const Type &v1, const Type &v2, const Type &v3) | |
Constructor for ![]() ![]() | |
StaticMatrix (const Type &v1, const Type &v2, const Type &v3, const Type &v4) | |
Constructor for ![]() ![]() ![]() | |
StaticMatrix (const Type &v1, const Type &v2, const Type &v3, const Type &v4, const Type &v5) | |
Constructor for ![]() ![]() | |
StaticMatrix (const Type &v1, const Type &v2, const Type &v3, const Type &v4, const Type &v5, const Type &v6) | |
Constructor for ![]() ![]() ![]() ![]() | |
StaticMatrix (const Type &v1, const Type &v2, const Type &v3, const Type &v4, const Type &v5, const Type &v6, const Type &v7) | |
Constructor for ![]() ![]() | |
StaticMatrix (const Type &v1, const Type &v2, const Type &v3, const Type &v4, const Type &v5, const Type &v6, const Type &v7, const Type &v8) | |
Constructor for ![]() ![]() | |
StaticMatrix (const Type &v1, const Type &v2, const Type &v3, const Type &v4, const Type &v5, const Type &v6, const Type &v7, const Type &v8, const Type &v9) | |
Constructor for ![]() ![]() ![]() | |
StaticMatrix (const Type &v1, const Type &v2, const Type &v3, const Type &v4, const Type &v5, const Type &v6, const Type &v7, const Type &v8, const Type &v9, const Type &v10) | |
Constructor for ![]() ![]() ![]() ![]() | |
Data access functions | |
Reference | operator() (size_t i, size_t j) |
2D-access to the matrix elements. More... | |
ConstReference | operator() (size_t i, size_t j) const |
2D-access to the matrix elements. More... | |
Type * | data () |
Low-level data access to the matrix elements. More... | |
const Type * | data () const |
Low-level data access to the matrix elements. More... | |
Type * | data (size_t i) |
Low-level data access to the matrix elements of row/column i. More... | |
const Type * | data (size_t i) const |
Low-level data access to the matrix elements of row/column i. More... | |
Iterator | begin (size_t i) |
Returns an iterator to the first element of row/column i. More... | |
ConstIterator | begin (size_t i) const |
Returns an iterator to the first element of row/column i. More... | |
ConstIterator | cbegin (size_t i) const |
Returns an iterator to the first element of row/column i. More... | |
Iterator | end (size_t i) |
Returns an iterator just past the last element of row/column i. More... | |
ConstIterator | end (size_t i) const |
Returns an iterator just past the last element of row/column i. More... | |
ConstIterator | cend (size_t i) const |
Returns an iterator just past the last element of row/column i. More... | |
Assignment operators | |
StaticMatrix & | operator= (const Type &set) |
Homogenous assignment to all matrix elements. More... | |
StaticMatrix & | operator= (const StaticMatrix &rhs) |
Copy assignment operator for StaticMatrix. More... | |
template<typename Other , bool SO2> | |
StaticMatrix & | operator= (const StaticMatrix< Other, M, N, SO2 > &rhs) |
template<typename MT , bool SO2> | |
StaticMatrix & | operator= (const Matrix< MT, SO2 > &rhs) |
template<typename MT , bool SO2> | |
StaticMatrix & | operator+= (const Matrix< MT, SO2 > &rhs) |
template<typename MT , bool SO2> | |
StaticMatrix & | operator-= (const Matrix< MT, SO2 > &rhs) |
template<typename MT , bool SO2> | |
StaticMatrix & | operator*= (const Matrix< MT, SO2 > &rhs) |
template<typename Other > | |
EnableIf< IsNumeric< Other > , StaticMatrix >::Type & | operator*= (Other rhs) |
template<typename Other > | |
EnableIf< IsNumeric< Other > , StaticMatrix >::Type & | operator/= (Other rhs) |
Utility functions | |
size_t | rows () const |
Returns the current number of rows of the matrix. More... | |
size_t | columns () const |
Returns the current number of columns of the matrix. More... | |
size_t | spacing () const |
Returns the spacing between the beginning of two rows. More... | |
size_t | capacity () const |
Returns the maximum capacity of the matrix. More... | |
size_t | capacity (size_t i) const |
Returns the current capacity of the specified row/column. More... | |
size_t | nonZeros () const |
Returns the total number of non-zero elements in the matrix. More... | |
size_t | nonZeros (size_t i) const |
Returns the number of non-zero elements in the specified row/column. More... | |
void | reset () |
Reset to the default initial values. More... | |
void | reset (size_t i) |
Reset the specified row/column to the default initial values. More... | |
StaticMatrix & | transpose () |
Transposing the matrix. More... | |
bool | isDiagonal () const |
Checks if the matrix is diagonal. More... | |
bool | isSymmetric () const |
Checks if the matrix is symmetric. More... | |
template<typename Other > | |
StaticMatrix & | scale (const Other &scalar) |
void | swap (StaticMatrix &m) |
Swapping the contents of two static matrices. More... | |
Expression template evaluation functions | |
template<typename Other > | |
bool | canAlias (const Other *alias) const |
Returns whether the matrix can alias with the given address alias. More... | |
template<typename Other > | |
bool | isAliased (const Other *alias) const |
Returns whether the matrix is aliased with the given address alias. More... | |
IntrinsicType | get (size_t i, size_t j) const |
Access to the intrinsic elements of the matrix. More... | |
template<typename MT , bool SO2> | |
DisableIf< VectorizedAssign < MT > >::Type | assign (const DenseMatrix< MT, SO2 > &rhs) |
template<typename MT , bool SO2> | |
EnableIf< VectorizedAssign< MT > >::Type | assign (const DenseMatrix< MT, SO2 > &rhs) |
template<typename MT > | |
void | assign (const SparseMatrix< MT, SO > &rhs) |
Default implementation of the assignment of a row-major sparse matrix. More... | |
template<typename MT > | |
void | assign (const SparseMatrix< MT,!SO > &rhs) |
Default implementation of the assignment of a column-major sparse matrix. More... | |
template<typename MT , bool SO2> | |
DisableIf< VectorizedAddAssign < MT > >::Type | addAssign (const DenseMatrix< MT, SO2 > &rhs) |
template<typename MT , bool SO2> | |
EnableIf< VectorizedAddAssign < MT > >::Type | addAssign (const DenseMatrix< MT, SO2 > &rhs) |
template<typename MT > | |
void | addAssign (const SparseMatrix< MT, SO > &rhs) |
Default implementation of the addition assignment of a row-major sparse matrix. More... | |
template<typename MT > | |
void | addAssign (const SparseMatrix< MT,!SO > &rhs) |
Default implementation of the addition assignment of a column-major sparse matrix. More... | |
template<typename MT , bool SO2> | |
DisableIf< VectorizedSubAssign < MT > >::Type | subAssign (const DenseMatrix< MT, SO2 > &rhs) |
template<typename MT , bool SO2> | |
EnableIf< VectorizedSubAssign < MT > >::Type | subAssign (const DenseMatrix< MT, SO2 > &rhs) |
template<typename MT > | |
void | subAssign (const SparseMatrix< MT, SO > &rhs) |
Default implementation of the subtraction assignment of a row-major sparse matrix. More... | |
template<typename MT > | |
void | subAssign (const SparseMatrix< MT,!SO > &rhs) |
Default implementation of the subtraction assignment of a column-major sparse matrix. More... | |
Private Types | |
enum | { NN = N + ( IT::size - ( N % IT::size ) ) % IT::size } |
Alignment adjustment. | |
typedef IntrinsicTrait< Type > | IT |
Intrinsic trait for the vector element type. | |
Private Attributes | |
Member variables | |
Type | v_ [M *NN] |
The statically allocated matrix elements. More... | |
Efficient implementation of a fixed-sized matrix.
The StaticMatrix class template is the representation of a fixed-size matrix with statically allocated elements of arbitrary type. The type of the elements, the number of rows and columns and the storage order of the matrix can be specified via the four template parameters:
Depending on the storage order, the matrix elements are either stored in a row-wise fashion or in a column-wise fashion. Given the 2x3 matrix
in case of row-major order the elements are stored in the order
In case of column-major order the elements are stored in the order
The use of StaticMatrix is very natural and intuitive. All operations (addition, subtraction, multiplication, scaling, ...) can be performed on all possible combination of row-major and column-major dense and sparse matrices with fitting element types. The following example gives an impression of the use of StaticMatrix:
anonymous enum |
Compilation flag for intrinsic optimization.
The vectorizable compilation flag indicates whether expressions the vector is involved in can be optimized via intrinsics. In case the element type of the vector is a vectorizable data type, the vectorizable compilation flag is set to true, otherwise it is set to false.
|
inlineexplicit |
The default constructor for StaticMatrix.
All matrix elements are initialized to the default value (i.e. 0 for integral data types).
|
inlineexplicit |
Constructor for a homogenous initialization of all elements.
init | Initial value for all matrix elements. |
|
inline |
The copy constructor for StaticMatrix.
m | Matrix to be copied. |
The copy constructor is explicitly defined in order to enable/facilitate NRV optimization.
|
inline |
Conversion constructor from different StaticMatrix instances.
m | Matrix to be copied. |
|
inline |
Conversion constructor from different matrices.
m | Matrix to be copied. |
std::invalid_argument | Invalid setup of static matrix. |
This constructor initializes the static matrix from the given matrix. In case the size of the given matrix does not match the size of the static matrix (i.e. the number of rows is not M or the number of columns is not N), a std::invalid_argument exception is thrown.
|
inline |
Constructor for and
matrices.
v1 | The initializer for the first matrix element. |
v2 | The initializer for the second matrix element. |
This constructor offers the option to directly initialize a newly created and
matrix. The following example demonstrates this by creating the matrix
:
|
inline |
Constructor for and
matrices.
v1 | The initializer for the first matrix element. |
v2 | The initializer for the second matrix element. |
v3 | The initializer for the third matrix element. |
This constructor offers the option to directly initialize a newly created and
matrix. The following example demonstrates this by creating the matrix
:
|
inline |
Constructor for ,
, and
matrices.
v1 | The initializer for the first matrix element. |
v2 | The initializer for the second matrix element. |
v3 | The initializer for the third matrix element. |
v4 | The initializer for the fourth matrix element. |
This constructor offers the option to directly initialize a newly created ,
and
matrix. The following example demonstrates this by creating the matrix
:
|
inline |
Constructor for and
matrices.
v1 | The initializer for the first matrix element. |
v2 | The initializer for the second matrix element. |
v3 | The initializer for the third matrix element. |
v4 | The initializer for the fourth matrix element. |
v5 | The initializer for the fifth matrix element. |
This constructor offers the option to directly initialize a newly created , and
matrix. The following example demonstrates this by creating the matrix
:
|
inline |
Constructor for ,
,
, and
matrices.
v1 | The initializer for the first matrix element. |
v2 | The initializer for the second matrix element. |
v3 | The initializer for the third matrix element. |
v4 | The initializer for the fourth matrix element. |
v5 | The initializer for the fifth matrix element. |
v6 | The initializer for the sixth matrix element. |
This constructor offers the option to directly initialize a newly created ,
,
, and
matrix. The following example demonstrates this by creating the matrix
:
|
inline |
Constructor for and
matrices.
v1 | The initializer for the first matrix element. |
v2 | The initializer for the second matrix element. |
v3 | The initializer for the third matrix element. |
v4 | The initializer for the fourth matrix element. |
v5 | The initializer for the fifth matrix element. |
v6 | The initializer for the sixth matrix element. |
v7 | The initializer for the seventh matrix element. |
This constructor offers the option to directly initialize a newly created , and
matrix. The following example demonstrates this by creating the matrix
:
|
inline |
Constructor for and
matrices.
v1 | The initializer for the first matrix element. |
v2 | The initializer for the second matrix element. |
v3 | The initializer for the third matrix element. |
v4 | The initializer for the fourth matrix element. |
v5 | The initializer for the fifth matrix element. |
v6 | The initializer for the sixth matrix element. |
v7 | The initializer for the seventh matrix element. |
v8 | The initializer for the eigth matrix element. |
This constructor offers the option to directly initialize a newly created ,
,
, and
matrix. The following example demonstrates this by creating the matrix
:
|
inline |
Constructor for ,
, and
matrices.
v1 | The initializer for the first matrix element. |
v2 | The initializer for the second matrix element. |
v3 | The initializer for the third matrix element. |
v4 | The initializer for the fourth matrix element. |
v5 | The initializer for the fifth matrix element. |
v6 | The initializer for the sixth matrix element. |
v7 | The initializer for the seventh matrix element. |
v8 | The initializer for the eigth matrix element. |
v9 | The initializer for the ninth matrix element. |
This constructor offers the option to directly initialize a newly created ,
, and
matrix. The following example demonstrates this by creating the matrix
:
|
inline |
Constructor for ,
,
, and
matrices.
v1 | The initializer for the first matrix element. |
v2 | The initializer for the second matrix element. |
v3 | The initializer for the third matrix element. |
v4 | The initializer for the fourth matrix element. |
v5 | The initializer for the fifth matrix element. |
v6 | The initializer for the sixth matrix element. |
v7 | The initializer for the seventh matrix element. |
v8 | The initializer for the eigth matrix element. |
v9 | The initializer for the ninth matrix element. |
v10 | The initializer for the tenth matrix element. |
This constructor offers the option to directly initialize a newly created ,
,
, and
matrix. The following example demonstrates this by creating the matrix
:
|
inline |
Default implementation of the addition assignment of a row-major sparse matrix.
rhs | The right-hand side sparse matrix to be added. |
This function must NOT be called explicitly! It is used internally for the performance optimized evaluation of expression templates. Calling this function explicitly might result in erroneous results and/or in compilation errors. Instead of using this function use the assignment operator.
|
inline |
Default implementation of the addition assignment of a column-major sparse matrix.
rhs | The right-hand side sparse matrix to be added. |
This function must NOT be called explicitly! It is used internally for the performance optimized evaluation of expression templates. Calling this function explicitly might result in erroneous results and/or in compilation errors. Instead of using this function use the assignment operator.
|
inline |
Default implementation of the addition assignment of a row-major dense matrix.
rhs | The right-hand side dense matrix to be added. |
This function must NOT be called explicitly! It is used internally for the performance optimized evaluation of expression templates. Calling this function explicitly might result in erroneous results and/or in compilation errors. Instead of using this function use the assignment operator.
|
inline |
Intrinsic optimized implementation of the addition assignment of a dense matrix.
rhs | The right-hand side dense matrix to be added. |
This function must NOT be called explicitly! It is used internally for the performance optimized evaluation of expression templates. Calling this function explicitly might result in erroneous results and/or in compilation errors. Instead of using this function use the assignment operator.
|
inline |
Default implementation of the assignment of a row-major sparse matrix.
rhs | The right-hand side sparse matrix to be assigned. |
This function must NOT be called explicitly! It is used internally for the performance optimized evaluation of expression templates. Calling this function explicitly might result in erroneous results and/or in compilation errors. Instead of using this function use the assignment operator.
|
inline |
Default implementation of the assignment of a column-major sparse matrix.
rhs | The right-hand side sparse matrix to be assigned. |
This function must NOT be called explicitly! It is used internally for the performance optimized evaluation of expression templates. Calling this function explicitly might result in erroneous results and/or in compilation errors. Instead of using this function use the assignment operator.
|
inline |
Default implementation of the assignment of a dense matrix.
rhs | The right-hand side dense matrix to be assigned. |
This function must NOT be called explicitly! It is used internally for the performance optimized evaluation of expression templates. Calling this function explicitly might result in erroneous results and/or in compilation errors. Instead of using this function use the assignment operator.
|
inline |
Intrinsic optimized implementation of the assignment of a dense matrix.
rhs | The right-hand side dense matrix to be assigned. |
This function must NOT be called explicitly! It is used internally for the performance optimized evaluation of expression templates. Calling this function explicitly might result in erroneous results and/or in compilation errors. Instead of using this function use the assignment operator.
|
inline |
Returns an iterator to the first element of row/column i.
i | The row/column index. |
This function returns a row/column iterator to the first element of row/column i. In case the storage order is set to rowMajor the function returns an iterator to the first element of row i, in case the storage flag is set to columnMajor the function returns an iterator to the first element of column i.
|
inline |
Returns an iterator to the first element of row/column i.
i | The row/column index. |
This function returns a row/column iterator to the first element of row/column i. In case the storage order is set to rowMajor the function returns an iterator to the first element of row i, in case the storage flag is set to columnMajor the function returns an iterator to the first element of column i.
|
inline |
Returns whether the matrix can alias with the given address alias.
alias | The alias to be checked. |
This function returns whether the given address can alias with the vector. In contrast to the isAliased() function this function is allowed to use compile time expressions to optimize the evaluation.
|
inline |
Returns the maximum capacity of the matrix.
|
inline |
Returns the current capacity of the specified row/column.
i | The index of the row/column. |
This function returns the current capacity of the specified row/column. In case the storage order is set to rowMajor the function returns the capacity of row i, in case the storage flag is set to columnMajor the function returns the capacity of column i.
|
inline |
Returns an iterator to the first element of row/column i.
i | The row/column index. |
This function returns a row/column iterator to the first element of row/column i. In case the storage order is set to rowMajor the function returns an iterator to the first element of row i, in case the storage flag is set to columnMajor the function returns an iterator to the first element of column i.
|
inline |
Returns an iterator just past the last element of row/column i.
i | The row/column index. |
This function returns an row/column iterator just past the last element of row/column i. In case the storage order is set to rowMajor the function returns an iterator just past the last element of row i, in case the storage flag is set to columnMajor the function returns an iterator just past the last element of column i.
|
inline |
Returns the current number of columns of the matrix.
|
inline |
Low-level data access to the matrix elements.
|
inline |
Low-level data access to the matrix elements.
|
inline |
Low-level data access to the matrix elements of row/column i.
i | The row/column index. |
|
inline |
Low-level data access to the matrix elements of row/column i.
i | The row/column index. |
|
inline |
Returns an iterator just past the last element of row/column i.
i | The row/column index. |
This function returns an row/column iterator just past the last element of row/column i. In case the storage order is set to rowMajor the function returns an iterator just past the last element of row i, in case the storage flag is set to columnMajor the function returns an iterator just past the last element of column i.
|
inline |
Returns an iterator just past the last element of row/column i.
i | The row/column index. |
This function returns an row/column iterator just past the last element of row/column i. In case the storage order is set to rowMajor the function returns an iterator just past the last element of row i, in case the storage flag is set to columnMajor the function returns an iterator just past the last element of column i.
|
inline |
Access to the intrinsic elements of the matrix.
i | Access index for the row. The index has to be in the range [0..M-1]. |
j | Access index for the column. The index has to be in the range [0..N-1]. |
This function offers a direct access to the intrinsic elements of the matrix. It must NOT be called explicitly! It is used internally for the performance optimized evaluation of expression templates. Calling this function explicitly might result in erroneous results and/or in compilation errors.
|
inline |
Returns whether the matrix is aliased with the given address alias.
alias | The alias to be checked. |
This function returns whether the given address is aliased with the vector. In contrast to the conAlias() function this function is not allowed to use compile time expressions to optimize the evaluation.
|
inline |
Checks if the matrix is diagonal.
This function tests whether the matrix is diagonal, i.e. if the non-diagonal elements are default elements. In case of integral or floating point data types, a diagonal matrix has the form
|
inline |
Checks if the matrix is symmetric.
|
inline |
Returns the total number of non-zero elements in the matrix.
|
inline |
Returns the number of non-zero elements in the specified row/column.
i | The index of the row/column. |
This function returns the current number of non-zero elements in the specified row/column. In case the storage order is set to rowMajor the function returns the number of non-zero elements in row i, in case the storage flag is set to columnMajor the function returns the number of non-zero elements in column i.
|
inline |
2D-access to the matrix elements.
i | Access index for the row. The index has to be in the range [0..M-1]. |
j | Access index for the column. The index has to be in the range [0..N-1]. |
|
inline |
2D-access to the matrix elements.
i | Access index for the row. The index has to be in the range [0..M-1]. |
j | Access index for the column. The index has to be in the range [0..N-1]. |
|
inline |
Multiplication assignment operator for the multiplication of a matrix ( ).
rhs | The right-hand side matrix for the multiplication. |
std::invalid_argument | Matrix sizes do not match. |
In case the current sizes of the two given matrices don't match, a std::invalid_argument is thrown.
|
inline |
Multiplication assignment operator for the multiplication between a matrix and a scalar value ( ).
rhs | The right-hand side scalar value for the multiplication. |
|
inline |
Addition assignment operator for the addition of a matrix ( ).
rhs | The right-hand side matrix to be added to the matrix. |
std::invalid_argument | Matrix sizes do not match. |
In case the current sizes of the two matrices don't match, a std::invalid_argument exception is thrown.
|
inline |
Subtraction assignment operator for the subtraction of a matrix ( ).
rhs | The right-hand side matrix to be subtracted from the matrix. |
std::invalid_argument | Matrix sizes do not match. |
In case the current sizes of the two matrices don't match, a std::invalid_argument exception is thrown.
|
inline |
Division assignment operator for the division of a matrix by a scalar value ( ).
rhs | The right-hand side scalar value for the division. |
Note: A division by zero is only checked by an user assert.
|
inline |
Homogenous assignment to all matrix elements.
set | Scalar value to be assigned to all matrix elements. |
|
inline |
Copy assignment operator for StaticMatrix.
rhs | Matrix to be copied. |
Explicit definition of a copy assignment operator for performance reasons.
|
inline |
Assignment operator for different StaticMatrix instances.
rhs | Matrix to be copied. |
|
inline |
Assignment operator for different matrices.
rhs | Matrix to be copied. |
std::invalid_argument | Invalid assignment to static matrix. |
This constructor initializes the matrix as a copy of the given matrix. In case the number of rows of the given matrix is not M or the number of columns is not N, a std::invalid_argument exception is thrown.
|
inlineinherited |
Conversion operator for non-constant matrices.
|
inlineinherited |
Conversion operator for constant matrices.
|
inline |
Reset to the default initial values.
|
inline |
Reset the specified row/column to the default initial values.
i | The index of the row/column. |
This function resets the values in the specified row/column to their default value. In case the storage order is set to rowMajor the function resets the values in row i, in case the storage order is set to columnMajor the function resets the values in column i. Note that the capacity of the row/column remains unchanged.
|
inline |
Returns the current number of rows of the matrix.
|
inline |
Scaling of the matrix by the scalar value scalar ( ).
scalar | The scalar value for the matrix scaling. |
|
inline |
Returns the spacing between the beginning of two rows.
This function returns the spacing between the beginning of two rows, i.e. the total number of elements of a row.
|
inline |
Default implementation of the subtraction assignment of a row-major sparse matrix.
rhs | The right-hand side sparse matrix to be subtracted. |
This function must NOT be called explicitly! It is used internally for the performance optimized evaluation of expression templates. Calling this function explicitly might result in erroneous results and/or in compilation errors. Instead of using this function use the assignment operator.
|
inline |
Default implementation of the subtraction assignment of a column-major sparse matrix.
rhs | The right-hand side sparse matrix to be subtracted. |
This function must NOT be called explicitly! It is used internally for the performance optimized evaluation of expression templates. Calling this function explicitly might result in erroneous results and/or in compilation errors. Instead of using this function use the assignment operator.
|
inline |
Default implementation of the subtraction assignment of a dense matrix.
rhs | The right-hand side dense matrix to be subtracted. |
This function must NOT be called explicitly! It is used internally for the performance optimized evaluation of expression templates. Calling this function explicitly might result in erroneous results and/or in compilation errors. Instead of using this function use the assignment operator.
|
inline |
Intrinsic optimized implementation of the subtraction assignment of a dense matrix.
rhs | The right-hand side dense matrix to be subtracted. |
This function must NOT be called explicitly! It is used internally for the performance optimized evaluation of expression templates. Calling this function explicitly might result in erroneous results and/or in compilation errors. Instead of using this function use the assignment operator.
|
inline |
Swapping the contents of two static matrices.
m | The matrix to be swapped. |
no-throw | guarantee. |
|
inline |
Transposing the matrix.
|
private |
The statically allocated matrix elements.
Access to the matrix elements is gained via the function call operator. In case of row-major order the memory layout of the elements is
.