Dense.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_ADAPTORS_LOWERMATRIX_DENSE_H_
36 #define _BLAZE_MATH_ADAPTORS_LOWERMATRIX_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>
71 #include <blaze/system/Inline.h>
72 #include <blaze/util/Assert.h>
78 #include <blaze/util/DisableIf.h>
79 #include <blaze/util/EnableIf.h>
80 #include <blaze/util/FalseType.h>
82 #include <blaze/util/TrueType.h>
83 #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 LowerMatrix<MT,SO,true>
107  : public DenseMatrix< LowerMatrix<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 LowerMatrix<MT,SO,true> This;
119  typedef DenseMatrix<This,SO> BaseType;
120  typedef This ResultType;
121  typedef LowerMatrix<OT,!SO,true> OppositeType;
122  typedef UpperMatrix<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 LowerProxy<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 LowerMatrix< 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 LowerProxy<MT> PointerType;
154  typedef LowerProxy<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 LowerMatrix();
630  template< typename A1 > explicit inline LowerMatrix( const A1& a1 );
631  explicit inline LowerMatrix( size_t n, const ElementType& init );
632 
633  explicit inline LowerMatrix( initializer_list< initializer_list<ElementType> > list );
634 
635  template< typename Other >
636  explicit inline LowerMatrix( size_t n, const Other* array );
637 
638  template< typename Other, size_t N >
639  explicit inline LowerMatrix( const Other (&array)[N][N] );
640 
641  explicit inline LowerMatrix( ElementType* ptr, size_t n );
642  explicit inline LowerMatrix( ElementType* ptr, size_t n, size_t nn );
643 
644  template< typename Deleter >
645  explicit inline LowerMatrix( ElementType* ptr, size_t n, Deleter d );
646 
647  template< typename Deleter >
648  explicit inline LowerMatrix( ElementType* ptr, size_t n, size_t nn, Deleter d );
649 
650  inline LowerMatrix( const LowerMatrix& m );
651  inline LowerMatrix( LowerMatrix&& 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 LowerMatrix& operator=( const ElementType& rhs );
681  inline LowerMatrix& operator=( initializer_list< initializer_list<ElementType> > list );
682 
683  template< typename Other, size_t N >
684  inline LowerMatrix& operator=( const Other (&array)[N][N] );
685 
686  inline LowerMatrix& operator=( const LowerMatrix& rhs );
687  inline LowerMatrix& operator=( LowerMatrix&& rhs ) noexcept;
688 
689  template< typename MT2, bool SO2 >
690  inline DisableIf_< IsComputation<MT2>, LowerMatrix& > operator=( const Matrix<MT2,SO2>& rhs );
691 
692  template< typename MT2, bool SO2 >
693  inline EnableIf_< IsComputation<MT2>, LowerMatrix& > operator=( const Matrix<MT2,SO2>& rhs );
694 
695  template< typename MT2, bool SO2 >
696  inline DisableIf_< IsComputation<MT2>, LowerMatrix& > operator+=( const Matrix<MT2,SO2>& rhs );
697 
698  template< typename MT2, bool SO2 >
699  inline EnableIf_< IsComputation<MT2>, LowerMatrix& > operator+=( const Matrix<MT2,SO2>& rhs );
700 
701  template< typename MT2, bool SO2 >
702  inline DisableIf_< IsComputation<MT2>, LowerMatrix& > operator-=( const Matrix<MT2,SO2>& rhs );
703 
704  template< typename MT2, bool SO2 >
705  inline EnableIf_< IsComputation<MT2>, LowerMatrix& > operator-=( const Matrix<MT2,SO2>& rhs );
706 
707  template< typename MT2, bool SO2 >
708  inline LowerMatrix& operator*=( const Matrix<MT2,SO2>& rhs );
709 
710  template< typename Other >
711  inline EnableIf_< IsNumeric<Other>, LowerMatrix >& operator*=( Other rhs );
712 
713  template< typename Other >
714  inline EnableIf_< IsNumeric<Other>, LowerMatrix >& operator/=( Other rhs );
716  //**********************************************************************************************
717 
718  //**Utility functions***************************************************************************
721  inline size_t rows() const noexcept;
722  inline size_t columns() const noexcept;
723  inline size_t spacing() const noexcept;
724  inline size_t capacity() const noexcept;
725  inline size_t capacity( size_t i ) const noexcept;
726  inline size_t nonZeros() const;
727  inline size_t nonZeros( size_t i ) const;
728  inline void reset();
729  inline void reset( size_t i );
730  inline void clear();
731  void resize ( size_t n, bool preserve=true );
732  inline void extend ( size_t n, bool preserve=true );
733  inline void reserve( size_t elements );
734  template< typename Other > inline LowerMatrix& scale( const Other& scalar );
735  inline void swap( LowerMatrix& m ) noexcept;
736 
737  static inline constexpr size_t maxNonZeros() noexcept;
738  static inline constexpr size_t maxNonZeros( size_t n ) noexcept;
740  //**********************************************************************************************
741 
742  //**Debugging functions*************************************************************************
745  inline bool isIntact() const noexcept;
747  //**********************************************************************************************
748 
749  //**Expression template evaluation functions****************************************************
752  template< typename Other > inline bool canAlias ( const Other* alias ) const noexcept;
753  template< typename Other > inline bool isAliased( const Other* alias ) const noexcept;
754 
755  inline bool isAligned () const noexcept;
756  inline bool canSMPAssign() const noexcept;
757 
758  BLAZE_ALWAYS_INLINE SIMDType load ( size_t i, size_t j ) const noexcept;
759  BLAZE_ALWAYS_INLINE SIMDType loada( size_t i, size_t j ) const noexcept;
760  BLAZE_ALWAYS_INLINE SIMDType loadu( size_t i, size_t j ) const noexcept;
762  //**********************************************************************************************
763 
764  private:
765  //**Construction functions**********************************************************************
768  inline const MT construct( size_t n , TrueType );
769  inline const MT construct( const ElementType& value, FalseType );
770 
771  template< typename MT2, bool SO2, typename T >
772  inline const MT construct( const Matrix<MT2,SO2>& m, T );
774  //**********************************************************************************************
775 
776  //**Member variables****************************************************************************
779  MT matrix_;
780 
781  //**********************************************************************************************
782 
783  //**Friend declarations*************************************************************************
784  template< typename MT2, bool SO2, bool DF2 >
785  friend bool isDefault( const LowerMatrix<MT2,SO2,DF2>& m );
786 
787  template< typename MT2, bool SO2, bool DF2 >
788  friend MT2& derestrict( LowerMatrix<MT2,SO2,DF2>& m );
789  //**********************************************************************************************
790 
791  //**Compile time checks*************************************************************************
804  BLAZE_STATIC_ASSERT( Rows<MT>::value == Columns<MT>::value );
805  //**********************************************************************************************
806 };
808 //*************************************************************************************************
809 
810 
811 
812 
813 //=================================================================================================
814 //
815 // CONSTRUCTORS
816 //
817 //=================================================================================================
818 
819 //*************************************************************************************************
823 template< typename MT // Type of the adapted dense matrix
824  , bool SO > // Storage order of the adapted dense matrix
825 inline LowerMatrix<MT,SO,true>::LowerMatrix()
826  : matrix_() // The adapted dense matrix
827 {
828  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square lower matrix detected" );
829  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
830 }
832 //*************************************************************************************************
833 
834 
835 //*************************************************************************************************
853 template< typename MT // Type of the adapted dense matrix
854  , bool SO > // Storage order of the adapted dense matrix
855 template< typename A1 > // Type of the constructor argument
856 inline LowerMatrix<MT,SO,true>::LowerMatrix( const A1& a1 )
857  : matrix_( construct( a1, typename IsResizable<MT>::Type() ) ) // The adapted dense matrix
858 {
859  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square lower matrix detected" );
860  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
861 }
863 //*************************************************************************************************
864 
865 
866 //*************************************************************************************************
873 template< typename MT // Type of the adapted dense matrix
874  , bool SO > // Storage order of the adapted dense matrix
875 inline LowerMatrix<MT,SO,true>::LowerMatrix( size_t n, const ElementType& init )
876  : matrix_( n, n, ElementType() ) // The adapted dense matrix
877 {
879 
880  if( SO ) {
881  for( size_t j=0UL; j<columns(); ++j )
882  for( size_t i=j; i<rows(); ++i )
883  matrix_(i,j) = init;
884  }
885  else {
886  for( size_t i=0UL; i<rows(); ++i )
887  for( size_t j=0UL; j<=i; ++j )
888  matrix_(i,j) = init;
889  }
890 
891  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square lower matrix detected" );
892  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
893 }
895 //*************************************************************************************************
896 
897 
898 //*************************************************************************************************
921 template< typename MT // Type of the adapted dense matrix
922  , bool SO > // Storage order of the adapted dense matrix
923 inline LowerMatrix<MT,SO,true>::LowerMatrix( initializer_list< initializer_list<ElementType> > list )
924  : matrix_( list ) // The adapted dense matrix
925 {
926  if( !isLower( matrix_ ) ) {
927  BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of lower matrix" );
928  }
929 
930  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
931 }
933 //*************************************************************************************************
934 
935 
936 //*************************************************************************************************
962 template< typename MT // Type of the adapted dense matrix
963  , bool SO > // Storage order of the adapted dense matrix
964 template< typename Other > // Data type of the initialization array
965 inline LowerMatrix<MT,SO,true>::LowerMatrix( size_t n, const Other* array )
966  : matrix_( n, n, array ) // The adapted dense matrix
967 {
968  if( !isLower( matrix_ ) ) {
969  BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of lower matrix" );
970  }
971 
972  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
973 }
975 //*************************************************************************************************
976 
977 
978 //*************************************************************************************************
1001 template< typename MT // Type of the adapted dense matrix
1002  , bool SO > // Storage order of the adapted dense matrix
1003 template< typename Other // Data type of the initialization array
1004  , size_t N > // Number of rows and columns of the initialization array
1005 inline LowerMatrix<MT,SO,true>::LowerMatrix( const Other (&array)[N][N] )
1006  : matrix_( array ) // The adapted dense matrix
1007 {
1008  if( !isLower( matrix_ ) ) {
1009  BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of lower matrix" );
1010  }
1011 
1012  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1013 }
1015 //*************************************************************************************************
1016 
1017 
1018 //*************************************************************************************************
1039 template< typename MT // Type of the adapted dense matrix
1040  , bool SO > // Storage order of the adapted dense matrix
1041 inline LowerMatrix<MT,SO,true>::LowerMatrix( ElementType* ptr, size_t n )
1042  : matrix_( ptr, n, n ) // The adapted dense matrix
1043 {
1044  if( !isLower( matrix_ ) ) {
1045  BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of lower matrix" );
1046  }
1047 
1048  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1049 }
1051 //*************************************************************************************************
1052 
1053 
1054 //*************************************************************************************************
1077 template< typename MT // Type of the adapted dense matrix
1078  , bool SO > // Storage order of the adapted dense matrix
1079 inline LowerMatrix<MT,SO,true>::LowerMatrix( ElementType* ptr, size_t n, size_t nn )
1080  : matrix_( ptr, n, n, nn ) // The adapted dense matrix
1081 {
1082  if( !isLower( matrix_ ) ) {
1083  BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of lower matrix" );
1084  }
1085 
1086  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1087 }
1089 //*************************************************************************************************
1090 
1091 
1092 //*************************************************************************************************
1113 template< typename MT // Type of the adapted dense matrix
1114  , bool SO > // Storage order of the adapted dense matrix
1115 template< typename Deleter > // Type of the custom deleter
1116 inline LowerMatrix<MT,SO,true>::LowerMatrix( ElementType* ptr, size_t n, Deleter d )
1117  : matrix_( ptr, n, n, d ) // The adapted dense matrix
1118 {
1119  if( !isLower( matrix_ ) ) {
1120  BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of lower matrix" );
1121  }
1122 
1123  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1124 }
1126 //*************************************************************************************************
1127 
1128 
1129 //*************************************************************************************************
1151 template< typename MT // Type of the adapted dense matrix
1152  , bool SO > // Storage order of the adapted dense matrix
1153 template< typename Deleter > // Type of the custom deleter
1154 inline LowerMatrix<MT,SO,true>::LowerMatrix( ElementType* ptr, size_t n, size_t nn, Deleter d )
1155  : matrix_( ptr, n, n, nn, d ) // The adapted dense matrix
1156 {
1157  if( !isLower( matrix_ ) ) {
1158  BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of lower matrix" );
1159  }
1160 
1161  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1162 }
1164 //*************************************************************************************************
1165 
1166 
1167 //*************************************************************************************************
1173 template< typename MT // Type of the adapted dense matrix
1174  , bool SO > // Storage order of the adapted dense matrix
1175 inline LowerMatrix<MT,SO,true>::LowerMatrix( const LowerMatrix& m )
1176  : matrix_( m.matrix_ ) // The adapted dense matrix
1177 {
1178  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square lower matrix detected" );
1179  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1180 }
1182 //*************************************************************************************************
1183 
1184 
1185 //*************************************************************************************************
1191 template< typename MT // Type of the adapted dense matrix
1192  , bool SO > // Storage order of the adapted dense matrix
1193 inline LowerMatrix<MT,SO,true>::LowerMatrix( LowerMatrix&& m ) noexcept
1194  : matrix_( std::move( m.matrix_ ) ) // The adapted dense matrix
1195 {
1196  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square lower matrix detected" );
1197  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1198 }
1200 //*************************************************************************************************
1201 
1202 
1203 
1204 
1205 //=================================================================================================
1206 //
1207 // DATA ACCESS FUNCTIONS
1208 //
1209 //=================================================================================================
1210 
1211 //*************************************************************************************************
1227 template< typename MT // Type of the adapted dense matrix
1228  , bool SO > // Storage order of the adapted dense matrix
1229 inline typename LowerMatrix<MT,SO,true>::Reference
1230  LowerMatrix<MT,SO,true>::operator()( size_t i, size_t j )
1231 {
1232  BLAZE_USER_ASSERT( i<rows() , "Invalid row access index" );
1233  BLAZE_USER_ASSERT( j<columns(), "Invalid column access index" );
1234 
1235  return Reference( matrix_, i, j );
1236 }
1238 //*************************************************************************************************
1239 
1240 
1241 //*************************************************************************************************
1257 template< typename MT // Type of the adapted dense matrix
1258  , bool SO > // Storage order of the adapted dense matrix
1260  LowerMatrix<MT,SO,true>::operator()( size_t i, size_t j ) const
1261 {
1262  BLAZE_USER_ASSERT( i<rows() , "Invalid row access index" );
1263  BLAZE_USER_ASSERT( j<columns(), "Invalid column access index" );
1264 
1265  return matrix_(i,j);
1266 }
1268 //*************************************************************************************************
1269 
1270 
1271 //*************************************************************************************************
1288 template< typename MT // Type of the adapted dense matrix
1289  , bool SO > // Storage order of the adapted dense matrix
1290 inline typename LowerMatrix<MT,SO,true>::Reference
1291  LowerMatrix<MT,SO,true>::at( size_t i, size_t j )
1292 {
1293  if( i >= rows() ) {
1294  BLAZE_THROW_OUT_OF_RANGE( "Invalid row access index" );
1295  }
1296  if( j >= columns() ) {
1297  BLAZE_THROW_OUT_OF_RANGE( "Invalid column access index" );
1298  }
1299  return (*this)(i,j);
1300 }
1302 //*************************************************************************************************
1303 
1304 
1305 //*************************************************************************************************
1322 template< typename MT // Type of the adapted dense matrix
1323  , bool SO > // Storage order of the adapted dense matrix
1325  LowerMatrix<MT,SO,true>::at( size_t i, size_t j ) const
1326 {
1327  if( i >= rows() ) {
1328  BLAZE_THROW_OUT_OF_RANGE( "Invalid row access index" );
1329  }
1330  if( j >= columns() ) {
1331  BLAZE_THROW_OUT_OF_RANGE( "Invalid column access index" );
1332  }
1333  return (*this)(i,j);
1334 }
1336 //*************************************************************************************************
1337 
1338 
1339 //*************************************************************************************************
1352 template< typename MT // Type of the adapted dense matrix
1353  , bool SO > // Storage order of the adapted dense matrix
1354 inline typename LowerMatrix<MT,SO,true>::ConstPointer
1355  LowerMatrix<MT,SO,true>::data() const noexcept
1356 {
1357  return matrix_.data();
1358 }
1360 //*************************************************************************************************
1361 
1362 
1363 //*************************************************************************************************
1372 template< typename MT // Type of the adapted dense matrix
1373  , bool SO > // Storage order of the adapted dense matrix
1374 inline typename LowerMatrix<MT,SO,true>::ConstPointer
1375  LowerMatrix<MT,SO,true>::data( size_t i ) const noexcept
1376 {
1377  return matrix_.data(i);
1378 }
1380 //*************************************************************************************************
1381 
1382 
1383 //*************************************************************************************************
1395 template< typename MT // Type of the adapted dense matrix
1396  , bool SO > // Storage order of the adapted dense matrix
1397 inline typename LowerMatrix<MT,SO,true>::Iterator
1398  LowerMatrix<MT,SO,true>::begin( size_t i )
1399 {
1400  if( SO )
1401  return Iterator( matrix_, 0UL, i );
1402  else
1403  return Iterator( matrix_, i, 0UL );
1404 }
1406 //*************************************************************************************************
1407 
1408 
1409 //*************************************************************************************************
1421 template< typename MT // Type of the adapted dense matrix
1422  , bool SO > // Storage order of the adapted dense matrix
1424  LowerMatrix<MT,SO,true>::begin( size_t i ) const
1425 {
1426  return matrix_.begin(i);
1427 }
1429 //*************************************************************************************************
1430 
1431 
1432 //*************************************************************************************************
1444 template< typename MT // Type of the adapted dense matrix
1445  , bool SO > // Storage order of the adapted dense matrix
1447  LowerMatrix<MT,SO,true>::cbegin( size_t i ) const
1448 {
1449  return matrix_.cbegin(i);
1450 }
1452 //*************************************************************************************************
1453 
1454 
1455 //*************************************************************************************************
1467 template< typename MT // Type of the adapted dense matrix
1468  , bool SO > // Storage order of the adapted dense matrix
1469 inline typename LowerMatrix<MT,SO,true>::Iterator
1470  LowerMatrix<MT,SO,true>::end( size_t i )
1471 {
1472  if( SO )
1473  return Iterator( matrix_, rows(), i );
1474  else
1475  return Iterator( matrix_, i, columns() );
1476 }
1478 //*************************************************************************************************
1479 
1480 
1481 //*************************************************************************************************
1493 template< typename MT // Type of the adapted dense matrix
1494  , bool SO > // Storage order of the adapted dense matrix
1496  LowerMatrix<MT,SO,true>::end( size_t i ) const
1497 {
1498  return matrix_.end(i);
1499 }
1501 //*************************************************************************************************
1502 
1503 
1504 //*************************************************************************************************
1516 template< typename MT // Type of the adapted dense matrix
1517  , bool SO > // Storage order of the adapted dense matrix
1519  LowerMatrix<MT,SO,true>::cend( size_t i ) const
1520 {
1521  return matrix_.cend(i);
1522 }
1524 //*************************************************************************************************
1525 
1526 
1527 
1528 
1529 //=================================================================================================
1530 //
1531 // ASSIGNMENT OPERATORS
1532 //
1533 //=================================================================================================
1534 
1535 //*************************************************************************************************
1542 template< typename MT // Type of the adapted dense matrix
1543  , bool SO > // Storage order of the adapted dense matrix
1544 inline LowerMatrix<MT,SO,true>&
1545  LowerMatrix<MT,SO,true>::operator=( const ElementType& rhs )
1546 {
1547  if( SO ) {
1548  for( size_t j=0UL; j<columns(); ++j )
1549  for( size_t i=j; i<rows(); ++i )
1550  matrix_(i,j) = rhs;
1551  }
1552  else {
1553  for( size_t i=0UL; i<rows(); ++i )
1554  for( size_t j=0UL; j<=i; ++j )
1555  matrix_(i,j) = rhs;
1556  }
1557 
1558  return *this;
1559 }
1561 //*************************************************************************************************
1562 
1563 
1564 //*************************************************************************************************
1588 template< typename MT // Type of the adapted dense matrix
1589  , bool SO > // Storage order of the adapted dense matrix
1590 inline LowerMatrix<MT,SO,true>&
1591  LowerMatrix<MT,SO,true>::operator=( initializer_list< initializer_list<ElementType> > list )
1592 {
1593  MT tmp( list );
1594 
1595  if( !isLower( tmp ) ) {
1596  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to lower matrix" );
1597  }
1598 
1599  matrix_ = std::move( tmp );
1600 
1601  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square lower matrix detected" );
1602  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1603 
1604  return *this;
1605 }
1607 //*************************************************************************************************
1608 
1609 
1610 //*************************************************************************************************
1634 template< typename MT // Type of the adapted dense matrix
1635  , bool SO > // Storage order of the adapted dense matrix
1636 template< typename Other // Data type of the initialization array
1637  , size_t N > // Number of rows and columns of the initialization array
1638 inline LowerMatrix<MT,SO,true>&
1639  LowerMatrix<MT,SO,true>::operator=( const Other (&array)[N][N] )
1640 {
1641  MT tmp( array );
1642 
1643  if( !isLower( tmp ) ) {
1644  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to lower matrix" );
1645  }
1646 
1647  matrix_ = std::move( tmp );
1648 
1649  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square lower matrix detected" );
1650  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1651 
1652  return *this;
1653 }
1655 //*************************************************************************************************
1656 
1657 
1658 //*************************************************************************************************
1668 template< typename MT // Type of the adapted dense matrix
1669  , bool SO > // Storage order of the adapted dense matrix
1670 inline LowerMatrix<MT,SO,true>&
1671  LowerMatrix<MT,SO,true>::operator=( const LowerMatrix& rhs )
1672 {
1673  matrix_ = rhs.matrix_;
1674 
1675  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square lower matrix detected" );
1676  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1677 
1678  return *this;
1679 }
1681 //*************************************************************************************************
1682 
1683 
1684 //*************************************************************************************************
1691 template< typename MT // Type of the adapted dense matrix
1692  , bool SO > // Storage order of the adapted dense matrix
1693 inline LowerMatrix<MT,SO,true>&
1694  LowerMatrix<MT,SO,true>::operator=( LowerMatrix&& rhs ) noexcept
1695 {
1696  matrix_ = std::move( rhs.matrix_ );
1697 
1698  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square lower matrix detected" );
1699  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1700 
1701  return *this;
1702 }
1704 //*************************************************************************************************
1705 
1706 
1707 //*************************************************************************************************
1720 template< typename MT // Type of the adapted dense matrix
1721  , bool SO > // Storage order of the adapted dense matrix
1722 template< typename MT2 // Type of the right-hand side matrix
1723  , bool SO2 > // Storage order of the right-hand side matrix
1724 inline DisableIf_< IsComputation<MT2>, LowerMatrix<MT,SO,true>& >
1725  LowerMatrix<MT,SO,true>::operator=( const Matrix<MT2,SO2>& rhs )
1726 {
1727  if( !IsLower<MT2>::value && !isLower( ~rhs ) ) {
1728  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to lower matrix" );
1729  }
1730 
1731  matrix_ = ~rhs;
1732 
1733  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square lower matrix detected" );
1734  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1735 
1736  return *this;
1737 }
1739 //*************************************************************************************************
1740 
1741 
1742 //*************************************************************************************************
1755 template< typename MT // Type of the adapted dense matrix
1756  , bool SO > // Storage order of the adapted dense matrix
1757 template< typename MT2 // Type of the right-hand side matrix
1758  , bool SO2 > // Storage order of the right-hand side matrix
1759 inline EnableIf_< IsComputation<MT2>, LowerMatrix<MT,SO,true>& >
1760  LowerMatrix<MT,SO,true>::operator=( const Matrix<MT2,SO2>& rhs )
1761 {
1762  if( !IsSquare<MT2>::value && !isSquare( ~rhs ) ) {
1763  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to lower matrix" );
1764  }
1765 
1766  if( IsLower<MT2>::value ) {
1767  matrix_ = ~rhs;
1768  }
1769  else {
1770  MT tmp( ~rhs );
1771 
1772  if( !isLower( tmp ) ) {
1773  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to lower matrix" );
1774  }
1775 
1776  matrix_ = std::move( tmp );
1777  }
1778 
1779  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square lower matrix detected" );
1780  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1781 
1782  return *this;
1783 }
1785 //*************************************************************************************************
1786 
1787 
1788 //*************************************************************************************************
1801 template< typename MT // Type of the adapted dense matrix
1802  , bool SO > // Storage order of the adapted dense matrix
1803 template< typename MT2 // Type of the right-hand side matrix
1804  , bool SO2 > // Storage order of the right-hand side matrix
1805 inline DisableIf_< IsComputation<MT2>, LowerMatrix<MT,SO,true>& >
1806  LowerMatrix<MT,SO,true>::operator+=( const Matrix<MT2,SO2>& rhs )
1807 {
1808  if( !IsLower<MT2>::value && !isLower( ~rhs ) ) {
1809  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to lower matrix" );
1810  }
1811 
1812  matrix_ += ~rhs;
1813 
1814  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square lower matrix detected" );
1815  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1816 
1817  return *this;
1818 }
1820 //*************************************************************************************************
1821 
1822 
1823 //*************************************************************************************************
1836 template< typename MT // Type of the adapted dense matrix
1837  , bool SO > // Storage order of the adapted dense matrix
1838 template< typename MT2 // Type of the right-hand side matrix
1839  , bool SO2 > // Storage order of the right-hand side matrix
1840 inline EnableIf_< IsComputation<MT2>, LowerMatrix<MT,SO,true>& >
1841  LowerMatrix<MT,SO,true>::operator+=( const Matrix<MT2,SO2>& rhs )
1842 {
1843  if( !IsSquare<MT2>::value && !isSquare( ~rhs ) ) {
1844  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to lower matrix" );
1845  }
1846 
1847  if( IsLower<MT2>::value ) {
1848  matrix_ += ~rhs;
1849  }
1850  else {
1851  const ResultType_<MT2> tmp( ~rhs );
1852 
1853  if( !isLower( tmp ) ) {
1854  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to lower matrix" );
1855  }
1856 
1857  matrix_ += tmp;
1858  }
1859 
1860  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square lower matrix detected" );
1861  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1862 
1863  return *this;
1864 }
1866 //*************************************************************************************************
1867 
1868 
1869 //*************************************************************************************************
1882 template< typename MT // Type of the adapted dense matrix
1883  , bool SO > // Storage order of the adapted dense matrix
1884 template< typename MT2 // Type of the right-hand side matrix
1885  , bool SO2 > // Storage order of the right-hand side matrix
1886 inline DisableIf_< IsComputation<MT2>, LowerMatrix<MT,SO,true>& >
1887  LowerMatrix<MT,SO,true>::operator-=( const Matrix<MT2,SO2>& rhs )
1888 {
1889  if( !IsLower<MT2>::value && !isLower( ~rhs ) ) {
1890  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to lower matrix" );
1891  }
1892 
1893  matrix_ -= ~rhs;
1894 
1895  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square lower matrix detected" );
1896  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1897 
1898  return *this;
1899 }
1901 //*************************************************************************************************
1902 
1903 
1904 //*************************************************************************************************
1917 template< typename MT // Type of the adapted dense matrix
1918  , bool SO > // Storage order of the adapted dense matrix
1919 template< typename MT2 // Type of the right-hand side matrix
1920  , bool SO2 > // Storage order of the right-hand side matrix
1921 inline EnableIf_< IsComputation<MT2>, LowerMatrix<MT,SO,true>& >
1922  LowerMatrix<MT,SO,true>::operator-=( const Matrix<MT2,SO2>& rhs )
1923 {
1924  if( !IsSquare<MT2>::value && !isSquare( ~rhs ) ) {
1925  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to lower matrix" );
1926  }
1927 
1928  if( IsLower<MT2>::value ) {
1929  matrix_ -= ~rhs;
1930  }
1931  else {
1932  const ResultType_<MT2> tmp( ~rhs );
1933 
1934  if( !isLower( tmp ) ) {
1935  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to lower matrix" );
1936  }
1937 
1938  matrix_ -= tmp;
1939  }
1940 
1941  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square lower matrix detected" );
1942  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1943 
1944  return *this;
1945 }
1947 //*************************************************************************************************
1948 
1949 
1950 //*************************************************************************************************
1962 template< typename MT // Type of the adapted dense matrix
1963  , bool SO > // Storage order of the adapted dense matrix
1964 template< typename MT2 // Type of the right-hand side matrix
1965  , bool SO2 > // Storage order of the right-hand side matrix
1966 inline LowerMatrix<MT,SO,true>&
1967  LowerMatrix<MT,SO,true>::operator*=( const Matrix<MT2,SO2>& rhs )
1968 {
1969  if( matrix_.rows() != (~rhs).columns() ) {
1970  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to lower matrix" );
1971  }
1972 
1973  MT tmp( matrix_ * ~rhs );
1974 
1975  if( !isLower( tmp ) ) {
1976  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to lower matrix" );
1977  }
1978 
1979  matrix_ = std::move( tmp );
1980 
1981  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square lower matrix detected" );
1982  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1983 
1984  return *this;
1985 }
1987 //*************************************************************************************************
1988 
1989 
1990 //*************************************************************************************************
1998 template< typename MT // Type of the adapted dense matrix
1999  , bool SO > // Storage order of the adapted dense matrix
2000 template< typename Other > // Data type of the right-hand side scalar
2001 inline EnableIf_< IsNumeric<Other>, LowerMatrix<MT,SO,true> >&
2003 {
2004  matrix_ *= rhs;
2005  return *this;
2006 }
2007 //*************************************************************************************************
2008 
2009 
2010 //*************************************************************************************************
2018 template< typename MT // Type of the adapted dense matrix
2019  , bool SO > // Storage order of the adapted dense matrix
2020 template< typename Other > // Data type of the right-hand side scalar
2021 inline EnableIf_< IsNumeric<Other>, LowerMatrix<MT,SO,true> >&
2023 {
2024  BLAZE_USER_ASSERT( rhs != Other(0), "Division by zero detected" );
2025 
2026  matrix_ /= rhs;
2027  return *this;
2028 }
2030 //*************************************************************************************************
2031 
2032 
2033 
2034 
2035 //=================================================================================================
2036 //
2037 // UTILITY FUNCTIONS
2038 //
2039 //=================================================================================================
2040 
2041 //*************************************************************************************************
2047 template< typename MT // Type of the adapted dense matrix
2048  , bool SO > // Storage order of the adapted dense matrix
2049 inline size_t LowerMatrix<MT,SO,true>::rows() const noexcept
2050 {
2051  return matrix_.rows();
2052 }
2054 //*************************************************************************************************
2055 
2056 
2057 //*************************************************************************************************
2063 template< typename MT // Type of the adapted dense matrix
2064  , bool SO > // Storage order of the adapted dense matrix
2065 inline size_t LowerMatrix<MT,SO,true>::columns() const noexcept
2066 {
2067  return matrix_.columns();
2068 }
2070 //*************************************************************************************************
2071 
2072 
2073 //*************************************************************************************************
2084 template< typename MT // Type of the adapted dense matrix
2085  , bool SO > // Storage order of the adapted dense matrix
2086 inline size_t LowerMatrix<MT,SO,true>::spacing() const noexcept
2087 {
2088  return matrix_.spacing();
2089 }
2091 //*************************************************************************************************
2092 
2093 
2094 //*************************************************************************************************
2100 template< typename MT // Type of the adapted dense matrix
2101  , bool SO > // Storage order of the adapted dense matrix
2102 inline size_t LowerMatrix<MT,SO,true>::capacity() const noexcept
2103 {
2104  return matrix_.capacity();
2105 }
2107 //*************************************************************************************************
2108 
2109 
2110 //*************************************************************************************************
2122 template< typename MT // Type of the adapted dense matrix
2123  , bool SO > // Storage order of the adapted dense matrix
2124 inline size_t LowerMatrix<MT,SO,true>::capacity( size_t i ) const noexcept
2125 {
2126  return matrix_.capacity(i);
2127 }
2129 //*************************************************************************************************
2130 
2131 
2132 //*************************************************************************************************
2138 template< typename MT // Type of the adapted dense matrix
2139  , bool SO > // Storage order of the adapted dense matrix
2140 inline size_t LowerMatrix<MT,SO,true>::nonZeros() const
2141 {
2142  return matrix_.nonZeros();
2143 }
2145 //*************************************************************************************************
2146 
2147 
2148 //*************************************************************************************************
2160 template< typename MT // Type of the adapted dense matrix
2161  , bool SO > // Storage order of the adapted dense matrix
2162 inline size_t LowerMatrix<MT,SO,true>::nonZeros( size_t i ) const
2163 {
2164  return matrix_.nonZeros(i);
2165 }
2167 //*************************************************************************************************
2168 
2169 
2170 //*************************************************************************************************
2176 template< typename MT // Type of the adapted dense matrix
2177  , bool SO > // Storage order of the adapted dense matrix
2178 inline void LowerMatrix<MT,SO,true>::reset()
2179 {
2180  using blaze::clear;
2181 
2182  if( SO ) {
2183  for( size_t j=0UL; j<columns(); ++j )
2184  for( size_t i=j; i<rows(); ++i )
2185  clear( matrix_(i,j) );
2186  }
2187  else {
2188  for( size_t i=0UL; i<rows(); ++i )
2189  for( size_t j=0UL; j<=i; ++j )
2190  clear( matrix_(i,j) );
2191  }
2192 }
2194 //*************************************************************************************************
2195 
2196 
2197 //*************************************************************************************************
2210 template< typename MT // Type of the adapted dense matrix
2211  , bool SO > // Storage order of the adapted dense matrix
2212 inline void LowerMatrix<MT,SO,true>::reset( size_t i )
2213 {
2214  using blaze::clear;
2215 
2216  if( SO ) {
2217  for( size_t j=i; j<rows(); ++j )
2218  clear( matrix_(j,i) );
2219  }
2220  else {
2221  for( size_t j=0UL; j<=i; ++j )
2222  clear( matrix_(i,j) );
2223  }
2224 }
2226 //*************************************************************************************************
2227 
2228 
2229 //*************************************************************************************************
2241 template< typename MT // Type of the adapted dense matrix
2242  , bool SO > // Storage order of the adapted dense matrix
2243 inline void LowerMatrix<MT,SO,true>::clear()
2244 {
2245  using blaze::clear;
2246 
2247  if( IsResizable<MT>::value ) {
2248  clear( matrix_ );
2249  }
2250  else {
2251  reset();
2252  }
2253 }
2255 //*************************************************************************************************
2256 
2257 
2258 //*************************************************************************************************
2294 template< typename MT // Type of the adapted dense matrix
2295  , bool SO > // Storage order of the adapted dense matrix
2296 void LowerMatrix<MT,SO,true>::resize( size_t n, bool preserve )
2297 {
2299 
2300  UNUSED_PARAMETER( preserve );
2301 
2302  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square lower matrix detected" );
2303 
2304  const size_t oldsize( matrix_.rows() );
2305 
2306  matrix_.resize( n, n, true );
2307 
2308  if( n > oldsize ) {
2309  const size_t increment( n - oldsize );
2310  submatrix( matrix_, 0UL, oldsize, n-1UL, increment ).reset();
2311  }
2312 }
2314 //*************************************************************************************************
2315 
2316 
2317 //*************************************************************************************************
2330 template< typename MT // Type of the adapted dense matrix
2331  , bool SO > // Storage order of the adapted dense matrix
2332 inline void LowerMatrix<MT,SO,true>::extend( size_t n, bool preserve )
2333 {
2335 
2336  UNUSED_PARAMETER( preserve );
2337 
2338  resize( rows() + n, true );
2339 }
2340 //*************************************************************************************************
2341 
2342 
2343 //*************************************************************************************************
2353 template< typename MT // Type of the adapted dense matrix
2354  , bool SO > // Storage order of the adapted dense matrix
2355 inline void LowerMatrix<MT,SO,true>::reserve( size_t elements )
2356 {
2357  matrix_.reserve( elements );
2358 }
2360 //*************************************************************************************************
2361 
2362 
2363 //*************************************************************************************************
2370 template< typename MT // Type of the adapted dense matrix
2371  , bool SO > // Storage order of the adapted dense matrix
2372 template< typename Other > // Data type of the scalar value
2373 inline LowerMatrix<MT,SO,true>& LowerMatrix<MT,SO,true>::scale( const Other& scalar )
2374 {
2375  matrix_.scale( scalar );
2376  return *this;
2377 }
2379 //*************************************************************************************************
2380 
2381 
2382 //*************************************************************************************************
2389 template< typename MT // Type of the adapted dense matrix
2390  , bool SO > // Storage order of the adapted dense matrix
2391 inline void LowerMatrix<MT,SO,true>::swap( LowerMatrix& m ) noexcept
2392 {
2393  using std::swap;
2394 
2395  swap( matrix_, m.matrix_ );
2396 }
2398 //*************************************************************************************************
2399 
2400 
2401 //*************************************************************************************************
2413 template< typename MT // Type of the adapted dense matrix
2414  , bool SO > // Storage order of the adapted dense matrix
2415 inline constexpr size_t LowerMatrix<MT,SO,true>::maxNonZeros() noexcept
2416 {
2418 
2419  return maxNonZeros( Rows<MT>::value );
2420 }
2422 //*************************************************************************************************
2423 
2424 
2425 //*************************************************************************************************
2435 template< typename MT // Type of the adapted dense matrix
2436  , bool SO > // Storage order of the adapted dense matrix
2437 inline constexpr size_t LowerMatrix<MT,SO,true>::maxNonZeros( size_t n ) noexcept
2438 {
2439  return ( ( n + 1UL ) * n ) / 2UL;
2440 }
2442 //*************************************************************************************************
2443 
2444 
2445 
2446 
2447 //=================================================================================================
2448 //
2449 // DEBUGGING FUNCTIONS
2450 //
2451 //=================================================================================================
2452 
2453 //*************************************************************************************************
2463 template< typename MT // Type of the adapted dense matrix
2464  , bool SO > // Storage order of the adapted dense matrix
2465 inline bool LowerMatrix<MT,SO,true>::isIntact() const noexcept
2466 {
2467  using blaze::isIntact;
2468 
2469  return ( isIntact( matrix_ ) && isLower( matrix_ ) );
2470 }
2472 //*************************************************************************************************
2473 
2474 
2475 
2476 
2477 //=================================================================================================
2478 //
2479 // EXPRESSION TEMPLATE EVALUATION FUNCTIONS
2480 //
2481 //=================================================================================================
2482 
2483 //*************************************************************************************************
2494 template< typename MT // Type of the adapted dense matrix
2495  , bool SO > // Storage order of the adapted dense matrix
2496 template< typename Other > // Data type of the foreign expression
2497 inline bool LowerMatrix<MT,SO,true>::canAlias( const Other* alias ) const noexcept
2498 {
2499  return matrix_.canAlias( alias );
2500 }
2502 //*************************************************************************************************
2503 
2504 
2505 //*************************************************************************************************
2516 template< typename MT // Type of the adapted dense matrix
2517  , bool SO > // Storage order of the adapted dense matrix
2518 template< typename Other > // Data type of the foreign expression
2519 inline bool LowerMatrix<MT,SO,true>::isAliased( const Other* alias ) const noexcept
2520 {
2521  return matrix_.isAliased( alias );
2522 }
2524 //*************************************************************************************************
2525 
2526 
2527 //*************************************************************************************************
2537 template< typename MT // Type of the adapted dense matrix
2538  , bool SO > // Storage order of the adapted dense matrix
2539 inline bool LowerMatrix<MT,SO,true>::isAligned() const noexcept
2540 {
2541  return matrix_.isAligned();
2542 }
2544 //*************************************************************************************************
2545 
2546 
2547 //*************************************************************************************************
2558 template< typename MT // Type of the adapted dense matrix
2559  , bool SO > // Storage order of the adapted dense matrix
2560 inline bool LowerMatrix<MT,SO,true>::canSMPAssign() const noexcept
2561 {
2562  return matrix_.canSMPAssign();
2563 }
2565 //*************************************************************************************************
2566 
2567 
2568 //*************************************************************************************************
2584 template< typename MT // Type of the adapted dense matrix
2585  , bool SO > // Storage order of the adapted dense matrix
2586 BLAZE_ALWAYS_INLINE typename LowerMatrix<MT,SO,true>::SIMDType
2587  LowerMatrix<MT,SO,true>::load( size_t i, size_t j ) const noexcept
2588 {
2589  return matrix_.load( i, j );
2590 }
2592 //*************************************************************************************************
2593 
2594 
2595 //*************************************************************************************************
2611 template< typename MT // Type of the adapted dense matrix
2612  , bool SO > // Storage order of the adapted dense matrix
2613 BLAZE_ALWAYS_INLINE typename LowerMatrix<MT,SO,true>::SIMDType
2614  LowerMatrix<MT,SO,true>::loada( size_t i, size_t j ) const noexcept
2615 {
2616  return matrix_.loada( i, j );
2617 }
2619 //*************************************************************************************************
2620 
2621 
2622 //*************************************************************************************************
2638 template< typename MT // Type of the adapted dense matrix
2639  , bool SO > // Storage order of the adapted dense matrix
2640 BLAZE_ALWAYS_INLINE typename LowerMatrix<MT,SO,true>::SIMDType
2641  LowerMatrix<MT,SO,true>::loadu( size_t i, size_t j ) const noexcept
2642 {
2643  return matrix_.loadu( i, j );
2644 }
2646 //*************************************************************************************************
2647 
2648 
2649 
2650 
2651 //=================================================================================================
2652 //
2653 // CONSTRUCTION FUNCTIONS
2654 //
2655 //=================================================================================================
2656 
2657 //*************************************************************************************************
2664 template< typename MT // Type of the adapted dense matrix
2665  , bool SO > // Storage order of the adapted dense matrix
2666 inline const MT LowerMatrix<MT,SO,true>::construct( size_t n, TrueType )
2667 {
2669 
2670  return MT( n, n, ElementType() );
2671 }
2673 //*************************************************************************************************
2674 
2675 
2676 //*************************************************************************************************
2683 template< typename MT // Type of the adapted dense matrix
2684  , bool SO > // Storage order of the adapted dense matrix
2685 inline const MT LowerMatrix<MT,SO,true>::construct( const ElementType& init, FalseType )
2686 {
2689 
2690  MT tmp;
2691 
2692  if( SO ) {
2693  for( size_t j=0UL; j<tmp.columns(); ++j )
2694  for( size_t i=j; i<tmp.rows(); ++i )
2695  tmp(i,j) = init;
2696  }
2697  else {
2698  for( size_t i=0UL; i<tmp.rows(); ++i )
2699  for( size_t j=0UL; j<=i; ++j )
2700  tmp(i,j) = init;
2701  }
2702 
2703  return tmp;
2704 }
2706 //*************************************************************************************************
2707 
2708 
2709 //*************************************************************************************************
2720 template< typename MT // Type of the adapted dense matrix
2721  , bool SO > // Storage order of the adapted dense matrix
2722 template< typename MT2 // Type of the foreign matrix
2723  , bool SO2 // Storage order of the foreign matrix
2724  , typename T > // Type of the third argument
2725 inline const MT LowerMatrix<MT,SO,true>::construct( const Matrix<MT2,SO2>& m, T )
2726 {
2727  const MT tmp( ~m );
2728 
2729  if( !IsLower<MT2>::value && !isLower( tmp ) ) {
2730  BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of lower matrix" );
2731  }
2732 
2733  return tmp;
2734 }
2736 //*************************************************************************************************
2737 
2738 } // namespace blaze
2739 
2740 #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.
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
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
bool isLower(const DenseMatrix< MT, SO > &dm)
Checks if the given dense matrix is a lower triangular matrix.
Definition: DenseMatrix.h:1036
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
bool isDefault(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: DiagonalProxy.h:573
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.
Header file for the IsLower type trait.
Header file for the LowerProxy class.
BLAZE_ALWAYS_INLINE size_t columns(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of columns of the matrix.
Definition: Matrix.h: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
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 utility functions for dense matrices.
void clear(const DiagonalProxy< MT > &proxy)
Clearing the represented element.
Definition: DiagonalProxy.h:553
Header file for the IsNumeric type trait.
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.
#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 implementation of the base template of the LowerMatrix.
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.