Dense.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_ADAPTORS_STRICTLYLOWERMATRIX_DENSE_H_
36 #define _BLAZE_MATH_ADAPTORS_STRICTLYLOWERMATRIX_DENSE_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
43 #include <iterator>
44 #include <utility>
48 #include <blaze/math/Aliases.h>
59 #include <blaze/math/Exception.h>
62 #include <blaze/math/shims/Clear.h>
72 #include <blaze/system/Inline.h>
73 #include <blaze/util/Assert.h>
79 #include <blaze/util/DisableIf.h>
80 #include <blaze/util/EnableIf.h>
81 #include <blaze/util/FalseType.h>
83 #include <blaze/util/TrueType.h>
84 #include <blaze/util/Types.h>
85 #include <blaze/util/Unused.h>
86 
87 
88 namespace blaze {
89 
90 //=================================================================================================
91 //
92 // CLASS TEMPLATE SPECIALIZATION FOR DENSE MATRICES
93 //
94 //=================================================================================================
95 
96 //*************************************************************************************************
104 template< typename MT // Type of the adapted dense matrix
105  , bool SO > // Storage order of the adapted dense matrix
106 class StrictlyLowerMatrix<MT,SO,true>
107  : public DenseMatrix< StrictlyLowerMatrix<MT,SO,true>, SO >
108 {
109  private:
110  //**Type definitions****************************************************************************
111  typedef OppositeType_<MT> OT;
112  typedef TransposeType_<MT> TT;
113  typedef ElementType_<MT> ET;
114  //**********************************************************************************************
115 
116  public:
117  //**Type definitions****************************************************************************
118  typedef StrictlyLowerMatrix<MT,SO,true> This;
119  typedef DenseMatrix<This,SO> BaseType;
120  typedef This ResultType;
121  typedef StrictlyLowerMatrix<OT,!SO,true> OppositeType;
122  typedef StrictlyUpperMatrix<TT,!SO,true> TransposeType;
123  typedef ET ElementType;
124  typedef SIMDType_<MT> SIMDType;
125  typedef ReturnType_<MT> ReturnType;
126  typedef const This& CompositeType;
127  typedef StrictlyLowerProxy<MT> Reference;
128  typedef ConstReference_<MT> ConstReference;
129  typedef Pointer_<MT> Pointer;
130  typedef ConstPointer_<MT> ConstPointer;
131  typedef ConstIterator_<MT> ConstIterator;
132  //**********************************************************************************************
133 
134  //**Rebind struct definition********************************************************************
137  template< typename ET > // Data type of the other matrix
138  struct Rebind {
140  typedef StrictlyLowerMatrix< typename MT::template Rebind<ET>::Other > Other;
141  };
142  //**********************************************************************************************
143 
144  //**Iterator class definition*******************************************************************
147  class Iterator
148  {
149  public:
150  //**Type definitions*************************************************************************
151  typedef std::random_access_iterator_tag IteratorCategory;
152  typedef ElementType_<MT> ValueType;
153  typedef StrictlyLowerProxy<MT> PointerType;
154  typedef StrictlyLowerProxy<MT> ReferenceType;
155  typedef ptrdiff_t DifferenceType;
156 
157  // STL iterator requirements
158  typedef IteratorCategory iterator_category;
159  typedef ValueType value_type;
160  typedef PointerType pointer;
161  typedef ReferenceType reference;
162  typedef DifferenceType difference_type;
163  //*******************************************************************************************
164 
165  //**Constructor******************************************************************************
168  inline Iterator() noexcept
169  : matrix_( nullptr ) // Reference to the adapted dense matrix
170  , row_ ( 0UL ) // The current row index of the iterator
171  , column_( 0UL ) // The current column index of the iterator
172  {}
173  //*******************************************************************************************
174 
175  //**Constructor******************************************************************************
182  inline Iterator( MT& matrix, size_t row, size_t column ) noexcept
183  : matrix_( &matrix ) // Reference to the adapted dense matrix
184  , row_ ( row ) // The current row-index of the iterator
185  , column_( column ) // The current column-index of the iterator
186  {}
187  //*******************************************************************************************
188 
189  //**Addition assignment operator*************************************************************
195  inline Iterator& operator+=( size_t inc ) noexcept {
196  ( SO )?( row_ += inc ):( column_ += inc );
197  return *this;
198  }
199  //*******************************************************************************************
200 
201  //**Subtraction assignment operator**********************************************************
207  inline Iterator& operator-=( size_t dec ) noexcept {
208  ( SO )?( row_ -= dec ):( column_ -= dec );
209  return *this;
210  }
211  //*******************************************************************************************
212 
213  //**Prefix increment operator****************************************************************
218  inline Iterator& operator++() noexcept {
219  ( SO )?( ++row_ ):( ++column_ );
220  return *this;
221  }
222  //*******************************************************************************************
223 
224  //**Postfix increment operator***************************************************************
229  inline const Iterator operator++( int ) noexcept {
230  const Iterator tmp( *this );
231  ++(*this);
232  return tmp;
233  }
234  //*******************************************************************************************
235 
236  //**Prefix decrement operator****************************************************************
241  inline Iterator& operator--() noexcept {
242  ( SO )?( --row_ ):( --column_ );
243  return *this;
244  }
245  //*******************************************************************************************
246 
247  //**Postfix decrement operator***************************************************************
252  inline const Iterator operator--( int ) noexcept {
253  const Iterator tmp( *this );
254  --(*this);
255  return tmp;
256  }
257  //*******************************************************************************************
258 
259  //**Element access operator******************************************************************
264  inline ReferenceType operator*() const {
265  return ReferenceType( *matrix_, row_, column_ );
266  }
267  //*******************************************************************************************
268 
269  //**Element access operator******************************************************************
274  inline PointerType operator->() const {
275  return PointerType( *matrix_, row_, column_ );
276  }
277  //*******************************************************************************************
278 
279  //**Load function****************************************************************************
289  inline SIMDType load() const {
290  return (*matrix_).load(row_,column_);
291  }
292  //*******************************************************************************************
293 
294  //**Loada function***************************************************************************
304  inline SIMDType loada() const {
305  return (*matrix_).loada(row_,column_);
306  }
307  //*******************************************************************************************
308 
309  //**Loadu function***************************************************************************
319  inline SIMDType loadu() const {
320  return (*matrix_).loadu(row_,column_);
321  }
322  //*******************************************************************************************
323 
324  //**Conversion operator**********************************************************************
329  inline operator ConstIterator() const {
330  if( SO )
331  return matrix_->begin( column_ ) + row_;
332  else
333  return matrix_->begin( row_ ) + column_;
334  }
335  //*******************************************************************************************
336 
337  //**Equality operator************************************************************************
344  friend inline bool operator==( const Iterator& lhs, const Iterator& rhs ) noexcept {
345  return ( SO )?( lhs.row_ == rhs.row_ ):( lhs.column_ == rhs.column_ );
346  }
347  //*******************************************************************************************
348 
349  //**Equality operator************************************************************************
356  friend inline bool operator==( const Iterator& lhs, const ConstIterator& rhs ) {
357  return ( ConstIterator( lhs ) == rhs );
358  }
359  //*******************************************************************************************
360 
361  //**Equality operator************************************************************************
368  friend inline bool operator==( const ConstIterator& lhs, const Iterator& rhs ) {
369  return ( lhs == ConstIterator( rhs ) );
370  }
371  //*******************************************************************************************
372 
373  //**Inequality operator**********************************************************************
380  friend inline bool operator!=( const Iterator& lhs, const Iterator& rhs ) noexcept {
381  return ( SO )?( lhs.row_ != rhs.row_ ):( lhs.column_ != rhs.column_ );
382  }
383  //*******************************************************************************************
384 
385  //**Inequality operator**********************************************************************
392  friend inline bool operator!=( const Iterator& lhs, const ConstIterator& rhs ) {
393  return ( ConstIterator( lhs ) != rhs );
394  }
395  //*******************************************************************************************
396 
397  //**Inequality operator**********************************************************************
404  friend inline bool operator!=( const ConstIterator& lhs, const Iterator& rhs ) {
405  return ( lhs != ConstIterator( rhs ) );
406  }
407  //*******************************************************************************************
408 
409  //**Less-than operator***********************************************************************
416  friend inline bool operator<( const Iterator& lhs, const Iterator& rhs ) noexcept {
417  return ( SO )?( lhs.row_ < rhs.row_ ):( lhs.column_ < rhs.column_ );
418  }
419  //*******************************************************************************************
420 
421  //**Less-than operator***********************************************************************
428  friend inline bool operator<( const Iterator& lhs, const ConstIterator& rhs ) {
429  return ( ConstIterator( lhs ) < rhs );
430  }
431  //*******************************************************************************************
432 
433  //**Less-than operator***********************************************************************
440  friend inline bool operator<( const ConstIterator& lhs, const Iterator& rhs ) {
441  return ( lhs < ConstIterator( rhs ) );
442  }
443  //*******************************************************************************************
444 
445  //**Greater-than operator********************************************************************
452  friend inline bool operator>( const Iterator& lhs, const Iterator& rhs ) noexcept {
453  return ( SO )?( lhs.row_ > rhs.row_ ):( lhs.column_ > rhs.column_ );
454  }
455  //*******************************************************************************************
456 
457  //**Greater-than operator********************************************************************
464  friend inline bool operator>( const Iterator& lhs, const ConstIterator& rhs ) {
465  return ( ConstIterator( lhs ) > rhs );
466  }
467  //*******************************************************************************************
468 
469  //**Greater-than operator********************************************************************
476  friend inline bool operator>( const ConstIterator& lhs, const Iterator& rhs ) {
477  return ( lhs > ConstIterator( rhs ) );
478  }
479  //*******************************************************************************************
480 
481  //**Less-or-equal-than operator**************************************************************
488  friend inline bool operator<=( const Iterator& lhs, const Iterator& rhs ) noexcept {
489  return ( SO )?( lhs.row_ <= rhs.row_ ):( lhs.column_ <= rhs.column_ );
490  }
491  //*******************************************************************************************
492 
493  //**Less-or-equal-than operator**************************************************************
500  friend inline bool operator<=( const Iterator& lhs, const ConstIterator& rhs ) {
501  return ( ConstIterator( lhs ) <= rhs );
502  }
503  //*******************************************************************************************
504 
505  //**Less-or-equal-than operator**************************************************************
512  friend inline bool operator<=( const ConstIterator& lhs, const Iterator& rhs ) {
513  return ( lhs <= ConstIterator( rhs ) );
514  }
515  //*******************************************************************************************
516 
517  //**Greater-or-equal-than operator***********************************************************
524  friend inline bool operator>=( const Iterator& lhs, const Iterator& rhs ) noexcept {
525  return ( SO )?( lhs.row_ >= rhs.row_ ):( lhs.column_ >= rhs.column_ );
526  }
527  //*******************************************************************************************
528 
529  //**Greater-or-equal-than operator***********************************************************
536  friend inline bool operator>=( const Iterator& lhs, const ConstIterator& rhs ) {
537  return ( ConstIterator( lhs ) >= rhs );
538  }
539  //*******************************************************************************************
540 
541  //**Greater-or-equal-than operator***********************************************************
548  friend inline bool operator>=( const ConstIterator& lhs, const Iterator& rhs ) {
549  return ( lhs >= ConstIterator( rhs ) );
550  }
551  //*******************************************************************************************
552 
553  //**Subtraction operator*********************************************************************
559  inline DifferenceType operator-( const Iterator& rhs ) const noexcept {
560  return ( SO )?( row_ - rhs.row_ ):( column_ - rhs.column_ );
561  }
562  //*******************************************************************************************
563 
564  //**Addition operator************************************************************************
571  friend inline const Iterator operator+( const Iterator& it, size_t inc ) noexcept {
572  if( SO )
573  return Iterator( *it.matrix_, it.row_ + inc, it.column_ );
574  else
575  return Iterator( *it.matrix_, it.row_, it.column_ + inc );
576  }
577  //*******************************************************************************************
578 
579  //**Addition operator************************************************************************
586  friend inline const Iterator operator+( size_t inc, const Iterator& it ) noexcept {
587  if( SO )
588  return Iterator( *it.matrix_, it.row_ + inc, it.column_ );
589  else
590  return Iterator( *it.matrix_, it.row_, it.column_ + inc );
591  }
592  //*******************************************************************************************
593 
594  //**Subtraction operator*********************************************************************
601  friend inline const Iterator operator-( const Iterator& it, size_t dec ) noexcept {
602  if( SO )
603  return Iterator( *it.matrix_, it.row_ - dec, it.column_ );
604  else
605  return Iterator( *it.matrix_, it.row_, it.column_ - dec );
606  }
607  //*******************************************************************************************
608 
609  private:
610  //**Member variables*************************************************************************
611  MT* matrix_;
612  size_t row_;
613  size_t column_;
614  //*******************************************************************************************
615  };
616  //**********************************************************************************************
617 
618  //**Compilation flags***************************************************************************
620  enum : bool { simdEnabled = MT::simdEnabled };
621 
623  enum : bool { smpAssignable = MT::smpAssignable };
624  //**********************************************************************************************
625 
626  //**Constructors********************************************************************************
629  explicit inline StrictlyLowerMatrix();
630  template< typename A1 > explicit inline StrictlyLowerMatrix( const A1& a1 );
631  explicit inline StrictlyLowerMatrix( size_t n, const ElementType& init );
632 
633  explicit inline StrictlyLowerMatrix( initializer_list< initializer_list<ElementType> > list );
634 
635  template< typename Other >
636  explicit inline StrictlyLowerMatrix( size_t n, const Other* array );
637 
638  template< typename Other, size_t N >
639  explicit inline StrictlyLowerMatrix( const Other (&array)[N][N] );
640 
641  explicit inline StrictlyLowerMatrix( ElementType* ptr, size_t n );
642  explicit inline StrictlyLowerMatrix( ElementType* ptr, size_t n, size_t nn );
643 
644  template< typename Deleter >
645  explicit inline StrictlyLowerMatrix( ElementType* ptr, size_t n, Deleter d );
646 
647  template< typename Deleter >
648  explicit inline StrictlyLowerMatrix( ElementType* ptr, size_t n, size_t nn, Deleter d );
649 
650  inline StrictlyLowerMatrix( const StrictlyLowerMatrix& m );
651  inline StrictlyLowerMatrix( StrictlyLowerMatrix&& m ) noexcept;
653  //**********************************************************************************************
654 
655  //**Destructor**********************************************************************************
656  // No explicitly declared destructor.
657  //**********************************************************************************************
658 
659  //**Data access functions***********************************************************************
662  inline Reference operator()( size_t i, size_t j );
663  inline ConstReference operator()( size_t i, size_t j ) const;
664  inline Reference at( size_t i, size_t j );
665  inline ConstReference at( size_t i, size_t j ) const;
666  inline ConstPointer data () const noexcept;
667  inline ConstPointer data ( size_t i ) const noexcept;
668  inline Iterator begin ( size_t i );
669  inline ConstIterator begin ( size_t i ) const;
670  inline ConstIterator cbegin( size_t i ) const;
671  inline Iterator end ( size_t i );
672  inline ConstIterator end ( size_t i ) const;
673  inline ConstIterator cend ( size_t i ) const;
675  //**********************************************************************************************
676 
677  //**Assignment operators************************************************************************
680  inline StrictlyLowerMatrix& operator=( const ElementType& rhs );
681  inline StrictlyLowerMatrix& operator=( initializer_list< initializer_list<ElementType> > list );
682 
683  template< typename Other, size_t N >
684  inline StrictlyLowerMatrix& operator=( const Other (&array)[N][N] );
685 
686  inline StrictlyLowerMatrix& operator=( const StrictlyLowerMatrix& rhs );
687  inline StrictlyLowerMatrix& operator=( StrictlyLowerMatrix&& rhs ) noexcept;
688 
689  template< typename MT2, bool SO2 >
690  inline DisableIf_< IsComputation<MT2>, StrictlyLowerMatrix& >
691  operator=( const Matrix<MT2,SO2>& rhs );
692 
693  template< typename MT2, bool SO2 >
694  inline EnableIf_< IsComputation<MT2>, StrictlyLowerMatrix& >
695  operator=( const Matrix<MT2,SO2>& rhs );
696 
697  template< typename MT2, bool SO2 >
698  inline DisableIf_< IsComputation<MT2>, StrictlyLowerMatrix& >
699  operator+=( const Matrix<MT2,SO2>& rhs );
700 
701  template< typename MT2, bool SO2 >
702  inline EnableIf_< IsComputation<MT2>, StrictlyLowerMatrix& >
703  operator+=( const Matrix<MT2,SO2>& rhs );
704 
705  template< typename MT2, bool SO2 >
706  inline DisableIf_< IsComputation<MT2>, StrictlyLowerMatrix& >
707  operator-=( const Matrix<MT2,SO2>& rhs );
708 
709  template< typename MT2, bool SO2 >
710  inline EnableIf_< IsComputation<MT2>, StrictlyLowerMatrix& >
711  operator-=( const Matrix<MT2,SO2>& rhs );
712 
713  template< typename MT2, bool SO2 >
714  inline StrictlyLowerMatrix& operator*=( const Matrix<MT2,SO2>& rhs );
715 
716  template< typename Other >
717  inline EnableIf_< IsNumeric<Other>, StrictlyLowerMatrix >& operator*=( Other rhs );
718 
719  template< typename Other >
720  inline EnableIf_< IsNumeric<Other>, StrictlyLowerMatrix >& operator/=( Other rhs );
722  //**********************************************************************************************
723 
724  //**Utility functions***************************************************************************
727  inline size_t rows() const noexcept;
728  inline size_t columns() const noexcept;
729  inline size_t spacing() const noexcept;
730  inline size_t capacity() const noexcept;
731  inline size_t capacity( size_t i ) const noexcept;
732  inline size_t nonZeros() const;
733  inline size_t nonZeros( size_t i ) const;
734  inline void reset();
735  inline void reset( size_t i );
736  inline void clear();
737  void resize ( size_t n, bool preserve=true );
738  inline void extend ( size_t n, bool preserve=true );
739  inline void reserve( size_t elements );
740 
741  template< typename Other > inline StrictlyLowerMatrix& scale( const Other& scalar );
742 
743  inline void swap( StrictlyLowerMatrix& m ) noexcept;
744 
745  static inline constexpr size_t maxNonZeros() noexcept;
746  static inline constexpr size_t maxNonZeros( size_t n ) noexcept;
748  //**********************************************************************************************
749 
750  //**Debugging functions*************************************************************************
753  inline bool isIntact() const noexcept;
755  //**********************************************************************************************
756 
757  //**Expression template evaluation functions****************************************************
760  template< typename Other > inline bool canAlias ( const Other* alias ) const noexcept;
761  template< typename Other > inline bool isAliased( const Other* alias ) const noexcept;
762 
763  inline bool isAligned () const noexcept;
764  inline bool canSMPAssign() const noexcept;
765 
766  BLAZE_ALWAYS_INLINE SIMDType load ( size_t i, size_t j ) const noexcept;
767  BLAZE_ALWAYS_INLINE SIMDType loada( size_t i, size_t j ) const noexcept;
768  BLAZE_ALWAYS_INLINE SIMDType loadu( size_t i, size_t j ) const noexcept;
770  //**********************************************************************************************
771 
772  private:
773  //**Construction functions**********************************************************************
776  inline const MT construct( size_t n , TrueType );
777  inline const MT construct( const ElementType& value, FalseType );
778 
779  template< typename MT2, bool SO2, typename T >
780  inline const MT construct( const Matrix<MT2,SO2>& m, T );
782  //**********************************************************************************************
783 
784  //**Member variables****************************************************************************
787  MT matrix_;
788 
789  //**********************************************************************************************
790 
791  //**Friend declarations*************************************************************************
792  template< typename MT2, bool SO2, bool DF2 >
793  friend MT2& derestrict( StrictlyLowerMatrix<MT2,SO2,DF2>& m );
794  //**********************************************************************************************
795 
796  //**Compile time checks*************************************************************************
809  BLAZE_STATIC_ASSERT( Rows<MT>::value == Columns<MT>::value );
810  //**********************************************************************************************
811 };
813 //*************************************************************************************************
814 
815 
816 
817 
818 //=================================================================================================
819 //
820 // CONSTRUCTORS
821 //
822 //=================================================================================================
823 
824 //*************************************************************************************************
828 template< typename MT // Type of the adapted dense matrix
829  , bool SO > // Storage order of the adapted dense matrix
830 inline StrictlyLowerMatrix<MT,SO,true>::StrictlyLowerMatrix()
831  : matrix_() // The adapted dense matrix
832 {
833  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly lower matrix detected" );
834  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
835 }
837 //*************************************************************************************************
838 
839 
840 //*************************************************************************************************
858 template< typename MT // Type of the adapted dense matrix
859  , bool SO > // Storage order of the adapted dense matrix
860 template< typename A1 > // Type of the constructor argument
861 inline StrictlyLowerMatrix<MT,SO,true>::StrictlyLowerMatrix( const A1& a1 )
862  : matrix_( construct( a1, typename IsResizable<MT>::Type() ) ) // The adapted dense matrix
863 {
864  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly lower matrix detected" );
865  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
866 }
868 //*************************************************************************************************
869 
870 
871 //*************************************************************************************************
878 template< typename MT // Type of the adapted dense matrix
879  , bool SO > // Storage order of the adapted dense matrix
880 inline StrictlyLowerMatrix<MT,SO,true>::StrictlyLowerMatrix( size_t n, const ElementType& init )
881  : matrix_( n, n, ElementType() ) // The adapted dense matrix
882 {
884 
885  if( SO ) {
886  for( size_t j=0UL; j<columns(); ++j ) {
887  for( size_t i=j+1UL; i<rows(); ++i )
888  matrix_(i,j) = init;
889  }
890  }
891  else {
892  for( size_t i=0UL; i<rows(); ++i ) {
893  for( size_t j=0UL; j<i; ++j )
894  matrix_(i,j) = init;
895  }
896  }
897 
898  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly lower matrix detected" );
899  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
900 }
902 //*************************************************************************************************
903 
904 
905 //*************************************************************************************************
928 template< typename MT // Type of the adapted dense matrix
929  , bool SO > // Storage order of the adapted dense matrix
930 inline StrictlyLowerMatrix<MT,SO,true>::StrictlyLowerMatrix( initializer_list< initializer_list<ElementType> > list )
931  : matrix_( list ) // The adapted dense matrix
932 {
933  if( !isStrictlyLower( matrix_ ) ) {
934  BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of strictly lower matrix" );
935  }
936 
937  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
938 }
940 //*************************************************************************************************
941 
942 
943 //*************************************************************************************************
969 template< typename MT // Type of the adapted dense matrix
970  , bool SO > // Storage order of the adapted dense matrix
971 template< typename Other > // Data type of the initialization array
972 inline StrictlyLowerMatrix<MT,SO,true>::StrictlyLowerMatrix( size_t n, const Other* array )
973  : matrix_( n, n, array ) // The adapted dense matrix
974 {
975  if( !isStrictlyLower( matrix_ ) ) {
976  BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of strictly lower matrix" );
977  }
978 
979  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
980 }
982 //*************************************************************************************************
983 
984 
985 //*************************************************************************************************
1008 template< typename MT // Type of the adapted dense matrix
1009  , bool SO > // Storage order of the adapted dense matrix
1010 template< typename Other // Data type of the initialization array
1011  , size_t N > // Number of rows and columns of the initialization array
1012 inline StrictlyLowerMatrix<MT,SO,true>::StrictlyLowerMatrix( const Other (&array)[N][N] )
1013  : matrix_( array ) // The adapted dense matrix
1014 {
1015  if( !isStrictlyLower( matrix_ ) ) {
1016  BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of strictly lower matrix" );
1017  }
1018 
1019  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1020 }
1022 //*************************************************************************************************
1023 
1024 
1025 //*************************************************************************************************
1047 template< typename MT // Type of the adapted dense matrix
1048  , bool SO > // Storage order of the adapted dense matrix
1049 inline StrictlyLowerMatrix<MT,SO,true>::StrictlyLowerMatrix( ElementType* ptr, size_t n )
1050  : matrix_( ptr, n, n ) // The adapted dense matrix
1051 {
1052  if( !isStrictlyLower( matrix_ ) ) {
1053  BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of strictly lower matrix" );
1054  }
1055 
1056  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1057 }
1059 //*************************************************************************************************
1060 
1061 
1062 //*************************************************************************************************
1085 template< typename MT // Type of the adapted dense matrix
1086  , bool SO > // Storage order of the adapted dense matrix
1087 inline StrictlyLowerMatrix<MT,SO,true>::StrictlyLowerMatrix( ElementType* ptr, size_t n, size_t nn )
1088  : matrix_( ptr, n, n, nn ) // The adapted dense matrix
1089 {
1090  if( !isStrictlyLower( matrix_ ) ) {
1091  BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of strictly lower matrix" );
1092  }
1093 
1094  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1095 }
1097 //*************************************************************************************************
1098 
1099 
1100 //*************************************************************************************************
1121 template< typename MT // Type of the adapted dense matrix
1122  , bool SO > // Storage order of the adapted dense matrix
1123 template< typename Deleter > // Type of the custom deleter
1124 inline StrictlyLowerMatrix<MT,SO,true>::StrictlyLowerMatrix( ElementType* ptr, size_t n, Deleter d )
1125  : matrix_( ptr, n, n, d ) // The adapted dense matrix
1126 {
1127  if( !isStrictlyLower( matrix_ ) ) {
1128  BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of strictly lower matrix" );
1129  }
1130 
1131  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1132 }
1134 //*************************************************************************************************
1135 
1136 
1137 //*************************************************************************************************
1159 template< typename MT // Type of the adapted dense matrix
1160  , bool SO > // Storage order of the adapted dense matrix
1161 template< typename Deleter > // Type of the custom deleter
1162 inline StrictlyLowerMatrix<MT,SO,true>::StrictlyLowerMatrix( ElementType* ptr, size_t n, size_t nn, Deleter d )
1163  : matrix_( ptr, n, n, nn, d ) // The adapted dense matrix
1164 {
1165  if( !isStrictlyLower( matrix_ ) ) {
1166  BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of strictly lower matrix" );
1167  }
1168 
1169  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1170 }
1172 //*************************************************************************************************
1173 
1174 
1175 //*************************************************************************************************
1181 template< typename MT // Type of the adapted dense matrix
1182  , bool SO > // Storage order of the adapted dense matrix
1183 inline StrictlyLowerMatrix<MT,SO,true>::StrictlyLowerMatrix( const StrictlyLowerMatrix& m )
1184  : matrix_( m.matrix_ ) // The adapted dense matrix
1185 {
1186  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly lower matrix detected" );
1187  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1188 }
1190 //*************************************************************************************************
1191 
1192 
1193 //*************************************************************************************************
1199 template< typename MT // Type of the adapted dense matrix
1200  , bool SO > // Storage order of the adapted dense matrix
1201 inline StrictlyLowerMatrix<MT,SO,true>::StrictlyLowerMatrix( StrictlyLowerMatrix&& m ) noexcept
1202  : matrix_( std::move( m.matrix_ ) ) // The adapted dense matrix
1203 {
1204  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly lower matrix detected" );
1205  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1206 }
1208 //*************************************************************************************************
1209 
1210 
1211 
1212 
1213 //=================================================================================================
1214 //
1215 // DATA ACCESS FUNCTIONS
1216 //
1217 //=================================================================================================
1218 
1219 //*************************************************************************************************
1235 template< typename MT // Type of the adapted dense matrix
1236  , bool SO > // Storage order of the adapted dense matrix
1238  StrictlyLowerMatrix<MT,SO,true>::operator()( size_t i, size_t j )
1239 {
1240  BLAZE_USER_ASSERT( i<rows() , "Invalid row access index" );
1241  BLAZE_USER_ASSERT( j<columns(), "Invalid column access index" );
1242 
1243  return Reference( matrix_, i, j );
1244 }
1246 //*************************************************************************************************
1247 
1248 
1249 //*************************************************************************************************
1265 template< typename MT // Type of the adapted dense matrix
1266  , bool SO > // Storage order of the adapted dense matrix
1268  StrictlyLowerMatrix<MT,SO,true>::operator()( size_t i, size_t j ) const
1269 {
1270  BLAZE_USER_ASSERT( i<rows() , "Invalid row access index" );
1271  BLAZE_USER_ASSERT( j<columns(), "Invalid column access index" );
1272 
1273  return matrix_(i,j);
1274 }
1276 //*************************************************************************************************
1277 
1278 
1279 //*************************************************************************************************
1296 template< typename MT // Type of the adapted dense matrix
1297  , bool SO > // Storage order of the adapted dense matrix
1299  StrictlyLowerMatrix<MT,SO,true>::at( size_t i, size_t j )
1300 {
1301  if( i >= rows() ) {
1302  BLAZE_THROW_OUT_OF_RANGE( "Invalid row access index" );
1303  }
1304  if( j >= columns() ) {
1305  BLAZE_THROW_OUT_OF_RANGE( "Invalid column access index" );
1306  }
1307  return (*this)(i,j);
1308 }
1310 //*************************************************************************************************
1311 
1312 
1313 //*************************************************************************************************
1330 template< typename MT // Type of the adapted dense matrix
1331  , bool SO > // Storage order of the adapted dense matrix
1333  StrictlyLowerMatrix<MT,SO,true>::at( size_t i, size_t j ) const
1334 {
1335  if( i >= rows() ) {
1336  BLAZE_THROW_OUT_OF_RANGE( "Invalid row access index" );
1337  }
1338  if( j >= columns() ) {
1339  BLAZE_THROW_OUT_OF_RANGE( "Invalid column access index" );
1340  }
1341  return (*this)(i,j);
1342 }
1344 //*************************************************************************************************
1345 
1346 
1347 //*************************************************************************************************
1360 template< typename MT // Type of the adapted dense matrix
1361  , bool SO > // Storage order of the adapted dense matrix
1362 inline typename StrictlyLowerMatrix<MT,SO,true>::ConstPointer
1363  StrictlyLowerMatrix<MT,SO,true>::data() const noexcept
1364 {
1365  return matrix_.data();
1366 }
1368 //*************************************************************************************************
1369 
1370 
1371 //*************************************************************************************************
1380 template< typename MT // Type of the adapted dense matrix
1381  , bool SO > // Storage order of the adapted dense matrix
1382 inline typename StrictlyLowerMatrix<MT,SO,true>::ConstPointer
1383  StrictlyLowerMatrix<MT,SO,true>::data( size_t i ) const noexcept
1384 {
1385  return matrix_.data(i);
1386 }
1388 //*************************************************************************************************
1389 
1390 
1391 //*************************************************************************************************
1403 template< typename MT // Type of the adapted dense matrix
1404  , bool SO > // Storage order of the adapted dense matrix
1407 {
1408  if( SO )
1409  return Iterator( matrix_, 0UL, i );
1410  else
1411  return Iterator( matrix_, i, 0UL );
1412 }
1414 //*************************************************************************************************
1415 
1416 
1417 //*************************************************************************************************
1429 template< typename MT // Type of the adapted dense matrix
1430  , bool SO > // Storage order of the adapted dense matrix
1432  StrictlyLowerMatrix<MT,SO,true>::begin( size_t i ) const
1433 {
1434  return matrix_.begin(i);
1435 }
1437 //*************************************************************************************************
1438 
1439 
1440 //*************************************************************************************************
1452 template< typename MT // Type of the adapted dense matrix
1453  , bool SO > // Storage order of the adapted dense matrix
1455  StrictlyLowerMatrix<MT,SO,true>::cbegin( size_t i ) const
1456 {
1457  return matrix_.cbegin(i);
1458 }
1460 //*************************************************************************************************
1461 
1462 
1463 //*************************************************************************************************
1475 template< typename MT // Type of the adapted dense matrix
1476  , bool SO > // Storage order of the adapted dense matrix
1479 {
1480  if( SO )
1481  return Iterator( matrix_, rows(), i );
1482  else
1483  return Iterator( matrix_, i, columns() );
1484 }
1486 //*************************************************************************************************
1487 
1488 
1489 //*************************************************************************************************
1501 template< typename MT // Type of the adapted dense matrix
1502  , bool SO > // Storage order of the adapted dense matrix
1504  StrictlyLowerMatrix<MT,SO,true>::end( size_t i ) const
1505 {
1506  return matrix_.end(i);
1507 }
1509 //*************************************************************************************************
1510 
1511 
1512 //*************************************************************************************************
1524 template< typename MT // Type of the adapted dense matrix
1525  , bool SO > // Storage order of the adapted dense matrix
1527  StrictlyLowerMatrix<MT,SO,true>::cend( size_t i ) const
1528 {
1529  return matrix_.cend(i);
1530 }
1532 //*************************************************************************************************
1533 
1534 
1535 
1536 
1537 //=================================================================================================
1538 //
1539 // ASSIGNMENT OPERATORS
1540 //
1541 //=================================================================================================
1542 
1543 //*************************************************************************************************
1550 template< typename MT // Type of the adapted dense matrix
1551  , bool SO > // Storage order of the adapted dense matrix
1552 inline StrictlyLowerMatrix<MT,SO,true>&
1553  StrictlyLowerMatrix<MT,SO,true>::operator=( const ElementType& rhs )
1554 {
1555  if( SO ) {
1556  for( size_t j=0UL; j<columns(); ++j )
1557  for( size_t i=j+1UL; i<rows(); ++i )
1558  matrix_(i,j) = rhs;
1559  }
1560  else {
1561  for( size_t i=1UL; i<rows(); ++i )
1562  for( size_t j=0UL; j<i; ++j )
1563  matrix_(i,j) = rhs;
1564  }
1565 
1566  return *this;
1567 }
1569 //*************************************************************************************************
1570 
1571 
1572 //*************************************************************************************************
1596 template< typename MT // Type of the adapted dense matrix
1597  , bool SO > // Storage order of the adapted dense matrix
1598 inline StrictlyLowerMatrix<MT,SO,true>&
1599  StrictlyLowerMatrix<MT,SO,true>::operator=( initializer_list< initializer_list<ElementType> > list )
1600 {
1601  MT tmp( list );
1602 
1603  if( !isStrictlyLower( tmp ) ) {
1604  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to strictly lower matrix" );
1605  }
1606 
1607  matrix_ = std::move( tmp );
1608 
1609  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly lower matrix detected" );
1610  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1611 
1612  return *this;
1613 }
1615 //*************************************************************************************************
1616 
1617 
1618 //*************************************************************************************************
1643 template< typename MT // Type of the adapted dense matrix
1644  , bool SO > // Storage order of the adapted dense matrix
1645 template< typename Other // Data type of the initialization array
1646  , size_t N > // Number of rows and columns of the initialization array
1647 inline StrictlyLowerMatrix<MT,SO,true>&
1648  StrictlyLowerMatrix<MT,SO,true>::operator=( const Other (&array)[N][N] )
1649 {
1650  MT tmp( array );
1651 
1652  if( !isStrictlyLower( tmp ) ) {
1653  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to strictly lower matrix" );
1654  }
1655 
1656  matrix_ = std::move( tmp );
1657 
1658  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly lower matrix detected" );
1659  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1660 
1661  return *this;
1662 }
1664 //*************************************************************************************************
1665 
1666 
1667 //*************************************************************************************************
1677 template< typename MT // Type of the adapted dense matrix
1678  , bool SO > // Storage order of the adapted dense matrix
1679 inline StrictlyLowerMatrix<MT,SO,true>&
1680  StrictlyLowerMatrix<MT,SO,true>::operator=( const StrictlyLowerMatrix& rhs )
1681 {
1682  matrix_ = rhs.matrix_;
1683 
1684  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly lower matrix detected" );
1685  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1686 
1687  return *this;
1688 }
1690 //*************************************************************************************************
1691 
1692 
1693 //*************************************************************************************************
1700 template< typename MT // Type of the adapted dense matrix
1701  , bool SO > // Storage order of the adapted dense matrix
1702 inline StrictlyLowerMatrix<MT,SO,true>&
1703  StrictlyLowerMatrix<MT,SO,true>::operator=( StrictlyLowerMatrix&& rhs ) noexcept
1704 {
1705  matrix_ = std::move( rhs.matrix_ );
1706 
1707  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly lower matrix detected" );
1708  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1709 
1710  return *this;
1711 }
1713 //*************************************************************************************************
1714 
1715 
1716 //*************************************************************************************************
1729 template< typename MT // Type of the adapted dense matrix
1730  , bool SO > // Storage order of the adapted dense matrix
1731 template< typename MT2 // Type of the right-hand side matrix
1732  , bool SO2 > // Storage order of the right-hand side matrix
1733 inline DisableIf_< IsComputation<MT2>, StrictlyLowerMatrix<MT,SO,true>& >
1734  StrictlyLowerMatrix<MT,SO,true>::operator=( const Matrix<MT2,SO2>& rhs )
1735 {
1736  if( IsUniTriangular<MT2>::value ||
1737  ( !IsStrictlyLower<MT2>::value && !isStrictlyLower( ~rhs ) ) ) {
1738  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to strictly lower matrix" );
1739  }
1740 
1741  matrix_ = ~rhs;
1742 
1743  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly lower matrix detected" );
1744  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1745 
1746  return *this;
1747 }
1749 //*************************************************************************************************
1750 
1751 
1752 //*************************************************************************************************
1765 template< typename MT // Type of the adapted dense matrix
1766  , bool SO > // Storage order of the adapted dense matrix
1767 template< typename MT2 // Type of the right-hand side matrix
1768  , bool SO2 > // Storage order of the right-hand side matrix
1769 inline EnableIf_< IsComputation<MT2>, StrictlyLowerMatrix<MT,SO,true>& >
1770  StrictlyLowerMatrix<MT,SO,true>::operator=( const Matrix<MT2,SO2>& rhs )
1771 {
1772  if( IsUniTriangular<MT2>::value || ( !IsSquare<MT2>::value && !isSquare( ~rhs ) ) ) {
1773  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to strictly lower matrix" );
1774  }
1775 
1776  if( IsStrictlyLower<MT2>::value ) {
1777  matrix_ = ~rhs;
1778  }
1779  else {
1780  MT tmp( ~rhs );
1781 
1782  if( !isStrictlyLower( tmp ) ) {
1783  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to strictly lower matrix" );
1784  }
1785 
1786  matrix_ = std::move( tmp );
1787  }
1788 
1789  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly lower matrix detected" );
1790  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1791 
1792  return *this;
1793 }
1795 //*************************************************************************************************
1796 
1797 
1798 //*************************************************************************************************
1811 template< typename MT // Type of the adapted dense matrix
1812  , bool SO > // Storage order of the adapted dense matrix
1813 template< typename MT2 // Type of the right-hand side matrix
1814  , bool SO2 > // Storage order of the right-hand side matrix
1815 inline DisableIf_< IsComputation<MT2>, StrictlyLowerMatrix<MT,SO,true>& >
1816  StrictlyLowerMatrix<MT,SO,true>::operator+=( const Matrix<MT2,SO2>& rhs )
1817 {
1818  if( IsUniTriangular<MT2>::value ||
1819  ( !IsStrictlyLower<MT2>::value && !isStrictlyLower( ~rhs ) ) ) {
1820  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to strictly lower matrix" );
1821  }
1822 
1823  matrix_ += ~rhs;
1824 
1825  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly lower matrix detected" );
1826  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1827 
1828  return *this;
1829 }
1831 //*************************************************************************************************
1832 
1833 
1834 //*************************************************************************************************
1847 template< typename MT // Type of the adapted dense matrix
1848  , bool SO > // Storage order of the adapted dense matrix
1849 template< typename MT2 // Type of the right-hand side matrix
1850  , bool SO2 > // Storage order of the right-hand side matrix
1851 inline EnableIf_< IsComputation<MT2>, StrictlyLowerMatrix<MT,SO,true>& >
1852  StrictlyLowerMatrix<MT,SO,true>::operator+=( const Matrix<MT2,SO2>& rhs )
1853 {
1854  if( IsUniTriangular<MT2>::value || ( !IsSquare<MT2>::value && !isSquare( ~rhs ) ) ) {
1855  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to strictly lower matrix" );
1856  }
1857 
1858  if( IsStrictlyLower<MT2>::value ) {
1859  matrix_ += ~rhs;
1860  }
1861  else {
1862  const ResultType_<MT2> tmp( ~rhs );
1863 
1864  if( !isStrictlyLower( tmp ) ) {
1865  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to strictly lower matrix" );
1866  }
1867 
1868  matrix_ += tmp;
1869  }
1870 
1871  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly lower matrix detected" );
1872  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1873 
1874  return *this;
1875 }
1877 //*************************************************************************************************
1878 
1879 
1880 //*************************************************************************************************
1893 template< typename MT // Type of the adapted dense matrix
1894  , bool SO > // Storage order of the adapted dense matrix
1895 template< typename MT2 // Type of the right-hand side matrix
1896  , bool SO2 > // Storage order of the right-hand side matrix
1897 inline DisableIf_< IsComputation<MT2>, StrictlyLowerMatrix<MT,SO,true>& >
1898  StrictlyLowerMatrix<MT,SO,true>::operator-=( const Matrix<MT2,SO2>& rhs )
1899 {
1900  if( IsUniTriangular<MT2>::value ||
1901  ( !IsStrictlyLower<MT2>::value && !isStrictlyLower( ~rhs ) ) ) {
1902  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to strictly lower matrix" );
1903  }
1904 
1905  matrix_ -= ~rhs;
1906 
1907  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly lower matrix detected" );
1908  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1909 
1910  return *this;
1911 }
1913 //*************************************************************************************************
1914 
1915 
1916 //*************************************************************************************************
1929 template< typename MT // Type of the adapted dense matrix
1930  , bool SO > // Storage order of the adapted dense matrix
1931 template< typename MT2 // Type of the right-hand side matrix
1932  , bool SO2 > // Storage order of the right-hand side matrix
1933 inline EnableIf_< IsComputation<MT2>, StrictlyLowerMatrix<MT,SO,true>& >
1934  StrictlyLowerMatrix<MT,SO,true>::operator-=( const Matrix<MT2,SO2>& rhs )
1935 {
1936  if( IsUniTriangular<MT2>::value || ( !IsSquare<MT2>::value && !isSquare( ~rhs ) ) ) {
1937  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to strictly lower matrix" );
1938  }
1939 
1940  if( IsStrictlyLower<MT2>::value ) {
1941  matrix_ -= ~rhs;
1942  }
1943  else {
1944  const ResultType_<MT2> tmp( ~rhs );
1945 
1946  if( !isStrictlyLower( tmp ) ) {
1947  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to strictly lower matrix" );
1948  }
1949 
1950  matrix_ -= tmp;
1951  }
1952 
1953  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly lower matrix detected" );
1954  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1955 
1956  return *this;
1957 }
1959 //*************************************************************************************************
1960 
1961 
1962 //*************************************************************************************************
1974 template< typename MT // Type of the adapted dense matrix
1975  , bool SO > // Storage order of the adapted dense matrix
1976 template< typename MT2 // Type of the right-hand side matrix
1977  , bool SO2 > // Storage order of the right-hand side matrix
1978 inline StrictlyLowerMatrix<MT,SO,true>&
1979  StrictlyLowerMatrix<MT,SO,true>::operator*=( const Matrix<MT2,SO2>& rhs )
1980 {
1981  if( matrix_.rows() != (~rhs).columns() ) {
1982  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to strictly lower matrix" );
1983  }
1984 
1985  MT tmp( matrix_ * ~rhs );
1986 
1987  if( !isStrictlyLower( tmp ) ) {
1988  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to strictly lower matrix" );
1989  }
1990 
1991  matrix_ = std::move( tmp );
1992 
1993  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly lower matrix detected" );
1994  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1995 
1996  return *this;
1997 }
1999 //*************************************************************************************************
2000 
2001 
2002 //*************************************************************************************************
2010 template< typename MT // Type of the adapted dense matrix
2011  , bool SO > // Storage order of the adapted dense matrix
2012 template< typename Other > // Data type of the right-hand side scalar
2013 inline EnableIf_< IsNumeric<Other>, StrictlyLowerMatrix<MT,SO,true> >&
2015 {
2016  matrix_ *= rhs;
2017  return *this;
2018 }
2019 //*************************************************************************************************
2020 
2021 
2022 //*************************************************************************************************
2030 template< typename MT // Type of the adapted dense matrix
2031  , bool SO > // Storage order of the adapted dense matrix
2032 template< typename Other > // Data type of the right-hand side scalar
2033 inline EnableIf_< IsNumeric<Other>, StrictlyLowerMatrix<MT,SO,true> >&
2035 {
2036  BLAZE_USER_ASSERT( rhs != Other(0), "Division by zero detected" );
2037 
2038  matrix_ /= rhs;
2039  return *this;
2040 }
2042 //*************************************************************************************************
2043 
2044 
2045 
2046 
2047 //=================================================================================================
2048 //
2049 // UTILITY FUNCTIONS
2050 //
2051 //=================================================================================================
2052 
2053 //*************************************************************************************************
2059 template< typename MT // Type of the adapted dense matrix
2060  , bool SO > // Storage order of the adapted dense matrix
2061 inline size_t StrictlyLowerMatrix<MT,SO,true>::rows() const noexcept
2062 {
2063  return matrix_.rows();
2064 }
2066 //*************************************************************************************************
2067 
2068 
2069 //*************************************************************************************************
2075 template< typename MT // Type of the adapted dense matrix
2076  , bool SO > // Storage order of the adapted dense matrix
2077 inline size_t StrictlyLowerMatrix<MT,SO,true>::columns() const noexcept
2078 {
2079  return matrix_.columns();
2080 }
2082 //*************************************************************************************************
2083 
2084 
2085 //*************************************************************************************************
2096 template< typename MT // Type of the adapted dense matrix
2097  , bool SO > // Storage order of the adapted dense matrix
2098 inline size_t StrictlyLowerMatrix<MT,SO,true>::spacing() const noexcept
2099 {
2100  return matrix_.spacing();
2101 }
2103 //*************************************************************************************************
2104 
2105 
2106 //*************************************************************************************************
2112 template< typename MT // Type of the adapted dense matrix
2113  , bool SO > // Storage order of the adapted dense matrix
2114 inline size_t StrictlyLowerMatrix<MT,SO,true>::capacity() const noexcept
2115 {
2116  return matrix_.capacity();
2117 }
2119 //*************************************************************************************************
2120 
2121 
2122 //*************************************************************************************************
2134 template< typename MT // Type of the adapted dense matrix
2135  , bool SO > // Storage order of the adapted dense matrix
2136 inline size_t StrictlyLowerMatrix<MT,SO,true>::capacity( size_t i ) const noexcept
2137 {
2138  return matrix_.capacity(i);
2139 }
2141 //*************************************************************************************************
2142 
2143 
2144 //*************************************************************************************************
2150 template< typename MT // Type of the adapted dense matrix
2151  , bool SO > // Storage order of the adapted dense matrix
2152 inline size_t StrictlyLowerMatrix<MT,SO,true>::nonZeros() const
2153 {
2154  return matrix_.nonZeros();
2155 }
2157 //*************************************************************************************************
2158 
2159 
2160 //*************************************************************************************************
2172 template< typename MT // Type of the adapted dense matrix
2173  , bool SO > // Storage order of the adapted dense matrix
2174 inline size_t StrictlyLowerMatrix<MT,SO,true>::nonZeros( size_t i ) const
2175 {
2176  return matrix_.nonZeros(i);
2177 }
2179 //*************************************************************************************************
2180 
2181 
2182 //*************************************************************************************************
2188 template< typename MT // Type of the adapted dense matrix
2189  , bool SO > // Storage order of the adapted dense matrix
2191 {
2192  using blaze::clear;
2193 
2194  if( SO ) {
2195  for( size_t j=0UL; j<columns(); ++j )
2196  for( size_t i=j+1UL; i<rows(); ++i )
2197  clear( matrix_(i,j) );
2198  }
2199  else {
2200  for( size_t i=1UL; i<rows(); ++i )
2201  for( size_t j=0UL; j<i; ++j )
2202  clear( matrix_(i,j) );
2203  }
2204 }
2206 //*************************************************************************************************
2207 
2208 
2209 //*************************************************************************************************
2222 template< typename MT // Type of the adapted dense matrix
2223  , bool SO > // Storage order of the adapted dense matrix
2224 inline void StrictlyLowerMatrix<MT,SO,true>::reset( size_t i )
2225 {
2226  using blaze::clear;
2227 
2228  if( SO ) {
2229  for( size_t j=i+1UL; j<rows(); ++j )
2230  clear( matrix_(j,i) );
2231  }
2232  else {
2233  for( size_t j=0UL; j<i; ++j )
2234  clear( matrix_(i,j) );
2235  }
2236 }
2238 //*************************************************************************************************
2239 
2240 
2241 //*************************************************************************************************
2253 template< typename MT // Type of the adapted dense matrix
2254  , bool SO > // Storage order of the adapted dense matrix
2256 {
2257  using blaze::clear;
2258 
2259  if( IsResizable<MT>::value ) {
2260  clear( matrix_ );
2261  }
2262  else {
2263  reset();
2264  }
2265 }
2267 //*************************************************************************************************
2268 
2269 
2270 //*************************************************************************************************
2306 template< typename MT // Type of the adapted dense matrix
2307  , bool SO > // Storage order of the adapted dense matrix
2308 void StrictlyLowerMatrix<MT,SO,true>::resize( size_t n, bool preserve )
2309 {
2311 
2312  UNUSED_PARAMETER( preserve );
2313 
2314  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly lower matrix detected" );
2315 
2316  const size_t oldsize( matrix_.rows() );
2317 
2318  matrix_.resize( n, n, true );
2319 
2320  if( n > oldsize )
2321  {
2322  const size_t increment( n - oldsize );
2323  submatrix( matrix_, 0UL, oldsize, n, increment ).reset();
2324  }
2325 }
2327 //*************************************************************************************************
2328 
2329 
2330 //*************************************************************************************************
2343 template< typename MT // Type of the adapted dense matrix
2344  , bool SO > // Storage order of the adapted dense matrix
2345 inline void StrictlyLowerMatrix<MT,SO,true>::extend( size_t n, bool preserve )
2346 {
2348 
2349  UNUSED_PARAMETER( preserve );
2350 
2351  resize( rows() + n, true );
2352 }
2353 //*************************************************************************************************
2354 
2355 
2356 //*************************************************************************************************
2366 template< typename MT // Type of the adapted dense matrix
2367  , bool SO > // Storage order of the adapted dense matrix
2368 inline void StrictlyLowerMatrix<MT,SO,true>::reserve( size_t elements )
2369 {
2370  matrix_.reserve( elements );
2371 }
2373 //*************************************************************************************************
2374 
2375 
2376 //*************************************************************************************************
2383 template< typename MT // Type of the adapted dense matrix
2384  , bool SO > // Storage order of the adapted dense matrix
2385 template< typename Other > // Data type of the scalar value
2386 inline StrictlyLowerMatrix<MT,SO,true>&
2387  StrictlyLowerMatrix<MT,SO,true>::scale( const Other& scalar )
2388 {
2389  matrix_.scale( scalar );
2390  return *this;
2391 }
2393 //*************************************************************************************************
2394 
2395 
2396 //*************************************************************************************************
2403 template< typename MT // Type of the adapted dense matrix
2404  , bool SO > // Storage order of the adapted dense matrix
2405 inline void StrictlyLowerMatrix<MT,SO,true>::swap( StrictlyLowerMatrix& m ) noexcept
2406 {
2407  using std::swap;
2408 
2409  swap( matrix_, m.matrix_ );
2410 }
2412 //*************************************************************************************************
2413 
2414 
2415 //*************************************************************************************************
2427 template< typename MT // Type of the adapted dense matrix
2428  , bool SO > // Storage order of the adapted dense matrix
2429 inline constexpr size_t StrictlyLowerMatrix<MT,SO,true>::maxNonZeros() noexcept
2430 {
2432 
2433  return maxNonZeros( Rows<MT>::value );
2434 }
2436 //*************************************************************************************************
2437 
2438 
2439 //*************************************************************************************************
2449 template< typename MT // Type of the adapted dense matrix
2450  , bool SO > // Storage order of the adapted dense matrix
2451 inline constexpr size_t StrictlyLowerMatrix<MT,SO,true>::maxNonZeros( size_t n ) noexcept
2452 {
2453  return ( ( n - 1UL ) * n ) / 2UL;
2454 }
2456 //*************************************************************************************************
2457 
2458 
2459 
2460 
2461 //=================================================================================================
2462 //
2463 // DEBUGGING FUNCTIONS
2464 //
2465 //=================================================================================================
2466 
2467 //*************************************************************************************************
2477 template< typename MT // Type of the adapted dense matrix
2478  , bool SO > // Storage order of the adapted dense matrix
2479 inline bool StrictlyLowerMatrix<MT,SO,true>::isIntact() const noexcept
2480 {
2481  using blaze::isIntact;
2482 
2483  return ( isIntact( matrix_ ) && isStrictlyLower( matrix_ ) );
2484 }
2486 //*************************************************************************************************
2487 
2488 
2489 
2490 
2491 //=================================================================================================
2492 //
2493 // EXPRESSION TEMPLATE EVALUATION FUNCTIONS
2494 //
2495 //=================================================================================================
2496 
2497 //*************************************************************************************************
2508 template< typename MT // Type of the adapted dense matrix
2509  , bool SO > // Storage order of the adapted dense matrix
2510 template< typename Other > // Data type of the foreign expression
2511 inline bool StrictlyLowerMatrix<MT,SO,true>::canAlias( const Other* alias ) const noexcept
2512 {
2513  return matrix_.canAlias( alias );
2514 }
2516 //*************************************************************************************************
2517 
2518 
2519 //*************************************************************************************************
2530 template< typename MT // Type of the adapted dense matrix
2531  , bool SO > // Storage order of the adapted dense matrix
2532 template< typename Other > // Data type of the foreign expression
2533 inline bool StrictlyLowerMatrix<MT,SO,true>::isAliased( const Other* alias ) const noexcept
2534 {
2535  return matrix_.isAliased( alias );
2536 }
2538 //*************************************************************************************************
2539 
2540 
2541 //*************************************************************************************************
2551 template< typename MT // Type of the adapted dense matrix
2552  , bool SO > // Storage order of the adapted dense matrix
2553 inline bool StrictlyLowerMatrix<MT,SO,true>::isAligned() const noexcept
2554 {
2555  return matrix_.isAligned();
2556 }
2558 //*************************************************************************************************
2559 
2560 
2561 //*************************************************************************************************
2572 template< typename MT // Type of the adapted dense matrix
2573  , bool SO > // Storage order of the adapted dense matrix
2574 inline bool StrictlyLowerMatrix<MT,SO,true>::canSMPAssign() const noexcept
2575 {
2576  return matrix_.canSMPAssign();
2577 }
2579 //*************************************************************************************************
2580 
2581 
2582 //*************************************************************************************************
2598 template< typename MT // Type of the adapted dense matrix
2599  , bool SO > // Storage order of the adapted dense matrix
2600 BLAZE_ALWAYS_INLINE typename StrictlyLowerMatrix<MT,SO,true>::SIMDType
2601  StrictlyLowerMatrix<MT,SO,true>::load( size_t i, size_t j ) const noexcept
2602 {
2603  return matrix_.load( i, j );
2604 }
2606 //*************************************************************************************************
2607 
2608 
2609 //*************************************************************************************************
2625 template< typename MT // Type of the adapted dense matrix
2626  , bool SO > // Storage order of the adapted dense matrix
2627 BLAZE_ALWAYS_INLINE typename StrictlyLowerMatrix<MT,SO,true>::SIMDType
2628  StrictlyLowerMatrix<MT,SO,true>::loada( size_t i, size_t j ) const noexcept
2629 {
2630  return matrix_.loada( i, j );
2631 }
2633 //*************************************************************************************************
2634 
2635 
2636 //*************************************************************************************************
2652 template< typename MT // Type of the adapted dense matrix
2653  , bool SO > // Storage order of the adapted dense matrix
2654 BLAZE_ALWAYS_INLINE typename StrictlyLowerMatrix<MT,SO,true>::SIMDType
2655  StrictlyLowerMatrix<MT,SO,true>::loadu( size_t i, size_t j ) const noexcept
2656 {
2657  return matrix_.loadu( i, j );
2658 }
2660 //*************************************************************************************************
2661 
2662 
2663 
2664 
2665 //=================================================================================================
2666 //
2667 // CONSTRUCTION FUNCTIONS
2668 //
2669 //=================================================================================================
2670 
2671 //*************************************************************************************************
2678 template< typename MT // Type of the adapted dense matrix
2679  , bool SO > // Storage order of the adapted dense matrix
2680 inline const MT StrictlyLowerMatrix<MT,SO,true>::construct( size_t n, TrueType )
2681 {
2683 
2684  return MT( n, n, ElementType() );
2685 }
2687 //*************************************************************************************************
2688 
2689 
2690 //*************************************************************************************************
2697 template< typename MT // Type of the adapted dense matrix
2698  , bool SO > // Storage order of the adapted dense matrix
2699 inline const MT StrictlyLowerMatrix<MT,SO,true>::construct( const ElementType& init, FalseType )
2700 {
2703 
2704  MT tmp;
2705 
2706  if( SO ) {
2707  for( size_t j=0UL; j<tmp.columns(); ++j ) {
2708  for( size_t i=j+1UL; i<tmp.rows(); ++i )
2709  tmp(i,j) = init;
2710  }
2711  }
2712  else {
2713  for( size_t i=0UL; i<tmp.rows(); ++i ) {
2714  for( size_t j=0UL; j<i; ++j )
2715  tmp(i,j) = init;
2716  }
2717  }
2718 
2719  return tmp;
2720 }
2722 //*************************************************************************************************
2723 
2724 
2725 //*************************************************************************************************
2736 template< typename MT // Type of the adapted dense matrix
2737  , bool SO > // Storage order of the adapted dense matrix
2738 template< typename MT2 // Type of the foreign matrix
2739  , bool SO2 // Storage order of the foreign matrix
2740  , typename T > // Type of the third argument
2741 inline const MT StrictlyLowerMatrix<MT,SO,true>::construct( const Matrix<MT2,SO2>& m, T )
2742 {
2743  const MT tmp( ~m );
2744 
2745  if( IsUniTriangular<MT2>::value ||
2746  ( !IsStrictlyLower<MT2>::value && !isStrictlyLower( tmp ) ) ) {
2747  BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of strictly lower matrix" );
2748  }
2749 
2750  return tmp;
2751 }
2753 //*************************************************************************************************
2754 
2755 } // namespace blaze
2756 
2757 #endif
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.
#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.
const DMatDMatMultExpr< T1, T2 > operator*(const DenseMatrix< T1, false > &lhs, const DenseMatrix< T2, false > &rhs)
Multiplication operator for the multiplication of two row-major dense matrices ( ).
Definition: DMatDMatMultExpr.h:7800
BLAZE_ALWAYS_INLINE size_t capacity(const Matrix< MT, SO > &matrix) noexcept
Returns the maximum capacity of the matrix.
Definition: Matrix.h:346
Header file for basic type definitions.
Header file for the implementation of the base template of the StrictlyLowerMatrix.
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:404
bool isStrictlyLower(const DenseMatrix< MT, SO > &dm)
Checks if the given dense matrix is a strictly lower triangular matrix.
Definition: DenseMatrix.h:1192
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
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:1339
Constraint on the data type.
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:188
Constraint on the data type.
void reset(const DiagonalProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: DiagonalProxy.h:533
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
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:2643
typename DisableIf< Condition, T >::Type DisableIf_
Auxiliary type for the DisableIf class template.The DisableIf_ alias declaration provides a convenien...
Definition: DisableIf.h:223
void clear(CompressedMatrix< Type, SO > &m)
Clearing the given compressed matrix.
Definition: CompressedMatrix.h:5077
bool operator>(const NegativeAccuracy< A > &lhs, const T &rhs)
Greater-than comparison between a NegativeAccuracy object and a floating point value.
Definition: Accuracy.h:366
CompressedMatrix< Type, true > This
Type of this CompressedMatrix instance.
Definition: CompressedMatrix.h:2636
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:442
#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:384
#define BLAZE_CONSTRAINT_MUST_BE_SQUARE(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
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
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:1321
Constraint on the data type.
STL namespace.
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
CompressedMatrix< Type, false > OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: CompressedMatrix.h:2639
DisableIf_< Or< IsComputation< MT >, IsTransExpr< MT > >, ColumnExprTrait_< MT > > column(Matrix< MT, SO > &matrix, size_t index)
Creating a view on a specific column of the given matrix.
Definition: Column.h:126
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:298
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:232
Constraint on the data type.
Constraint on the data type.
constexpr bool spacing
Adding an additional spacing line between two log messages.This setting gives the opportunity to add ...
Definition: Logging.h:70
Header file for the std::initializer_list aliases.
Header file for the IsSquare type trait.
Constraint on the data type.
Constraint on the data type.
Header file for the DisableIf class template.
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
void swap(CompressedMatrix< Type, SO > &a, CompressedMatrix< Type, SO > &b) noexcept
Swapping the contents of two compressed matrices.
Definition: CompressedMatrix.h:5148
Compile time assertion.
bool isIntact(const CompressedMatrix< Type, SO > &m)
Returns whether the invariants of the given compressed matrix are intact.
Definition: CompressedMatrix.h:5131
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2647
#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
#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.
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:330
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
Header file for the IsUniTriangular type trait.
CompressedMatrix< Type, false > TransposeType
Transpose type for expression template evaluations.
Definition: CompressedMatrix.h:2640
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:538
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:254
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:2641
const Type & ConstReference
Reference to a constant matrix value.
Definition: CompressedMatrix.h:2645
Header file for the EnableIf class template.
Header file for the IsStrictlyLower type trait.
Header file for utility functions for dense matrices.
void clear(const DiagonalProxy< MT > &proxy)
Clearing the represented element.
Definition: DiagonalProxy.h:553
Header file for all adaptor forward declarations.
DisableIf_< Or< IsComputation< MT >, IsTransExpr< MT > >, RowExprTrait_< MT > > row(Matrix< MT, SO > &matrix, size_t index)
Creating a view on a specific row of the given matrix.
Definition: Row.h:126
#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
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:2642
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:1285
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_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
Element * Iterator
Iterator over non-constant elements.
Definition: CompressedMatrix.h:2646
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:258
Constraint on the data type.
Constraint on the data type.
Header file for the StrictlyLowerProxy class.
#define BLAZE_CONSTRAINT_MUST_NOT_BE_RESIZABLE(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
typename EnableIf< Condition, T >::Type EnableIf_
Auxiliary alias declaration for the EnableIf class template.The EnableIf_ alias declaration provides ...
Definition: EnableIf.h:223
BLAZE_ALWAYS_INLINE size_t rows(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of rows of the matrix.
Definition: Matrix.h:314
SparseMatrix< This, true > BaseType
Base type of this CompressedMatrix instance.
Definition: CompressedMatrix.h:2637
bool operator<(const NegativeAccuracy< A > &lhs, const T &rhs)
Less-than comparison between a NegativeAccuracy object and a floating point value.
Definition: Accuracy.h:328
#define BLAZE_CONSTRAINT_MUST_BE_RESIZABLE(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.
#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 operator==(const NegativeAccuracy< A > &lhs, const T &rhs)
Equality comparison between a NegativeAccuracy object and a floating point value. ...
Definition: Accuracy.h:249
This ResultType
Result type for expression template evaluations.
Definition: CompressedMatrix.h:2638
bool operator!=(const NegativeAccuracy< A > &lhs, const T &rhs)
Inequality comparison between a NegativeAccuracy object and a floating point value.
Definition: Accuracy.h:289
bool isIntact(const DiagonalMatrix< MT, SO, DF > &m)
Returns whether the invariants of the given diagonal matrix are intact.
Definition: DiagonalMatrix.h:240
MatrixAccessProxy< This > Reference
Reference to a non-constant matrix value.
Definition: CompressedMatrix.h:2644
#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:1303
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
SubmatrixExprTrait_< MT, unaligned > 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:167
BLAZE_ALWAYS_INLINE bool isSquare(const Matrix< MT, SO > &matrix) noexcept
Checks if the given matrix is a square matrix.
Definition: Matrix.h:609
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.