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>
61 #include <blaze/math/Exception.h>
64 #include <blaze/math/shims/Clear.h>
73 #include <blaze/system/Inline.h>
74 #include <blaze/util/Assert.h>
80 #include <blaze/util/DisableIf.h>
81 #include <blaze/util/EnableIf.h>
82 #include <blaze/util/FalseType.h>
84 #include <blaze/util/TrueType.h>
85 #include <blaze/util/Types.h>
87 #include <blaze/util/Unused.h>
88 
89 
90 namespace blaze {
91 
92 //=================================================================================================
93 //
94 // CLASS TEMPLATE SPECIALIZATION FOR DENSE MATRICES
95 //
96 //=================================================================================================
97 
98 //*************************************************************************************************
106 template< typename MT // Type of the adapted dense matrix
107  , bool SO > // Storage order of the adapted dense matrix
108 class LowerMatrix<MT,SO,true>
109  : public DenseMatrix< LowerMatrix<MT,SO,true>, SO >
110 {
111  private:
112  //**Type definitions****************************************************************************
113  using OT = OppositeType_t<MT>;
114  using TT = TransposeType_t<MT>;
115  using ET = ElementType_t<MT>;
116  //**********************************************************************************************
117 
118  public:
119  //**Type definitions****************************************************************************
120  using This = LowerMatrix<MT,SO,true>;
121  using BaseType = DenseMatrix<This,SO>;
122  using ResultType = This;
123  using OppositeType = LowerMatrix<OT,!SO,true>;
124  using TransposeType = UpperMatrix<TT,!SO,true>;
125  using ElementType = ET;
126  using SIMDType = SIMDType_t<MT>;
127  using ReturnType = ReturnType_t<MT>;
128  using CompositeType = const This&;
129  using Reference = LowerProxy<MT>;
130  using ConstReference = ConstReference_t<MT>;
131  using Pointer = Pointer_t<MT>;
132  using ConstPointer = ConstPointer_t<MT>;
133  using ConstIterator = ConstIterator_t<MT>;
134  //**********************************************************************************************
135 
136  //**Rebind struct definition********************************************************************
139  template< typename NewType > // Data type of the other matrix
140  struct Rebind {
142  using Other = LowerMatrix< typename MT::template Rebind<NewType>::Other >;
143  };
144  //**********************************************************************************************
145 
146  //**Resize struct definition********************************************************************
149  template< size_t NewM // Number of rows of the other matrix
150  , size_t NewN > // Number of columns of the other matrix
151  struct Resize {
153  using Other = LowerMatrix< typename MT::template Resize<NewM,NewN>::Other >;
154  };
155  //**********************************************************************************************
156 
157  //**Iterator class definition*******************************************************************
160  class Iterator
161  {
162  public:
163  //**Type definitions*************************************************************************
164  using IteratorCategory = std::random_access_iterator_tag;
165  using ValueType = ElementType_t<MT>;
166  using PointerType = LowerProxy<MT>;
167  using ReferenceType = LowerProxy<MT>;
168  using DifferenceType = ptrdiff_t;
169 
170  // STL iterator requirements
171  using iterator_category = IteratorCategory;
172  using value_type = ValueType;
173  using pointer = PointerType;
174  using reference = ReferenceType;
175  using difference_type = DifferenceType;
176  //*******************************************************************************************
177 
178  //**Constructor******************************************************************************
181  inline Iterator() noexcept
182  : matrix_( nullptr ) // Reference to the adapted dense matrix
183  , row_ ( 0UL ) // The current row index of the iterator
184  , column_( 0UL ) // The current column index of the iterator
185  {}
186  //*******************************************************************************************
187 
188  //**Constructor******************************************************************************
195  inline Iterator( MT& matrix, size_t row, size_t column ) noexcept
196  : matrix_( &matrix ) // Reference to the adapted dense matrix
197  , row_ ( row ) // The current row-index of the iterator
198  , column_( column ) // The current column-index of the iterator
199  {}
200  //*******************************************************************************************
201 
202  //**Addition assignment operator*************************************************************
208  inline Iterator& operator+=( size_t inc ) noexcept {
209  ( SO )?( row_ += inc ):( column_ += inc );
210  return *this;
211  }
212  //*******************************************************************************************
213 
214  //**Subtraction assignment operator**********************************************************
220  inline Iterator& operator-=( size_t dec ) noexcept {
221  ( SO )?( row_ -= dec ):( column_ -= dec );
222  return *this;
223  }
224  //*******************************************************************************************
225 
226  //**Prefix increment operator****************************************************************
231  inline Iterator& operator++() noexcept {
232  ( SO )?( ++row_ ):( ++column_ );
233  return *this;
234  }
235  //*******************************************************************************************
236 
237  //**Postfix increment operator***************************************************************
242  inline const Iterator operator++( int ) noexcept {
243  const Iterator tmp( *this );
244  ++(*this);
245  return tmp;
246  }
247  //*******************************************************************************************
248 
249  //**Prefix decrement operator****************************************************************
254  inline Iterator& operator--() noexcept {
255  ( SO )?( --row_ ):( --column_ );
256  return *this;
257  }
258  //*******************************************************************************************
259 
260  //**Postfix decrement operator***************************************************************
265  inline const Iterator operator--( int ) noexcept {
266  const Iterator tmp( *this );
267  --(*this);
268  return tmp;
269  }
270  //*******************************************************************************************
271 
272  //**Element access operator******************************************************************
277  inline ReferenceType operator*() const {
278  return ReferenceType( *matrix_, row_, column_ );
279  }
280  //*******************************************************************************************
281 
282  //**Element access operator******************************************************************
287  inline PointerType operator->() const {
288  return PointerType( *matrix_, row_, column_ );
289  }
290  //*******************************************************************************************
291 
292  //**Load function****************************************************************************
302  inline SIMDType load() const {
303  return (*matrix_).load(row_,column_);
304  }
305  //*******************************************************************************************
306 
307  //**Loada function***************************************************************************
317  inline SIMDType loada() const {
318  return (*matrix_).loada(row_,column_);
319  }
320  //*******************************************************************************************
321 
322  //**Loadu function***************************************************************************
332  inline SIMDType loadu() const {
333  return (*matrix_).loadu(row_,column_);
334  }
335  //*******************************************************************************************
336 
337  //**Conversion operator**********************************************************************
342  inline operator ConstIterator() const {
343  if( SO )
344  return matrix_->begin( column_ ) + row_;
345  else
346  return matrix_->begin( row_ ) + column_;
347  }
348  //*******************************************************************************************
349 
350  //**Equality operator************************************************************************
357  friend inline bool operator==( const Iterator& lhs, const Iterator& rhs ) noexcept {
358  return ( SO )?( lhs.row_ == rhs.row_ ):( lhs.column_ == rhs.column_ );
359  }
360  //*******************************************************************************************
361 
362  //**Equality operator************************************************************************
369  friend inline bool operator==( const Iterator& lhs, const ConstIterator& rhs ) {
370  return ( ConstIterator( lhs ) == rhs );
371  }
372  //*******************************************************************************************
373 
374  //**Equality operator************************************************************************
381  friend inline bool operator==( const ConstIterator& lhs, const Iterator& rhs ) {
382  return ( lhs == ConstIterator( rhs ) );
383  }
384  //*******************************************************************************************
385 
386  //**Inequality operator**********************************************************************
393  friend inline bool operator!=( const Iterator& lhs, const Iterator& rhs ) noexcept {
394  return ( SO )?( lhs.row_ != rhs.row_ ):( lhs.column_ != rhs.column_ );
395  }
396  //*******************************************************************************************
397 
398  //**Inequality operator**********************************************************************
405  friend inline bool operator!=( const Iterator& lhs, const ConstIterator& rhs ) {
406  return ( ConstIterator( lhs ) != rhs );
407  }
408  //*******************************************************************************************
409 
410  //**Inequality operator**********************************************************************
417  friend inline bool operator!=( const ConstIterator& lhs, const Iterator& rhs ) {
418  return ( lhs != ConstIterator( rhs ) );
419  }
420  //*******************************************************************************************
421 
422  //**Less-than operator***********************************************************************
429  friend inline bool operator<( const Iterator& lhs, const Iterator& rhs ) noexcept {
430  return ( SO )?( lhs.row_ < rhs.row_ ):( lhs.column_ < rhs.column_ );
431  }
432  //*******************************************************************************************
433 
434  //**Less-than operator***********************************************************************
441  friend inline bool operator<( const Iterator& lhs, const ConstIterator& rhs ) {
442  return ( ConstIterator( lhs ) < rhs );
443  }
444  //*******************************************************************************************
445 
446  //**Less-than operator***********************************************************************
453  friend inline bool operator<( const ConstIterator& lhs, const Iterator& rhs ) {
454  return ( lhs < ConstIterator( rhs ) );
455  }
456  //*******************************************************************************************
457 
458  //**Greater-than operator********************************************************************
465  friend inline bool operator>( const Iterator& lhs, const Iterator& rhs ) noexcept {
466  return ( SO )?( lhs.row_ > rhs.row_ ):( lhs.column_ > rhs.column_ );
467  }
468  //*******************************************************************************************
469 
470  //**Greater-than operator********************************************************************
477  friend inline bool operator>( const Iterator& lhs, const ConstIterator& rhs ) {
478  return ( ConstIterator( lhs ) > rhs );
479  }
480  //*******************************************************************************************
481 
482  //**Greater-than operator********************************************************************
489  friend inline bool operator>( const ConstIterator& lhs, const Iterator& rhs ) {
490  return ( lhs > ConstIterator( rhs ) );
491  }
492  //*******************************************************************************************
493 
494  //**Less-or-equal-than operator**************************************************************
501  friend inline bool operator<=( const Iterator& lhs, const Iterator& rhs ) noexcept {
502  return ( SO )?( lhs.row_ <= rhs.row_ ):( lhs.column_ <= rhs.column_ );
503  }
504  //*******************************************************************************************
505 
506  //**Less-or-equal-than operator**************************************************************
513  friend inline bool operator<=( const Iterator& lhs, const ConstIterator& rhs ) {
514  return ( ConstIterator( lhs ) <= rhs );
515  }
516  //*******************************************************************************************
517 
518  //**Less-or-equal-than operator**************************************************************
525  friend inline bool operator<=( const ConstIterator& lhs, const Iterator& rhs ) {
526  return ( lhs <= ConstIterator( rhs ) );
527  }
528  //*******************************************************************************************
529 
530  //**Greater-or-equal-than operator***********************************************************
537  friend inline bool operator>=( const Iterator& lhs, const Iterator& rhs ) noexcept {
538  return ( SO )?( lhs.row_ >= rhs.row_ ):( lhs.column_ >= rhs.column_ );
539  }
540  //*******************************************************************************************
541 
542  //**Greater-or-equal-than operator***********************************************************
549  friend inline bool operator>=( const Iterator& lhs, const ConstIterator& rhs ) {
550  return ( ConstIterator( lhs ) >= rhs );
551  }
552  //*******************************************************************************************
553 
554  //**Greater-or-equal-than operator***********************************************************
561  friend inline bool operator>=( const ConstIterator& lhs, const Iterator& rhs ) {
562  return ( lhs >= ConstIterator( rhs ) );
563  }
564  //*******************************************************************************************
565 
566  //**Subtraction operator*********************************************************************
572  inline DifferenceType operator-( const Iterator& rhs ) const noexcept {
573  return ( SO )?( row_ - rhs.row_ ):( column_ - rhs.column_ );
574  }
575  //*******************************************************************************************
576 
577  //**Addition operator************************************************************************
584  friend inline const Iterator operator+( const Iterator& it, size_t inc ) noexcept {
585  if( SO )
586  return Iterator( *it.matrix_, it.row_ + inc, it.column_ );
587  else
588  return Iterator( *it.matrix_, it.row_, it.column_ + inc );
589  }
590  //*******************************************************************************************
591 
592  //**Addition operator************************************************************************
599  friend inline const Iterator operator+( size_t inc, const Iterator& it ) noexcept {
600  if( SO )
601  return Iterator( *it.matrix_, it.row_ + inc, it.column_ );
602  else
603  return Iterator( *it.matrix_, it.row_, it.column_ + inc );
604  }
605  //*******************************************************************************************
606 
607  //**Subtraction operator*********************************************************************
614  friend inline const Iterator operator-( const Iterator& it, size_t dec ) noexcept {
615  if( SO )
616  return Iterator( *it.matrix_, it.row_ - dec, it.column_ );
617  else
618  return Iterator( *it.matrix_, it.row_, it.column_ - dec );
619  }
620  //*******************************************************************************************
621 
622  private:
623  //**Member variables*************************************************************************
624  MT* matrix_;
625  size_t row_;
626  size_t column_;
627  //*******************************************************************************************
628  };
629  //**********************************************************************************************
630 
631  //**Compilation flags***************************************************************************
633  static constexpr bool simdEnabled = MT::simdEnabled;
634 
636  static constexpr bool smpAssignable = MT::smpAssignable;
637  //**********************************************************************************************
638 
639  //**Constructors********************************************************************************
642  explicit inline LowerMatrix();
643  template< typename A1 > explicit inline LowerMatrix( const A1& a1 );
644  explicit inline LowerMatrix( size_t n, const ElementType& init );
645 
646  explicit inline LowerMatrix( initializer_list< initializer_list<ElementType> > list );
647 
648  template< typename Other >
649  explicit inline LowerMatrix( size_t n, const Other* array );
650 
651  template< typename Other, size_t N >
652  explicit inline LowerMatrix( const Other (&array)[N][N] );
653 
654  explicit inline LowerMatrix( ElementType* ptr, size_t n );
655  explicit inline LowerMatrix( ElementType* ptr, size_t n, size_t nn );
656 
657  inline LowerMatrix( const LowerMatrix& m );
658  inline LowerMatrix( LowerMatrix&& m ) noexcept;
660  //**********************************************************************************************
661 
662  //**Destructor**********************************************************************************
665  ~LowerMatrix() = default;
667  //**********************************************************************************************
668 
669  //**Data access functions***********************************************************************
672  inline Reference operator()( size_t i, size_t j );
673  inline ConstReference operator()( size_t i, size_t j ) const;
674  inline Reference at( size_t i, size_t j );
675  inline ConstReference at( size_t i, size_t j ) const;
676  inline ConstPointer data () const noexcept;
677  inline ConstPointer data ( size_t i ) const noexcept;
678  inline Iterator begin ( size_t i );
679  inline ConstIterator begin ( size_t i ) const;
680  inline ConstIterator cbegin( size_t i ) const;
681  inline Iterator end ( size_t i );
682  inline ConstIterator end ( size_t i ) const;
683  inline ConstIterator cend ( size_t i ) const;
685  //**********************************************************************************************
686 
687  //**Assignment operators************************************************************************
690  inline LowerMatrix& operator=( const ElementType& rhs );
691  inline LowerMatrix& operator=( initializer_list< initializer_list<ElementType> > list );
692 
693  template< typename Other, size_t N >
694  inline LowerMatrix& operator=( const Other (&array)[N][N] );
695 
696  inline LowerMatrix& operator=( const LowerMatrix& rhs );
697  inline LowerMatrix& operator=( LowerMatrix&& rhs ) noexcept;
698 
699  template< typename MT2, bool SO2 >
700  inline auto operator=( const Matrix<MT2,SO2>& rhs )
701  -> DisableIf_t< IsComputation_v<MT2>, LowerMatrix& >;
702 
703  template< typename MT2, bool SO2 >
704  inline auto operator=( const Matrix<MT2,SO2>& rhs )
705  -> EnableIf_t< IsComputation_v<MT2>, LowerMatrix& >;
706 
707  template< typename MT2, bool SO2 >
708  inline auto operator+=( const Matrix<MT2,SO2>& rhs )
709  -> DisableIf_t< IsComputation_v<MT2>, LowerMatrix& >;
710 
711  template< typename MT2, bool SO2 >
712  inline auto operator+=( const Matrix<MT2,SO2>& rhs )
713  -> EnableIf_t< IsComputation_v<MT2>, LowerMatrix& >;
714 
715  template< typename MT2, bool SO2 >
716  inline auto operator-=( const Matrix<MT2,SO2>& rhs )
717  -> DisableIf_t< IsComputation_v<MT2>, LowerMatrix& >;
718 
719  template< typename MT2, bool SO2 >
720  inline auto operator-=( const Matrix<MT2,SO2>& rhs )
721  -> EnableIf_t< IsComputation_v<MT2>, LowerMatrix& >;
722 
723  template< typename MT2, bool SO2 >
724  inline auto operator%=( const Matrix<MT2,SO2>& rhs ) -> LowerMatrix&;
725 
726  template< typename ST >
727  inline auto operator*=( ST rhs ) -> EnableIf_t< IsNumeric_v<ST>, LowerMatrix& >;
728 
729  template< typename ST >
730  inline auto operator/=( ST rhs ) -> EnableIf_t< IsNumeric_v<ST>, LowerMatrix& >;
732  //**********************************************************************************************
733 
734  //**Utility functions***************************************************************************
737  inline size_t rows() const noexcept;
738  inline size_t columns() const noexcept;
739  inline size_t spacing() const noexcept;
740  inline size_t capacity() const noexcept;
741  inline size_t capacity( size_t i ) const noexcept;
742  inline size_t nonZeros() const;
743  inline size_t nonZeros( size_t i ) const;
744  inline void reset();
745  inline void reset( size_t i );
746  inline void clear();
747  void resize ( size_t n, bool preserve=true );
748  inline void extend ( size_t n, bool preserve=true );
749  inline void reserve( size_t elements );
750  inline void shrinkToFit();
751  inline void swap( LowerMatrix& m ) noexcept;
752 
753  static inline constexpr size_t maxNonZeros() noexcept;
754  static inline constexpr size_t maxNonZeros( size_t n ) noexcept;
756  //**********************************************************************************************
757 
758  //**Numeric functions***************************************************************************
761  template< typename Other > inline LowerMatrix& scale( const Other& scalar );
763  //**********************************************************************************************
764 
765  //**Debugging functions*************************************************************************
768  inline bool isIntact() const noexcept;
770  //**********************************************************************************************
771 
772  //**Expression template evaluation functions****************************************************
775  template< typename Other > inline bool canAlias ( const Other* alias ) const noexcept;
776  template< typename Other > inline bool isAliased( const Other* alias ) const noexcept;
777 
778  inline bool isAligned () const noexcept;
779  inline bool canSMPAssign() const noexcept;
780 
781  BLAZE_ALWAYS_INLINE SIMDType load ( size_t i, size_t j ) const noexcept;
782  BLAZE_ALWAYS_INLINE SIMDType loada( size_t i, size_t j ) const noexcept;
783  BLAZE_ALWAYS_INLINE SIMDType loadu( size_t i, size_t j ) const noexcept;
785  //**********************************************************************************************
786 
787  private:
788  //**Construction functions**********************************************************************
791  inline const MT construct( size_t n , TrueType );
792  inline const MT construct( const ElementType& value, FalseType );
793 
794  template< typename MT2, bool SO2, typename T >
795  inline const MT construct( const Matrix<MT2,SO2>& m, T );
797  //**********************************************************************************************
798 
799  //**Member variables****************************************************************************
802  MT matrix_;
803 
804  //**********************************************************************************************
805 
806  //**Friend declarations*************************************************************************
807  template< bool RF, typename MT2, bool SO2, bool DF2 >
808  friend bool isDefault( const LowerMatrix<MT2,SO2,DF2>& m );
809 
810  template< typename MT2, bool SO2, bool DF2 >
811  friend MT2& derestrict( LowerMatrix<MT2,SO2,DF2>& m );
812  //**********************************************************************************************
813 
814  //**Compile time checks*************************************************************************
827  BLAZE_STATIC_ASSERT( ( Size_v<MT,0UL> == Size_v<MT,1UL> ) );
828  //**********************************************************************************************
829 };
831 //*************************************************************************************************
832 
833 
834 
835 
836 //=================================================================================================
837 //
838 // CONSTRUCTORS
839 //
840 //=================================================================================================
841 
842 //*************************************************************************************************
846 template< typename MT // Type of the adapted dense matrix
847  , bool SO > // Storage order of the adapted dense matrix
848 inline LowerMatrix<MT,SO,true>::LowerMatrix()
849  : matrix_() // The adapted dense matrix
850 {
851  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square lower matrix detected" );
852  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
853 }
855 //*************************************************************************************************
856 
857 
858 //*************************************************************************************************
876 template< typename MT // Type of the adapted dense matrix
877  , bool SO > // Storage order of the adapted dense matrix
878 template< typename A1 > // Type of the constructor argument
879 inline LowerMatrix<MT,SO,true>::LowerMatrix( const A1& a1 )
880  : matrix_( construct( a1, typename IsResizable<MT>::Type() ) ) // The adapted dense matrix
881 {
882  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square lower matrix detected" );
883  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
884 }
886 //*************************************************************************************************
887 
888 
889 //*************************************************************************************************
896 template< typename MT // Type of the adapted dense matrix
897  , bool SO > // Storage order of the adapted dense matrix
898 inline LowerMatrix<MT,SO,true>::LowerMatrix( size_t n, const ElementType& init )
899  : matrix_( n, n, ElementType() ) // The adapted dense matrix
900 {
902 
903  if( SO ) {
904  for( size_t j=0UL; j<columns(); ++j )
905  for( size_t i=j; i<rows(); ++i )
906  matrix_(i,j) = init;
907  }
908  else {
909  for( size_t i=0UL; i<rows(); ++i )
910  for( size_t j=0UL; j<=i; ++j )
911  matrix_(i,j) = init;
912  }
913 
914  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square lower matrix detected" );
915  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
916 }
918 //*************************************************************************************************
919 
920 
921 //*************************************************************************************************
945 template< typename MT // Type of the adapted dense matrix
946  , bool SO > // Storage order of the adapted dense matrix
947 inline LowerMatrix<MT,SO,true>::LowerMatrix( initializer_list< initializer_list<ElementType> > list )
948  : matrix_( list ) // The adapted dense matrix
949 {
950  if( !isLower( matrix_ ) ) {
951  BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of lower matrix" );
952  }
953 
954  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
955 }
957 //*************************************************************************************************
958 
959 
960 //*************************************************************************************************
986 template< typename MT // Type of the adapted dense matrix
987  , bool SO > // Storage order of the adapted dense matrix
988 template< typename Other > // Data type of the initialization array
989 inline LowerMatrix<MT,SO,true>::LowerMatrix( size_t n, const Other* array )
990  : matrix_( n, n, array ) // The adapted dense matrix
991 {
992  if( !isLower( matrix_ ) ) {
993  BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of lower matrix" );
994  }
995 
996  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
997 }
999 //*************************************************************************************************
1000 
1001 
1002 //*************************************************************************************************
1025 template< typename MT // Type of the adapted dense matrix
1026  , bool SO > // Storage order of the adapted dense matrix
1027 template< typename Other // Data type of the initialization array
1028  , size_t N > // Number of rows and columns of the initialization array
1029 inline LowerMatrix<MT,SO,true>::LowerMatrix( const Other (&array)[N][N] )
1030  : matrix_( array ) // The adapted dense matrix
1031 {
1032  if( !isLower( matrix_ ) ) {
1033  BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of lower matrix" );
1034  }
1035 
1036  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1037 }
1039 //*************************************************************************************************
1040 
1041 
1042 //*************************************************************************************************
1074 template< typename MT // Type of the adapted dense matrix
1075  , bool SO > // Storage order of the adapted dense matrix
1076 inline LowerMatrix<MT,SO,true>::LowerMatrix( ElementType* ptr, size_t n )
1077  : matrix_( ptr, n, n ) // The adapted dense matrix
1078 {
1079  if( !isLower( matrix_ ) ) {
1080  BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of lower matrix" );
1081  }
1082 
1083  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1084 }
1086 //*************************************************************************************************
1087 
1088 
1089 //*************************************************************************************************
1123 template< typename MT // Type of the adapted dense matrix
1124  , bool SO > // Storage order of the adapted dense matrix
1125 inline LowerMatrix<MT,SO,true>::LowerMatrix( ElementType* ptr, size_t n, size_t nn )
1126  : matrix_( ptr, n, n, nn ) // The adapted dense matrix
1127 {
1128  if( !isLower( matrix_ ) ) {
1129  BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of lower matrix" );
1130  }
1131 
1132  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1133 }
1135 //*************************************************************************************************
1136 
1137 
1138 //*************************************************************************************************
1144 template< typename MT // Type of the adapted dense matrix
1145  , bool SO > // Storage order of the adapted dense matrix
1146 inline LowerMatrix<MT,SO,true>::LowerMatrix( const LowerMatrix& m )
1147  : matrix_( m.matrix_ ) // The adapted dense matrix
1148 {
1149  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square lower matrix detected" );
1150  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1151 }
1153 //*************************************************************************************************
1154 
1155 
1156 //*************************************************************************************************
1162 template< typename MT // Type of the adapted dense matrix
1163  , bool SO > // Storage order of the adapted dense matrix
1164 inline LowerMatrix<MT,SO,true>::LowerMatrix( LowerMatrix&& m ) noexcept
1165  : matrix_( std::move( m.matrix_ ) ) // The adapted dense matrix
1166 {
1167  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square lower matrix detected" );
1168  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1169 }
1171 //*************************************************************************************************
1172 
1173 
1174 
1175 
1176 //=================================================================================================
1177 //
1178 // DATA ACCESS FUNCTIONS
1179 //
1180 //=================================================================================================
1181 
1182 //*************************************************************************************************
1198 template< typename MT // Type of the adapted dense matrix
1199  , bool SO > // Storage order of the adapted dense matrix
1200 inline typename LowerMatrix<MT,SO,true>::Reference
1201  LowerMatrix<MT,SO,true>::operator()( size_t i, size_t j )
1202 {
1203  BLAZE_USER_ASSERT( i<rows() , "Invalid row access index" );
1204  BLAZE_USER_ASSERT( j<columns(), "Invalid column access index" );
1205 
1206  return Reference( matrix_, i, j );
1207 }
1209 //*************************************************************************************************
1210 
1211 
1212 //*************************************************************************************************
1228 template< typename MT // Type of the adapted dense matrix
1229  , bool SO > // Storage order of the adapted dense matrix
1231  LowerMatrix<MT,SO,true>::operator()( size_t i, size_t j ) const
1232 {
1233  BLAZE_USER_ASSERT( i<rows() , "Invalid row access index" );
1234  BLAZE_USER_ASSERT( j<columns(), "Invalid column access index" );
1235 
1236  return matrix_(i,j);
1237 }
1239 //*************************************************************************************************
1240 
1241 
1242 //*************************************************************************************************
1259 template< typename MT // Type of the adapted dense matrix
1260  , bool SO > // Storage order of the adapted dense matrix
1261 inline typename LowerMatrix<MT,SO,true>::Reference
1262  LowerMatrix<MT,SO,true>::at( size_t i, size_t j )
1263 {
1264  if( i >= rows() ) {
1265  BLAZE_THROW_OUT_OF_RANGE( "Invalid row access index" );
1266  }
1267  if( j >= columns() ) {
1268  BLAZE_THROW_OUT_OF_RANGE( "Invalid column access index" );
1269  }
1270  return (*this)(i,j);
1271 }
1273 //*************************************************************************************************
1274 
1275 
1276 //*************************************************************************************************
1293 template< typename MT // Type of the adapted dense matrix
1294  , bool SO > // Storage order of the adapted dense matrix
1296  LowerMatrix<MT,SO,true>::at( size_t i, size_t j ) const
1297 {
1298  if( i >= rows() ) {
1299  BLAZE_THROW_OUT_OF_RANGE( "Invalid row access index" );
1300  }
1301  if( j >= columns() ) {
1302  BLAZE_THROW_OUT_OF_RANGE( "Invalid column access index" );
1303  }
1304  return (*this)(i,j);
1305 }
1307 //*************************************************************************************************
1308 
1309 
1310 //*************************************************************************************************
1323 template< typename MT // Type of the adapted dense matrix
1324  , bool SO > // Storage order of the adapted dense matrix
1325 inline typename LowerMatrix<MT,SO,true>::ConstPointer
1326  LowerMatrix<MT,SO,true>::data() const noexcept
1327 {
1328  return matrix_.data();
1329 }
1331 //*************************************************************************************************
1332 
1333 
1334 //*************************************************************************************************
1343 template< typename MT // Type of the adapted dense matrix
1344  , bool SO > // Storage order of the adapted dense matrix
1345 inline typename LowerMatrix<MT,SO,true>::ConstPointer
1346  LowerMatrix<MT,SO,true>::data( size_t i ) const noexcept
1347 {
1348  return matrix_.data(i);
1349 }
1351 //*************************************************************************************************
1352 
1353 
1354 //*************************************************************************************************
1366 template< typename MT // Type of the adapted dense matrix
1367  , bool SO > // Storage order of the adapted dense matrix
1368 inline typename LowerMatrix<MT,SO,true>::Iterator
1369  LowerMatrix<MT,SO,true>::begin( size_t i )
1370 {
1371  if( SO )
1372  return Iterator( matrix_, 0UL, i );
1373  else
1374  return Iterator( matrix_, i, 0UL );
1375 }
1377 //*************************************************************************************************
1378 
1379 
1380 //*************************************************************************************************
1392 template< typename MT // Type of the adapted dense matrix
1393  , bool SO > // Storage order of the adapted dense matrix
1395  LowerMatrix<MT,SO,true>::begin( size_t i ) const
1396 {
1397  return matrix_.begin(i);
1398 }
1400 //*************************************************************************************************
1401 
1402 
1403 //*************************************************************************************************
1415 template< typename MT // Type of the adapted dense matrix
1416  , bool SO > // Storage order of the adapted dense matrix
1418  LowerMatrix<MT,SO,true>::cbegin( size_t i ) const
1419 {
1420  return matrix_.cbegin(i);
1421 }
1423 //*************************************************************************************************
1424 
1425 
1426 //*************************************************************************************************
1438 template< typename MT // Type of the adapted dense matrix
1439  , bool SO > // Storage order of the adapted dense matrix
1440 inline typename LowerMatrix<MT,SO,true>::Iterator
1441  LowerMatrix<MT,SO,true>::end( size_t i )
1442 {
1443  if( SO )
1444  return Iterator( matrix_, rows(), i );
1445  else
1446  return Iterator( matrix_, i, columns() );
1447 }
1449 //*************************************************************************************************
1450 
1451 
1452 //*************************************************************************************************
1464 template< typename MT // Type of the adapted dense matrix
1465  , bool SO > // Storage order of the adapted dense matrix
1467  LowerMatrix<MT,SO,true>::end( size_t i ) const
1468 {
1469  return matrix_.end(i);
1470 }
1472 //*************************************************************************************************
1473 
1474 
1475 //*************************************************************************************************
1487 template< typename MT // Type of the adapted dense matrix
1488  , bool SO > // Storage order of the adapted dense matrix
1490  LowerMatrix<MT,SO,true>::cend( size_t i ) const
1491 {
1492  return matrix_.cend(i);
1493 }
1495 //*************************************************************************************************
1496 
1497 
1498 
1499 
1500 //=================================================================================================
1501 //
1502 // ASSIGNMENT OPERATORS
1503 //
1504 //=================================================================================================
1505 
1506 //*************************************************************************************************
1513 template< typename MT // Type of the adapted dense matrix
1514  , bool SO > // Storage order of the adapted dense matrix
1515 inline LowerMatrix<MT,SO,true>&
1516  LowerMatrix<MT,SO,true>::operator=( const ElementType& rhs )
1517 {
1518  if( SO ) {
1519  for( size_t j=0UL; j<columns(); ++j )
1520  for( size_t i=j; i<rows(); ++i )
1521  matrix_(i,j) = rhs;
1522  }
1523  else {
1524  for( size_t i=0UL; i<rows(); ++i )
1525  for( size_t j=0UL; j<=i; ++j )
1526  matrix_(i,j) = rhs;
1527  }
1528 
1529  return *this;
1530 }
1532 //*************************************************************************************************
1533 
1534 
1535 //*************************************************************************************************
1560 template< typename MT // Type of the adapted dense matrix
1561  , bool SO > // Storage order of the adapted dense matrix
1562 inline LowerMatrix<MT,SO,true>&
1563  LowerMatrix<MT,SO,true>::operator=( initializer_list< initializer_list<ElementType> > list )
1564 {
1565  const InitializerMatrix<ElementType> tmp( list, list.size() );
1566 
1567  if( !isLower( tmp ) ) {
1568  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to lower matrix" );
1569  }
1570 
1571  matrix_ = list;
1572 
1573  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square lower matrix detected" );
1574  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1575 
1576  return *this;
1577 }
1579 //*************************************************************************************************
1580 
1581 
1582 //*************************************************************************************************
1606 template< typename MT // Type of the adapted dense matrix
1607  , bool SO > // Storage order of the adapted dense matrix
1608 template< typename Other // Data type of the initialization array
1609  , size_t N > // Number of rows and columns of the initialization array
1610 inline LowerMatrix<MT,SO,true>&
1611  LowerMatrix<MT,SO,true>::operator=( const Other (&array)[N][N] )
1612 {
1613  MT tmp( array );
1614 
1615  if( !isLower( tmp ) ) {
1616  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to lower matrix" );
1617  }
1618 
1619  matrix_ = std::move( tmp );
1620 
1621  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square lower matrix detected" );
1622  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1623 
1624  return *this;
1625 }
1627 //*************************************************************************************************
1628 
1629 
1630 //*************************************************************************************************
1640 template< typename MT // Type of the adapted dense matrix
1641  , bool SO > // Storage order of the adapted dense matrix
1642 inline LowerMatrix<MT,SO,true>&
1643  LowerMatrix<MT,SO,true>::operator=( const LowerMatrix& rhs )
1644 {
1645  matrix_ = rhs.matrix_;
1646 
1647  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square lower matrix detected" );
1648  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1649 
1650  return *this;
1651 }
1653 //*************************************************************************************************
1654 
1655 
1656 //*************************************************************************************************
1663 template< typename MT // Type of the adapted dense matrix
1664  , bool SO > // Storage order of the adapted dense matrix
1665 inline LowerMatrix<MT,SO,true>&
1666  LowerMatrix<MT,SO,true>::operator=( LowerMatrix&& rhs ) noexcept
1667 {
1668  matrix_ = std::move( rhs.matrix_ );
1669 
1670  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square lower matrix detected" );
1671  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1672 
1673  return *this;
1674 }
1676 //*************************************************************************************************
1677 
1678 
1679 //*************************************************************************************************
1692 template< typename MT // Type of the adapted dense matrix
1693  , bool SO > // Storage order of the adapted dense matrix
1694 template< typename MT2 // Type of the right-hand side matrix
1695  , bool SO2 > // Storage order of the right-hand side matrix
1696 inline auto LowerMatrix<MT,SO,true>::operator=( const Matrix<MT2,SO2>& rhs )
1697  -> DisableIf_t< IsComputation_v<MT2>, LowerMatrix& >
1698 {
1699  if( !IsLower_v<MT2> && !isLower( ~rhs ) ) {
1700  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to lower matrix" );
1701  }
1702 
1703  matrix_ = decllow( ~rhs );
1704 
1705  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square lower matrix detected" );
1706  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1707 
1708  return *this;
1709 }
1711 //*************************************************************************************************
1712 
1713 
1714 //*************************************************************************************************
1727 template< typename MT // Type of the adapted dense matrix
1728  , bool SO > // Storage order of the adapted dense matrix
1729 template< typename MT2 // Type of the right-hand side matrix
1730  , bool SO2 > // Storage order of the right-hand side matrix
1731 inline auto LowerMatrix<MT,SO,true>::operator=( const Matrix<MT2,SO2>& rhs )
1732  -> EnableIf_t< IsComputation_v<MT2>, LowerMatrix& >
1733 {
1734  if( !IsSquare_v<MT2> && !isSquare( ~rhs ) ) {
1735  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to lower matrix" );
1736  }
1737 
1738  if( IsLower_v<MT2> ) {
1739  matrix_ = ~rhs;
1740  }
1741  else {
1742  MT tmp( ~rhs );
1743 
1744  if( !isLower( tmp ) ) {
1745  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to lower matrix" );
1746  }
1747 
1748  matrix_ = std::move( tmp );
1749  }
1750 
1751  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square lower matrix detected" );
1752  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1753 
1754  return *this;
1755 }
1757 //*************************************************************************************************
1758 
1759 
1760 //*************************************************************************************************
1773 template< typename MT // Type of the adapted dense matrix
1774  , bool SO > // Storage order of the adapted dense matrix
1775 template< typename MT2 // Type of the right-hand side matrix
1776  , bool SO2 > // Storage order of the right-hand side matrix
1777 inline auto LowerMatrix<MT,SO,true>::operator+=( const Matrix<MT2,SO2>& rhs )
1778  -> DisableIf_t< IsComputation_v<MT2>, LowerMatrix& >
1779 {
1780  if( !IsLower_v<MT2> && !isLower( ~rhs ) ) {
1781  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to lower matrix" );
1782  }
1783 
1784  matrix_ += decllow( ~rhs );
1785 
1786  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square lower matrix detected" );
1787  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1788 
1789  return *this;
1790 }
1792 //*************************************************************************************************
1793 
1794 
1795 //*************************************************************************************************
1808 template< typename MT // Type of the adapted dense matrix
1809  , bool SO > // Storage order of the adapted dense matrix
1810 template< typename MT2 // Type of the right-hand side matrix
1811  , bool SO2 > // Storage order of the right-hand side matrix
1812 inline auto LowerMatrix<MT,SO,true>::operator+=( const Matrix<MT2,SO2>& rhs )
1813  -> EnableIf_t< IsComputation_v<MT2>, LowerMatrix& >
1814 {
1815  if( !IsSquare_v<MT2> && !isSquare( ~rhs ) ) {
1816  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to lower matrix" );
1817  }
1818 
1819  if( IsLower_v<MT2> ) {
1820  matrix_ += ~rhs;
1821  }
1822  else {
1823  const ResultType_t<MT2> tmp( ~rhs );
1824 
1825  if( !isLower( tmp ) ) {
1826  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to lower matrix" );
1827  }
1828 
1829  matrix_ += decllow( tmp );
1830  }
1831 
1832  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square lower matrix detected" );
1833  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1834 
1835  return *this;
1836 }
1838 //*************************************************************************************************
1839 
1840 
1841 //*************************************************************************************************
1854 template< typename MT // Type of the adapted dense matrix
1855  , bool SO > // Storage order of the adapted dense matrix
1856 template< typename MT2 // Type of the right-hand side matrix
1857  , bool SO2 > // Storage order of the right-hand side matrix
1858 inline auto LowerMatrix<MT,SO,true>::operator-=( const Matrix<MT2,SO2>& rhs )
1859  -> DisableIf_t< IsComputation_v<MT2>, LowerMatrix& >
1860 {
1861  if( !IsLower_v<MT2> && !isLower( ~rhs ) ) {
1862  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to lower matrix" );
1863  }
1864 
1865  matrix_ -= decllow( ~rhs );
1866 
1867  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square lower matrix detected" );
1868  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1869 
1870  return *this;
1871 }
1873 //*************************************************************************************************
1874 
1875 
1876 //*************************************************************************************************
1889 template< typename MT // Type of the adapted dense matrix
1890  , bool SO > // Storage order of the adapted dense matrix
1891 template< typename MT2 // Type of the right-hand side matrix
1892  , bool SO2 > // Storage order of the right-hand side matrix
1893 inline auto LowerMatrix<MT,SO,true>::operator-=( const Matrix<MT2,SO2>& rhs )
1894  -> EnableIf_t< IsComputation_v<MT2>, LowerMatrix& >
1895 {
1896  if( !IsSquare_v<MT2> && !isSquare( ~rhs ) ) {
1897  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to lower matrix" );
1898  }
1899 
1900  if( IsLower_v<MT2> ) {
1901  matrix_ -= ~rhs;
1902  }
1903  else {
1904  const ResultType_t<MT2> tmp( ~rhs );
1905 
1906  if( !isLower( tmp ) ) {
1907  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to lower matrix" );
1908  }
1909 
1910  matrix_ -= decllow( tmp );
1911  }
1912 
1913  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square lower matrix detected" );
1914  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1915 
1916  return *this;
1917 }
1919 //*************************************************************************************************
1920 
1921 
1922 //*************************************************************************************************
1933 template< typename MT // Type of the adapted dense matrix
1934  , bool SO > // Storage order of the adapted dense matrix
1935 template< typename MT2 // Type of the right-hand side matrix
1936  , bool SO2 > // Storage order of the right-hand side matrix
1937 inline auto LowerMatrix<MT,SO,true>::operator%=( const Matrix<MT2,SO2>& rhs )
1938  -> LowerMatrix&
1939 {
1940  if( !IsSquare_v<MT2> && !isSquare( ~rhs ) ) {
1941  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to lower matrix" );
1942  }
1943 
1944  matrix_ %= ~rhs;
1945 
1946  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square lower matrix detected" );
1947  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1948 
1949  return *this;
1950 }
1952 //*************************************************************************************************
1953 
1954 
1955 //*************************************************************************************************
1963 template< typename MT // Type of the adapted dense matrix
1964  , bool SO > // Storage order of the adapted dense matrix
1965 template< typename ST > // Data type of the right-hand side scalar
1966 inline auto LowerMatrix<MT,SO,true>::operator*=( ST rhs )
1967  -> EnableIf_t< IsNumeric_v<ST>, LowerMatrix& >
1968 {
1969  matrix_ *= rhs;
1970  return *this;
1971 }
1972 //*************************************************************************************************
1973 
1974 
1975 //*************************************************************************************************
1983 template< typename MT // Type of the adapted dense matrix
1984  , bool SO > // Storage order of the adapted dense matrix
1985 template< typename ST > // Data type of the right-hand side scalar
1986 inline auto LowerMatrix<MT,SO,true>::operator/=( ST rhs )
1987  -> EnableIf_t< IsNumeric_v<ST>, LowerMatrix& >
1988 {
1989  BLAZE_USER_ASSERT( !isZero( rhs ), "Division by zero detected" );
1990 
1991  matrix_ /= rhs;
1992  return *this;
1993 }
1995 //*************************************************************************************************
1996 
1997 
1998 
1999 
2000 //=================================================================================================
2001 //
2002 // UTILITY FUNCTIONS
2003 //
2004 //=================================================================================================
2005 
2006 //*************************************************************************************************
2012 template< typename MT // Type of the adapted dense matrix
2013  , bool SO > // Storage order of the adapted dense matrix
2014 inline size_t LowerMatrix<MT,SO,true>::rows() const noexcept
2015 {
2016  return matrix_.rows();
2017 }
2019 //*************************************************************************************************
2020 
2021 
2022 //*************************************************************************************************
2028 template< typename MT // Type of the adapted dense matrix
2029  , bool SO > // Storage order of the adapted dense matrix
2030 inline size_t LowerMatrix<MT,SO,true>::columns() const noexcept
2031 {
2032  return matrix_.columns();
2033 }
2035 //*************************************************************************************************
2036 
2037 
2038 //*************************************************************************************************
2049 template< typename MT // Type of the adapted dense matrix
2050  , bool SO > // Storage order of the adapted dense matrix
2051 inline size_t LowerMatrix<MT,SO,true>::spacing() const noexcept
2052 {
2053  return matrix_.spacing();
2054 }
2056 //*************************************************************************************************
2057 
2058 
2059 //*************************************************************************************************
2065 template< typename MT // Type of the adapted dense matrix
2066  , bool SO > // Storage order of the adapted dense matrix
2067 inline size_t LowerMatrix<MT,SO,true>::capacity() const noexcept
2068 {
2069  return matrix_.capacity();
2070 }
2072 //*************************************************************************************************
2073 
2074 
2075 //*************************************************************************************************
2087 template< typename MT // Type of the adapted dense matrix
2088  , bool SO > // Storage order of the adapted dense matrix
2089 inline size_t LowerMatrix<MT,SO,true>::capacity( size_t i ) const noexcept
2090 {
2091  return matrix_.capacity(i);
2092 }
2094 //*************************************************************************************************
2095 
2096 
2097 //*************************************************************************************************
2103 template< typename MT // Type of the adapted dense matrix
2104  , bool SO > // Storage order of the adapted dense matrix
2105 inline size_t LowerMatrix<MT,SO,true>::nonZeros() const
2106 {
2107  return matrix_.nonZeros();
2108 }
2110 //*************************************************************************************************
2111 
2112 
2113 //*************************************************************************************************
2125 template< typename MT // Type of the adapted dense matrix
2126  , bool SO > // Storage order of the adapted dense matrix
2127 inline size_t LowerMatrix<MT,SO,true>::nonZeros( size_t i ) const
2128 {
2129  return matrix_.nonZeros(i);
2130 }
2132 //*************************************************************************************************
2133 
2134 
2135 //*************************************************************************************************
2141 template< typename MT // Type of the adapted dense matrix
2142  , bool SO > // Storage order of the adapted dense matrix
2143 inline void LowerMatrix<MT,SO,true>::reset()
2144 {
2145  using blaze::clear;
2146 
2147  if( SO ) {
2148  for( size_t j=0UL; j<columns(); ++j )
2149  for( size_t i=j; i<rows(); ++i )
2150  clear( matrix_(i,j) );
2151  }
2152  else {
2153  for( size_t i=0UL; i<rows(); ++i )
2154  for( size_t j=0UL; j<=i; ++j )
2155  clear( matrix_(i,j) );
2156  }
2157 }
2159 //*************************************************************************************************
2160 
2161 
2162 //*************************************************************************************************
2175 template< typename MT // Type of the adapted dense matrix
2176  , bool SO > // Storage order of the adapted dense matrix
2177 inline void LowerMatrix<MT,SO,true>::reset( size_t i )
2178 {
2179  using blaze::clear;
2180 
2181  if( SO ) {
2182  for( size_t j=i; j<rows(); ++j )
2183  clear( matrix_(j,i) );
2184  }
2185  else {
2186  for( size_t j=0UL; j<=i; ++j )
2187  clear( matrix_(i,j) );
2188  }
2189 }
2191 //*************************************************************************************************
2192 
2193 
2194 //*************************************************************************************************
2206 template< typename MT // Type of the adapted dense matrix
2207  , bool SO > // Storage order of the adapted dense matrix
2208 inline void LowerMatrix<MT,SO,true>::clear()
2209 {
2210  using blaze::clear;
2211 
2212  if( IsResizable_v<MT> ) {
2213  clear( matrix_ );
2214  }
2215  else {
2216  reset();
2217  }
2218 }
2220 //*************************************************************************************************
2221 
2222 
2223 //*************************************************************************************************
2259 template< typename MT // Type of the adapted dense matrix
2260  , bool SO > // Storage order of the adapted dense matrix
2261 void LowerMatrix<MT,SO,true>::resize( size_t n, bool preserve )
2262 {
2264 
2265  UNUSED_PARAMETER( preserve );
2266 
2267  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square lower matrix detected" );
2268 
2269  const size_t oldsize( matrix_.rows() );
2270 
2271  matrix_.resize( n, n, true );
2272 
2273  if( n > oldsize ) {
2274  const size_t increment( n - oldsize );
2275  submatrix( matrix_, 0UL, oldsize, n-1UL, increment ).reset();
2276  }
2277 }
2279 //*************************************************************************************************
2280 
2281 
2282 //*************************************************************************************************
2295 template< typename MT // Type of the adapted dense matrix
2296  , bool SO > // Storage order of the adapted dense matrix
2297 inline void LowerMatrix<MT,SO,true>::extend( size_t n, bool preserve )
2298 {
2300 
2301  UNUSED_PARAMETER( preserve );
2302 
2303  resize( rows() + n, true );
2304 }
2305 //*************************************************************************************************
2306 
2307 
2308 //*************************************************************************************************
2318 template< typename MT // Type of the adapted dense matrix
2319  , bool SO > // Storage order of the adapted dense matrix
2320 inline void LowerMatrix<MT,SO,true>::reserve( size_t elements )
2321 {
2322  matrix_.reserve( elements );
2323 }
2325 //*************************************************************************************************
2326 
2327 
2328 //*************************************************************************************************
2338 template< typename MT // Type of the adapted dense matrix
2339  , bool SO > // Storage order of the adapted dense matrix
2341 {
2342  matrix_.shrinkToFit();
2343 }
2345 //*************************************************************************************************
2346 
2347 
2348 //*************************************************************************************************
2355 template< typename MT // Type of the adapted dense matrix
2356  , bool SO > // Storage order of the adapted dense matrix
2357 inline void LowerMatrix<MT,SO,true>::swap( LowerMatrix& m ) noexcept
2358 {
2359  using std::swap;
2360 
2361  swap( matrix_, m.matrix_ );
2362 }
2364 //*************************************************************************************************
2365 
2366 
2367 //*************************************************************************************************
2379 template< typename MT // Type of the adapted dense matrix
2380  , bool SO > // Storage order of the adapted dense matrix
2381 inline constexpr size_t LowerMatrix<MT,SO,true>::maxNonZeros() noexcept
2382 {
2384 
2385  return maxNonZeros( Size_v<MT,0UL> );
2386 }
2388 //*************************************************************************************************
2389 
2390 
2391 //*************************************************************************************************
2401 template< typename MT // Type of the adapted dense matrix
2402  , bool SO > // Storage order of the adapted dense matrix
2403 inline constexpr size_t LowerMatrix<MT,SO,true>::maxNonZeros( size_t n ) noexcept
2404 {
2405  return ( ( n + 1UL ) * n ) / 2UL;
2406 }
2408 //*************************************************************************************************
2409 
2410 
2411 
2412 
2413 //=================================================================================================
2414 //
2415 // NUMERIC FUNCTIONS
2416 //
2417 //=================================================================================================
2418 
2419 //*************************************************************************************************
2437 template< typename MT // Type of the adapted dense matrix
2438  , bool SO > // Storage order of the adapted dense matrix
2439 template< typename Other > // Data type of the scalar value
2440 inline LowerMatrix<MT,SO,true>& LowerMatrix<MT,SO,true>::scale( const Other& scalar )
2441 {
2442  matrix_.scale( scalar );
2443  return *this;
2444 }
2446 //*************************************************************************************************
2447 
2448 
2449 
2450 
2451 //=================================================================================================
2452 //
2453 // DEBUGGING FUNCTIONS
2454 //
2455 //=================================================================================================
2456 
2457 //*************************************************************************************************
2467 template< typename MT // Type of the adapted dense matrix
2468  , bool SO > // Storage order of the adapted dense matrix
2469 inline bool LowerMatrix<MT,SO,true>::isIntact() const noexcept
2470 {
2471  using blaze::isIntact;
2472 
2473  return ( isIntact( matrix_ ) && isLower( matrix_ ) );
2474 }
2476 //*************************************************************************************************
2477 
2478 
2479 
2480 
2481 //=================================================================================================
2482 //
2483 // EXPRESSION TEMPLATE EVALUATION FUNCTIONS
2484 //
2485 //=================================================================================================
2486 
2487 //*************************************************************************************************
2498 template< typename MT // Type of the adapted dense matrix
2499  , bool SO > // Storage order of the adapted dense matrix
2500 template< typename Other > // Data type of the foreign expression
2501 inline bool LowerMatrix<MT,SO,true>::canAlias( const Other* alias ) const noexcept
2502 {
2503  return matrix_.canAlias( alias );
2504 }
2506 //*************************************************************************************************
2507 
2508 
2509 //*************************************************************************************************
2520 template< typename MT // Type of the adapted dense matrix
2521  , bool SO > // Storage order of the adapted dense matrix
2522 template< typename Other > // Data type of the foreign expression
2523 inline bool LowerMatrix<MT,SO,true>::isAliased( const Other* alias ) const noexcept
2524 {
2525  return matrix_.isAliased( alias );
2526 }
2528 //*************************************************************************************************
2529 
2530 
2531 //*************************************************************************************************
2541 template< typename MT // Type of the adapted dense matrix
2542  , bool SO > // Storage order of the adapted dense matrix
2543 inline bool LowerMatrix<MT,SO,true>::isAligned() const noexcept
2544 {
2545  return matrix_.isAligned();
2546 }
2548 //*************************************************************************************************
2549 
2550 
2551 //*************************************************************************************************
2562 template< typename MT // Type of the adapted dense matrix
2563  , bool SO > // Storage order of the adapted dense matrix
2564 inline bool LowerMatrix<MT,SO,true>::canSMPAssign() const noexcept
2565 {
2566  return matrix_.canSMPAssign();
2567 }
2569 //*************************************************************************************************
2570 
2571 
2572 //*************************************************************************************************
2588 template< typename MT // Type of the adapted dense matrix
2589  , bool SO > // Storage order of the adapted dense matrix
2590 BLAZE_ALWAYS_INLINE typename LowerMatrix<MT,SO,true>::SIMDType
2591  LowerMatrix<MT,SO,true>::load( size_t i, size_t j ) const noexcept
2592 {
2593  return matrix_.load( i, j );
2594 }
2596 //*************************************************************************************************
2597 
2598 
2599 //*************************************************************************************************
2615 template< typename MT // Type of the adapted dense matrix
2616  , bool SO > // Storage order of the adapted dense matrix
2617 BLAZE_ALWAYS_INLINE typename LowerMatrix<MT,SO,true>::SIMDType
2618  LowerMatrix<MT,SO,true>::loada( size_t i, size_t j ) const noexcept
2619 {
2620  return matrix_.loada( i, j );
2621 }
2623 //*************************************************************************************************
2624 
2625 
2626 //*************************************************************************************************
2642 template< typename MT // Type of the adapted dense matrix
2643  , bool SO > // Storage order of the adapted dense matrix
2644 BLAZE_ALWAYS_INLINE typename LowerMatrix<MT,SO,true>::SIMDType
2645  LowerMatrix<MT,SO,true>::loadu( size_t i, size_t j ) const noexcept
2646 {
2647  return matrix_.loadu( i, j );
2648 }
2650 //*************************************************************************************************
2651 
2652 
2653 
2654 
2655 //=================================================================================================
2656 //
2657 // CONSTRUCTION FUNCTIONS
2658 //
2659 //=================================================================================================
2660 
2661 //*************************************************************************************************
2668 template< typename MT // Type of the adapted dense matrix
2669  , bool SO > // Storage order of the adapted dense matrix
2670 inline const MT LowerMatrix<MT,SO,true>::construct( size_t n, TrueType )
2671 {
2673 
2674  return MT( n, n, ElementType() );
2675 }
2677 //*************************************************************************************************
2678 
2679 
2680 //*************************************************************************************************
2687 template< typename MT // Type of the adapted dense matrix
2688  , bool SO > // Storage order of the adapted dense matrix
2689 inline const MT LowerMatrix<MT,SO,true>::construct( const ElementType& init, FalseType )
2690 {
2693 
2694  MT tmp;
2695 
2696  if( SO ) {
2697  for( size_t j=0UL; j<tmp.columns(); ++j )
2698  for( size_t i=j; i<tmp.rows(); ++i )
2699  tmp(i,j) = init;
2700  }
2701  else {
2702  for( size_t i=0UL; i<tmp.rows(); ++i )
2703  for( size_t j=0UL; j<=i; ++j )
2704  tmp(i,j) = init;
2705  }
2706 
2707  return tmp;
2708 }
2710 //*************************************************************************************************
2711 
2712 
2713 //*************************************************************************************************
2724 template< typename MT // Type of the adapted dense matrix
2725  , bool SO > // Storage order of the adapted dense matrix
2726 template< typename MT2 // Type of the foreign matrix
2727  , bool SO2 // Storage order of the foreign matrix
2728  , typename T > // Type of the third argument
2729 inline const MT LowerMatrix<MT,SO,true>::construct( const Matrix<MT2,SO2>& m, T )
2730 {
2731  const MT tmp( ~m );
2732 
2733  if( !IsLower_v<MT2> && !isLower( tmp ) ) {
2734  BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of lower matrix" );
2735  }
2736 
2737  return tmp;
2738 }
2740 //*************************************************************************************************
2741 
2742 } // namespace blaze
2743 
2744 #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.
decltype(auto) column(Matrix< MT, SO > &matrix, RCAs... args)
Creating a view on a specific column of the given matrix.
Definition: Column.h:133
CompressedMatrix< Type, false > OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: CompressedMatrix.h:3078
bool isLower(const DenseMatrix< MT, SO > &dm)
Checks if the given dense matrix is a lower triangular matrix.
Definition: DenseMatrix.h:1004
#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
auto operator/=(DenseMatrix< MT, SO > &mat, ST scalar) -> EnableIf_t< IsNumeric_v< ST >, MT & >
Division assignment operator for the division of a dense matrix by a scalar value ( )...
Definition: DenseMatrix.h:354
Header file for the UNUSED_PARAMETER function template.
size_t capacity(const Matrix< MT, SO > &matrix) noexcept
Returns the maximum capacity of the matrix.
Definition: Matrix.h:546
Header file for basic type definitions.
constexpr const DenseIterator< Type, AF > operator-(const DenseIterator< Type, AF > &it, ptrdiff_t inc) noexcept
Subtraction between a DenseIterator and an integral value.
Definition: DenseIterator.h:750
MT::ElementType * data(DenseMatrix< MT, SO > &dm) noexcept
Low-level data access to the dense matrix elements.
Definition: DenseMatrix.h:169
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
Header file for the isZero shim.
#define BLAZE_CONSTRAINT_MUST_BE_DENSE_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is not a dense, N-dimensional matrix type...
Definition: DenseMatrix.h:61
constexpr bool operator<(const NegativeAccuracy< A > &lhs, const T &rhs)
Less-than comparison between a NegativeAccuracy object and a floating point value.
Definition: Accuracy.h:332
BLAZE_ALWAYS_INLINE const EnableIf_t< IsIntegral_v< T > &&HasSize_v< T, 1UL >, If_t< IsSigned_v< T >, SIMDint8, SIMDuint8 > > loadu(const T *address) noexcept
Loads a vector of 1-byte integral values.
Definition: Loadu.h:76
Constraint on the data type.
This ResultType
Result type for expression template evaluations.
Definition: CompressedMatrix.h:3077
MT::Iterator begin(Matrix< MT, SO > &matrix, size_t i)
Returns an iterator to the first element of row/column i.
Definition: Matrix.h:372
CompressedMatrix< Type, true > This
Type of this CompressedMatrix instance.
Definition: CompressedMatrix.h:3075
Constraint on the data type.
void reset(const DiagonalProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: DiagonalProxy.h:591
static constexpr bool smpAssignable
Compilation flag for SMP assignments.
Definition: CompressedMatrix.h:3113
void shrinkToFit(Matrix< MT, SO > &matrix)
Requesting the removal of unused capacity.
Definition: Matrix.h:799
void clear(CompressedMatrix< Type, SO > &m)
Clearing the given compressed matrix.
Definition: CompressedMatrix.h:5828
CompressedMatrix< Type, false > TransposeType
Transpose type for expression template evaluations.
Definition: CompressedMatrix.h:3079
const Type & ConstReference
Reference to a constant matrix value.
Definition: CompressedMatrix.h:3084
#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
size_t nonZeros(const Matrix< MT, SO > &matrix)
Returns the total number of non-zero elements in the matrix.
Definition: Matrix.h:584
BoolConstant< true > TrueType
Type traits base class.The TrueType class is used as base class for type traits and value traits that...
Definition: TrueType.h:61
Element * Iterator
Iterator over non-constant elements.
Definition: CompressedMatrix.h:3085
Header file for the extended initializer_list functionality.
constexpr void UNUSED_PARAMETER(const Args &...)
Suppression of unused parameter warnings.
Definition: Unused.h:81
Constraint on the data type.
constexpr size_t columns(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of columns of the matrix.
Definition: Matrix.h:514
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:482
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:416
Constraint on the data type.
Constraint on the data type.
Constraint on the data type.
size_t spacing(const DenseMatrix< MT, SO > &dm) noexcept
Returns the spacing between the beginning of two rows/columns.
Definition: DenseMatrix.h:252
#define BLAZE_CONSTRAINT_MUST_BE_SQUARE_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is not a square matrix type, a compilation error is created.
Definition: Square.h:60
Header file for the IsSquare type trait.
bool isZero(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is 0.
Definition: DiagonalProxy.h:673
Constraint on the data type.
Header file for the implementation of a matrix representation of an initializer list.
typename EnableIf< Condition, T >::Type EnableIf_t
Auxiliary type for the EnableIf class template.The EnableIf_t alias declaration provides a convenient...
Definition: EnableIf.h:138
Header file for the DisableIf class template.
MatrixAccessProxy< This > Reference
Reference to a non-constant matrix value.
Definition: CompressedMatrix.h:3083
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58
#define BLAZE_ALWAYS_INLINE
Platform dependent setup of an enforced inline keyword.
Definition: Inline.h:85
#define BLAZE_CONSTRAINT_MUST_BE_STATIC_TYPE(T)
Constraint on the data type.In case the given data type T is not a static data type, i.e. a vector or matrix with dimensions fixed at compile time, a compilation error is created.
Definition: Static.h:61
void swap(CompressedMatrix< Type, SO > &a, CompressedMatrix< Type, SO > &b) noexcept
Swapping the contents of two compressed matrices.
Definition: CompressedMatrix.h:5907
Compile time assertion.
bool isIntact(const CompressedMatrix< Type, SO > &m)
Returns whether the invariants of the given compressed matrix are intact.
Definition: CompressedMatrix.h:5890
SparseMatrix< This, true > BaseType
Base type of this CompressedMatrix instance.
Definition: CompressedMatrix.h:3076
#define BLAZE_CONSTRAINT_MUST_NOT_BE_POINTER_TYPE(T)
Constraint on the data type.In case the given data type T is not a pointer type, a compilation error ...
Definition: Pointer.h:79
Type ElementType
Type of the compressed matrix elements.
Definition: CompressedMatrix.h:3080
#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.
constexpr bool operator>(const NegativeAccuracy< A > &lhs, const T &rhs)
Greater-than comparison between a NegativeAccuracy object and a floating point value.
Definition: Accuracy.h:370
constexpr bool operator>=(const NegativeAccuracy< A > &, const T &rhs)
Greater-or-equal-than comparison between a NegativeAccuracy object and a floating point value...
Definition: Accuracy.h:446
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:3086
constexpr bool operator==(const NegativeAccuracy< A > &lhs, const T &rhs)
Equality comparison between a NegativeAccuracy object and a floating point value. ...
Definition: Accuracy.h:253
constexpr bool IsNumeric_v
Auxiliary variable template for the IsNumeric type trait.The IsNumeric_v variable template provides a...
Definition: IsNumeric.h:143
Constraint on the data type.
decltype(auto) decllow(const DenseMatrix< MT, SO > &dm)
Declares the given dense matrix expression dm as lower.
Definition: DMatDeclLowExpr.h:1002
Header file for the IsLower type trait.
Header file for the LowerProxy class.
Constraints on the storage order of matrix types.
decltype(auto) elements(Vector< VT, TF > &vector, REAs... args)
Creating a view on a selection of elements of the given vector.
Definition: Elements.h:135
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
void resize(Matrix< MT, SO > &matrix, size_t rows, size_t columns, bool preserve=true)
Changing the size of the matrix.
Definition: Matrix.h:738
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:438
decltype(auto) operator*(const DenseMatrix< MT1, false > &lhs, const DenseMatrix< MT2, false > &rhs)
Multiplication operator for the multiplication of two row-major dense matrices ( ).
Definition: DMatDMatMultExpr.h:8908
constexpr bool operator!=(const NegativeAccuracy< A > &lhs, const T &rhs)
Inequality comparison between a NegativeAccuracy object and a floating point value.
Definition: Accuracy.h:293
decltype(auto) submatrix(Matrix< MT, SO > &, RSAs...)
Creating a view on a specific submatrix of the given matrix.
Definition: Submatrix.h:360
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:611
Header file for the IsNumeric type trait.
Header file for all adaptor forward declarations.
#define BLAZE_CONSTRAINT_MUST_NOT_BE_SYMMETRIC_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is a symmetric matrix type, a compilation error is created.
Definition: Symmetric.h:79
BLAZE_ALWAYS_INLINE T1 & operator+=(SIMDPack< T1 > &lhs, const SIMDPack< T2 > &rhs)
Addition assignment operator for the addition of two SIMD packs.
Definition: BasicTypes.h:1357
Header file for run time assertion macros.
Constraint on the data type.
Constraint on the data type.
Constraint on the data type.
decltype(auto) row(Matrix< MT, SO > &, RRAs...)
Creating a view on a specific row of the given matrix.
Definition: Row.h:133
#define BLAZE_CONSTRAINT_MUST_NOT_BE_LOWER_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is a lower triangular matrix type...
Definition: Lower.h:81
#define BLAZE_CONSTRAINT_MUST_NOT_BE_RESIZABLE_TYPE(T)
Constraint on the data type.In case the given data type T is resizable, i.e. has a &#39;resize&#39; member fu...
Definition: Resizable.h:81
#define BLAZE_CONSTRAINT_MUST_NOT_BE_REFERENCE_TYPE(T)
Constraint on the data type.In case the given data type T is not a reference type, a compilation error is created.
Definition: Reference.h:79
Header file for the isDefault shim.
void swap(DiagonalMatrix< MT, SO, DF > &a, DiagonalMatrix< MT, SO, DF > &b) noexcept
Swapping the contents of two matrices.
Definition: DiagonalMatrix.h:281
Constraint on the data type.
Constraint on the data type.
constexpr bool operator<=(const NegativeAccuracy< A > &, const T &rhs)
Less-or-equal-than comparison between a NegativeAccuracy object and a floating point value...
Definition: Accuracy.h:408
constexpr size_t rows(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of rows of the matrix.
Definition: Matrix.h:498
constexpr const DenseIterator< Type, AF > operator+(const DenseIterator< Type, AF > &it, ptrdiff_t inc) noexcept
Addition between a DenseIterator and an integral value.
Definition: DenseIterator.h:718
BLAZE_ALWAYS_INLINE const EnableIf_t< IsIntegral_v< T > &&HasSize_v< T, 1UL >, If_t< IsSigned_v< T >, SIMDint8, SIMDuint8 > > loada(const T *address) noexcept
Loads a vector of 1-byte integral values.
Definition: Loada.h:79
constexpr bool IsComputation_v
Auxiliary variable template for the IsComputation type trait.The IsComputation_v variable template pr...
Definition: IsComputation.h:90
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:3081
#define BLAZE_CONSTRAINT_MUST_BE_RESIZABLE_TYPE(T)
Constraint on the data type.In case the given data type T is not resizable, i.e. does not have a &#39;res...
Definition: Resizable.h:61
Header file for the implementation of the base template of the LowerMatrix.
Header file for the IsComputation type trait class.
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:3082
#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
auto operator*=(DenseMatrix< MT, SO > &mat, ST scalar) -> EnableIf_t< IsNumeric_v< ST >, MT & >
Multiplication assignment operator for the multiplication of a dense matrix and a scalar value ( )...
Definition: DenseMatrix.h:290
bool isIntact(const DiagonalMatrix< MT, SO, DF > &m)
Returns whether the invariants of the given diagonal matrix are intact.
Definition: DiagonalMatrix.h:263
bool isDefault(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: DiagonalProxy.h:631
#define BLAZE_CONSTRAINT_MUST_NOT_BE_HERMITIAN_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is an Hermitian matrix type, a compilation error is created.
Definition: Hermitian.h:79
BLAZE_ALWAYS_INLINE T1 & operator-=(SIMDPack< T1 > &lhs, const SIMDPack< T2 > &rhs)
Subtraction assignment operator for the subtraction of two SIMD packs.
Definition: BasicTypes.h:1375
typename DisableIf< Condition, T >::Type DisableIf_t
Auxiliary type for the DisableIf class template.The DisableIf_t alias declaration provides a convenie...
Definition: DisableIf.h:138
#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
bool isSquare(const Matrix< MT, SO > &matrix) noexcept
Checks if the given matrix is a square matrix.
Definition: Matrix.h:951
Header file for the IsResizable type trait.
System settings for the inline keywords.
Header file for the Size type trait.
#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
constexpr ptrdiff_t Size_v
Auxiliary variable template for the Size type trait.The Size_v variable template provides a convenien...
Definition: Size.h:176
Header file for the TrueType type/value trait base class.
Header file for the clear shim.