35 #ifndef _BLAZE_MATH_ADAPTORS_LOWERMATRIX_DENSE_H_ 36 #define _BLAZE_MATH_ADAPTORS_LOWERMATRIX_DENSE_H_ 105 template<
typename MT
107 class LowerMatrix<MT,SO,true>
108 :
public DenseMatrix< LowerMatrix<MT,SO,true>, SO >
112 using OT = OppositeType_<MT>;
113 using TT = TransposeType_<MT>;
114 using ET = ElementType_<MT>;
119 using This = LowerMatrix<MT,SO,true>;
120 using BaseType = DenseMatrix<This,SO>;
125 using SIMDType = SIMDType_<MT>;
130 using Pointer = Pointer_<MT>;
131 using ConstPointer = ConstPointer_<MT>;
138 template<
typename NewType >
141 using Other = LowerMatrix< typename MT::template Rebind<NewType>::Other >;
148 template<
size_t NewM
152 using Other = LowerMatrix< typename MT::template Resize<NewM,NewN>::Other >;
163 using IteratorCategory = std::random_access_iterator_tag;
164 using ValueType = ElementType_<MT>;
165 using PointerType = LowerProxy<MT>;
166 using ReferenceType = LowerProxy<MT>;
167 using DifferenceType = ptrdiff_t;
170 using iterator_category = IteratorCategory;
171 using value_type = ValueType;
172 using pointer = PointerType;
173 using reference = ReferenceType;
174 using difference_type = DifferenceType;
208 ( SO )?( row_ += inc ):( column_ += inc );
220 ( SO )?( row_ -= dec ):( column_ -= dec );
230 inline Iterator& operator++() noexcept {
231 ( SO )?( ++row_ ):( ++column_ );
241 inline const Iterator operator++(
int ) noexcept {
253 inline Iterator& operator--() noexcept {
254 ( SO )?( --row_ ):( --column_ );
264 inline const Iterator operator--(
int ) noexcept {
277 return ReferenceType( *matrix_, row_, column_ );
286 inline PointerType operator->()
const {
287 return PointerType( *matrix_, row_, column_ );
301 inline SIMDType load()
const {
302 return (*matrix_).load(row_,column_);
316 inline SIMDType
loada()
const {
317 return (*matrix_).loada(row_,column_);
331 inline SIMDType
loadu()
const {
332 return (*matrix_).loadu(row_,column_);
343 return matrix_->begin( column_ ) + row_;
345 return matrix_->begin( row_ ) + column_;
357 return ( SO )?( lhs.row_ == rhs.row_ ):( lhs.column_ == rhs.column_ );
393 return ( SO )?( lhs.row_ != rhs.row_ ):( lhs.column_ != rhs.column_ );
429 return ( SO )?( lhs.row_ < rhs.row_ ):( lhs.column_ < rhs.column_ );
465 return ( SO )?( lhs.row_ > rhs.row_ ):( lhs.column_ > rhs.column_ );
501 return ( SO )?( lhs.row_ <= rhs.row_ ):( lhs.column_ <= rhs.column_ );
537 return ( SO )?( lhs.row_ >= rhs.row_ ):( lhs.column_ >= rhs.column_ );
572 return ( SO )?( row_ - rhs.row_ ):( column_ - rhs.column_ );
585 return Iterator( *it.matrix_, it.row_ + inc, it.column_ );
587 return Iterator( *it.matrix_, it.row_, it.column_ + inc );
600 return Iterator( *it.matrix_, it.row_ + inc, it.column_ );
602 return Iterator( *it.matrix_, it.row_, it.column_ + inc );
615 return Iterator( *it.matrix_, it.row_ - dec, it.column_ );
617 return Iterator( *it.matrix_, it.row_, it.column_ - dec );
632 enum :
bool { simdEnabled = MT::simdEnabled };
635 enum :
bool { smpAssignable = MT::smpAssignable };
641 explicit inline LowerMatrix();
642 template<
typename A1 >
explicit inline LowerMatrix(
const A1& a1 );
643 explicit inline LowerMatrix(
size_t n,
const ElementType& init );
645 explicit inline LowerMatrix( initializer_list< initializer_list<ElementType> > list );
647 template<
typename Other >
648 explicit inline LowerMatrix(
size_t n,
const Other* array );
650 template<
typename Other,
size_t N >
651 explicit inline LowerMatrix(
const Other (&array)[N][N] );
653 explicit inline LowerMatrix(
ElementType* ptr,
size_t n );
654 explicit inline LowerMatrix(
ElementType* ptr,
size_t n,
size_t nn );
656 inline LowerMatrix(
const LowerMatrix& m );
657 inline LowerMatrix( LowerMatrix&& m ) noexcept;
668 inline Reference operator()(
size_t i,
size_t j );
670 inline Reference at(
size_t i,
size_t j );
672 inline ConstPointer data () const noexcept;
673 inline ConstPointer data (
size_t i ) const noexcept;
686 inline LowerMatrix& operator=( const
ElementType& rhs );
687 inline LowerMatrix& operator=( initializer_list< initializer_list<
ElementType> > list );
689 template< typename Other,
size_t N >
690 inline LowerMatrix& operator=( const Other (&array)[N][N] );
692 inline LowerMatrix& operator=( const LowerMatrix& rhs );
693 inline LowerMatrix& operator=( LowerMatrix&& rhs ) noexcept;
695 template< typename MT2,
bool SO2 >
696 inline
DisableIf_< IsComputation<MT2>, LowerMatrix& > operator=( const Matrix<MT2,SO2>& rhs );
698 template< typename MT2,
bool SO2 >
699 inline
EnableIf_< IsComputation<MT2>, LowerMatrix& > operator=( const Matrix<MT2,SO2>& rhs );
701 template< typename MT2,
bool SO2 >
702 inline
DisableIf_< IsComputation<MT2>, LowerMatrix& > operator+=( const Matrix<MT2,SO2>& rhs );
704 template< typename MT2,
bool SO2 >
705 inline
EnableIf_< IsComputation<MT2>, LowerMatrix& > operator+=( const Matrix<MT2,SO2>& rhs );
707 template< typename MT2,
bool SO2 >
708 inline
DisableIf_< IsComputation<MT2>, LowerMatrix& > operator-=( const Matrix<MT2,SO2>& rhs );
710 template< typename MT2,
bool SO2 >
711 inline
EnableIf_< IsComputation<MT2>, LowerMatrix& > operator-=( const Matrix<MT2,SO2>& rhs );
713 template< typename MT2,
bool SO2 >
714 inline LowerMatrix& operator%=( const Matrix<MT2,SO2>& rhs );
716 template< typename MT2,
bool SO2 >
717 inline LowerMatrix& operator*=( const Matrix<MT2,SO2>& rhs );
719 template< typename Other >
720 inline
EnableIf_< IsNumeric<Other>, LowerMatrix >& operator*=( Other rhs );
722 template< typename Other >
723 inline
EnableIf_< IsNumeric<Other>, LowerMatrix >& operator/=( Other rhs );
730 inline
size_t rows() const noexcept;
731 inline
size_t columns() const noexcept;
732 inline
size_t spacing() const noexcept;
733 inline
size_t capacity() const noexcept;
734 inline
size_t capacity(
size_t i ) const noexcept;
736 inline
size_t nonZeros(
size_t i ) const;
738 inline
void reset(
size_t i );
740 void resize (
size_t n,
bool preserve=true );
741 inline
void extend (
size_t n,
bool preserve=true );
742 inline
void reserve(
size_t elements );
744 inline
void swap( LowerMatrix& m ) noexcept;
746 static inline constexpr
size_t maxNonZeros() noexcept;
747 static inline constexpr
size_t maxNonZeros(
size_t n ) noexcept;
754 template< typename Other > inline LowerMatrix& scale( const Other& scalar );
761 inline
bool isIntact() const noexcept;
768 template< typename Other > inline
bool canAlias ( const Other* alias ) const noexcept;
769 template< typename Other > inline
bool isAliased( const Other* alias ) const noexcept;
771 inline
bool isAligned () const noexcept;
772 inline
bool canSMPAssign() const noexcept;
784 inline const MT construct(
size_t n ,
TrueType );
787 template< typename MT2,
bool SO2, typename T >
788 inline const MT construct( const Matrix<MT2,SO2>& m, T );
800 template<
bool RF, typename MT2,
bool SO2,
bool DF2 >
801 friend
bool isDefault( const LowerMatrix<MT2,SO2,DF2>& m );
803 template< typename MT2,
bool SO2,
bool DF2 >
804 friend MT2& derestrict( LowerMatrix<MT2,SO2,DF2>& m );
839 template< typename MT
841 inline LowerMatrix<MT,SO,true>::LowerMatrix()
869 template<
typename MT
871 template<
typename A1 >
872 inline LowerMatrix<MT,SO,true>::LowerMatrix(
const A1& a1 )
873 : matrix_( construct( a1, typename IsResizable<MT>::Type() ) )
889 template<
typename MT
891 inline LowerMatrix<MT,SO,true>::LowerMatrix(
size_t n,
const ElementType& init )
897 for(
size_t j=0UL; j<
columns(); ++j )
898 for(
size_t i=j; i<
rows(); ++i )
902 for(
size_t i=0UL; i<
rows(); ++i )
903 for(
size_t j=0UL; j<=i; ++j )
937 template<
typename MT
939 inline LowerMatrix<MT,SO,true>::LowerMatrix( initializer_list< initializer_list<ElementType> > list )
978 template<
typename MT
980 template<
typename Other >
981 inline LowerMatrix<MT,SO,true>::LowerMatrix(
size_t n,
const Other* array )
982 : matrix_( n, n, array )
1017 template<
typename MT
1019 template<
typename Other
1021 inline LowerMatrix<MT,SO,true>::LowerMatrix(
const Other (&array)[N][N] )
1066 template<
typename MT
1068 inline LowerMatrix<MT,SO,true>::LowerMatrix(
ElementType* ptr,
size_t n )
1069 : matrix_( ptr, n, n )
1115 template<
typename MT
1117 inline LowerMatrix<MT,SO,true>::LowerMatrix(
ElementType* ptr,
size_t n,
size_t nn )
1118 : matrix_( ptr, n, n, nn )
1136 template<
typename MT
1138 inline LowerMatrix<MT,SO,true>::LowerMatrix(
const LowerMatrix& m )
1139 : matrix_( m.matrix_ )
1154 template<
typename MT
1156 inline LowerMatrix<MT,SO,true>::LowerMatrix( LowerMatrix&& m ) noexcept
1157 : matrix_( std::move( m.matrix_ ) )
1190 template<
typename MT
1193 LowerMatrix<MT,SO,true>::operator()(
size_t i,
size_t j )
1220 template<
typename MT
1223 LowerMatrix<MT,SO,true>::operator()(
size_t i,
size_t j )
const 1228 return matrix_(i,j);
1251 template<
typename MT
1254 LowerMatrix<MT,SO,true>::at(
size_t i,
size_t j )
1262 return (*
this)(i,j);
1285 template<
typename MT
1288 LowerMatrix<MT,SO,true>::at(
size_t i,
size_t j )
const 1296 return (*
this)(i,j);
1315 template<
typename MT
1317 inline typename LowerMatrix<MT,SO,true>::ConstPointer
1318 LowerMatrix<MT,SO,true>::data() const noexcept
1320 return matrix_.data();
1335 template<
typename MT
1337 inline typename LowerMatrix<MT,SO,true>::ConstPointer
1338 LowerMatrix<MT,SO,true>::data(
size_t i )
const noexcept
1340 return matrix_.data(i);
1358 template<
typename MT
1364 return Iterator( matrix_, 0UL, i );
1366 return Iterator( matrix_, i, 0UL );
1384 template<
typename MT
1389 return matrix_.begin(i);
1407 template<
typename MT
1412 return matrix_.cbegin(i);
1430 template<
typename MT
1456 template<
typename MT
1461 return matrix_.end(i);
1479 template<
typename MT
1484 return matrix_.cend(i);
1505 template<
typename MT
1507 inline LowerMatrix<MT,SO,true>&
1508 LowerMatrix<MT,SO,true>::operator=(
const ElementType& rhs )
1511 for(
size_t j=0UL; j<
columns(); ++j )
1512 for(
size_t i=j; i<
rows(); ++i )
1516 for(
size_t i=0UL; i<
rows(); ++i )
1517 for(
size_t j=0UL; j<=i; ++j )
1551 template<
typename MT
1553 inline LowerMatrix<MT,SO,true>&
1554 LowerMatrix<MT,SO,true>::operator=( initializer_list< initializer_list<ElementType> > list )
1562 matrix_ = std::move( tmp );
1597 template<
typename MT
1599 template<
typename Other
1601 inline LowerMatrix<MT,SO,true>&
1602 LowerMatrix<MT,SO,true>::operator=(
const Other (&array)[N][N] )
1610 matrix_ = std::move( tmp );
1631 template<
typename MT
1633 inline LowerMatrix<MT,SO,true>&
1634 LowerMatrix<MT,SO,true>::operator=(
const LowerMatrix& rhs )
1636 matrix_ = rhs.matrix_;
1654 template<
typename MT
1656 inline LowerMatrix<MT,SO,true>&
1657 LowerMatrix<MT,SO,true>::operator=( LowerMatrix&& rhs ) noexcept
1659 matrix_ = std::move( rhs.matrix_ );
1683 template<
typename MT
1685 template<
typename MT2
1687 inline DisableIf_< IsComputation<MT2>, LowerMatrix<MT,SO,true>& >
1688 LowerMatrix<MT,SO,true>::operator=(
const Matrix<MT2,SO2>& rhs )
1690 if( !IsLower<MT2>::value && !
isLower( ~rhs ) ) {
1718 template<
typename MT
1720 template<
typename MT2
1722 inline EnableIf_< IsComputation<MT2>, LowerMatrix<MT,SO,true>& >
1723 LowerMatrix<MT,SO,true>::operator=(
const Matrix<MT2,SO2>& rhs )
1725 if( !IsSquare<MT2>::value && !
isSquare( ~rhs ) ) {
1729 if( IsLower<MT2>::value ) {
1739 matrix_ = std::move( tmp );
1764 template<
typename MT
1766 template<
typename MT2
1768 inline DisableIf_< IsComputation<MT2>, LowerMatrix<MT,SO,true>& >
1771 if( !IsLower<MT2>::value && !
isLower( ~rhs ) ) {
1799 template<
typename MT
1801 template<
typename MT2
1803 inline EnableIf_< IsComputation<MT2>, LowerMatrix<MT,SO,true>& >
1806 if( !IsSquare<MT2>::value && !
isSquare( ~rhs ) ) {
1810 if( IsLower<MT2>::value ) {
1814 const ResultType_<MT2> tmp( ~rhs );
1845 template<
typename MT
1847 template<
typename MT2
1849 inline DisableIf_< IsComputation<MT2>, LowerMatrix<MT,SO,true>& >
1852 if( !IsLower<MT2>::value && !
isLower( ~rhs ) ) {
1880 template<
typename MT
1882 template<
typename MT2
1884 inline EnableIf_< IsComputation<MT2>, LowerMatrix<MT,SO,true>& >
1887 if( !IsSquare<MT2>::value && !
isSquare( ~rhs ) ) {
1891 if( IsLower<MT2>::value ) {
1895 const ResultType_<MT2> tmp( ~rhs );
1924 template<
typename MT
1926 template<
typename MT2
1928 inline LowerMatrix<MT,SO,true>&
1929 LowerMatrix<MT,SO,true>::operator%=(
const Matrix<MT2,SO2>& rhs )
1931 if( !IsSquare<MT2>::value && !
isSquare( ~rhs ) ) {
1958 template<
typename MT
1960 template<
typename MT2
1962 inline LowerMatrix<MT,SO,true>&
1965 if( matrix_.rows() != (~rhs).
columns() ) {
1969 MT tmp( matrix_ * ~rhs );
1975 matrix_ = std::move( tmp );
1994 template<
typename MT
1996 template<
typename Other >
1997 inline EnableIf_< IsNumeric<Other>, LowerMatrix<MT,SO,true> >&
2014 template<
typename MT
2016 template<
typename Other >
2017 inline EnableIf_< IsNumeric<Other>, LowerMatrix<MT,SO,true> >&
2043 template<
typename MT
2047 return matrix_.rows();
2059 template<
typename MT
2063 return matrix_.columns();
2080 template<
typename MT
2084 return matrix_.spacing();
2096 template<
typename MT
2100 return matrix_.capacity();
2118 template<
typename MT
2122 return matrix_.capacity(i);
2134 template<
typename MT
2138 return matrix_.nonZeros();
2156 template<
typename MT
2160 return matrix_.nonZeros(i);
2172 template<
typename MT
2179 for(
size_t j=0UL; j<
columns(); ++j )
2180 for(
size_t i=j; i<
rows(); ++i )
2181 clear( matrix_(i,j) );
2184 for(
size_t i=0UL; i<
rows(); ++i )
2185 for(
size_t j=0UL; j<=i; ++j )
2186 clear( matrix_(i,j) );
2206 template<
typename MT
2213 for(
size_t j=i; j<
rows(); ++j )
2214 clear( matrix_(j,i) );
2217 for(
size_t j=0UL; j<=i; ++j )
2218 clear( matrix_(i,j) );
2237 template<
typename MT
2243 if( IsResizable<MT>::value ) {
2290 template<
typename MT
2300 const size_t oldsize( matrix_.rows() );
2302 matrix_.resize( n, n,
true );
2305 const size_t increment( n - oldsize );
2306 submatrix( matrix_, 0UL, oldsize, n-1UL, increment ).reset();
2326 template<
typename MT
2328 inline void LowerMatrix<MT,SO,true>::extend(
size_t n,
bool preserve )
2349 template<
typename MT
2351 inline void LowerMatrix<MT,SO,true>::reserve(
size_t elements )
2353 matrix_.reserve( elements );
2369 template<
typename MT
2373 matrix_.shrinkToFit();
2386 template<
typename MT
2392 swap( matrix_, m.matrix_ );
2410 template<
typename MT
2412 inline constexpr
size_t LowerMatrix<MT,SO,true>::maxNonZeros() noexcept
2416 return maxNonZeros( Rows<MT>::value );
2432 template<
typename MT
2434 inline constexpr
size_t LowerMatrix<MT,SO,true>::maxNonZeros(
size_t n ) noexcept
2436 return ( ( n + 1UL ) * n ) / 2UL;
2468 template<
typename MT
2470 template<
typename Other >
2471 inline LowerMatrix<MT,SO,true>& LowerMatrix<MT,SO,true>::scale(
const Other& scalar )
2473 matrix_.scale( scalar );
2498 template<
typename MT
2529 template<
typename MT
2531 template<
typename Other >
2532 inline bool LowerMatrix<MT,SO,true>::canAlias(
const Other* alias )
const noexcept
2534 return matrix_.canAlias( alias );
2551 template<
typename MT
2553 template<
typename Other >
2554 inline bool LowerMatrix<MT,SO,true>::isAliased(
const Other* alias )
const noexcept
2556 return matrix_.isAliased( alias );
2572 template<
typename MT
2574 inline bool LowerMatrix<MT,SO,true>::isAligned() const noexcept
2576 return matrix_.isAligned();
2593 template<
typename MT
2595 inline bool LowerMatrix<MT,SO,true>::canSMPAssign() const noexcept
2597 return matrix_.canSMPAssign();
2619 template<
typename MT
2622 LowerMatrix<MT,SO,true>::load(
size_t i,
size_t j )
const noexcept
2624 return matrix_.load( i, j );
2646 template<
typename MT
2651 return matrix_.loada( i, j );
2673 template<
typename MT
2678 return matrix_.loadu( i, j );
2699 template<
typename MT
2701 inline const MT LowerMatrix<MT,SO,true>::construct(
size_t n, TrueType )
2718 template<
typename MT
2720 inline const MT LowerMatrix<MT,SO,true>::construct(
const ElementType& init, FalseType )
2728 for(
size_t j=0UL; j<tmp.columns(); ++j )
2729 for(
size_t i=j; i<tmp.rows(); ++i )
2733 for(
size_t i=0UL; i<tmp.rows(); ++i )
2734 for(
size_t j=0UL; j<=i; ++j )
2755 template<
typename MT
2757 template<
typename MT2
2760 inline const MT LowerMatrix<MT,SO,true>::construct(
const Matrix<MT2,SO2>& m, T )
2764 if( !IsLower<MT2>::value && !
isLower( 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
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.
CompressedMatrix< Type, false > OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: CompressedMatrix.h:3079
bool isLower(const DenseMatrix< MT, SO > &dm)
Checks if the given dense matrix is a lower triangular matrix.
Definition: DenseMatrix.h:1073
#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 Rows type trait.
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:356
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
#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
BLAZE_ALWAYS_INLINE T1 & operator/=(SIMDPack< T1 > &lhs, const SIMDPack< T2 > &rhs)
Division assignment operator for the division of two SIMD packs.
Definition: BasicTypes.h:1411
Constraint on the data type.
This ResultType
Result type for expression template evaluations.
Definition: CompressedMatrix.h:3078
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:198
CompressedMatrix< Type, true > This
Type of this CompressedMatrix instance.
Definition: CompressedMatrix.h:3076
Constraint on the data type.
void reset(const DiagonalProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: DiagonalProxy.h:560
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:699
BLAZE_ALWAYS_INLINE void shrinkToFit(Matrix< MT, SO > &matrix)
Requesting the removal of unused capacity.
Definition: Matrix.h:609
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:5845
CompressedMatrix< Type, false > TransposeType
Transpose type for expression template evaluations.
Definition: CompressedMatrix.h:3080
Submatrix< MT, AF > submatrix(Matrix< MT, SO > &matrix, size_t row, size_t column, size_t m, size_t n)
Creating a view on a specific submatrix of the given matrix.
Definition: Submatrix.h:352
const Type & ConstReference
Reference to a constant matrix value.
Definition: CompressedMatrix.h:3085
#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
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:394
Column< MT > column(Matrix< MT, SO > &matrix, size_t index)
Creating a view on a specific column of the given matrix.
Definition: Column.h:124
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:731
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:3086
BLAZE_ALWAYS_INLINE T1 & operator*=(SIMDPack< T1 > &lhs, const SIMDPack< T2 > &rhs)
Multiplication assignment operator for the multiplication of two SIMD packs.
Definition: BasicTypes.h:1393
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:308
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:242
Constraint on the data type.
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:110
#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 std::initializer_list aliases.
Header file for the IsSquare type trait.
Row< MT > row(Matrix< MT, SO > &matrix, size_t index)
Creating a view on a specific row of the given matrix.
Definition: Row.h:124
Constraint on the data type.
Constraint on the data type.
Header file for the DisableIf class template.
MatrixAccessProxy< This > Reference
Reference to a non-constant matrix value.
Definition: CompressedMatrix.h:3084
Header file for the clear shim.
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
#define BLAZE_CONSTRAINT_MUST_BE_STATIC_TYPE(T)
Constraint on the data type.In case the given data type T is not a static data type, i.e. a vector or matrix with dimensions fixed at compile time, a compilation error is created.
Definition: Static.h:61
void swap(CompressedMatrix< Type, SO > &a, CompressedMatrix< Type, SO > &b) noexcept
Swapping the contents of two compressed matrices.
Definition: CompressedMatrix.h:5924
bool isIntact(const CompressedMatrix< Type, SO > &m)
Returns whether the invariants of the given compressed matrix are intact.
Definition: CompressedMatrix.h:5907
SparseMatrix< This, true > BaseType
Base type of this CompressedMatrix instance.
Definition: CompressedMatrix.h:3077
#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:3081
#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.
Header file for the Columns type trait.
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:3087
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.
decltype(auto) decllow(const DenseMatrix< MT, SO > &dm)
Declares the given dense matrix expression dm as lower.
Definition: DMatDeclLowExpr.h:1027
Header file for the IsLower type trait.
Header file for the LowerProxy class.
BLAZE_ALWAYS_INLINE size_t columns(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of columns of the matrix.
Definition: Matrix.h:340
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.
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:548
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:264
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
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:580
Header file for the IsNumeric type trait.
Header file for all adaptor forward declarations.
#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.
#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:270
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
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:324
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:3082
#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 implementation of the base template of the LowerMatrix.
Header file for the IsComputation type trait class.
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:3083
#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:252
bool isDefault(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: DiagonalProxy.h:600
#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
BLAZE_ALWAYS_INLINE bool isSquare(const Matrix< MT, SO > &matrix) noexcept
Checks if the given matrix is a square matrix.
Definition: Matrix.h:742
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 TrueType type/value trait base class.