35 #ifndef _BLAZE_MATH_EXPRESSIONS_MATRIX_H_
36 #define _BLAZE_MATH_EXPRESSIONS_MATRIX_H_
93 return *
static_cast<MatrixType*
>( this );
103 return *
static_cast<const MatrixType*
>( this );
121 template<
typename MT,
bool SO >
124 template<
typename MT,
bool SO >
127 template<
typename MT,
bool SO >
130 template<
typename MT,
bool SO >
133 template<
typename MT,
bool SO >
136 template<
typename MT,
bool SO >
139 template<
typename MT,
bool SO >
142 template<
typename MT,
bool SO >
145 template<
typename MT,
bool SO >
148 template<
typename MT,
bool SO >
151 template<
typename MT,
bool SO >
154 template<
typename MT,
bool SO >
157 template<
typename MT,
bool SO >
160 template<
typename MT1,
bool SO1,
typename MT2,
bool SO2 >
163 template<
typename MT1,
bool SO1,
typename MT2,
bool SO2 >
166 template<
typename MT1,
bool SO1,
typename MT2,
bool SO2 >
169 template<
typename MT1,
bool SO1,
typename MT2,
bool SO2 >
172 template<
typename MT,
bool SO >
175 template<
typename MT1,
bool SO1,
typename MT2,
bool SO2 >
193 template<
typename MT
197 return (~matrix).begin(i);
214 template<
typename MT
218 return (~matrix).begin(i);
235 template<
typename MT
239 return (~matrix).cbegin(i);
256 template<
typename MT
260 return (~matrix).end(i);
277 template<
typename MT
281 return (~matrix).end(i);
298 template<
typename MT
302 return (~matrix).cend(i);
314 template<
typename MT
318 return (~matrix).rows();
330 template<
typename MT
334 return (~matrix).columns();
346 template<
typename MT
350 return (~matrix).capacity();
368 template<
typename MT
372 return (~matrix).capacity( i );
384 template<
typename MT
388 return (~matrix).nonZeros();
406 template<
typename MT
410 return (~matrix).nonZeros( i );
431 template<
typename MT
434 resize_backend( Matrix<MT,SO>& matrix,
size_t m,
size_t n,
bool preserve )
438 if( (~matrix).
rows() != m || (~matrix).
columns() != n )
439 throw std::invalid_argument(
"Matrix cannot be resized" );
457 template<
typename MT
460 resize_backend( Matrix<MT,SO>& matrix,
size_t m,
size_t n,
bool preserve )
462 (~matrix).
resize( m, n, preserve );
481 template<
typename MT
484 resize_backend( Matrix<MT,SO>& matrix,
size_t m,
size_t n,
bool preserve )
487 throw std::invalid_argument(
"Invalid resize arguments for square matrix" );
489 (~matrix).
resize( m, preserve );
533 template<
typename MT
537 resize_backend( matrix, m, n, preserve );
551 template<
typename MT1
573 template<
typename MT1
577 assign_backend( Matrix<MT1,SO>& lhs,
const Matrix<MT2,!SO>& rhs )
599 template<
typename MT1
603 assign_backend( Matrix<MT1,SO>& lhs,
const Matrix<MT2,!SO>& rhs )
631 template<
typename MT1
642 assign_backend( ~lhs, ~rhs );
657 template<
typename MT1
660 BLAZE_ALWAYS_INLINE void addAssign_backend( Matrix<MT1,SO>& lhs,
const Matrix<MT2,SO>& rhs )
680 template<
typename MT1
684 addAssign_backend( Matrix<MT1,SO>& lhs,
const Matrix<MT2,!SO>& rhs )
706 template<
typename MT1
710 addAssign_backend( Matrix<MT1,SO>& lhs,
const Matrix<MT2,!SO>& rhs )
738 template<
typename MT1
749 addAssign_backend( ~lhs, ~rhs );
764 template<
typename MT1
767 BLAZE_ALWAYS_INLINE void subAssign_backend( Matrix<MT1,SO>& lhs,
const Matrix<MT2,SO>& rhs )
787 template<
typename MT1
791 subAssign_backend( Matrix<MT1,SO>& lhs,
const Matrix<MT2,!SO>& rhs )
813 template<
typename MT1
817 subAssign_backend( Matrix<MT1,SO>& lhs,
const Matrix<MT2,!SO>& rhs )
845 template<
typename MT1
856 subAssign_backend( ~lhs, ~rhs );
875 template<
typename MT1
900 template<
typename MT
942 template<
typename MT1
949 reinterpret_cast<const void*>( &a ) == reinterpret_cast<const void*>( &b ) );
969 template<
typename MT
BLAZE_ALWAYS_INLINE void multAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the multiplication assignment of a matrix to a matrix.
Definition: Matrix.h:879
Header file for the UNUSED_PARAMETER function template.
Header file for basic type definitions.
BLAZE_ALWAYS_INLINE const MatrixType & operator~() const
Conversion operator for constant matrices.
Definition: Matrix.h:102
BLAZE_ALWAYS_INLINE bool isSquare(const Matrix< MT, SO > &matrix)
Checks if the given matrix is a square matrix.
Definition: Matrix.h:902
BLAZE_ALWAYS_INLINE MT::ConstIterator cbegin(const Matrix< MT, SO > &matrix, size_t i)
Returns an iterator to the first element of row/column i.
Definition: Matrix.h:237
BLAZE_ALWAYS_INLINE MT::ConstIterator cend(const Matrix< MT, SO > &matrix, size_t i)
Returns an iterator just past the last element of row/column i.
Definition: Matrix.h:300
BLAZE_ALWAYS_INLINE MT::Iterator end(Matrix< MT, SO > &matrix, size_t i)
Returns an iterator just past the last element of row/column i.
Definition: Matrix.h:258
MT MatrixType
Type of the matrix.
Definition: Matrix.h:84
BLAZE_ALWAYS_INLINE bool isSame(const Matrix< MT1, SO1 > &a, const Matrix< MT2, SO2 > &b)
Returns whether the two given matrices represent the same observable state.
Definition: Matrix.h:946
Header file for the IsSame and IsStrictlySame type traits.
BLAZE_ALWAYS_INLINE size_t capacity(const Matrix< MT, SO > &matrix)
Returns the maximum capacity of the matrix.
Definition: Matrix.h:348
BLAZE_ALWAYS_INLINE size_t rows(const Matrix< MT, SO > &matrix)
Returns the current number of rows of the matrix.
Definition: Matrix.h:316
void UNUSED_PARAMETER(const T1 &)
Suppression of unused parameter warnings.
Definition: Unused.h:81
Header file for the And class template.
BLAZE_ALWAYS_INLINE size_t nonZeros(const Matrix< MT, SO > &matrix)
Returns the total number of non-zero elements in the matrix.
Definition: Matrix.h:386
Type relationship analysis.This class tests if the two data types A and B are equal. For this type comparison, the cv-qualifiers of both data types are ignored. If A and B are the same data type (ignoring the cv-qualifiers), then the value member enumeration is set to 1, the nested type definition Type is TrueType, and the class derives from TrueType. Otherwise value is set to 0, Type is FalseType, and the class derives from FalseType.
Definition: IsSame.h:158
Header file for the IsSquare type trait.
Header file for the DisableIf class template.
Header file for the IsSymmetric type trait.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
#define BLAZE_ALWAYS_INLINE
Platform dependent setup of an enforced inline keyword.
Definition: Inline.h:85
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2511
BLAZE_ALWAYS_INLINE void assign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the assignment of a matrix to a matrix.
Definition: Matrix.h:635
Header file for the Not class template.
BLAZE_ALWAYS_INLINE MatrixType & operator~()
Conversion operator for non-constant matrices.
Definition: Matrix.h:92
Compile time check for square matrices.This type trait tests whether or not the given template parame...
Definition: IsSquare.h:87
BLAZE_ALWAYS_INLINE MT::Iterator begin(Matrix< MT, SO > &matrix, size_t i)
Returns an iterator to the first element of row/column i.
Definition: Matrix.h:195
BLAZE_ALWAYS_INLINE void resize(Matrix< MT, SO > &matrix, size_t rows, size_t columns, bool preserve=true)
Changing the size of the matrix.
Definition: Matrix.h:535
Header file for the EnableIf class template.
#define BLAZE_CONSTRAINT_MUST_NOT_BE_SYMMETRIC_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is a symmetric matrix type, a compilation error is created.
Definition: Symmetric.h:116
Header file for run time assertion macros.
BLAZE_ALWAYS_INLINE void addAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the addition assignment of a matrix to a matrix.
Definition: Matrix.h:742
Element * Iterator
Iterator over non-constant elements.
Definition: CompressedMatrix.h:2510
Base class for matrices.The Matrix class is a base class for all dense and sparse matrix classes with...
Definition: Forward.h:87
Constraint on the data type.
const DMatTransExpr< MT,!SO > trans(const DenseMatrix< MT, SO > &dm)
Calculation of the transpose of the given dense matrix.
Definition: DMatTransExpr.h:937
#define BLAZE_FUNCTION_TRACE
Function trace macro.This macro can be used to reliably trace function calls. In case function tracin...
Definition: FunctionTrace.h:157
BLAZE_ALWAYS_INLINE size_t columns(const Matrix< MT, SO > &matrix)
Returns the current number of columns of the matrix.
Definition: Matrix.h:332
Header file for the IsResizable type trait.
System settings for the inline keywords.
#define BLAZE_INTERNAL_ASSERT(expr, msg)
Run time assertion macro for internal checks.In case of an invalid run time expression, the program execution is terminated. The BLAZE_INTERNAL_ASSERT macro can be disabled by setting the BLAZE_USER_ASSERTION flag to zero or by defining NDEBUG during the compilation.
Definition: Assert.h:101
Header file for the FunctionTrace class.
BLAZE_ALWAYS_INLINE void subAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the subtraction assignment of a matrix to matrix.
Definition: Matrix.h:849