Dense.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_ADAPTORS_UNILOWERMATRIX_DENSE_H_
36 #define _BLAZE_MATH_ADAPTORS_UNILOWERMATRIX_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>
75 #include <blaze/system/Inline.h>
76 #include <blaze/util/Assert.h>
83 #include <blaze/util/DisableIf.h>
84 #include <blaze/util/EnableIf.h>
85 #include <blaze/util/FalseType.h>
87 #include <blaze/util/TrueType.h>
88 #include <blaze/util/Types.h>
89 #include <blaze/util/Unused.h>
90 
91 
92 namespace blaze {
93 
94 //=================================================================================================
95 //
96 // CLASS TEMPLATE SPECIALIZATION FOR DENSE MATRICES
97 //
98 //=================================================================================================
99 
100 //*************************************************************************************************
108 template< typename MT // Type of the adapted dense matrix
109  , bool SO > // Storage order of the adapted dense matrix
110 class UniLowerMatrix<MT,SO,true>
111  : public DenseMatrix< UniLowerMatrix<MT,SO,true>, SO >
112 {
113  private:
114  //**Type definitions****************************************************************************
115  typedef OppositeType_<MT> OT;
116  typedef TransposeType_<MT> TT;
117  typedef ElementType_<MT> ET;
118  //**********************************************************************************************
119 
120  public:
121  //**Type definitions****************************************************************************
122  typedef UniLowerMatrix<MT,SO,true> This;
123  typedef DenseMatrix<This,SO> BaseType;
124  typedef This ResultType;
125  typedef UniLowerMatrix<OT,!SO,true> OppositeType;
126  typedef UniUpperMatrix<TT,!SO,true> TransposeType;
127  typedef ET ElementType;
128  typedef SIMDType_<MT> SIMDType;
129  typedef ReturnType_<MT> ReturnType;
130  typedef const This& CompositeType;
131  typedef UniLowerProxy<MT> Reference;
132  typedef ConstReference_<MT> ConstReference;
133  typedef Pointer_<MT> Pointer;
134  typedef ConstPointer_<MT> ConstPointer;
135  typedef ConstIterator_<MT> ConstIterator;
136  //**********************************************************************************************
137 
138  //**Rebind struct definition********************************************************************
141  template< typename ET > // Data type of the other matrix
142  struct Rebind {
144  typedef UniLowerMatrix< typename MT::template Rebind<ET>::Other > Other;
145  };
146  //**********************************************************************************************
147 
148  //**Iterator class definition*******************************************************************
151  class Iterator
152  {
153  public:
154  //**Type definitions*************************************************************************
155  typedef std::random_access_iterator_tag IteratorCategory;
156  typedef ElementType_<MT> ValueType;
157  typedef UniLowerProxy<MT> PointerType;
158  typedef UniLowerProxy<MT> ReferenceType;
159  typedef ptrdiff_t DifferenceType;
160 
161  // STL iterator requirements
162  typedef IteratorCategory iterator_category;
163  typedef ValueType value_type;
164  typedef PointerType pointer;
165  typedef ReferenceType reference;
166  typedef DifferenceType difference_type;
167  //*******************************************************************************************
168 
169  //**Constructor******************************************************************************
172  inline Iterator() noexcept
173  : matrix_( nullptr ) // Reference to the adapted dense matrix
174  , row_ ( 0UL ) // The current row index of the iterator
175  , column_( 0UL ) // The current column index of the iterator
176  {}
177  //*******************************************************************************************
178 
179  //**Constructor******************************************************************************
186  inline Iterator( MT& matrix, size_t row, size_t column ) noexcept
187  : matrix_( &matrix ) // Reference to the adapted dense matrix
188  , row_ ( row ) // The current row-index of the iterator
189  , column_( column ) // The current column-index of the iterator
190  {}
191  //*******************************************************************************************
192 
193  //**Addition assignment operator*************************************************************
199  inline Iterator& operator+=( size_t inc ) noexcept {
200  ( SO )?( row_ += inc ):( column_ += inc );
201  return *this;
202  }
203  //*******************************************************************************************
204 
205  //**Subtraction assignment operator**********************************************************
211  inline Iterator& operator-=( size_t dec ) noexcept {
212  ( SO )?( row_ -= dec ):( column_ -= dec );
213  return *this;
214  }
215  //*******************************************************************************************
216 
217  //**Prefix increment operator****************************************************************
222  inline Iterator& operator++() noexcept {
223  ( SO )?( ++row_ ):( ++column_ );
224  return *this;
225  }
226  //*******************************************************************************************
227 
228  //**Postfix increment operator***************************************************************
233  inline const Iterator operator++( int ) noexcept {
234  const Iterator tmp( *this );
235  ++(*this);
236  return tmp;
237  }
238  //*******************************************************************************************
239 
240  //**Prefix decrement operator****************************************************************
245  inline Iterator& operator--() noexcept {
246  ( SO )?( --row_ ):( --column_ );
247  return *this;
248  }
249  //*******************************************************************************************
250 
251  //**Postfix decrement operator***************************************************************
256  inline const Iterator operator--( int ) noexcept {
257  const Iterator tmp( *this );
258  --(*this);
259  return tmp;
260  }
261  //*******************************************************************************************
262 
263  //**Element access operator******************************************************************
268  inline ReferenceType operator*() const {
269  return ReferenceType( *matrix_, row_, column_ );
270  }
271  //*******************************************************************************************
272 
273  //**Element access operator******************************************************************
278  inline PointerType operator->() const {
279  return PointerType( *matrix_, row_, column_ );
280  }
281  //*******************************************************************************************
282 
283  //**Load function****************************************************************************
293  inline SIMDType load() const {
294  return (*matrix_).load(row_,column_);
295  }
296  //*******************************************************************************************
297 
298  //**Loada function***************************************************************************
308  inline SIMDType loada() const {
309  return (*matrix_).loada(row_,column_);
310  }
311  //*******************************************************************************************
312 
313  //**Loadu function***************************************************************************
323  inline SIMDType loadu() const {
324  return (*matrix_).loadu(row_,column_);
325  }
326  //*******************************************************************************************
327 
328  //**Conversion operator**********************************************************************
333  inline operator ConstIterator() const {
334  if( SO )
335  return matrix_->begin( column_ ) + row_;
336  else
337  return matrix_->begin( row_ ) + column_;
338  }
339  //*******************************************************************************************
340 
341  //**Equality operator************************************************************************
348  friend inline bool operator==( const Iterator& lhs, const Iterator& rhs ) noexcept {
349  return ( SO )?( lhs.row_ == rhs.row_ ):( lhs.column_ == rhs.column_ );
350  }
351  //*******************************************************************************************
352 
353  //**Equality operator************************************************************************
360  friend inline bool operator==( const Iterator& lhs, const ConstIterator& rhs ) noexcept {
361  return ( ConstIterator( lhs ) == rhs );
362  }
363  //*******************************************************************************************
364 
365  //**Equality operator************************************************************************
372  friend inline bool operator==( const ConstIterator& lhs, const Iterator& rhs ) noexcept {
373  return ( lhs == ConstIterator( rhs ) );
374  }
375  //*******************************************************************************************
376 
377  //**Inequality operator**********************************************************************
384  friend inline bool operator!=( const Iterator& lhs, const Iterator& rhs ) noexcept {
385  return ( SO )?( lhs.row_ != rhs.row_ ):( lhs.column_ != rhs.column_ );
386  }
387  //*******************************************************************************************
388 
389  //**Inequality operator**********************************************************************
396  friend inline bool operator!=( const Iterator& lhs, const ConstIterator& rhs ) {
397  return ( ConstIterator( lhs ) != rhs );
398  }
399  //*******************************************************************************************
400 
401  //**Inequality operator**********************************************************************
408  friend inline bool operator!=( const ConstIterator& lhs, const Iterator& rhs ) {
409  return ( lhs != ConstIterator( rhs ) );
410  }
411  //*******************************************************************************************
412 
413  //**Less-than operator***********************************************************************
420  friend inline bool operator<( const Iterator& lhs, const Iterator& rhs ) noexcept {
421  return ( SO )?( lhs.row_ < rhs.row_ ):( lhs.column_ < rhs.column_ );
422  }
423  //*******************************************************************************************
424 
425  //**Less-than operator***********************************************************************
432  friend inline bool operator<( const Iterator& lhs, const ConstIterator& rhs ) {
433  return ( ConstIterator( lhs ) < rhs );
434  }
435  //*******************************************************************************************
436 
437  //**Less-than operator***********************************************************************
444  friend inline bool operator<( const ConstIterator& lhs, const Iterator& rhs ) {
445  return ( lhs < ConstIterator( rhs ) );
446  }
447  //*******************************************************************************************
448 
449  //**Greater-than operator********************************************************************
456  friend inline bool operator>( const Iterator& lhs, const Iterator& rhs ) noexcept {
457  return ( SO )?( lhs.row_ > rhs.row_ ):( lhs.column_ > rhs.column_ );
458  }
459  //*******************************************************************************************
460 
461  //**Greater-than operator********************************************************************
468  friend inline bool operator>( const Iterator& lhs, const ConstIterator& rhs ) {
469  return ( ConstIterator( lhs ) > rhs );
470  }
471  //*******************************************************************************************
472 
473  //**Greater-than operator********************************************************************
480  friend inline bool operator>( const ConstIterator& lhs, const Iterator& rhs ) {
481  return ( lhs > ConstIterator( rhs ) );
482  }
483  //*******************************************************************************************
484 
485  //**Less-or-equal-than operator**************************************************************
492  friend inline bool operator<=( const Iterator& lhs, const Iterator& rhs ) noexcept {
493  return ( SO )?( lhs.row_ <= rhs.row_ ):( lhs.column_ <= rhs.column_ );
494  }
495  //*******************************************************************************************
496 
497  //**Less-or-equal-than operator**************************************************************
504  friend inline bool operator<=( const Iterator& lhs, const ConstIterator& rhs ) {
505  return ( ConstIterator( lhs ) <= rhs );
506  }
507  //*******************************************************************************************
508 
509  //**Less-or-equal-than operator**************************************************************
516  friend inline bool operator<=( const ConstIterator& lhs, const Iterator& rhs ) {
517  return ( lhs <= ConstIterator( rhs ) );
518  }
519  //*******************************************************************************************
520 
521  //**Greater-or-equal-than operator***********************************************************
528  friend inline bool operator>=( const Iterator& lhs, const Iterator& rhs ) noexcept {
529  return ( SO )?( lhs.row_ >= rhs.row_ ):( lhs.column_ >= rhs.column_ );
530  }
531  //*******************************************************************************************
532 
533  //**Greater-or-equal-than operator***********************************************************
540  friend inline bool operator>=( const Iterator& lhs, const ConstIterator& rhs ) {
541  return ( ConstIterator( lhs ) >= rhs );
542  }
543  //*******************************************************************************************
544 
545  //**Greater-or-equal-than operator***********************************************************
552  friend inline bool operator>=( const ConstIterator& lhs, const Iterator& rhs ) {
553  return ( lhs >= ConstIterator( rhs ) );
554  }
555  //*******************************************************************************************
556 
557  //**Subtraction operator*********************************************************************
563  inline DifferenceType operator-( const Iterator& rhs ) const noexcept {
564  return ( SO )?( row_ - rhs.row_ ):( column_ - rhs.column_ );
565  }
566  //*******************************************************************************************
567 
568  //**Addition operator************************************************************************
575  friend inline const Iterator operator+( const Iterator& it, size_t inc ) noexcept {
576  if( SO )
577  return Iterator( *it.matrix_, it.row_ + inc, it.column_ );
578  else
579  return Iterator( *it.matrix_, it.row_, it.column_ + inc );
580  }
581  //*******************************************************************************************
582 
583  //**Addition operator************************************************************************
590  friend inline const Iterator operator+( size_t inc, const Iterator& it ) noexcept {
591  if( SO )
592  return Iterator( *it.matrix_, it.row_ + inc, it.column_ );
593  else
594  return Iterator( *it.matrix_, it.row_, it.column_ + inc );
595  }
596  //*******************************************************************************************
597 
598  //**Subtraction operator*********************************************************************
605  friend inline const Iterator operator-( const Iterator& it, size_t dec ) noexcept {
606  if( SO )
607  return Iterator( *it.matrix_, it.row_ - dec, it.column_ );
608  else
609  return Iterator( *it.matrix_, it.row_, it.column_ - dec );
610  }
611  //*******************************************************************************************
612 
613  private:
614  //**Member variables*************************************************************************
615  MT* matrix_;
616  size_t row_;
617  size_t column_;
618  //*******************************************************************************************
619  };
620  //**********************************************************************************************
621 
622  //**Compilation flags***************************************************************************
624  enum : bool { simdEnabled = MT::simdEnabled };
625 
627  enum : bool { smpAssignable = MT::smpAssignable };
628  //**********************************************************************************************
629 
630  //**Constructors********************************************************************************
633  explicit inline UniLowerMatrix();
634  template< typename A1 > explicit inline UniLowerMatrix( const A1& a1 );
635  explicit inline UniLowerMatrix( size_t n, const ElementType& init );
636 
637  explicit inline UniLowerMatrix( initializer_list< initializer_list<ElementType> > list );
638 
639  template< typename Other >
640  explicit inline UniLowerMatrix( size_t n, const Other* array );
641 
642  template< typename Other, size_t N >
643  explicit inline UniLowerMatrix( const Other (&array)[N][N] );
644 
645  explicit inline UniLowerMatrix( ElementType* ptr, size_t n );
646  explicit inline UniLowerMatrix( ElementType* ptr, size_t n, size_t nn );
647 
648  template< typename Deleter >
649  explicit inline UniLowerMatrix( ElementType* ptr, size_t n, Deleter d );
650 
651  template< typename Deleter >
652  explicit inline UniLowerMatrix( ElementType* ptr, size_t n, size_t nn, Deleter d );
653 
654  inline UniLowerMatrix( const UniLowerMatrix& m );
655  inline UniLowerMatrix( UniLowerMatrix&& m ) noexcept;
657  //**********************************************************************************************
658 
659  //**Destructor**********************************************************************************
660  // No explicitly declared destructor.
661  //**********************************************************************************************
662 
663  //**Data access functions***********************************************************************
666  inline Reference operator()( size_t i, size_t j );
667  inline ConstReference operator()( size_t i, size_t j ) const;
668  inline Reference at( size_t i, size_t j );
669  inline ConstReference at( size_t i, size_t j ) const;
670  inline ConstPointer data () const noexcept;
671  inline ConstPointer data ( size_t i ) const noexcept;
672  inline Iterator begin ( size_t i );
673  inline ConstIterator begin ( size_t i ) const;
674  inline ConstIterator cbegin( size_t i ) const;
675  inline Iterator end ( size_t i );
676  inline ConstIterator end ( size_t i ) const;
677  inline ConstIterator cend ( size_t i ) const;
679  //**********************************************************************************************
680 
681  //**Assignment operators************************************************************************
684  inline UniLowerMatrix& operator=( const ElementType& rhs );
685  inline UniLowerMatrix& operator=( initializer_list< initializer_list<ElementType> > list );
686 
687  template< typename Other, size_t N >
688  inline UniLowerMatrix& operator=( const Other (&array)[N][N] );
689 
690  inline UniLowerMatrix& operator=( const UniLowerMatrix& rhs );
691  inline UniLowerMatrix& operator=( UniLowerMatrix&& rhs ) noexcept;
692 
693  template< typename MT2, bool SO2 >
694  inline DisableIf_< IsComputation<MT2>, UniLowerMatrix& > operator=( const Matrix<MT2,SO2>& rhs );
695 
696  template< typename MT2, bool SO2 >
697  inline EnableIf_< IsComputation<MT2>, UniLowerMatrix& > operator=( const Matrix<MT2,SO2>& rhs );
698 
699  template< typename MT2, bool SO2 >
700  inline DisableIf_< IsComputation<MT2>, UniLowerMatrix& > operator+=( const Matrix<MT2,SO2>& rhs );
701 
702  template< typename MT2, bool SO2 >
703  inline EnableIf_< IsComputation<MT2>, UniLowerMatrix& > operator+=( const Matrix<MT2,SO2>& rhs );
704 
705  template< typename MT2, bool SO2 >
706  inline DisableIf_< IsComputation<MT2>, UniLowerMatrix& > operator-=( const Matrix<MT2,SO2>& rhs );
707 
708  template< typename MT2, bool SO2 >
709  inline EnableIf_< IsComputation<MT2>, UniLowerMatrix& > operator-=( const Matrix<MT2,SO2>& rhs );
710 
711  template< typename MT2, bool SO2 >
712  inline UniLowerMatrix& operator*=( const Matrix<MT2,SO2>& rhs );
714  //**********************************************************************************************
715 
716  //**Utility functions***************************************************************************
719  inline size_t rows() const noexcept;
720  inline size_t columns() const noexcept;
721  inline size_t spacing() const noexcept;
722  inline size_t capacity() const noexcept;
723  inline size_t capacity( size_t i ) const noexcept;
724  inline size_t nonZeros() const;
725  inline size_t nonZeros( size_t i ) const;
726  inline void reset();
727  inline void reset( size_t i );
728  inline void clear();
729  void resize ( size_t n, bool preserve=true );
730  inline void extend ( size_t n, bool preserve=true );
731  inline void reserve( size_t elements );
732  inline void swap( UniLowerMatrix& m ) noexcept;
733 
734  static inline constexpr size_t maxNonZeros() noexcept;
735  static inline constexpr size_t maxNonZeros( size_t n ) noexcept;
737  //**********************************************************************************************
738 
739  //**Debugging functions*************************************************************************
742  inline bool isIntact() const noexcept;
744  //**********************************************************************************************
745 
746  //**Expression template evaluation functions****************************************************
749  template< typename Other > inline bool canAlias ( const Other* alias ) const noexcept;
750  template< typename Other > inline bool isAliased( const Other* alias ) const noexcept;
751 
752  inline bool isAligned () const noexcept;
753  inline bool canSMPAssign() const noexcept;
754 
755  BLAZE_ALWAYS_INLINE SIMDType load ( size_t i, size_t j ) const noexcept;
756  BLAZE_ALWAYS_INLINE SIMDType loada( size_t i, size_t j ) const noexcept;
757  BLAZE_ALWAYS_INLINE SIMDType loadu( size_t i, size_t j ) const noexcept;
759  //**********************************************************************************************
760 
761  private:
762  //**Construction functions**********************************************************************
765  inline const MT construct( size_t n , TrueType );
766  inline const MT construct( const ElementType& value, FalseType );
767 
768  template< typename MT2, bool SO2, typename T >
769  inline const MT construct( const Matrix<MT2,SO2>& m, T );
771  //**********************************************************************************************
772 
773  //**Member variables****************************************************************************
776  MT matrix_;
777 
778  //**********************************************************************************************
779 
780  //**Friend declarations*************************************************************************
781  template< typename MT2, bool SO2, bool DF2 >
782  friend MT2& derestrict( UniLowerMatrix<MT2,SO2,DF2>& m );
783  //**********************************************************************************************
784 
785  //**Compile time checks*************************************************************************
799  BLAZE_STATIC_ASSERT( Rows<MT>::value == Columns<MT>::value );
800  //**********************************************************************************************
801 };
803 //*************************************************************************************************
804 
805 
806 
807 
808 //=================================================================================================
809 //
810 // CONSTRUCTORS
811 //
812 //=================================================================================================
813 
814 //*************************************************************************************************
818 template< typename MT // Type of the adapted dense matrix
819  , bool SO > // Storage order of the adapted dense matrix
820 inline UniLowerMatrix<MT,SO,true>::UniLowerMatrix()
821  : matrix_() // The adapted dense matrix
822 {
823  for( size_t i=0UL; i<Rows<MT>::value; ++i )
824  matrix_(i,i) = ElementType(1);
825 
826  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square unilower matrix detected" );
827  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
828 }
830 //*************************************************************************************************
831 
832 
833 //*************************************************************************************************
851 template< typename MT // Type of the adapted dense matrix
852  , bool SO > // Storage order of the adapted dense matrix
853 template< typename A1 > // Type of the constructor argument
854 inline UniLowerMatrix<MT,SO,true>::UniLowerMatrix( const A1& a1 )
855  : matrix_( construct( a1, typename IsResizable<MT>::Type() ) ) // The adapted dense matrix
856 {
857  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square unilower matrix detected" );
858  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
859 }
861 //*************************************************************************************************
862 
863 
864 //*************************************************************************************************
871 template< typename MT // Type of the adapted dense matrix
872  , bool SO > // Storage order of the adapted dense matrix
873 inline UniLowerMatrix<MT,SO,true>::UniLowerMatrix( size_t n, const ElementType& init )
874  : matrix_( n, n, ElementType() ) // The adapted dense matrix
875 {
877 
878  if( SO ) {
879  for( size_t j=0UL; j<columns(); ++j ) {
880  matrix_(j,j) = ElementType(1);
881  for( size_t i=j+1UL; i<rows(); ++i )
882  matrix_(i,j) = init;
883  }
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  matrix_(i,i) = ElementType(1);
890  }
891  }
892 
893  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square unilower matrix detected" );
894  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
895 }
897 //*************************************************************************************************
898 
899 
900 //*************************************************************************************************
923 template< typename MT // Type of the adapted dense matrix
924  , bool SO > // Storage order of the adapted dense matrix
925 inline UniLowerMatrix<MT,SO,true>::UniLowerMatrix( initializer_list< initializer_list<ElementType> > list )
926  : matrix_( list ) // The adapted dense matrix
927 {
928  if( !isUniLower( matrix_ ) ) {
929  BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of unilower matrix" );
930  }
931 
932  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
933 }
935 //*************************************************************************************************
936 
937 
938 //*************************************************************************************************
964 template< typename MT // Type of the adapted dense matrix
965  , bool SO > // Storage order of the adapted dense matrix
966 template< typename Other > // Data type of the initialization array
967 inline UniLowerMatrix<MT,SO,true>::UniLowerMatrix( size_t n, const Other* array )
968  : matrix_( n, n, array ) // The adapted dense matrix
969 {
970  if( !isUniLower( matrix_ ) ) {
971  BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of unilower matrix" );
972  }
973 
974  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
975 }
977 //*************************************************************************************************
978 
979 
980 //*************************************************************************************************
1003 template< typename MT // Type of the adapted dense matrix
1004  , bool SO > // Storage order of the adapted dense matrix
1005 template< typename Other // Data type of the initialization array
1006  , size_t N > // Number of rows and columns of the initialization array
1007 inline UniLowerMatrix<MT,SO,true>::UniLowerMatrix( const Other (&array)[N][N] )
1008  : matrix_( array ) // The adapted dense matrix
1009 {
1010  if( !isUniLower( matrix_ ) ) {
1011  BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of unilower matrix" );
1012  }
1013 
1014  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1015 }
1017 //*************************************************************************************************
1018 
1019 
1020 //*************************************************************************************************
1041 template< typename MT // Type of the adapted dense matrix
1042  , bool SO > // Storage order of the adapted dense matrix
1043 inline UniLowerMatrix<MT,SO,true>::UniLowerMatrix( ElementType* ptr, size_t n )
1044  : matrix_( ptr, n, n ) // The adapted dense matrix
1045 {
1046  if( !isUniLower( matrix_ ) ) {
1047  BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of unilower matrix" );
1048  }
1049 
1050  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1051 }
1053 //*************************************************************************************************
1054 
1055 
1056 //*************************************************************************************************
1079 template< typename MT // Type of the adapted dense matrix
1080  , bool SO > // Storage order of the adapted dense matrix
1081 inline UniLowerMatrix<MT,SO,true>::UniLowerMatrix( ElementType* ptr, size_t n, size_t nn )
1082  : matrix_( ptr, n, n, nn ) // The adapted dense matrix
1083 {
1084  if( !isUniLower( matrix_ ) ) {
1085  BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of unilower matrix" );
1086  }
1087 
1088  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1089 }
1091 //*************************************************************************************************
1092 
1093 
1094 //*************************************************************************************************
1115 template< typename MT // Type of the adapted dense matrix
1116  , bool SO > // Storage order of the adapted dense matrix
1117 template< typename Deleter > // Type of the custom deleter
1118 inline UniLowerMatrix<MT,SO,true>::UniLowerMatrix( ElementType* ptr, size_t n, Deleter d )
1119  : matrix_( ptr, n, n, d ) // The adapted dense matrix
1120 {
1121  if( !isUniLower( matrix_ ) ) {
1122  BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of unilower matrix" );
1123  }
1124 
1125  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1126 }
1128 //*************************************************************************************************
1129 
1130 
1131 //*************************************************************************************************
1153 template< typename MT // Type of the adapted dense matrix
1154  , bool SO > // Storage order of the adapted dense matrix
1155 template< typename Deleter > // Type of the custom deleter
1156 inline UniLowerMatrix<MT,SO,true>::UniLowerMatrix( ElementType* ptr, size_t n, size_t nn, Deleter d )
1157  : matrix_( ptr, n, n, nn, d ) // The adapted dense matrix
1158 {
1159  if( !isUniLower( matrix_ ) ) {
1160  BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of unilower matrix" );
1161  }
1162 
1163  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1164 }
1166 //*************************************************************************************************
1167 
1168 
1169 //*************************************************************************************************
1175 template< typename MT // Type of the adapted dense matrix
1176  , bool SO > // Storage order of the adapted dense matrix
1177 inline UniLowerMatrix<MT,SO,true>::UniLowerMatrix( const UniLowerMatrix& m )
1178  : matrix_( m.matrix_ ) // The adapted dense matrix
1179 {
1180  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square unilower matrix detected" );
1181  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1182 }
1184 //*************************************************************************************************
1185 
1186 
1187 //*************************************************************************************************
1193 template< typename MT // Type of the adapted dense matrix
1194  , bool SO > // Storage order of the adapted dense matrix
1195 inline UniLowerMatrix<MT,SO,true>::UniLowerMatrix( UniLowerMatrix&& m ) noexcept
1196  : matrix_( std::move( m.matrix_ ) ) // The adapted dense matrix
1197 {
1198  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square unilower matrix detected" );
1199  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1200 }
1202 //*************************************************************************************************
1203 
1204 
1205 
1206 
1207 //=================================================================================================
1208 //
1209 // DATA ACCESS FUNCTIONS
1210 //
1211 //=================================================================================================
1212 
1213 //*************************************************************************************************
1229 template< typename MT // Type of the adapted dense matrix
1230  , bool SO > // Storage order of the adapted dense matrix
1232  UniLowerMatrix<MT,SO,true>::operator()( size_t i, size_t j )
1233 {
1234  BLAZE_USER_ASSERT( i<rows() , "Invalid row access index" );
1235  BLAZE_USER_ASSERT( j<columns(), "Invalid column access index" );
1236 
1237  return Reference( matrix_, i, j );
1238 }
1240 //*************************************************************************************************
1241 
1242 
1243 //*************************************************************************************************
1259 template< typename MT // Type of the adapted dense matrix
1260  , bool SO > // Storage order of the adapted dense matrix
1262  UniLowerMatrix<MT,SO,true>::operator()( size_t i, size_t j ) const
1263 {
1264  BLAZE_USER_ASSERT( i<rows() , "Invalid row access index" );
1265  BLAZE_USER_ASSERT( j<columns(), "Invalid column access index" );
1266 
1267  return matrix_(i,j);
1268 }
1270 //*************************************************************************************************
1271 
1272 
1273 //*************************************************************************************************
1290 template< typename MT // Type of the adapted dense matrix
1291  , bool SO > // Storage order of the adapted dense matrix
1293  UniLowerMatrix<MT,SO,true>::at( size_t i, size_t j )
1294 {
1295  if( i >= rows() ) {
1296  BLAZE_THROW_OUT_OF_RANGE( "Invalid row access index" );
1297  }
1298  if( j >= columns() ) {
1299  BLAZE_THROW_OUT_OF_RANGE( "Invalid column access index" );
1300  }
1301  return (*this)(i,j);
1302 }
1304 //*************************************************************************************************
1305 
1306 
1307 //*************************************************************************************************
1324 template< typename MT // Type of the adapted dense matrix
1325  , bool SO > // Storage order of the adapted dense matrix
1327  UniLowerMatrix<MT,SO,true>::at( size_t i, size_t j ) const
1328 {
1329  if( i >= rows() ) {
1330  BLAZE_THROW_OUT_OF_RANGE( "Invalid row access index" );
1331  }
1332  if( j >= columns() ) {
1333  BLAZE_THROW_OUT_OF_RANGE( "Invalid column access index" );
1334  }
1335  return (*this)(i,j);
1336 }
1338 //*************************************************************************************************
1339 
1340 
1341 //*************************************************************************************************
1354 template< typename MT // Type of the adapted dense matrix
1355  , bool SO > // Storage order of the adapted dense matrix
1356 inline typename UniLowerMatrix<MT,SO,true>::ConstPointer
1357  UniLowerMatrix<MT,SO,true>::data() const noexcept
1358 {
1359  return matrix_.data();
1360 }
1362 //*************************************************************************************************
1363 
1364 
1365 //*************************************************************************************************
1374 template< typename MT // Type of the adapted dense matrix
1375  , bool SO > // Storage order of the adapted dense matrix
1376 inline typename UniLowerMatrix<MT,SO,true>::ConstPointer
1377  UniLowerMatrix<MT,SO,true>::data( size_t i ) const noexcept
1378 {
1379  return matrix_.data(i);
1380 }
1382 //*************************************************************************************************
1383 
1384 
1385 //*************************************************************************************************
1397 template< typename MT // Type of the adapted dense matrix
1398  , bool SO > // Storage order of the adapted dense matrix
1401 {
1402  if( SO )
1403  return Iterator( matrix_, 0UL, i );
1404  else
1405  return Iterator( matrix_, i, 0UL );
1406 }
1408 //*************************************************************************************************
1409 
1410 
1411 //*************************************************************************************************
1423 template< typename MT // Type of the adapted dense matrix
1424  , bool SO > // Storage order of the adapted dense matrix
1426  UniLowerMatrix<MT,SO,true>::begin( size_t i ) const
1427 {
1428  return matrix_.begin(i);
1429 }
1431 //*************************************************************************************************
1432 
1433 
1434 //*************************************************************************************************
1446 template< typename MT // Type of the adapted dense matrix
1447  , bool SO > // Storage order of the adapted dense matrix
1449  UniLowerMatrix<MT,SO,true>::cbegin( size_t i ) const
1450 {
1451  return matrix_.cbegin(i);
1452 }
1454 //*************************************************************************************************
1455 
1456 
1457 //*************************************************************************************************
1469 template< typename MT // Type of the adapted dense matrix
1470  , bool SO > // Storage order of the adapted dense matrix
1473 {
1474  if( SO )
1475  return Iterator( matrix_, rows(), i );
1476  else
1477  return Iterator( matrix_, i, columns() );
1478 }
1480 //*************************************************************************************************
1481 
1482 
1483 //*************************************************************************************************
1495 template< typename MT // Type of the adapted dense matrix
1496  , bool SO > // Storage order of the adapted dense matrix
1498  UniLowerMatrix<MT,SO,true>::end( size_t i ) const
1499 {
1500  return matrix_.end(i);
1501 }
1503 //*************************************************************************************************
1504 
1505 
1506 //*************************************************************************************************
1518 template< typename MT // Type of the adapted dense matrix
1519  , bool SO > // Storage order of the adapted dense matrix
1521  UniLowerMatrix<MT,SO,true>::cend( size_t i ) const
1522 {
1523  return matrix_.cend(i);
1524 }
1526 //*************************************************************************************************
1527 
1528 
1529 
1530 
1531 //=================================================================================================
1532 //
1533 // ASSIGNMENT OPERATORS
1534 //
1535 //=================================================================================================
1536 
1537 //*************************************************************************************************
1544 template< typename MT // Type of the adapted dense matrix
1545  , bool SO > // Storage order of the adapted dense matrix
1546 inline UniLowerMatrix<MT,SO,true>&
1547  UniLowerMatrix<MT,SO,true>::operator=( const ElementType& rhs )
1548 {
1549  if( SO ) {
1550  for( size_t j=0UL; j<columns(); ++j )
1551  for( size_t i=j+1UL; i<rows(); ++i )
1552  matrix_(i,j) = rhs;
1553  }
1554  else {
1555  for( size_t i=1UL; i<rows(); ++i )
1556  for( size_t j=0UL; j<i; ++j )
1557  matrix_(i,j) = rhs;
1558  }
1559 
1560  return *this;
1561 }
1563 //*************************************************************************************************
1564 
1565 
1566 //*************************************************************************************************
1590 template< typename MT // Type of the adapted dense matrix
1591  , bool SO > // Storage order of the adapted dense matrix
1592 inline UniLowerMatrix<MT,SO,true>&
1593  UniLowerMatrix<MT,SO,true>::operator=( initializer_list< initializer_list<ElementType> > list )
1594 {
1595  MT tmp( list );
1596 
1597  if( !isUniLower( tmp ) ) {
1598  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to unilower matrix" );
1599  }
1600 
1601  matrix_ = std::move( tmp );
1602 
1603  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square unilower matrix detected" );
1604  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1605 
1606  return *this;
1607 }
1609 //*************************************************************************************************
1610 
1611 
1612 //*************************************************************************************************
1636 template< typename MT // Type of the adapted dense matrix
1637  , bool SO > // Storage order of the adapted dense matrix
1638 template< typename Other // Data type of the initialization array
1639  , size_t N > // Number of rows and columns of the initialization array
1640 inline UniLowerMatrix<MT,SO,true>&
1641  UniLowerMatrix<MT,SO,true>::operator=( const Other (&array)[N][N] )
1642 {
1643  MT tmp( array );
1644 
1645  if( !isUniLower( tmp ) ) {
1646  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to unilower matrix" );
1647  }
1648 
1649  matrix_ = std::move( tmp );
1650 
1651  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square unilower matrix detected" );
1652  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1653 
1654  return *this;
1655 }
1657 //*************************************************************************************************
1658 
1659 
1660 //*************************************************************************************************
1670 template< typename MT // Type of the adapted dense matrix
1671  , bool SO > // Storage order of the adapted dense matrix
1672 inline UniLowerMatrix<MT,SO,true>&
1673  UniLowerMatrix<MT,SO,true>::operator=( const UniLowerMatrix& rhs )
1674 {
1675  matrix_ = rhs.matrix_;
1676 
1677  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square unilower matrix detected" );
1678  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1679 
1680  return *this;
1681 }
1683 //*************************************************************************************************
1684 
1685 
1686 //*************************************************************************************************
1693 template< typename MT // Type of the adapted dense matrix
1694  , bool SO > // Storage order of the adapted dense matrix
1695 inline UniLowerMatrix<MT,SO,true>&
1696  UniLowerMatrix<MT,SO,true>::operator=( UniLowerMatrix&& rhs ) noexcept
1697 {
1698  matrix_ = std::move( rhs.matrix_ );
1699 
1700  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square unilower matrix detected" );
1701  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1702 
1703  return *this;
1704 }
1706 //*************************************************************************************************
1707 
1708 
1709 //*************************************************************************************************
1722 template< typename MT // Type of the adapted dense matrix
1723  , bool SO > // Storage order of the adapted dense matrix
1724 template< typename MT2 // Type of the right-hand side matrix
1725  , bool SO2 > // Storage order of the right-hand side matrix
1726 inline DisableIf_< IsComputation<MT2>, UniLowerMatrix<MT,SO,true>& >
1727  UniLowerMatrix<MT,SO,true>::operator=( const Matrix<MT2,SO2>& rhs )
1728 {
1729  if( IsStrictlyTriangular<MT2>::value || ( !IsUniLower<MT2>::value && !isUniLower( ~rhs ) ) ) {
1730  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to unilower matrix" );
1731  }
1732 
1733  matrix_ = ~rhs;
1734 
1735  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square unilower matrix detected" );
1736  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1737 
1738  return *this;
1739 }
1741 //*************************************************************************************************
1742 
1743 
1744 //*************************************************************************************************
1757 template< typename MT // Type of the adapted dense matrix
1758  , bool SO > // Storage order of the adapted dense matrix
1759 template< typename MT2 // Type of the right-hand side matrix
1760  , bool SO2 > // Storage order of the right-hand side matrix
1761 inline EnableIf_< IsComputation<MT2>, UniLowerMatrix<MT,SO,true>& >
1762  UniLowerMatrix<MT,SO,true>::operator=( const Matrix<MT2,SO2>& rhs )
1763 {
1764  if( IsStrictlyTriangular<MT2>::value || ( !IsSquare<MT2>::value && !isSquare( ~rhs ) ) ) {
1765  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to unilower matrix" );
1766  }
1767 
1768  if( IsUniLower<MT2>::value ) {
1769  matrix_ = ~rhs;
1770  }
1771  else {
1772  MT tmp( ~rhs );
1773 
1774  if( !isUniLower( tmp ) ) {
1775  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to unilower matrix" );
1776  }
1777 
1778  matrix_ = std::move( tmp );
1779  }
1780 
1781  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square unilower matrix detected" );
1782  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1783 
1784  return *this;
1785 }
1787 //*************************************************************************************************
1788 
1789 
1790 //*************************************************************************************************
1803 template< typename MT // Type of the adapted dense matrix
1804  , bool SO > // Storage order of the adapted dense matrix
1805 template< typename MT2 // Type of the right-hand side matrix
1806  , bool SO2 > // Storage order of the right-hand side matrix
1807 inline DisableIf_< IsComputation<MT2>, UniLowerMatrix<MT,SO,true>& >
1808  UniLowerMatrix<MT,SO,true>::operator+=( const Matrix<MT2,SO2>& rhs )
1809 {
1810  if( IsUpper<MT2>::value || IsUniTriangular<MT2>::value ||
1811  ( !IsStrictlyLower<MT2>::value && !isStrictlyLower( ~rhs ) ) ) {
1812  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to unilower matrix" );
1813  }
1814 
1815  matrix_ += ~rhs;
1816 
1817  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square unilower matrix detected" );
1818  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1819 
1820  return *this;
1821 }
1823 //*************************************************************************************************
1824 
1825 
1826 //*************************************************************************************************
1839 template< typename MT // Type of the adapted dense matrix
1840  , bool SO > // Storage order of the adapted dense matrix
1841 template< typename MT2 // Type of the right-hand side matrix
1842  , bool SO2 > // Storage order of the right-hand side matrix
1843 inline EnableIf_< IsComputation<MT2>, UniLowerMatrix<MT,SO,true>& >
1844  UniLowerMatrix<MT,SO,true>::operator+=( const Matrix<MT2,SO2>& rhs )
1845 {
1846  if( IsUpper<MT2>::value || IsUniTriangular<MT2>::value ||
1847  ( !IsSquare<MT2>::value && !isSquare( ~rhs ) ) ) {
1848  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to unilower matrix" );
1849  }
1850 
1851  if( IsStrictlyLower<MT2>::value ) {
1852  matrix_ += ~rhs;
1853  }
1854  else {
1855  const ResultType_<MT2> tmp( ~rhs );
1856 
1857  if( !isStrictlyLower( tmp ) ) {
1858  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to unilower matrix" );
1859  }
1860 
1861  matrix_ += tmp;
1862  }
1863 
1864  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square unilower matrix detected" );
1865  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1866 
1867  return *this;
1868 }
1870 //*************************************************************************************************
1871 
1872 
1873 //*************************************************************************************************
1886 template< typename MT // Type of the adapted dense matrix
1887  , bool SO > // Storage order of the adapted dense matrix
1888 template< typename MT2 // Type of the right-hand side matrix
1889  , bool SO2 > // Storage order of the right-hand side matrix
1890 inline DisableIf_< IsComputation<MT2>, UniLowerMatrix<MT,SO,true>& >
1891  UniLowerMatrix<MT,SO,true>::operator-=( const Matrix<MT2,SO2>& rhs )
1892 {
1893  if( IsUpper<MT2>::value || IsUniTriangular<MT2>::value ||
1894  ( !IsStrictlyLower<MT2>::value && !isStrictlyLower( ~rhs ) ) ) {
1895  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to unilower matrix" );
1896  }
1897 
1898  matrix_ -= ~rhs;
1899 
1900  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square unilower matrix detected" );
1901  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1902 
1903  return *this;
1904 }
1906 //*************************************************************************************************
1907 
1908 
1909 //*************************************************************************************************
1922 template< typename MT // Type of the adapted dense matrix
1923  , bool SO > // Storage order of the adapted dense matrix
1924 template< typename MT2 // Type of the right-hand side matrix
1925  , bool SO2 > // Storage order of the right-hand side matrix
1926 inline EnableIf_< IsComputation<MT2>, UniLowerMatrix<MT,SO,true>& >
1927  UniLowerMatrix<MT,SO,true>::operator-=( const Matrix<MT2,SO2>& rhs )
1928 {
1929  if( IsUpper<MT2>::value || IsUniTriangular<MT2>::value ||
1930  ( !IsSquare<MT2>::value && !isSquare( ~rhs ) ) ) {
1931  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to unilower matrix" );
1932  }
1933 
1934  if( IsStrictlyLower<MT2>::value ) {
1935  matrix_ -= ~rhs;
1936  }
1937  else {
1938  const ResultType_<MT2> tmp( ~rhs );
1939 
1940  if( !isStrictlyLower( tmp ) ) {
1941  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to unilower matrix" );
1942  }
1943 
1944  matrix_ -= tmp;
1945  }
1946 
1947  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square unilower matrix detected" );
1948  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1949 
1950  return *this;
1951 }
1953 //*************************************************************************************************
1954 
1955 
1956 //*************************************************************************************************
1968 template< typename MT // Type of the adapted dense matrix
1969  , bool SO > // Storage order of the adapted dense matrix
1970 template< typename MT2 // Type of the right-hand side matrix
1971  , bool SO2 > // Storage order of the right-hand side matrix
1972 inline UniLowerMatrix<MT,SO,true>&
1973  UniLowerMatrix<MT,SO,true>::operator*=( const Matrix<MT2,SO2>& rhs )
1974 {
1975  if( matrix_.rows() != (~rhs).columns() ) {
1976  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to unilower matrix" );
1977  }
1978 
1979  MT tmp( matrix_ * ~rhs );
1980 
1981  if( !isUniLower( tmp ) ) {
1982  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to unilower matrix" );
1983  }
1984 
1985  matrix_ = std::move( tmp );
1986 
1987  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square unilower matrix detected" );
1988  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1989 
1990  return *this;
1991 }
1993 //*************************************************************************************************
1994 
1995 
1996 
1997 
1998 //=================================================================================================
1999 //
2000 // UTILITY FUNCTIONS
2001 //
2002 //=================================================================================================
2003 
2004 //*************************************************************************************************
2010 template< typename MT // Type of the adapted dense matrix
2011  , bool SO > // Storage order of the adapted dense matrix
2012 inline size_t UniLowerMatrix<MT,SO,true>::rows() const noexcept
2013 {
2014  return matrix_.rows();
2015 }
2017 //*************************************************************************************************
2018 
2019 
2020 //*************************************************************************************************
2026 template< typename MT // Type of the adapted dense matrix
2027  , bool SO > // Storage order of the adapted dense matrix
2028 inline size_t UniLowerMatrix<MT,SO,true>::columns() const noexcept
2029 {
2030  return matrix_.columns();
2031 }
2033 //*************************************************************************************************
2034 
2035 
2036 //*************************************************************************************************
2047 template< typename MT // Type of the adapted dense matrix
2048  , bool SO > // Storage order of the adapted dense matrix
2049 inline size_t UniLowerMatrix<MT,SO,true>::spacing() const noexcept
2050 {
2051  return matrix_.spacing();
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 UniLowerMatrix<MT,SO,true>::capacity() const noexcept
2066 {
2067  return matrix_.capacity();
2068 }
2070 //*************************************************************************************************
2071 
2072 
2073 //*************************************************************************************************
2085 template< typename MT // Type of the adapted dense matrix
2086  , bool SO > // Storage order of the adapted dense matrix
2087 inline size_t UniLowerMatrix<MT,SO,true>::capacity( size_t i ) const noexcept
2088 {
2089  return matrix_.capacity(i);
2090 }
2092 //*************************************************************************************************
2093 
2094 
2095 //*************************************************************************************************
2101 template< typename MT // Type of the adapted dense matrix
2102  , bool SO > // Storage order of the adapted dense matrix
2103 inline size_t UniLowerMatrix<MT,SO,true>::nonZeros() const
2104 {
2105  return matrix_.nonZeros();
2106 }
2108 //*************************************************************************************************
2109 
2110 
2111 //*************************************************************************************************
2123 template< typename MT // Type of the adapted dense matrix
2124  , bool SO > // Storage order of the adapted dense matrix
2125 inline size_t UniLowerMatrix<MT,SO,true>::nonZeros( size_t i ) const
2126 {
2127  return matrix_.nonZeros(i);
2128 }
2130 //*************************************************************************************************
2131 
2132 
2133 //*************************************************************************************************
2139 template< typename MT // Type of the adapted dense matrix
2140  , bool SO > // Storage order of the adapted dense matrix
2142 {
2143  using blaze::clear;
2144 
2145  if( SO ) {
2146  for( size_t j=0UL; j<columns(); ++j )
2147  for( size_t i=j+1UL; i<rows(); ++i )
2148  clear( matrix_(i,j) );
2149  }
2150  else {
2151  for( size_t i=1UL; i<rows(); ++i )
2152  for( size_t j=0UL; j<i; ++j )
2153  clear( matrix_(i,j) );
2154  }
2155 }
2157 //*************************************************************************************************
2158 
2159 
2160 //*************************************************************************************************
2173 template< typename MT // Type of the adapted dense matrix
2174  , bool SO > // Storage order of the adapted dense matrix
2175 inline void UniLowerMatrix<MT,SO,true>::reset( size_t i )
2176 {
2177  using blaze::clear;
2178 
2179  if( SO ) {
2180  for( size_t j=i+1UL; j<rows(); ++j )
2181  clear( matrix_(j,i) );
2182  }
2183  else {
2184  for( size_t j=0UL; j<i; ++j )
2185  clear( matrix_(i,j) );
2186  }
2187 }
2189 //*************************************************************************************************
2190 
2191 
2192 //*************************************************************************************************
2204 template< typename MT // Type of the adapted dense matrix
2205  , bool SO > // Storage order of the adapted dense matrix
2207 {
2208  using blaze::clear;
2209 
2210  if( IsResizable<MT>::value ) {
2211  clear( matrix_ );
2212  }
2213  else {
2214  reset();
2215  }
2216 }
2218 //*************************************************************************************************
2219 
2220 
2221 //*************************************************************************************************
2257 template< typename MT // Type of the adapted dense matrix
2258  , bool SO > // Storage order of the adapted dense matrix
2259 void UniLowerMatrix<MT,SO,true>::resize( size_t n, bool preserve )
2260 {
2262 
2263  UNUSED_PARAMETER( preserve );
2264 
2265  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square unilower matrix detected" );
2266 
2267  const size_t oldsize( matrix_.rows() );
2268 
2269  matrix_.resize( n, n, true );
2270 
2271  if( n > oldsize )
2272  {
2273  const size_t increment( n - oldsize );
2274  submatrix( matrix_, 0UL, oldsize, n-1UL, increment ).reset();
2275 
2276  for( size_t i=oldsize; i<n; ++i )
2277  matrix_(i,i) = ElementType(1);
2278  }
2279 }
2281 //*************************************************************************************************
2282 
2283 
2284 //*************************************************************************************************
2297 template< typename MT // Type of the adapted dense matrix
2298  , bool SO > // Storage order of the adapted dense matrix
2299 inline void UniLowerMatrix<MT,SO,true>::extend( size_t n, bool preserve )
2300 {
2302 
2303  UNUSED_PARAMETER( preserve );
2304 
2305  resize( rows() + n, true );
2306 }
2307 //*************************************************************************************************
2308 
2309 
2310 //*************************************************************************************************
2320 template< typename MT // Type of the adapted dense matrix
2321  , bool SO > // Storage order of the adapted dense matrix
2322 inline void UniLowerMatrix<MT,SO,true>::reserve( size_t elements )
2323 {
2324  matrix_.reserve( elements );
2325 }
2327 //*************************************************************************************************
2328 
2329 
2330 //*************************************************************************************************
2337 template< typename MT // Type of the adapted dense matrix
2338  , bool SO > // Storage order of the adapted dense matrix
2339 inline void UniLowerMatrix<MT,SO,true>::swap( UniLowerMatrix& m ) noexcept
2340 {
2341  using std::swap;
2342 
2343  swap( matrix_, m.matrix_ );
2344 }
2346 //*************************************************************************************************
2347 
2348 
2349 //*************************************************************************************************
2361 template< typename MT // Type of the adapted dense matrix
2362  , bool SO > // Storage order of the adapted dense matrix
2363 inline constexpr size_t UniLowerMatrix<MT,SO,true>::maxNonZeros() noexcept
2364 {
2366 
2367  return maxNonZeros( Rows<MT>::value );
2368 }
2370 //*************************************************************************************************
2371 
2372 
2373 //*************************************************************************************************
2383 template< typename MT // Type of the adapted dense matrix
2384  , bool SO > // Storage order of the adapted dense matrix
2385 inline constexpr size_t UniLowerMatrix<MT,SO,true>::maxNonZeros( size_t n ) noexcept
2386 {
2387  return ( ( n + 1UL ) * n ) / 2UL;
2388 }
2390 //*************************************************************************************************
2391 
2392 
2393 
2394 
2395 //=================================================================================================
2396 //
2397 // DEBUGGING FUNCTIONS
2398 //
2399 //=================================================================================================
2400 
2401 //*************************************************************************************************
2411 template< typename MT // Type of the adapted dense matrix
2412  , bool SO > // Storage order of the adapted dense matrix
2413 inline bool UniLowerMatrix<MT,SO,true>::isIntact() const noexcept
2414 {
2415  using blaze::isIntact;
2416 
2417  return ( isIntact( matrix_ ) && isUniLower( matrix_ ) );
2418 }
2420 //*************************************************************************************************
2421 
2422 
2423 
2424 
2425 //=================================================================================================
2426 //
2427 // EXPRESSION TEMPLATE EVALUATION FUNCTIONS
2428 //
2429 //=================================================================================================
2430 
2431 //*************************************************************************************************
2442 template< typename MT // Type of the adapted dense matrix
2443  , bool SO > // Storage order of the adapted dense matrix
2444 template< typename Other > // Data type of the foreign expression
2445 inline bool UniLowerMatrix<MT,SO,true>::canAlias( const Other* alias ) const noexcept
2446 {
2447  return matrix_.canAlias( alias );
2448 }
2450 //*************************************************************************************************
2451 
2452 
2453 //*************************************************************************************************
2464 template< typename MT // Type of the adapted dense matrix
2465  , bool SO > // Storage order of the adapted dense matrix
2466 template< typename Other > // Data type of the foreign expression
2467 inline bool UniLowerMatrix<MT,SO,true>::isAliased( const Other* alias ) const noexcept
2468 {
2469  return matrix_.isAliased( alias );
2470 }
2472 //*************************************************************************************************
2473 
2474 
2475 //*************************************************************************************************
2485 template< typename MT // Type of the adapted dense matrix
2486  , bool SO > // Storage order of the adapted dense matrix
2487 inline bool UniLowerMatrix<MT,SO,true>::isAligned() const noexcept
2488 {
2489  return matrix_.isAligned();
2490 }
2492 //*************************************************************************************************
2493 
2494 
2495 //*************************************************************************************************
2506 template< typename MT // Type of the adapted dense matrix
2507  , bool SO > // Storage order of the adapted dense matrix
2508 inline bool UniLowerMatrix<MT,SO,true>::canSMPAssign() const noexcept
2509 {
2510  return matrix_.canSMPAssign();
2511 }
2513 //*************************************************************************************************
2514 
2515 
2516 //*************************************************************************************************
2532 template< typename MT // Type of the adapted dense matrix
2533  , bool SO > // Storage order of the adapted dense matrix
2534 BLAZE_ALWAYS_INLINE typename UniLowerMatrix<MT,SO,true>::SIMDType
2535  UniLowerMatrix<MT,SO,true>::load( size_t i, size_t j ) const noexcept
2536 {
2537  return matrix_.load( i, j );
2538 }
2540 //*************************************************************************************************
2541 
2542 
2543 //*************************************************************************************************
2559 template< typename MT // Type of the adapted dense matrix
2560  , bool SO > // Storage order of the adapted dense matrix
2561 BLAZE_ALWAYS_INLINE typename UniLowerMatrix<MT,SO,true>::SIMDType
2562  UniLowerMatrix<MT,SO,true>::loada( size_t i, size_t j ) const noexcept
2563 {
2564  return matrix_.loada( i, j );
2565 }
2567 //*************************************************************************************************
2568 
2569 
2570 //*************************************************************************************************
2586 template< typename MT // Type of the adapted dense matrix
2587  , bool SO > // Storage order of the adapted dense matrix
2588 BLAZE_ALWAYS_INLINE typename UniLowerMatrix<MT,SO,true>::SIMDType
2589  UniLowerMatrix<MT,SO,true>::loadu( size_t i, size_t j ) const noexcept
2590 {
2591  return matrix_.loadu( i, j );
2592 }
2594 //*************************************************************************************************
2595 
2596 
2597 
2598 
2599 //=================================================================================================
2600 //
2601 // CONSTRUCTION FUNCTIONS
2602 //
2603 //=================================================================================================
2604 
2605 //*************************************************************************************************
2612 template< typename MT // Type of the adapted dense matrix
2613  , bool SO > // Storage order of the adapted dense matrix
2614 inline const MT UniLowerMatrix<MT,SO,true>::construct( size_t n, TrueType )
2615 {
2617 
2618  MT tmp( n, n, ElementType() );
2619 
2620  for( size_t i=0UL; i<n; ++i )
2621  tmp(i,i) = ElementType(1);
2622 
2623  return tmp;
2624 }
2626 //*************************************************************************************************
2627 
2628 
2629 //*************************************************************************************************
2636 template< typename MT // Type of the adapted dense matrix
2637  , bool SO > // Storage order of the adapted dense matrix
2638 inline const MT UniLowerMatrix<MT,SO,true>::construct( const ElementType& init, FalseType )
2639 {
2642 
2643  MT tmp;
2644 
2645  if( SO ) {
2646  for( size_t j=0UL; j<tmp.columns(); ++j ) {
2647  tmp(j,j) = ElementType(1);
2648  for( size_t i=j+1UL; i<tmp.rows(); ++i )
2649  tmp(i,j) = init;
2650  }
2651  }
2652  else {
2653  for( size_t i=0UL; i<tmp.rows(); ++i ) {
2654  for( size_t j=0UL; j<i; ++j )
2655  tmp(i,j) = init;
2656  tmp(i,i) = ElementType(1);
2657  }
2658  }
2659 
2660  return tmp;
2661 }
2663 //*************************************************************************************************
2664 
2665 
2666 //*************************************************************************************************
2677 template< typename MT // Type of the adapted dense matrix
2678  , bool SO > // Storage order of the adapted dense matrix
2679 template< typename MT2 // Type of the foreign matrix
2680  , bool SO2 // Storage order of the foreign matrix
2681  , typename T > // Type of the third argument
2682 inline const MT UniLowerMatrix<MT,SO,true>::construct( const Matrix<MT2,SO2>& m, T )
2683 {
2684  const MT tmp( ~m );
2685 
2686  if( IsStrictlyTriangular<MT2>::value || ( !IsUniLower<MT2>::value && !isUniLower( tmp ) ) ) {
2687  BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of unilower matrix" );
2688  }
2689 
2690  return tmp;
2691 }
2693 //*************************************************************************************************
2694 
2695 } // namespace blaze
2696 
2697 #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 the implementation of the base template of the UniLowerMatrix.
Header file for auxiliary alias declarations.
Constraint on the data type.
#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
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
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
Header file for the IsUniLower type trait.
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.
Header file for the IsStrictlyTriangular 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
bool isUniLower(const DenseMatrix< MT, SO > &dm)
Checks if the given dense matrix is a lower unitriangular matrix.
Definition: DenseMatrix.h:1113
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 the UniLowerProxy class.
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_BE_NUMERIC_TYPE(T)
Constraint on the data type.In case the given data type T is not a numeric (integral or floating poin...
Definition: Numeric.h:61
#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 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
Header file for the IsUpper type trait.
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.