35#ifndef _BLAZE_MATH_ADAPTORS_STRICTLYLOWERMATRIX_DENSE_H_
36#define _BLAZE_MATH_ADAPTORS_STRICTLYLOWERMATRIX_DENSE_H_
110 :
public DenseMatrix< StrictlyLowerMatrix<MT,SO,true>, SO >
114 using OT = OppositeType_t<MT>;
115 using TT = TransposeType_t<MT>;
116 using ET = ElementType_t<MT>;
121 using This = StrictlyLowerMatrix<MT,SO,true>;
122 using BaseType = DenseMatrix<This,SO>;
123 using ResultType = This;
124 using OppositeType = StrictlyLowerMatrix<OT,!SO,true>;
125 using TransposeType = StrictlyUpperMatrix<TT,!SO,true>;
126 using ElementType = ET;
127 using SIMDType = SIMDType_t<MT>;
128 using TagType = TagType_t<MT>;
129 using ReturnType = ReturnType_t<MT>;
130 using CompositeType =
const This&;
131 using Reference = StrictlyLowerProxy<MT>;
132 using ConstReference = ConstReference_t<MT>;
133 using Pointer = Pointer_t<MT>;
134 using ConstPointer = ConstPointer_t<MT>;
135 using ConstIterator = ConstIterator_t<MT>;
141 template<
typename NewType >
144 using Other = StrictlyLowerMatrix< typename MT::template Rebind<NewType>::Other >;
151 template<
size_t NewM
155 using Other = StrictlyLowerMatrix< typename MT::template Resize<NewM,NewN>::Other >;
166 using IteratorCategory = std::random_access_iterator_tag;
167 using ValueType = ElementType_t<MT>;
168 using PointerType = StrictlyLowerProxy<MT>;
169 using ReferenceType = StrictlyLowerProxy<MT>;
170 using DifferenceType = ptrdiff_t;
173 using iterator_category = IteratorCategory;
174 using value_type = ValueType;
175 using pointer = PointerType;
176 using reference = ReferenceType;
177 using difference_type = DifferenceType;
183 inline Iterator() noexcept
197 inline Iterator( MT& matrix,
size_t row,
size_t column ) noexcept
210 inline Iterator&
operator+=(
size_t inc )
noexcept {
211 ( SO )?( row_ += inc ):( column_ += inc );
222 inline Iterator&
operator-=(
size_t dec )
noexcept {
223 ( SO )?( row_ -= dec ):( column_ -= dec );
233 inline Iterator& operator++() noexcept {
234 ( SO )?( ++row_ ):( ++column_ );
244 inline const Iterator operator++(
int )
noexcept {
245 const Iterator tmp( *
this );
256 inline Iterator& operator--() noexcept {
257 ( SO )?( --row_ ):( --column_ );
267 inline const Iterator operator--(
int )
noexcept {
268 const Iterator tmp( *
this );
280 return ReferenceType( *matrix_, row_, column_ );
289 inline PointerType operator->()
const {
290 return PointerType( *matrix_, row_, column_ );
304 inline SIMDType load()
const {
305 return (*matrix_).load(row_,column_);
319 inline SIMDType
loada()
const {
320 return (*matrix_).loada(row_,column_);
334 inline SIMDType
loadu()
const {
335 return (*matrix_).loadu(row_,column_);
344 inline operator ConstIterator()
const {
346 return matrix_->begin( column_ ) + row_;
348 return matrix_->begin( row_ ) + column_;
359 friend inline bool operator==(
const Iterator& lhs,
const Iterator& rhs )
noexcept {
360 return ( SO )?( lhs.row_ == rhs.row_ ):( lhs.column_ == rhs.column_ );
371 friend inline bool operator==(
const Iterator& lhs,
const ConstIterator& rhs ) {
372 return ( ConstIterator( lhs ) == rhs );
383 friend inline bool operator==(
const ConstIterator& lhs,
const Iterator& rhs ) {
384 return ( lhs == ConstIterator( rhs ) );
395 friend inline bool operator!=(
const Iterator& lhs,
const Iterator& rhs )
noexcept {
396 return ( SO )?( lhs.row_ != rhs.row_ ):( lhs.column_ != rhs.column_ );
407 friend inline bool operator!=(
const Iterator& lhs,
const ConstIterator& rhs ) {
408 return ( ConstIterator( lhs ) != rhs );
419 friend inline bool operator!=(
const ConstIterator& lhs,
const Iterator& rhs ) {
420 return ( lhs != ConstIterator( rhs ) );
431 friend inline bool operator<(
const Iterator& lhs,
const Iterator& rhs )
noexcept {
432 return ( SO )?( lhs.row_ < rhs.row_ ):( lhs.column_ < rhs.column_ );
443 friend inline bool operator<(
const Iterator& lhs,
const ConstIterator& rhs ) {
444 return ( ConstIterator( lhs ) < rhs );
455 friend inline bool operator<(
const ConstIterator& lhs,
const Iterator& rhs ) {
456 return ( lhs < ConstIterator( rhs ) );
467 friend inline bool operator>(
const Iterator& lhs,
const Iterator& rhs )
noexcept {
468 return ( SO )?( lhs.row_ > rhs.row_ ):( lhs.column_ > rhs.column_ );
479 friend inline bool operator>(
const Iterator& lhs,
const ConstIterator& rhs ) {
480 return ( ConstIterator( lhs ) > rhs );
491 friend inline bool operator>(
const ConstIterator& lhs,
const Iterator& rhs ) {
492 return ( lhs > ConstIterator( rhs ) );
503 friend inline bool operator<=(
const Iterator& lhs,
const Iterator& rhs )
noexcept {
504 return ( SO )?( lhs.row_ <= rhs.row_ ):( lhs.column_ <= rhs.column_ );
515 friend inline bool operator<=(
const Iterator& lhs,
const ConstIterator& rhs ) {
516 return ( ConstIterator( lhs ) <= rhs );
527 friend inline bool operator<=(
const ConstIterator& lhs,
const Iterator& rhs ) {
528 return ( lhs <= ConstIterator( rhs ) );
539 friend inline bool operator>=(
const Iterator& lhs,
const Iterator& rhs )
noexcept {
540 return ( SO )?( lhs.row_ >= rhs.row_ ):( lhs.column_ >= rhs.column_ );
551 friend inline bool operator>=(
const Iterator& lhs,
const ConstIterator& rhs ) {
552 return ( ConstIterator( lhs ) >= rhs );
563 friend inline bool operator>=(
const ConstIterator& lhs,
const Iterator& rhs ) {
564 return ( lhs >= ConstIterator( rhs ) );
574 inline DifferenceType
operator-(
const Iterator& rhs )
const noexcept {
575 return ( SO )?( row_ - rhs.row_ ):( column_ - rhs.column_ );
586 friend inline const Iterator
operator+(
const Iterator& it,
size_t inc )
noexcept {
588 return Iterator( *it.matrix_, it.row_ + inc, it.column_ );
590 return Iterator( *it.matrix_, it.row_, it.column_ + inc );
601 friend inline const Iterator
operator+(
size_t inc,
const Iterator& it )
noexcept {
603 return Iterator( *it.matrix_, it.row_ + inc, it.column_ );
605 return Iterator( *it.matrix_, it.row_, it.column_ + inc );
616 friend inline const Iterator
operator-(
const Iterator& it,
size_t dec )
noexcept {
618 return Iterator( *it.matrix_, it.row_ - dec, it.column_ );
620 return Iterator( *it.matrix_, it.row_, it.column_ - dec );
635 static constexpr bool simdEnabled = MT::simdEnabled;
638 static constexpr bool smpAssignable = MT::smpAssignable;
644 inline StrictlyLowerMatrix();
645 template<
typename A1 >
explicit inline StrictlyLowerMatrix(
const A1& a1 );
646 inline StrictlyLowerMatrix(
size_t n,
const ElementType& init );
648 inline StrictlyLowerMatrix( initializer_list< initializer_list<ElementType> > list );
650 template<
typename Other >
651 inline StrictlyLowerMatrix(
size_t n,
const Other* array );
653 template<
typename Other,
size_t N >
654 inline StrictlyLowerMatrix(
const Other (&array)[N][N] );
656 inline StrictlyLowerMatrix( ElementType* ptr,
size_t n );
657 inline StrictlyLowerMatrix( ElementType* ptr,
size_t n,
size_t nn );
659 inline StrictlyLowerMatrix(
const StrictlyLowerMatrix& m );
660 inline StrictlyLowerMatrix( StrictlyLowerMatrix&& m )
noexcept;
667 ~StrictlyLowerMatrix() =
default;
674 inline Reference operator()(
size_t i,
size_t j );
675 inline ConstReference operator()(
size_t i,
size_t j )
const;
676 inline Reference at(
size_t i,
size_t j );
677 inline ConstReference at(
size_t i,
size_t j )
const;
678 inline ConstPointer
data () const noexcept;
679 inline ConstPointer
data (
size_t i ) const noexcept;
680 inline Iterator
begin (
size_t i );
681 inline ConstIterator
begin (
size_t i ) const;
682 inline ConstIterator
cbegin(
size_t i ) const;
683 inline Iterator
end (
size_t i );
684 inline ConstIterator
end (
size_t i ) const;
685 inline ConstIterator
cend (
size_t i ) const;
692 inline StrictlyLowerMatrix& operator=( const ElementType& rhs );
693 inline StrictlyLowerMatrix& operator=( initializer_list< initializer_list<ElementType> > list );
695 template< typename Other,
size_t N >
696 inline StrictlyLowerMatrix& operator=( const Other (&array)[N][N] );
698 inline StrictlyLowerMatrix& operator=( const StrictlyLowerMatrix& rhs );
699 inline StrictlyLowerMatrix& operator=( StrictlyLowerMatrix&& rhs ) noexcept;
701 template< typename MT2,
bool SO2 >
702 inline auto operator=( const Matrix<MT2,SO2>& rhs )
705 template< typename MT2,
bool SO2 >
706 inline auto operator=( const Matrix<MT2,SO2>& rhs )
709 template< typename MT2,
bool SO2 >
710 inline auto operator+=( const Matrix<MT2,SO2>& rhs )
713 template< typename MT2,
bool SO2 >
714 inline auto operator+=( const Matrix<MT2,SO2>& rhs )
717 template< typename MT2,
bool SO2 >
718 inline auto operator-=( const Matrix<MT2,SO2>& rhs )
721 template< typename MT2,
bool SO2 >
722 inline auto operator-=( const Matrix<MT2,SO2>& rhs )
725 template< typename MT2,
bool SO2 >
726 inline auto operator%=( const Matrix<MT2,SO2>& rhs ) -> StrictlyLowerMatrix&;
728 template< typename ST >
731 template< typename ST >
739 inline
size_t rows() const noexcept;
740 inline
size_t columns() const noexcept;
741 inline
size_t spacing() const noexcept;
742 inline
size_t capacity() const noexcept;
743 inline
size_t capacity(
size_t i ) const noexcept;
745 inline
size_t nonZeros(
size_t i ) const;
747 inline
void reset(
size_t i );
749 void resize (
size_t n,
bool preserve=true );
750 inline
void extend (
size_t n,
bool preserve=true );
751 inline
void reserve(
size_t elements );
753 inline
void swap( StrictlyLowerMatrix& m ) noexcept;
755 static constexpr
size_t maxNonZeros() noexcept;
756 static constexpr
size_t maxNonZeros(
size_t n ) noexcept;
763 template< typename Other > inline StrictlyLowerMatrix& scale( const Other& scalar );
770 inline
bool isIntact() const noexcept;
777 template< typename Other > inline
bool canAlias ( const Other* alias ) const noexcept;
778 template< typename Other > inline
bool isAliased( const Other* alias ) const noexcept;
780 inline
bool isAligned () const noexcept;
781 inline
bool canSMPAssign() const noexcept;
793 inline const MT construct(
size_t n ,
TrueType );
794 inline const MT construct( const ElementType& value,
FalseType );
796 template< typename MT2,
bool SO2, typename T >
797 inline const MT construct( const Matrix<MT2,SO2>& m, T );
809 template< typename MT2,
bool SO2,
bool DF2 >
810 friend MT2& derestrict( StrictlyLowerMatrix<MT2,SO2,DF2>& m );
849inline StrictlyLowerMatrix<MT,SO,true>::StrictlyLowerMatrix()
879template<
typename A1 >
880inline StrictlyLowerMatrix<MT,SO,true>::StrictlyLowerMatrix(
const A1& a1 )
881 : matrix_( construct( a1, IsResizable<MT>() ) )
899inline StrictlyLowerMatrix<MT,SO,true>::StrictlyLowerMatrix(
size_t n,
const ElementType& init )
900 : matrix_( n, n, ElementType() )
905 for(
size_t j=0UL; j<
columns(); ++j ) {
906 for(
size_t i=j+1UL; i<
rows(); ++i )
911 for(
size_t i=0UL; i<
rows(); ++i ) {
912 for(
size_t j=0UL; j<i; ++j )
991template<
typename Other >
992inline StrictlyLowerMatrix<MT,SO,true>::StrictlyLowerMatrix(
size_t n,
const Other* array )
993 : matrix_( n, n, array )
1028template<
typename MT
1030template<
typename Other
1032inline StrictlyLowerMatrix<MT,SO,true>::StrictlyLowerMatrix(
const Other (&array)[N][N] )
1078template<
typename MT
1080inline StrictlyLowerMatrix<MT,SO,true>::StrictlyLowerMatrix( ElementType* ptr,
size_t n )
1081 : matrix_( ptr, n, n )
1127template<
typename MT
1129inline StrictlyLowerMatrix<MT,SO,true>::StrictlyLowerMatrix( ElementType* ptr,
size_t n,
size_t nn )
1130 : matrix_( ptr, n, n, nn )
1148template<
typename MT
1150inline StrictlyLowerMatrix<MT,SO,true>::StrictlyLowerMatrix(
const StrictlyLowerMatrix& m )
1151 : matrix_( m.matrix_ )
1166template<
typename MT
1168inline StrictlyLowerMatrix<MT,SO,true>::StrictlyLowerMatrix( StrictlyLowerMatrix&& m ) noexcept
1169 : matrix_( std::move( m.matrix_ ) )
1202template<
typename MT
1204inline typename StrictlyLowerMatrix<MT,SO,true>::Reference
1205 StrictlyLowerMatrix<MT,SO,true>::operator()(
size_t i,
size_t j )
1210 return Reference( matrix_, i, j );
1232template<
typename MT
1234inline typename StrictlyLowerMatrix<MT,SO,true>::ConstReference
1235 StrictlyLowerMatrix<MT,SO,true>::operator()(
size_t i,
size_t j )
const
1240 return matrix_(i,j);
1263template<
typename MT
1265inline typename StrictlyLowerMatrix<MT,SO,true>::Reference
1266 StrictlyLowerMatrix<MT,SO,true>::at(
size_t i,
size_t j )
1274 return (*
this)(i,j);
1297template<
typename MT
1299inline typename StrictlyLowerMatrix<MT,SO,true>::ConstReference
1300 StrictlyLowerMatrix<MT,SO,true>::at(
size_t i,
size_t j )
const
1308 return (*
this)(i,j);
1327template<
typename MT
1329inline typename StrictlyLowerMatrix<MT,SO,true>::ConstPointer
1330 StrictlyLowerMatrix<MT,SO,true>::data() const noexcept
1332 return matrix_.data();
1347template<
typename MT
1349inline typename StrictlyLowerMatrix<MT,SO,true>::ConstPointer
1350 StrictlyLowerMatrix<MT,SO,true>::data(
size_t i )
const noexcept
1352 return matrix_.data(i);
1370template<
typename MT
1372inline typename StrictlyLowerMatrix<MT,SO,true>::Iterator
1373 StrictlyLowerMatrix<MT,SO,true>::begin(
size_t i )
1376 return Iterator( matrix_, 0UL, i );
1378 return Iterator( matrix_, i, 0UL );
1396template<
typename MT
1398inline typename StrictlyLowerMatrix<MT,SO,true>::ConstIterator
1399 StrictlyLowerMatrix<MT,SO,true>::begin(
size_t i )
const
1401 return matrix_.begin(i);
1419template<
typename MT
1421inline typename StrictlyLowerMatrix<MT,SO,true>::ConstIterator
1422 StrictlyLowerMatrix<MT,SO,true>::cbegin(
size_t i )
const
1424 return matrix_.cbegin(i);
1442template<
typename MT
1444inline typename StrictlyLowerMatrix<MT,SO,true>::Iterator
1445 StrictlyLowerMatrix<MT,SO,true>::end(
size_t i )
1448 return Iterator( matrix_,
rows(), i );
1450 return Iterator( matrix_, i,
columns() );
1468template<
typename MT
1470inline typename StrictlyLowerMatrix<MT,SO,true>::ConstIterator
1471 StrictlyLowerMatrix<MT,SO,true>::end(
size_t i )
const
1473 return matrix_.end(i);
1491template<
typename MT
1493inline typename StrictlyLowerMatrix<MT,SO,true>::ConstIterator
1494 StrictlyLowerMatrix<MT,SO,true>::cend(
size_t i )
const
1496 return matrix_.cend(i);
1517template<
typename MT
1519inline StrictlyLowerMatrix<MT,SO,true>&
1520 StrictlyLowerMatrix<MT,SO,true>::operator=(
const ElementType& rhs )
1523 for(
size_t j=0UL; j<
columns(); ++j )
1524 for(
size_t i=j+1UL; i<
rows(); ++i )
1528 for(
size_t i=1UL; i<
rows(); ++i )
1529 for(
size_t j=0UL; j<i; ++j )
1564template<
typename MT
1566inline StrictlyLowerMatrix<MT,SO,true>&
1569 const InitializerMatrix<ElementType> tmp( list, list.size() );
1611template<
typename MT
1613template<
typename Other
1615inline StrictlyLowerMatrix<MT,SO,true>&
1616 StrictlyLowerMatrix<MT,SO,true>::operator=(
const Other (&array)[N][N] )
1624 matrix_ = std::move( tmp );
1645template<
typename MT
1647inline StrictlyLowerMatrix<MT,SO,true>&
1648 StrictlyLowerMatrix<MT,SO,true>::operator=(
const StrictlyLowerMatrix& rhs )
1650 matrix_ = rhs.matrix_;
1668template<
typename MT
1670inline StrictlyLowerMatrix<MT,SO,true>&
1671 StrictlyLowerMatrix<MT,SO,true>::operator=( StrictlyLowerMatrix&& rhs )
noexcept
1673 matrix_ = std::move( rhs.matrix_ );
1697template<
typename MT
1699template<
typename MT2
1701inline auto StrictlyLowerMatrix<MT,SO,true>::operator=(
const Matrix<MT2,SO2>& rhs )
1702 -> DisableIf_t< IsComputation_v<MT2>, StrictlyLowerMatrix& >
1704 if( IsUniTriangular_v<MT2> ||
1733template<
typename MT
1735template<
typename MT2
1737inline auto StrictlyLowerMatrix<MT,SO,true>::operator=(
const Matrix<MT2,SO2>& rhs )
1738 -> EnableIf_t< IsComputation_v<MT2>, StrictlyLowerMatrix& >
1740 if( IsUniTriangular_v<MT2> || ( !IsSquare_v<MT2> && !
isSquare( *rhs ) ) ) {
1744 if( IsStrictlyLower_v<MT2> ) {
1754 matrix_ = std::move( tmp );
1779template<
typename MT
1781template<
typename MT2
1783inline auto StrictlyLowerMatrix<MT,SO,true>::operator+=(
const Matrix<MT2,SO2>& rhs )
1784 -> DisableIf_t< IsComputation_v<MT2>, StrictlyLowerMatrix& >
1786 if( IsUniTriangular_v<MT2> ||
1815template<
typename MT
1817template<
typename MT2
1819inline auto StrictlyLowerMatrix<MT,SO,true>::operator+=(
const Matrix<MT2,SO2>& rhs )
1820 -> EnableIf_t< IsComputation_v<MT2>, StrictlyLowerMatrix& >
1822 if( IsUniTriangular_v<MT2> || ( !IsSquare_v<MT2> && !
isSquare( *rhs ) ) ) {
1826 if( IsStrictlyLower_v<MT2> ) {
1830 const ResultType_t<MT2> tmp( *rhs );
1861template<
typename MT
1863template<
typename MT2
1865inline auto StrictlyLowerMatrix<MT,SO,true>::operator-=(
const Matrix<MT2,SO2>& rhs )
1866 -> DisableIf_t< IsComputation_v<MT2>, StrictlyLowerMatrix& >
1868 if( IsUniTriangular_v<MT2> ||
1897template<
typename MT
1899template<
typename MT2
1901inline auto StrictlyLowerMatrix<MT,SO,true>::operator-=(
const Matrix<MT2,SO2>& rhs )
1902 -> EnableIf_t< IsComputation_v<MT2>, StrictlyLowerMatrix& >
1904 if( IsUniTriangular_v<MT2> || ( !IsSquare_v<MT2> && !
isSquare( *rhs ) ) ) {
1908 if( IsStrictlyLower_v<MT2> ) {
1912 const ResultType_t<MT2> tmp( *rhs );
1941template<
typename MT
1943template<
typename MT2
1945inline auto StrictlyLowerMatrix<MT,SO,true>::operator%=(
const Matrix<MT2,SO2>& rhs )
1946 -> StrictlyLowerMatrix&
1948 if( !IsSquare_v<MT2> && !
isSquare( *rhs ) ) {
1971template<
typename MT
1973template<
typename ST >
1974inline auto StrictlyLowerMatrix<MT,SO,true>::operator*=( ST rhs )
1975 -> EnableIf_t< IsScalar_v<ST>, StrictlyLowerMatrix& >
1991template<
typename MT
1993template<
typename ST >
1994inline auto StrictlyLowerMatrix<MT,SO,true>::operator/=( ST rhs )
1995 -> EnableIf_t< IsScalar_v<ST>, StrictlyLowerMatrix& >
2020template<
typename MT
2022inline size_t StrictlyLowerMatrix<MT,SO,true>::rows() const noexcept
2024 return matrix_.rows();
2036template<
typename MT
2038inline size_t StrictlyLowerMatrix<MT,SO,true>::columns() const noexcept
2040 return matrix_.columns();
2057template<
typename MT
2059inline size_t StrictlyLowerMatrix<MT,SO,true>::spacing() const noexcept
2061 return matrix_.spacing();
2073template<
typename MT
2075inline size_t StrictlyLowerMatrix<MT,SO,true>::capacity() const noexcept
2077 return matrix_.capacity();
2095template<
typename MT
2097inline size_t StrictlyLowerMatrix<MT,SO,true>::capacity(
size_t i )
const noexcept
2099 return matrix_.capacity(i);
2111template<
typename MT
2113inline size_t StrictlyLowerMatrix<MT,SO,true>::nonZeros()
const
2115 return matrix_.nonZeros();
2133template<
typename MT
2135inline size_t StrictlyLowerMatrix<MT,SO,true>::nonZeros(
size_t i )
const
2137 return matrix_.nonZeros(i);
2149template<
typename MT
2151inline void StrictlyLowerMatrix<MT,SO,true>::reset()
2156 for(
size_t j=0UL; j<
columns(); ++j )
2157 for(
size_t i=j+1UL; i<
rows(); ++i )
2158 clear( matrix_(i,j) );
2161 for(
size_t i=1UL; i<
rows(); ++i )
2162 for(
size_t j=0UL; j<i; ++j )
2163 clear( matrix_(i,j) );
2183template<
typename MT
2185inline void StrictlyLowerMatrix<MT,SO,true>::reset(
size_t i )
2190 for(
size_t j=i+1UL; j<
rows(); ++j )
2191 clear( matrix_(j,i) );
2194 for(
size_t j=0UL; j<i; ++j )
2195 clear( matrix_(i,j) );
2214template<
typename MT
2216inline void StrictlyLowerMatrix<MT,SO,true>::clear()
2263template<
typename MT
2265void StrictlyLowerMatrix<MT,SO,true>::resize(
size_t n,
bool preserve )
2273 const size_t oldsize( matrix_.rows() );
2275 matrix_.resize( n, n,
true );
2279 const size_t increment( n - oldsize );
2280 submatrix( matrix_, 0UL, oldsize, n, increment ).reset();
2300template<
typename MT
2302inline void StrictlyLowerMatrix<MT,SO,true>::extend(
size_t n,
bool preserve )
2323template<
typename MT
2325inline void StrictlyLowerMatrix<MT,SO,true>::reserve(
size_t elements )
2327 matrix_.reserve( elements );
2343template<
typename MT
2345inline void StrictlyLowerMatrix<MT,SO,true>::shrinkToFit()
2347 matrix_.shrinkToFit();
2360template<
typename MT
2362inline void StrictlyLowerMatrix<MT,SO,true>::swap( StrictlyLowerMatrix& m )
noexcept
2366 swap( matrix_, m.matrix_ );
2384template<
typename MT
2386constexpr size_t StrictlyLowerMatrix<MT,SO,true>::maxNonZeros() noexcept
2390 return maxNonZeros( Size_v<MT,0UL> );
2406template<
typename MT
2408constexpr size_t StrictlyLowerMatrix<MT,SO,true>::maxNonZeros(
size_t n )
noexcept
2410 return ( ( n - 1UL ) * n ) / 2UL;
2442template<
typename MT
2444template<
typename Other >
2445inline StrictlyLowerMatrix<MT,SO,true>&
2446 StrictlyLowerMatrix<MT,SO,true>::scale(
const Other& scalar )
2448 matrix_.scale( scalar );
2473template<
typename MT
2475inline bool StrictlyLowerMatrix<MT,SO,true>::isIntact() const noexcept
2504template<
typename MT
2506template<
typename Other >
2507inline bool StrictlyLowerMatrix<MT,SO,true>::canAlias(
const Other* alias )
const noexcept
2509 return matrix_.canAlias( alias );
2526template<
typename MT
2528template<
typename Other >
2529inline bool StrictlyLowerMatrix<MT,SO,true>::isAliased(
const Other* alias )
const noexcept
2531 return matrix_.isAliased( alias );
2547template<
typename MT
2549inline bool StrictlyLowerMatrix<MT,SO,true>::isAligned() const noexcept
2551 return matrix_.isAligned();
2568template<
typename MT
2570inline bool StrictlyLowerMatrix<MT,SO,true>::canSMPAssign() const noexcept
2572 return matrix_.canSMPAssign();
2594template<
typename MT
2597 StrictlyLowerMatrix<MT,SO,true>::load(
size_t i,
size_t j )
const noexcept
2599 return matrix_.load( i, j );
2621template<
typename MT
2624 StrictlyLowerMatrix<MT,SO,true>::loada(
size_t i,
size_t j )
const noexcept
2626 return matrix_.loada( i, j );
2648template<
typename MT
2651 StrictlyLowerMatrix<MT,SO,true>::loadu(
size_t i,
size_t j )
const noexcept
2653 return matrix_.loadu( i, j );
2674template<
typename MT
2676inline const MT StrictlyLowerMatrix<MT,SO,true>::construct(
size_t n, TrueType )
2680 return MT( n, n, ElementType() );
2693template<
typename MT
2695inline const MT StrictlyLowerMatrix<MT,SO,true>::construct(
const ElementType& init, FalseType )
2703 for(
size_t j=0UL; j<tmp.columns(); ++j ) {
2704 for(
size_t i=j+1UL; i<tmp.rows(); ++i )
2709 for(
size_t i=0UL; i<tmp.rows(); ++i ) {
2710 for(
size_t j=0UL; j<i; ++j )
2732template<
typename MT
2734template<
typename MT2
2737inline const MT StrictlyLowerMatrix<MT,SO,true>::construct(
const Matrix<MT2,SO2>& m, T )
2741 if( IsUniTriangular_v<MT2> ||
Header file for auxiliary alias declarations.
Header file for run time assertion macros.
Constraint on the data type.
constexpr 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:751
constexpr 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:719
Header file for the EnableIf class template.
Constraint on the data type.
Header file for the IntegralConstant class template.
Header file for the IsComputation type trait class.
Header file for the isDefault shim.
Header file for the IsResizable type trait.
Header file for the IsScalar type trait.
Header file for the IsSquare type trait.
Header file for the IsStrictlyLower type trait.
Header file for the IsUniTriangular type trait.
Constraint on the data type.
Header file for the MAYBE_UNUSED function template.
Constraint on the data type.
Constraint on the data type.
Constraint on the data type.
Constraint on the data type.
Constraint on the data type.
Header file for the StrictlyLowerProxy class.
Constraint on the data type.
Constraint on the data type.
Constraint on the data type.
Constraint on the data type.
Header file for the implementation of the base template of the StrictlyLowerMatrix.
Base class for dense matrices.
Definition DenseMatrix.h:82
Matrix adapter for strictly lower triangular matrices.
Definition BaseTemplate.h:563
Initializer list type of the Blaze library.
Constraint on the data type.
Constraint on the data type.
Constraint on the data type.
Header file for utility functions for dense matrices.
Header file for the implementation of a matrix representation of an initializer list.
Header file for the DenseMatrix base class.
#define BLAZE_CONSTRAINT_MUST_NOT_BE_VOLATILE(T)
Constraint on the data type.
Definition Volatile.h:79
#define BLAZE_CONSTRAINT_MUST_NOT_BE_POINTER_TYPE(T)
Constraint on the data type.
Definition Pointer.h:79
#define BLAZE_CONSTRAINT_MUST_NOT_BE_CONST(T)
Constraint on the data type.
Definition Const.h:79
#define BLAZE_CONSTRAINT_MUST_NOT_BE_REFERENCE_TYPE(T)
Constraint on the data type.
Definition Reference.h:79
bool isStrictlyLower(const DenseMatrix< MT, SO > &dm)
Checks if the given dense matrix is a strictly lower triangular matrix.
Definition DenseMatrix.h:2096
MT::ElementType * data(DenseMatrix< MT, SO > &dm) noexcept
Low-level data access to the dense matrix elements.
Definition DenseMatrix.h:182
auto operator+=(DenseMatrix< MT, SO > &mat, ST scalar) -> EnableIf_t< IsScalar_v< ST >, MT & >
Addition assignment operator for the addition of a dense matrix and a scalar value ( ).
Definition DenseMatrix.h:386
size_t spacing(const DenseMatrix< MT, SO > &dm) noexcept
Returns the spacing between the beginning of two rows/columns.
Definition DenseMatrix.h:265
decltype(auto) decllow(const DenseMatrix< MT, SO > &dm)
Declares the given dense matrix expression dm as lower.
Definition DMatDeclLowExpr.h:1004
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:9640
auto operator-=(DenseMatrix< MT, SO > &mat, ST scalar) -> EnableIf_t< IsScalar_v< ST >, MT & >
Subtraction assignment operator for the subtraction of a dense matrix and a scalar value ( ).
Definition DenseMatrix.h:448
bool isZero(const DenseMatrix< MT, SO > &dm)
Checks if the given dense matrix is a zero matrix.
Definition DenseMatrix.h:1819
bool isIntact(const DiagonalMatrix< MT, SO, DF > &m)
Returns whether the invariants of the given diagonal matrix are intact.
Definition DiagonalMatrix.h:207
void swap(DiagonalMatrix< MT, SO, DF > &a, DiagonalMatrix< MT, SO, DF > &b) noexcept
Swapping the contents of two matrices.
Definition DiagonalMatrix.h:225
decltype(auto) elements(Vector< VT, TF > &vector, REAs... args)
Creating a view on a selection of elements of the given vector.
Definition Elements.h:143
#define BLAZE_CONSTRAINT_MUST_NOT_BE_SYMMETRIC_MATRIX_TYPE(T)
Constraint on the data type.
Definition Symmetric.h:79
#define BLAZE_CONSTRAINT_MUST_NOT_BE_VIEW_TYPE(T)
Constraint on the data type.
Definition View.h:81
#define BLAZE_CONSTRAINT_MUST_NOT_BE_HERMITIAN_MATRIX_TYPE(T)
Constraint on the data type.
Definition Hermitian.h:79
#define BLAZE_CONSTRAINT_MUST_BE_SQUARE_MATRIX_TYPE(T)
Constraint on the data type.
Definition Square.h:60
#define BLAZE_CONSTRAINT_MUST_NOT_BE_UPPER_MATRIX_TYPE(T)
Constraint on the data type.
Definition Upper.h:81
#define BLAZE_CONSTRAINT_MUST_BE_DENSE_MATRIX_TYPE(T)
Constraint on the data type.
Definition DenseMatrix.h:61
#define BLAZE_CONSTRAINT_MUST_NOT_BE_COMPUTATION_TYPE(T)
Constraint on the data type.
Definition Computation.h:81
#define BLAZE_CONSTRAINT_MUST_NOT_BE_RESIZABLE_TYPE(T)
Constraint on the data type.
Definition Resizable.h:81
#define BLAZE_CONSTRAINT_MUST_BE_STATIC_TYPE(T)
Constraint on the data type.
Definition Static.h:61
#define BLAZE_CONSTRAINT_MUST_NOT_BE_LOWER_MATRIX_TYPE(T)
Constraint on the data type.
Definition Lower.h:81
#define BLAZE_CONSTRAINT_MUST_BE_RESIZABLE_TYPE(T)
Constraint on the data type.
Definition Resizable.h:61
#define BLAZE_CONSTRAINT_MUST_NOT_BE_TRANSFORMATION_TYPE(T)
Constraint on the data type.
Definition Transformation.h:81
#define BLAZE_CONSTRAINT_MUST_BE_MATRIX_WITH_STORAGE_ORDER(T, SO)
Constraint on the data type.
Definition StorageOrder.h:63
constexpr bool IsScalar_v
Auxiliary variable template for the IsScalar type trait.
Definition IsScalar.h:104
constexpr ptrdiff_t Size_v
Auxiliary variable template for the Size type trait.
Definition Size.h:176
constexpr bool IsComputation_v
Auxiliary variable template for the IsComputation type trait.
Definition IsComputation.h:90
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:370
constexpr bool operator==(const NegativeAccuracy< A > &lhs, const T &rhs)
Equality comparison between a NegativeAccuracy object and a floating point value.
Definition Accuracy.h:253
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:332
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:446
constexpr bool operator!=(const NegativeAccuracy< A > &lhs, const T &rhs)
Inequality comparison between a NegativeAccuracy object and a floating point value.
Definition Accuracy.h:293
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:408
constexpr void clear(Matrix< MT, SO > &matrix)
Clearing the given matrix.
Definition Matrix.h:960
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:628
constexpr size_t rows(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of rows of the matrix.
Definition Matrix.h:644
size_t nonZeros(const Matrix< MT, SO > &matrix)
Returns the total number of non-zero elements in the matrix.
Definition Matrix.h:730
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:562
size_t capacity(const Matrix< MT, SO > &matrix) noexcept
Returns the maximum capacity of the matrix.
Definition Matrix.h:692
constexpr void reset(Matrix< MT, SO > &matrix)
Resetting the given matrix.
Definition Matrix.h:806
constexpr size_t columns(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of columns of the matrix.
Definition Matrix.h:660
void resize(Matrix< MT, SO > &matrix, size_t rows, size_t columns, bool preserve=true)
Changing the size of the matrix.
Definition Matrix.h:1108
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:584
MT::Iterator begin(Matrix< MT, SO > &matrix, size_t i)
Returns an iterator to the first element of row/column i.
Definition Matrix.h:518
void shrinkToFit(Matrix< MT, SO > &matrix)
Requesting the removal of unused capacity.
Definition Matrix.h:1169
bool isSquare(const Matrix< MT, SO > &matrix) noexcept
Checks if the given matrix is a square matrix.
Definition Matrix.h:1383
#define BLAZE_INTERNAL_ASSERT(expr, msg)
Run time assertion macro for internal checks.
Definition Assert.h:101
#define BLAZE_USER_ASSERT(expr, msg)
Run time assertion macro for user checks.
Definition Assert.h:117
BLAZE_ALWAYS_INLINE const EnableIf_t< IsIntegral_v< T > &&HasSize_v< T, 1UL >, If_t< IsSigned_v< T >, SIMDint8, SIMDuint8 > > loadu(const T *address) noexcept
Loads a vector of 1-byte integral values.
Definition Loadu.h:76
BLAZE_ALWAYS_INLINE const EnableIf_t< IsIntegral_v< T > &&HasSize_v< T, 1UL >, If_t< IsSigned_v< T >, SIMDint8, SIMDuint8 > > loada(const T *address) noexcept
Loads a vector of 1-byte integral values.
Definition Loada.h:79
#define BLAZE_STATIC_ASSERT(expr)
Compile time assertion macro.
Definition StaticAssert.h:112
decltype(auto) submatrix(Matrix< MT, SO > &, RSAs...)
Creating a view on a specific submatrix of the given matrix.
Definition Submatrix.h:181
#define BLAZE_ALWAYS_INLINE
Platform dependent setup of an enforced inline keyword.
Definition Inline.h:85
BoolConstant< false > FalseType
Type/value traits base class.
Definition IntegralConstant.h:121
constexpr void MAYBE_UNUSED(const Args &...)
Suppression of unused parameter warnings.
Definition MaybeUnused.h:81
typename EnableIf< Condition, T >::Type EnableIf_t
Auxiliary type for the EnableIf class template.
Definition EnableIf.h:138
BoolConstant< true > TrueType
Type traits base class.
Definition IntegralConstant.h:132
#define BLAZE_THROW_OUT_OF_RANGE(MESSAGE)
Macro for the emission of a std::out_of_range exception.
Definition Exception.h:331
#define BLAZE_THROW_INVALID_ARGUMENT(MESSAGE)
Macro for the emission of a std::invalid_argument exception.
Definition Exception.h:235
typename EnableIf<!Condition, T >::Type DisableIf_t
Auxiliary type for the EnableIf class template.
Definition EnableIf.h:175
Header file for the exception macros of the math module.
Header file for the extended initializer_list functionality.
Header file for all adaptor forward declarations.
Constraints on the storage order of matrix types.
Header file for the Size type trait.
Header file for the clear shim.
Header file for the isZero shim.
System settings for the inline keywords.
Header file for basic type definitions.
Header file for the implementation of the Submatrix view.