35 #ifndef _BLAZE_MATH_ADAPTORS_DIAGONALMATRIX_DENSE_H_ 36 #define _BLAZE_MATH_ADAPTORS_DIAGONALMATRIX_DENSE_H_ 114 template<
typename MT
116 class DiagonalMatrix<MT,SO,true>
117 :
public DenseMatrix< DiagonalMatrix<MT,SO,true>, SO >
121 using OT = OppositeType_<MT>;
122 using TT = TransposeType_<MT>;
123 using ET = ElementType_<MT>;
128 using This = DiagonalMatrix<MT,SO,true>;
129 using BaseType = DenseMatrix<This,SO>;
134 using SIMDType = SIMDType_<MT>;
139 using Pointer = Pointer_<MT>;
140 using ConstPointer = ConstPointer_<MT>;
147 template<
typename NewType >
150 using Other = DiagonalMatrix< typename MT::template Rebind<NewType>::Other >;
157 template<
size_t NewM
161 using Other = DiagonalMatrix< typename MT::template Resize<NewM,NewN>::Other >;
172 using IteratorCategory = std::random_access_iterator_tag;
173 using ValueType = ElementType_<MT>;
174 using PointerType = DiagonalProxy<MT>;
175 using ReferenceType = DiagonalProxy<MT>;
176 using DifferenceType = ptrdiff_t;
179 using iterator_category = IteratorCategory;
180 using value_type = ValueType;
181 using pointer = PointerType;
182 using reference = ReferenceType;
183 using difference_type = DifferenceType;
217 ( SO )?( row_ += inc ):( column_ += inc );
229 ( SO )?( row_ -= dec ):( column_ -= dec );
239 inline Iterator& operator++() noexcept {
240 ( SO )?( ++row_ ):( ++column_ );
250 inline const Iterator operator++(
int ) noexcept {
262 inline Iterator& operator--() noexcept {
263 ( SO )?( --row_ ):( --column_ );
273 inline const Iterator operator--(
int ) noexcept {
286 return ReferenceType( *matrix_, row_, column_ );
295 inline PointerType operator->()
const {
296 return PointerType( *matrix_, row_, column_ );
310 inline SIMDType load()
const {
311 return (*matrix_).load(row_,column_);
325 inline SIMDType
loada()
const {
326 return (*matrix_).loada(row_,column_);
340 inline SIMDType
loadu()
const {
341 return (*matrix_).loadu(row_,column_);
352 return matrix_->begin( column_ ) + row_;
354 return matrix_->begin( row_ ) + column_;
366 return ( SO )?( lhs.row_ == rhs.row_ ):( lhs.column_ == rhs.column_ );
402 return ( SO )?( lhs.row_ != rhs.row_ ):( lhs.column_ != rhs.column_ );
438 return ( SO )?( lhs.row_ < rhs.row_ ):( lhs.column_ < rhs.column_ );
474 return ( SO )?( lhs.row_ > rhs.row_ ):( lhs.column_ > rhs.column_ );
510 return ( SO )?( lhs.row_ <= rhs.row_ ):( lhs.column_ <= rhs.column_ );
546 return ( SO )?( lhs.row_ >= rhs.row_ ):( lhs.column_ >= rhs.column_ );
581 return ( SO )?( row_ - rhs.row_ ):( column_ - rhs.column_ );
594 return Iterator( *it.matrix_, it.row_ + inc, it.column_ );
596 return Iterator( *it.matrix_, it.row_, it.column_ + inc );
609 return Iterator( *it.matrix_, it.row_ + inc, it.column_ );
611 return Iterator( *it.matrix_, it.row_, it.column_ + inc );
624 return Iterator( *it.matrix_, it.row_ - dec, it.column_ );
626 return Iterator( *it.matrix_, it.row_, it.column_ - dec );
641 enum :
bool { simdEnabled = MT::simdEnabled };
644 enum :
bool { smpAssignable = MT::smpAssignable };
650 explicit inline DiagonalMatrix();
651 template<
typename A1 >
explicit inline DiagonalMatrix(
const A1& a1 );
652 explicit inline DiagonalMatrix(
size_t n,
const ElementType& init );
654 explicit inline DiagonalMatrix( initializer_list< initializer_list<ElementType> > list );
656 template<
typename Other >
657 explicit inline DiagonalMatrix(
size_t n,
const Other* array );
659 template<
typename Other,
size_t N >
660 explicit inline DiagonalMatrix(
const Other (&array)[N][N] );
662 explicit inline DiagonalMatrix(
ElementType* ptr,
size_t n );
663 explicit inline DiagonalMatrix(
ElementType* ptr,
size_t n,
size_t nn );
665 inline DiagonalMatrix(
const DiagonalMatrix& m );
666 inline DiagonalMatrix( DiagonalMatrix&& m ) noexcept;
677 inline Reference operator()(
size_t i,
size_t j );
679 inline Reference at(
size_t i,
size_t j );
681 inline ConstPointer
data () const noexcept;
682 inline ConstPointer
data (
size_t i ) const noexcept;
695 inline DiagonalMatrix& operator=( const
ElementType& rhs );
696 inline DiagonalMatrix& operator=( initializer_list< initializer_list<
ElementType> > list );
698 template< typename Other,
size_t N >
699 inline DiagonalMatrix& operator=( const Other (&array)[N][N] );
701 inline DiagonalMatrix& operator=( const DiagonalMatrix& rhs );
702 inline DiagonalMatrix& operator=( DiagonalMatrix&& rhs ) noexcept;
704 template< typename MT2,
bool SO2 >
705 inline
DisableIf_< IsComputation<MT2>, DiagonalMatrix& > operator=( const Matrix<MT2,SO2>& rhs );
707 template< typename MT2,
bool SO2 >
708 inline
EnableIf_< IsComputation<MT2>, DiagonalMatrix& > operator=( const Matrix<MT2,SO2>& rhs );
710 template< typename MT2,
bool SO2 >
711 inline
DisableIf_< IsComputation<MT2>, DiagonalMatrix& > operator+=( const Matrix<MT2,SO2>& rhs );
713 template< typename MT2,
bool SO2 >
714 inline
EnableIf_< IsComputation<MT2>, DiagonalMatrix& > operator+=( const Matrix<MT2,SO2>& rhs );
716 template< typename MT2,
bool SO2 >
717 inline
DisableIf_< IsComputation<MT2>, DiagonalMatrix& > operator-=( const Matrix<MT2,SO2>& rhs );
719 template< typename MT2,
bool SO2 >
720 inline
EnableIf_< IsComputation<MT2>, DiagonalMatrix& > operator-=( const Matrix<MT2,SO2>& rhs );
722 template< typename MT2,
bool SO2 >
723 inline DiagonalMatrix& operator%=( const Matrix<MT2,SO2>& rhs );
725 template< typename ST >
726 inline
EnableIf_< IsNumeric<ST>, DiagonalMatrix >& operator*=( ST rhs );
728 template< typename ST >
729 inline
EnableIf_< IsNumeric<ST>, DiagonalMatrix >& operator/=( ST rhs );
736 inline
size_t rows() const noexcept;
737 inline
size_t columns() const noexcept;
738 inline
size_t spacing() const noexcept;
739 inline
size_t capacity() const noexcept;
740 inline
size_t capacity(
size_t i ) const noexcept;
742 inline
size_t nonZeros(
size_t i ) const;
744 inline
void reset(
size_t i );
746 void resize (
size_t n,
bool preserve=true );
747 inline
void extend (
size_t n,
bool preserve=true );
748 inline
void reserve(
size_t elements );
750 inline
void swap( DiagonalMatrix& m ) noexcept;
757 template< typename Other > inline DiagonalMatrix& scale( const Other& scalar );
764 inline
bool isIntact() const noexcept;
771 template< typename Other > inline
bool canAlias ( const Other* alias ) const noexcept;
772 template< typename Other > inline
bool isAliased( const Other* alias ) const noexcept;
774 inline
bool isAligned () const noexcept;
775 inline
bool canSMPAssign() const noexcept;
787 inline const MT construct(
size_t n ,
TrueType );
790 template< typename MT2,
bool SO2, typename T >
791 inline const MT construct( const Matrix<MT2,SO2>& m, T );
803 template<
bool RF, typename MT2,
bool SO2,
bool DF2 >
804 friend
bool isDefault( const DiagonalMatrix<MT2,SO2,DF2>& m );
806 template< typename MT2,
bool SO2,
bool DF2 >
807 friend MT2& derestrict( DiagonalMatrix<MT2,SO2,DF2>& m );
842 template< typename MT
844 inline DiagonalMatrix<MT,SO,true>::DiagonalMatrix()
872 template<
typename MT
874 template<
typename A1 >
875 inline DiagonalMatrix<MT,SO,true>::DiagonalMatrix(
const A1& a1 )
876 : matrix_( construct( a1, typename IsResizable<MT>::Type() ) )
892 template<
typename MT
894 inline DiagonalMatrix<MT,SO,true>::DiagonalMatrix(
size_t n,
const ElementType& init )
899 for(
size_t i=0UL; i<n; ++i )
933 template<
typename MT
935 inline DiagonalMatrix<MT,SO,true>::DiagonalMatrix( initializer_list< initializer_list<ElementType> > list )
974 template<
typename MT
976 template<
typename Other >
977 inline DiagonalMatrix<MT,SO,true>::DiagonalMatrix(
size_t n,
const Other* array )
978 : matrix_( n, n, array )
1013 template<
typename MT
1015 template<
typename Other
1017 inline DiagonalMatrix<MT,SO,true>::DiagonalMatrix(
const Other (&array)[N][N] )
1062 template<
typename MT
1064 inline DiagonalMatrix<MT,SO,true>::DiagonalMatrix(
ElementType* ptr,
size_t n )
1065 : matrix_( ptr, n, n )
1111 template<
typename MT
1113 inline DiagonalMatrix<MT,SO,true>::DiagonalMatrix(
ElementType* ptr,
size_t n,
size_t nn )
1114 : matrix_( ptr, n, n, nn )
1132 template<
typename MT
1134 inline DiagonalMatrix<MT,SO,true>::DiagonalMatrix(
const DiagonalMatrix& m )
1135 : matrix_( m.matrix_ )
1150 template<
typename MT
1152 inline DiagonalMatrix<MT,SO,true>::DiagonalMatrix( DiagonalMatrix&& m ) noexcept
1153 : matrix_( std::move( m.matrix_ ) )
1186 template<
typename MT
1189 DiagonalMatrix<MT,SO,true>::operator()(
size_t i,
size_t j )
1216 template<
typename MT
1219 DiagonalMatrix<MT,SO,true>::operator()(
size_t i,
size_t j )
const 1224 return matrix_(i,j);
1247 template<
typename MT
1250 DiagonalMatrix<MT,SO,true>::at(
size_t i,
size_t j )
1258 return (*
this)(i,j);
1281 template<
typename MT
1284 DiagonalMatrix<MT,SO,true>::at(
size_t i,
size_t j )
const 1292 return (*
this)(i,j);
1311 template<
typename MT
1313 inline typename DiagonalMatrix<MT,SO,true>::ConstPointer
1316 return matrix_.data();
1331 template<
typename MT
1333 inline typename DiagonalMatrix<MT,SO,true>::ConstPointer
1336 return matrix_.data(i);
1354 template<
typename MT
1360 return Iterator( matrix_, 0UL, i );
1362 return Iterator( matrix_, i, 0UL );
1380 template<
typename MT
1385 return matrix_.begin(i);
1403 template<
typename MT
1408 return matrix_.cbegin(i);
1426 template<
typename MT
1452 template<
typename MT
1457 return matrix_.end(i);
1475 template<
typename MT
1480 return matrix_.cend(i);
1501 template<
typename MT
1503 inline DiagonalMatrix<MT,SO,true>&
1504 DiagonalMatrix<MT,SO,true>::operator=(
const ElementType& rhs )
1506 for(
size_t i=0UL; i<
rows(); ++i )
1540 template<
typename MT
1542 inline DiagonalMatrix<MT,SO,true>&
1543 DiagonalMatrix<MT,SO,true>::operator=( initializer_list< initializer_list<ElementType> > list )
1545 const InitializerMatrix<ElementType> tmp( list, list.size() );
1586 template<
typename MT
1588 template<
typename Other
1590 inline DiagonalMatrix<MT,SO,true>&
1591 DiagonalMatrix<MT,SO,true>::operator=(
const Other (&array)[N][N] )
1599 matrix_ = std::move( tmp );
1620 template<
typename MT
1622 inline DiagonalMatrix<MT,SO,true>&
1623 DiagonalMatrix<MT,SO,true>::operator=(
const DiagonalMatrix& rhs )
1625 matrix_ = rhs.matrix_;
1643 template<
typename MT
1645 inline DiagonalMatrix<MT,SO,true>&
1646 DiagonalMatrix<MT,SO,true>::operator=( DiagonalMatrix&& rhs ) noexcept
1648 matrix_ = std::move( rhs.matrix_ );
1672 template<
typename MT
1674 template<
typename MT2
1676 inline DisableIf_< IsComputation<MT2>, DiagonalMatrix<MT,SO,true>& >
1677 DiagonalMatrix<MT,SO,true>::operator=(
const Matrix<MT2,SO2>& rhs )
1679 if( !IsDiagonal<MT2>::value && !
isDiagonal( ~rhs ) ) {
1707 template<
typename MT
1709 template<
typename MT2
1711 inline EnableIf_< IsComputation<MT2>, DiagonalMatrix<MT,SO,true>& >
1712 DiagonalMatrix<MT,SO,true>::operator=(
const Matrix<MT2,SO2>& rhs )
1714 if( !IsSquare<MT2>::value && !
isSquare( ~rhs ) ) {
1718 if( IsDiagonal<MT2>::value ) {
1728 matrix_ = std::move( tmp );
1753 template<
typename MT
1755 template<
typename MT2
1757 inline DisableIf_< IsComputation<MT2>, DiagonalMatrix<MT,SO,true>& >
1760 if( !IsDiagonal<MT2>::value && !
isDiagonal( ~rhs ) ) {
1788 template<
typename MT
1790 template<
typename MT2
1792 inline EnableIf_< IsComputation<MT2>, DiagonalMatrix<MT,SO,true>& >
1795 if( !IsSquare<MT2>::value && !
isSquare( ~rhs ) ) {
1799 if( IsDiagonal<MT2>::value ) {
1803 const ResultType_<MT2> tmp( ~rhs );
1834 template<
typename MT
1836 template<
typename MT2
1838 inline DisableIf_< IsComputation<MT2>, DiagonalMatrix<MT,SO,true>& >
1841 if( !IsDiagonal<MT2>::value && !
isDiagonal( ~rhs ) ) {
1869 template<
typename MT
1871 template<
typename MT2
1873 inline EnableIf_< IsComputation<MT2>, DiagonalMatrix<MT,SO,true>& >
1876 if( !IsSquare<MT2>::value && !
isSquare( ~rhs ) ) {
1880 if( IsDiagonal<MT2>::value ) {
1884 const ResultType_<MT2> tmp( ~rhs );
1913 template<
typename MT
1915 template<
typename MT2
1917 inline DiagonalMatrix<MT,SO,true>&
1918 DiagonalMatrix<MT,SO,true>::operator%=(
const Matrix<MT2,SO2>& rhs )
1920 if( !IsSquare<MT2>::value && !
isSquare( ~rhs ) ) {
1943 template<
typename MT
1945 template<
typename ST >
1946 inline EnableIf_< IsNumeric<ST>, DiagonalMatrix<MT,SO,true> >&
1964 template<
typename MT
1966 template<
typename ST >
1967 inline EnableIf_< IsNumeric<ST>, DiagonalMatrix<MT,SO,true> >&
1992 template<
typename MT
1996 return matrix_.rows();
2008 template<
typename MT
2012 return matrix_.columns();
2029 template<
typename MT
2033 return matrix_.spacing();
2045 template<
typename MT
2049 return matrix_.capacity();
2067 template<
typename MT
2071 return matrix_.capacity(i);
2083 template<
typename MT
2087 return matrix_.nonZeros();
2105 template<
typename MT
2109 return matrix_.nonZeros(i);
2121 template<
typename MT
2144 template<
typename MT
2166 template<
typename MT
2214 template<
typename MT
2224 const size_t oldsize( matrix_.rows() );
2226 matrix_.resize( n, n,
true );
2229 const size_t increment( n - oldsize );
2230 submatrix( matrix_, 0UL, oldsize, n, increment ).reset();
2231 submatrix( matrix_, oldsize, 0UL, increment, increment ).reset();
2251 template<
typename MT
2253 inline void DiagonalMatrix<MT,SO,true>::extend(
size_t n,
bool preserve )
2274 template<
typename MT
2276 inline void DiagonalMatrix<MT,SO,true>::reserve(
size_t elements )
2278 matrix_.reserve( elements );
2294 template<
typename MT
2298 matrix_.shrinkToFit();
2311 template<
typename MT
2317 swap( matrix_, m.matrix_ );
2349 template<
typename MT
2351 template<
typename Other >
2352 inline DiagonalMatrix<MT,SO,true>& DiagonalMatrix<MT,SO,true>::scale(
const Other& scalar )
2354 matrix_.scale( scalar );
2379 template<
typename MT
2410 template<
typename MT
2412 template<
typename Other >
2413 inline bool DiagonalMatrix<MT,SO,true>::canAlias(
const Other* alias )
const noexcept
2415 return matrix_.canAlias( alias );
2432 template<
typename MT
2434 template<
typename Other >
2435 inline bool DiagonalMatrix<MT,SO,true>::isAliased(
const Other* alias )
const noexcept
2437 return matrix_.isAliased( alias );
2453 template<
typename MT
2455 inline bool DiagonalMatrix<MT,SO,true>::isAligned() const noexcept
2457 return matrix_.isAligned();
2474 template<
typename MT
2476 inline bool DiagonalMatrix<MT,SO,true>::canSMPAssign() const noexcept
2478 return matrix_.canSMPAssign();
2500 template<
typename MT
2503 DiagonalMatrix<MT,SO,true>::load(
size_t i,
size_t j )
const noexcept
2505 return matrix_.load( i, j );
2527 template<
typename MT
2532 return matrix_.loada( i, j );
2554 template<
typename MT
2559 return matrix_.loadu( i, j );
2580 template<
typename MT
2582 inline const MT DiagonalMatrix<MT,SO,true>::construct(
size_t n, TrueType )
2599 template<
typename MT
2601 inline const MT DiagonalMatrix<MT,SO,true>::construct(
const ElementType& init, FalseType )
2608 for(
size_t i=0UL; i<tmp.rows(); ++i )
2628 template<
typename MT
2630 template<
typename MT2
2633 inline const MT DiagonalMatrix<MT,SO,true>::construct(
const Matrix<MT2,SO2>& m, T )
2637 if( !IsDiagonal<MT2>::value && !
isDiagonal( tmp ) ) {
Constraint on the data type.
Header file for the implementation of the Submatrix view.
#define BLAZE_CONSTRAINT_MUST_NOT_BE_CONST(T)
Constraint on the data type.In case the given data type is a const-qualified type, a compilation error is created.
Definition: Const.h:79
Header file for the UnderlyingNumeric type trait.
BoolConstant< false > FalseType
Type/value traits base class.The FalseType class is used as base class for type traits and value trai...
Definition: FalseType.h:61
#define BLAZE_THROW_INVALID_ARGUMENT(MESSAGE)
Macro for the emission of a std::invalid_argument exception.This macro encapsulates the default way o...
Definition: Exception.h:235
Header file for auxiliary alias declarations.
decltype(auto) column(Matrix< MT, SO > &matrix, RCAs... args)
Creating a view on a specific column of the given matrix.
Definition: Column.h:131
CompressedMatrix< Type, false > OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: CompressedMatrix.h:3077
decltype(auto) decldiag(const DenseMatrix< MT, SO > &dm)
Declares the given dense matrix expression dm as diagonal.
Definition: DMatDeclDiagExpr.h:996
#define BLAZE_USER_ASSERT(expr, msg)
Run time assertion macro for user checks.In case of an invalid run time expression, the program execution is terminated. The BLAZE_USER_ASSERT macro can be disabled by setting the BLAZE_USER_ASSERT flag to zero or by defining NDEBUG during the compilation.
Definition: Assert.h:117
Header file for the UNUSED_PARAMETER function template.
BLAZE_ALWAYS_INLINE size_t capacity(const Matrix< MT, SO > &matrix) noexcept
Returns the maximum capacity of the matrix.
Definition: Matrix.h:522
Header file for basic type definitions.
Header file for the FalseType type/value trait base class.
#define BLAZE_CONSTRAINT_MUST_BE_MATRIX_WITH_STORAGE_ORDER(T, SO)
Constraint on the data type.In case the given data type T is not a dense or sparse matrix type and in...
Definition: StorageOrder.h:63
Header file for the IsDiagonal type trait.
Header file for the implementation of the Band view.
#define BLAZE_CONSTRAINT_MUST_BE_DENSE_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is not a dense, N-dimensional matrix type...
Definition: DenseMatrix.h:61
constexpr bool operator<(const NegativeAccuracy< A > &lhs, const T &rhs)
Less-than comparison between a NegativeAccuracy object and a floating point value.
Definition: Accuracy.h:329
Constraint on the data type.
This ResultType
Result type for expression template evaluations.
Definition: CompressedMatrix.h:3076
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:364
CompressedMatrix< Type, true > This
Type of this CompressedMatrix instance.
Definition: CompressedMatrix.h:3074
Constraint on the data type.
void reset(const DiagonalProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: DiagonalProxy.h:588
const DenseIterator< Type, AF > operator+(const DenseIterator< Type, AF > &it, ptrdiff_t inc) noexcept
Addition between a DenseIterator and an integral value.
Definition: DenseIterator.h:701
BLAZE_ALWAYS_INLINE void shrinkToFit(Matrix< MT, SO > &matrix)
Requesting the removal of unused capacity.
Definition: Matrix.h:775
typename DisableIf< Condition, T >::Type DisableIf_
Auxiliary type for the DisableIf class template.The DisableIf_ alias declaration provides a convenien...
Definition: DisableIf.h:224
void clear(CompressedMatrix< Type, SO > &m)
Clearing the given compressed matrix.
Definition: CompressedMatrix.h:5829
CompressedMatrix< Type, false > TransposeType
Transpose type for expression template evaluations.
Definition: CompressedMatrix.h:3078
Header file for the And class template.
const Type & ConstReference
Reference to a constant matrix value.
Definition: CompressedMatrix.h:3083
#define BLAZE_CONSTRAINT_MUST_NOT_BE_VOLATILE(T)
Constraint on the data type.In case the given data type is a volatile-qualified type, a compilation error is created.
Definition: Volatile.h:79
bool isDiagonal(const DenseMatrix< MT, SO > &dm)
Checks if the give dense matrix is diagonal.
Definition: DenseMatrix.h:1725
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:560
const DenseIterator< Type, AF > operator-(const DenseIterator< Type, AF > &it, ptrdiff_t inc) noexcept
Subtraction between a DenseIterator and an integral value.
Definition: DenseIterator.h:733
BoolConstant< true > TrueType
Type traits base class.The TrueType class is used as base class for type traits and value traits that...
Definition: TrueType.h:61
Element * Iterator
Iterator over non-constant elements.
Definition: CompressedMatrix.h:3084
Header file for the extended initializer_list functionality.
Constraint on the data type.
BLAZE_ALWAYS_INLINE const EnableIf_< And< IsIntegral< T >, HasSize< T, 1UL > >, If_< IsSigned< T >, SIMDint8, SIMDuint8 > > loadu(const T *address) noexcept
Loads a vector of 1-byte integral values.
Definition: Loadu.h:77
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:474
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:408
Constraint on the data type.
Constraint on the data type.
BLAZE_ALWAYS_INLINE size_t spacing(const DenseMatrix< MT, SO > &dm) noexcept
Returns the spacing between the beginning of two rows/columns.
Definition: DenseMatrix.h:252
#define BLAZE_CONSTRAINT_MUST_BE_SQUARE_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is not a square matrix type, a compilation error is created.
Definition: Square.h:60
Header file for the IsSquare type trait.
Constraint on the data type.
Header file for the implementation of a matrix representation of an initializer list.
Header file for the DisableIf class template.
MatrixAccessProxy< This > Reference
Reference to a non-constant matrix value.
Definition: CompressedMatrix.h:3082
Header file for the DiagonalProxy class.
Header file for the clear shim.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58
#define BLAZE_ALWAYS_INLINE
Platform dependent setup of an enforced inline keyword.
Definition: Inline.h:85
void swap(CompressedMatrix< Type, SO > &a, CompressedMatrix< Type, SO > &b) noexcept
Swapping the contents of two compressed matrices.
Definition: CompressedMatrix.h:5908
Header file for the If class template.
Header file for the IsFloatingPoint type trait.
bool isIntact(const CompressedMatrix< Type, SO > &m)
Returns whether the invariants of the given compressed matrix are intact.
Definition: CompressedMatrix.h:5891
Header file for the UnderlyingBuiltin type trait.
SparseMatrix< This, true > BaseType
Base type of this CompressedMatrix instance.
Definition: CompressedMatrix.h:3075
#define BLAZE_CONSTRAINT_MUST_NOT_BE_POINTER_TYPE(T)
Constraint on the data type.In case the given data type T is not a pointer type, a compilation error ...
Definition: Pointer.h:79
Type ElementType
Type of the compressed matrix elements.
Definition: CompressedMatrix.h:3079
Header file for the Or class template.
#define BLAZE_THROW_OUT_OF_RANGE(MESSAGE)
Macro for the emission of a std::out_of_range exception.This macro encapsulates the default way of Bl...
Definition: Exception.h:331
Header file for the DenseMatrix base class.
constexpr bool operator>(const NegativeAccuracy< A > &lhs, const T &rhs)
Greater-than comparison between a NegativeAccuracy object and a floating point value.
Definition: Accuracy.h:367
constexpr bool operator>=(const NegativeAccuracy< A > &, const T &rhs)
Greater-or-equal-than comparison between a NegativeAccuracy object and a floating point value...
Definition: Accuracy.h:443
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:3085
Header file for the isZero shim.
constexpr bool operator==(const NegativeAccuracy< A > &lhs, const T &rhs)
Equality comparison between a NegativeAccuracy object and a floating point value. ...
Definition: Accuracy.h:250
Constraint on the data type.
BLAZE_ALWAYS_INLINE size_t columns(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of columns of the matrix.
Definition: Matrix.h:506
BLAZE_ALWAYS_INLINE const EnableIf_< And< IsIntegral< T >, HasSize< T, 1UL > >, If_< IsSigned< T >, SIMDint8, SIMDuint8 > > loada(const T *address) noexcept
Loads a vector of 1-byte integral values.
Definition: Loada.h:80
Constraints on the storage order of matrix types.
decltype(auto) elements(Vector< VT, TF > &vector, REAs... args)
Creating a view on a selection of elements of the given vector.
Definition: Elements.h:134
Header file for the exception macros of the math module.
#define BLAZE_CONSTRAINT_MUST_NOT_BE_UPPER_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is a upper triangular matrix type...
Definition: Upper.h:81
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:714
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:430
decltype(auto) diagonal(Matrix< MT, SO > &matrix, RDAs... args)
Creating a view on the diagonal of the given matrix.
Definition: Band.h:374
decltype(auto) operator*(const DenseMatrix< MT1, false > &lhs, const DenseMatrix< MT2, false > &rhs)
Multiplication operator for the multiplication of two row-major dense matrices ( ).
Definition: DMatDMatMultExpr.h:8893
constexpr bool operator!=(const NegativeAccuracy< A > &lhs, const T &rhs)
Inequality comparison between a NegativeAccuracy object and a floating point value.
Definition: Accuracy.h:290
decltype(auto) submatrix(Matrix< MT, SO > &, RSAs...)
Creating a view on a specific submatrix of the given matrix.
Definition: Submatrix.h:360
Header file for the EnableIf class template.
Header file for utility functions for dense matrices.
void clear(const DiagonalProxy< MT > &proxy)
Clearing the represented element.
Definition: DiagonalProxy.h:608
Header file for the IsNumeric type trait.
#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:79
BLAZE_ALWAYS_INLINE T1 & operator+=(SIMDPack< T1 > &lhs, const SIMDPack< T2 > &rhs)
Addition assignment operator for the addition of two SIMD packs.
Definition: BasicTypes.h:1357
Header file for run time assertion macros.
Constraint on the data type.
Constraint on the data type.
Constraint on the data type.
decltype(auto) row(Matrix< MT, SO > &, RRAs...)
Creating a view on a specific row of the given matrix.
Definition: Row.h:131
#define BLAZE_CONSTRAINT_MUST_NOT_BE_LOWER_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is a lower triangular matrix type...
Definition: Lower.h:81
#define BLAZE_CONSTRAINT_MUST_NOT_BE_RESIZABLE_TYPE(T)
Constraint on the data type.In case the given data type T is resizable, i.e. has a 'resize' member fu...
Definition: Resizable.h:81
#define BLAZE_CONSTRAINT_MUST_NOT_BE_REFERENCE_TYPE(T)
Constraint on the data type.In case the given data type T is not a reference type, a compilation error is created.
Definition: Reference.h:79
Header file for the isDefault shim.
void swap(DiagonalMatrix< MT, SO, DF > &a, DiagonalMatrix< MT, SO, DF > &b) noexcept
Swapping the contents of two matrices.
Definition: DiagonalMatrix.h:272
Constraint on the data type.
Constraint on the data type.
constexpr bool operator<=(const NegativeAccuracy< A > &, const T &rhs)
Less-or-equal-than comparison between a NegativeAccuracy object and a floating point value...
Definition: Accuracy.h:405
Header file for the IsInvertible type trait.
typename EnableIf< Condition, T >::Type EnableIf_
Auxiliary alias declaration for the EnableIf class template.The EnableIf_ alias declaration provides ...
Definition: EnableIf.h:224
BLAZE_ALWAYS_INLINE size_t rows(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of rows of the matrix.
Definition: Matrix.h:490
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:3080
Header file for the implementation of the base template of the DiagonalMatrix.
BLAZE_ALWAYS_INLINE MT::ElementType * data(DenseMatrix< MT, SO > &dm) noexcept
Low-level data access to the dense matrix elements.
Definition: DenseMatrix.h:169
EnableIf_< IsNumeric< ST >, MT &> operator/=(DenseMatrix< MT, SO > &mat, ST scalar)
Division assignment operator for the division of a dense matrix by a scalar value ( )...
Definition: DenseMatrix.h:655
#define BLAZE_CONSTRAINT_MUST_BE_RESIZABLE_TYPE(T)
Constraint on the data type.In case the given data type T is not resizable, i.e. does not have a 'res...
Definition: Resizable.h:61
Header file for the IsComputation type trait class.
Header file for the IsBuiltin type trait.
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:3081
#define BLAZE_CONSTRAINT_MUST_NOT_BE_EXPRESSION_TYPE(T)
Constraint on the data type.In case the given data type T is an expression (i.e. a type derived from ...
Definition: Expression.h:81
bool isIntact(const DiagonalMatrix< MT, SO, DF > &m)
Returns whether the invariants of the given diagonal matrix are intact.
Definition: DiagonalMatrix.h:254
Header file for the IsComplex type trait.
bool isDefault(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: DiagonalProxy.h:628
#define BLAZE_CONSTRAINT_MUST_NOT_BE_HERMITIAN_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is an Hermitian matrix type, a compilation error is created.
Definition: Hermitian.h:79
BLAZE_ALWAYS_INLINE T1 & operator-=(SIMDPack< T1 > &lhs, const SIMDPack< T2 > &rhs)
Subtraction assignment operator for the subtraction of two SIMD packs.
Definition: BasicTypes.h:1375
void UNUSED_PARAMETER(const Args &...)
Suppression of unused parameter warnings.
Definition: Unused.h:81
#define BLAZE_STATIC_ASSERT(expr)
Compile time assertion macro.In case of an invalid compile time expression, a compilation error is cr...
Definition: StaticAssert.h:112
EnableIf_< IsNumeric< ST >, MT &> operator*=(DenseMatrix< MT, SO > &mat, ST scalar)
Multiplication assignment operator for the multiplication of a dense matrix and a scalar value ( )...
Definition: DenseMatrix.h:593
BLAZE_ALWAYS_INLINE bool isSquare(const Matrix< MT, SO > &matrix) noexcept
Checks if the given matrix is a square matrix.
Definition: Matrix.h:908
Header file for the IsResizable type trait.
System settings for the inline keywords.
Header file for the Size type trait.
#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 TrueType type/value trait base class.