Dense.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_ADAPTORS_STRICTLYLOWERMATRIX_DENSE_H_
36 #define _BLAZE_MATH_ADAPTORS_STRICTLYLOWERMATRIX_DENSE_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
43 #include <iterator>
44 #include <utility>
48 #include <blaze/math/Aliases.h>
60 #include <blaze/math/Exception.h>
63 #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>
86 #include <blaze/util/Unused.h>
87 
88 
89 namespace blaze {
90 
91 //=================================================================================================
92 //
93 // CLASS TEMPLATE SPECIALIZATION FOR DENSE MATRICES
94 //
95 //=================================================================================================
96 
97 //*************************************************************************************************
105 template< typename MT // Type of the adapted dense matrix
106  , bool SO > // Storage order of the adapted dense matrix
107 class StrictlyLowerMatrix<MT,SO,true>
108  : public DenseMatrix< StrictlyLowerMatrix<MT,SO,true>, SO >
109 {
110  private:
111  //**Type definitions****************************************************************************
112  using OT = OppositeType_<MT>;
113  using TT = TransposeType_<MT>;
114  using ET = ElementType_<MT>;
115  //**********************************************************************************************
116 
117  public:
118  //**Type definitions****************************************************************************
119  using This = StrictlyLowerMatrix<MT,SO,true>;
120  using BaseType = DenseMatrix<This,SO>;
121  using ResultType = This;
122  using OppositeType = StrictlyLowerMatrix<OT,!SO,true>;
123  using TransposeType = StrictlyUpperMatrix<TT,!SO,true>;
124  using ElementType = ET;
125  using SIMDType = SIMDType_<MT>;
126  using ReturnType = ReturnType_<MT>;
127  using CompositeType = const This&;
128  using Reference = StrictlyLowerProxy<MT>;
129  using ConstReference = ConstReference_<MT>;
130  using Pointer = Pointer_<MT>;
131  using ConstPointer = ConstPointer_<MT>;
132  using ConstIterator = ConstIterator_<MT>;
133  //**********************************************************************************************
134 
135  //**Rebind struct definition********************************************************************
138  template< typename NewType > // Data type of the other matrix
139  struct Rebind {
141  using Other = StrictlyLowerMatrix< typename MT::template Rebind<NewType>::Other >;
142  };
143  //**********************************************************************************************
144 
145  //**Resize struct definition********************************************************************
148  template< size_t NewM // Number of rows of the other matrix
149  , size_t NewN > // Number of columns of the other matrix
150  struct Resize {
152  using Other = StrictlyLowerMatrix< typename MT::template Resize<NewM,NewN>::Other >;
153  };
154  //**********************************************************************************************
155 
156  //**Iterator class definition*******************************************************************
159  class Iterator
160  {
161  public:
162  //**Type definitions*************************************************************************
163  using IteratorCategory = std::random_access_iterator_tag;
164  using ValueType = ElementType_<MT>;
165  using PointerType = StrictlyLowerProxy<MT>;
166  using ReferenceType = StrictlyLowerProxy<MT>;
167  using DifferenceType = ptrdiff_t;
168 
169  // STL iterator requirements
170  using iterator_category = IteratorCategory;
171  using value_type = ValueType;
172  using pointer = PointerType;
173  using reference = ReferenceType;
174  using difference_type = DifferenceType;
175  //*******************************************************************************************
176 
177  //**Constructor******************************************************************************
180  inline Iterator() noexcept
181  : matrix_( nullptr ) // Reference to the adapted dense matrix
182  , row_ ( 0UL ) // The current row index of the iterator
183  , column_( 0UL ) // The current column index of the iterator
184  {}
185  //*******************************************************************************************
186 
187  //**Constructor******************************************************************************
194  inline Iterator( MT& matrix, size_t row, size_t column ) noexcept
195  : matrix_( &matrix ) // Reference to the adapted dense matrix
196  , row_ ( row ) // The current row-index of the iterator
197  , column_( column ) // The current column-index of the iterator
198  {}
199  //*******************************************************************************************
200 
201  //**Addition assignment operator*************************************************************
207  inline Iterator& operator+=( size_t inc ) noexcept {
208  ( SO )?( row_ += inc ):( column_ += inc );
209  return *this;
210  }
211  //*******************************************************************************************
212 
213  //**Subtraction assignment operator**********************************************************
219  inline Iterator& operator-=( size_t dec ) noexcept {
220  ( SO )?( row_ -= dec ):( column_ -= dec );
221  return *this;
222  }
223  //*******************************************************************************************
224 
225  //**Prefix increment operator****************************************************************
230  inline Iterator& operator++() noexcept {
231  ( SO )?( ++row_ ):( ++column_ );
232  return *this;
233  }
234  //*******************************************************************************************
235 
236  //**Postfix increment operator***************************************************************
241  inline const Iterator operator++( int ) noexcept {
242  const Iterator tmp( *this );
243  ++(*this);
244  return tmp;
245  }
246  //*******************************************************************************************
247 
248  //**Prefix decrement operator****************************************************************
253  inline Iterator& operator--() noexcept {
254  ( SO )?( --row_ ):( --column_ );
255  return *this;
256  }
257  //*******************************************************************************************
258 
259  //**Postfix decrement operator***************************************************************
264  inline const Iterator operator--( int ) noexcept {
265  const Iterator tmp( *this );
266  --(*this);
267  return tmp;
268  }
269  //*******************************************************************************************
270 
271  //**Element access operator******************************************************************
276  inline ReferenceType operator*() const {
277  return ReferenceType( *matrix_, row_, column_ );
278  }
279  //*******************************************************************************************
280 
281  //**Element access operator******************************************************************
286  inline PointerType operator->() const {
287  return PointerType( *matrix_, row_, column_ );
288  }
289  //*******************************************************************************************
290 
291  //**Load function****************************************************************************
301  inline SIMDType load() const {
302  return (*matrix_).load(row_,column_);
303  }
304  //*******************************************************************************************
305 
306  //**Loada function***************************************************************************
316  inline SIMDType loada() const {
317  return (*matrix_).loada(row_,column_);
318  }
319  //*******************************************************************************************
320 
321  //**Loadu function***************************************************************************
331  inline SIMDType loadu() const {
332  return (*matrix_).loadu(row_,column_);
333  }
334  //*******************************************************************************************
335 
336  //**Conversion operator**********************************************************************
341  inline operator ConstIterator() const {
342  if( SO )
343  return matrix_->begin( column_ ) + row_;
344  else
345  return matrix_->begin( row_ ) + column_;
346  }
347  //*******************************************************************************************
348 
349  //**Equality operator************************************************************************
356  friend inline bool operator==( const Iterator& lhs, const Iterator& rhs ) noexcept {
357  return ( SO )?( lhs.row_ == rhs.row_ ):( lhs.column_ == rhs.column_ );
358  }
359  //*******************************************************************************************
360 
361  //**Equality operator************************************************************************
368  friend inline bool operator==( const Iterator& lhs, const ConstIterator& rhs ) {
369  return ( ConstIterator( lhs ) == rhs );
370  }
371  //*******************************************************************************************
372 
373  //**Equality operator************************************************************************
380  friend inline bool operator==( const ConstIterator& lhs, const Iterator& rhs ) {
381  return ( lhs == ConstIterator( rhs ) );
382  }
383  //*******************************************************************************************
384 
385  //**Inequality operator**********************************************************************
392  friend inline bool operator!=( const Iterator& lhs, const Iterator& rhs ) noexcept {
393  return ( SO )?( lhs.row_ != rhs.row_ ):( lhs.column_ != rhs.column_ );
394  }
395  //*******************************************************************************************
396 
397  //**Inequality operator**********************************************************************
404  friend inline bool operator!=( const Iterator& lhs, const ConstIterator& rhs ) {
405  return ( ConstIterator( lhs ) != rhs );
406  }
407  //*******************************************************************************************
408 
409  //**Inequality operator**********************************************************************
416  friend inline bool operator!=( const ConstIterator& lhs, const Iterator& rhs ) {
417  return ( lhs != ConstIterator( rhs ) );
418  }
419  //*******************************************************************************************
420 
421  //**Less-than operator***********************************************************************
428  friend inline bool operator<( const Iterator& lhs, const Iterator& rhs ) noexcept {
429  return ( SO )?( lhs.row_ < rhs.row_ ):( lhs.column_ < rhs.column_ );
430  }
431  //*******************************************************************************************
432 
433  //**Less-than operator***********************************************************************
440  friend inline bool operator<( const Iterator& lhs, const ConstIterator& rhs ) {
441  return ( ConstIterator( lhs ) < rhs );
442  }
443  //*******************************************************************************************
444 
445  //**Less-than operator***********************************************************************
452  friend inline bool operator<( const ConstIterator& lhs, const Iterator& rhs ) {
453  return ( lhs < ConstIterator( rhs ) );
454  }
455  //*******************************************************************************************
456 
457  //**Greater-than operator********************************************************************
464  friend inline bool operator>( const Iterator& lhs, const Iterator& rhs ) noexcept {
465  return ( SO )?( lhs.row_ > rhs.row_ ):( lhs.column_ > rhs.column_ );
466  }
467  //*******************************************************************************************
468 
469  //**Greater-than operator********************************************************************
476  friend inline bool operator>( const Iterator& lhs, const ConstIterator& rhs ) {
477  return ( ConstIterator( lhs ) > rhs );
478  }
479  //*******************************************************************************************
480 
481  //**Greater-than operator********************************************************************
488  friend inline bool operator>( const ConstIterator& lhs, const Iterator& rhs ) {
489  return ( lhs > ConstIterator( rhs ) );
490  }
491  //*******************************************************************************************
492 
493  //**Less-or-equal-than operator**************************************************************
500  friend inline bool operator<=( const Iterator& lhs, const Iterator& rhs ) noexcept {
501  return ( SO )?( lhs.row_ <= rhs.row_ ):( lhs.column_ <= rhs.column_ );
502  }
503  //*******************************************************************************************
504 
505  //**Less-or-equal-than operator**************************************************************
512  friend inline bool operator<=( const Iterator& lhs, const ConstIterator& rhs ) {
513  return ( ConstIterator( lhs ) <= rhs );
514  }
515  //*******************************************************************************************
516 
517  //**Less-or-equal-than operator**************************************************************
524  friend inline bool operator<=( const ConstIterator& lhs, const Iterator& rhs ) {
525  return ( lhs <= ConstIterator( rhs ) );
526  }
527  //*******************************************************************************************
528 
529  //**Greater-or-equal-than operator***********************************************************
536  friend inline bool operator>=( const Iterator& lhs, const Iterator& rhs ) noexcept {
537  return ( SO )?( lhs.row_ >= rhs.row_ ):( lhs.column_ >= rhs.column_ );
538  }
539  //*******************************************************************************************
540 
541  //**Greater-or-equal-than operator***********************************************************
548  friend inline bool operator>=( const Iterator& lhs, const ConstIterator& rhs ) {
549  return ( ConstIterator( lhs ) >= rhs );
550  }
551  //*******************************************************************************************
552 
553  //**Greater-or-equal-than operator***********************************************************
560  friend inline bool operator>=( const ConstIterator& lhs, const Iterator& rhs ) {
561  return ( lhs >= ConstIterator( rhs ) );
562  }
563  //*******************************************************************************************
564 
565  //**Subtraction operator*********************************************************************
571  inline DifferenceType operator-( const Iterator& rhs ) const noexcept {
572  return ( SO )?( row_ - rhs.row_ ):( column_ - rhs.column_ );
573  }
574  //*******************************************************************************************
575 
576  //**Addition operator************************************************************************
583  friend inline const Iterator operator+( const Iterator& it, size_t inc ) noexcept {
584  if( SO )
585  return Iterator( *it.matrix_, it.row_ + inc, it.column_ );
586  else
587  return Iterator( *it.matrix_, it.row_, it.column_ + inc );
588  }
589  //*******************************************************************************************
590 
591  //**Addition operator************************************************************************
598  friend inline const Iterator operator+( size_t inc, const Iterator& it ) noexcept {
599  if( SO )
600  return Iterator( *it.matrix_, it.row_ + inc, it.column_ );
601  else
602  return Iterator( *it.matrix_, it.row_, it.column_ + inc );
603  }
604  //*******************************************************************************************
605 
606  //**Subtraction operator*********************************************************************
613  friend inline const Iterator operator-( const Iterator& it, size_t dec ) noexcept {
614  if( SO )
615  return Iterator( *it.matrix_, it.row_ - dec, it.column_ );
616  else
617  return Iterator( *it.matrix_, it.row_, it.column_ - dec );
618  }
619  //*******************************************************************************************
620 
621  private:
622  //**Member variables*************************************************************************
623  MT* matrix_;
624  size_t row_;
625  size_t column_;
626  //*******************************************************************************************
627  };
628  //**********************************************************************************************
629 
630  //**Compilation flags***************************************************************************
632  enum : bool { simdEnabled = MT::simdEnabled };
633 
635  enum : bool { smpAssignable = MT::smpAssignable };
636  //**********************************************************************************************
637 
638  //**Constructors********************************************************************************
641  explicit inline StrictlyLowerMatrix();
642  template< typename A1 > explicit inline StrictlyLowerMatrix( const A1& a1 );
643  explicit inline StrictlyLowerMatrix( size_t n, const ElementType& init );
644 
645  explicit inline StrictlyLowerMatrix( initializer_list< initializer_list<ElementType> > list );
646 
647  template< typename Other >
648  explicit inline StrictlyLowerMatrix( size_t n, const Other* array );
649 
650  template< typename Other, size_t N >
651  explicit inline StrictlyLowerMatrix( const Other (&array)[N][N] );
652 
653  explicit inline StrictlyLowerMatrix( ElementType* ptr, size_t n );
654  explicit inline StrictlyLowerMatrix( ElementType* ptr, size_t n, size_t nn );
655 
656  inline StrictlyLowerMatrix( const StrictlyLowerMatrix& m );
657  inline StrictlyLowerMatrix( StrictlyLowerMatrix&& m ) noexcept;
659  //**********************************************************************************************
660 
661  //**Destructor**********************************************************************************
662  // No explicitly declared destructor.
663  //**********************************************************************************************
664 
665  //**Data access functions***********************************************************************
668  inline Reference operator()( size_t i, size_t j );
669  inline ConstReference operator()( size_t i, size_t j ) const;
670  inline Reference at( size_t i, size_t j );
671  inline ConstReference at( size_t i, size_t j ) const;
672  inline ConstPointer data () const noexcept;
673  inline ConstPointer data ( size_t i ) const noexcept;
674  inline Iterator begin ( size_t i );
675  inline ConstIterator begin ( size_t i ) const;
676  inline ConstIterator cbegin( size_t i ) const;
677  inline Iterator end ( size_t i );
678  inline ConstIterator end ( size_t i ) const;
679  inline ConstIterator cend ( size_t i ) const;
681  //**********************************************************************************************
682 
683  //**Assignment operators************************************************************************
686  inline StrictlyLowerMatrix& operator=( const ElementType& rhs );
687  inline StrictlyLowerMatrix& operator=( initializer_list< initializer_list<ElementType> > list );
688 
689  template< typename Other, size_t N >
690  inline StrictlyLowerMatrix& operator=( const Other (&array)[N][N] );
691 
692  inline StrictlyLowerMatrix& operator=( const StrictlyLowerMatrix& rhs );
693  inline StrictlyLowerMatrix& operator=( StrictlyLowerMatrix&& rhs ) noexcept;
694 
695  template< typename MT2, bool SO2 >
696  inline DisableIf_< IsComputation<MT2>, StrictlyLowerMatrix& >
697  operator=( const Matrix<MT2,SO2>& rhs );
698 
699  template< typename MT2, bool SO2 >
700  inline EnableIf_< IsComputation<MT2>, StrictlyLowerMatrix& >
701  operator=( const Matrix<MT2,SO2>& rhs );
702 
703  template< typename MT2, bool SO2 >
704  inline DisableIf_< IsComputation<MT2>, StrictlyLowerMatrix& >
705  operator+=( const Matrix<MT2,SO2>& rhs );
706 
707  template< typename MT2, bool SO2 >
708  inline EnableIf_< IsComputation<MT2>, StrictlyLowerMatrix& >
709  operator+=( const Matrix<MT2,SO2>& rhs );
710 
711  template< typename MT2, bool SO2 >
712  inline DisableIf_< IsComputation<MT2>, StrictlyLowerMatrix& >
713  operator-=( const Matrix<MT2,SO2>& rhs );
714 
715  template< typename MT2, bool SO2 >
716  inline EnableIf_< IsComputation<MT2>, StrictlyLowerMatrix& >
717  operator-=( const Matrix<MT2,SO2>& rhs );
718 
719  template< typename MT2, bool SO2 >
720  inline StrictlyLowerMatrix& operator%=( const Matrix<MT2,SO2>& rhs );
721 
722  template< typename MT2, bool SO2 >
723  inline StrictlyLowerMatrix& operator*=( const Matrix<MT2,SO2>& rhs );
724 
725  template< typename Other >
726  inline EnableIf_< IsNumeric<Other>, StrictlyLowerMatrix >& operator*=( Other rhs );
727 
728  template< typename Other >
729  inline EnableIf_< IsNumeric<Other>, StrictlyLowerMatrix >& operator/=( Other rhs );
731  //**********************************************************************************************
732 
733  //**Utility functions***************************************************************************
736  inline size_t rows() const noexcept;
737  inline size_t columns() const noexcept;
738  inline size_t spacing() const noexcept;
739  inline size_t capacity() const noexcept;
740  inline size_t capacity( size_t i ) const noexcept;
741  inline size_t nonZeros() const;
742  inline size_t nonZeros( size_t i ) const;
743  inline void reset();
744  inline void reset( size_t i );
745  inline void clear();
746  void resize ( size_t n, bool preserve=true );
747  inline void extend ( size_t n, bool preserve=true );
748  inline void reserve( size_t elements );
749  inline void shrinkToFit();
750  inline void swap( StrictlyLowerMatrix& m ) noexcept;
751 
752  static inline constexpr size_t maxNonZeros() noexcept;
753  static inline constexpr size_t maxNonZeros( size_t n ) noexcept;
755  //**********************************************************************************************
756 
757  //**Numeric functions***************************************************************************
760  template< typename Other > inline StrictlyLowerMatrix& scale( const Other& scalar );
762  //**********************************************************************************************
763 
764  //**Debugging functions*************************************************************************
767  inline bool isIntact() const noexcept;
769  //**********************************************************************************************
770 
771  //**Expression template evaluation functions****************************************************
774  template< typename Other > inline bool canAlias ( const Other* alias ) const noexcept;
775  template< typename Other > inline bool isAliased( const Other* alias ) const noexcept;
776 
777  inline bool isAligned () const noexcept;
778  inline bool canSMPAssign() const noexcept;
779 
780  BLAZE_ALWAYS_INLINE SIMDType load ( size_t i, size_t j ) const noexcept;
781  BLAZE_ALWAYS_INLINE SIMDType loada( size_t i, size_t j ) const noexcept;
782  BLAZE_ALWAYS_INLINE SIMDType loadu( size_t i, size_t j ) const noexcept;
784  //**********************************************************************************************
785 
786  private:
787  //**Construction functions**********************************************************************
790  inline const MT construct( size_t n , TrueType );
791  inline const MT construct( const ElementType& value, FalseType );
792 
793  template< typename MT2, bool SO2, typename T >
794  inline const MT construct( const Matrix<MT2,SO2>& m, T );
796  //**********************************************************************************************
797 
798  //**Member variables****************************************************************************
801  MT matrix_;
802 
803  //**********************************************************************************************
804 
805  //**Friend declarations*************************************************************************
806  template< typename MT2, bool SO2, bool DF2 >
807  friend MT2& derestrict( StrictlyLowerMatrix<MT2,SO2,DF2>& m );
808  //**********************************************************************************************
809 
810  //**Compile time checks*************************************************************************
823  BLAZE_STATIC_ASSERT( Rows<MT>::value == Columns<MT>::value );
824  //**********************************************************************************************
825 };
827 //*************************************************************************************************
828 
829 
830 
831 
832 //=================================================================================================
833 //
834 // CONSTRUCTORS
835 //
836 //=================================================================================================
837 
838 //*************************************************************************************************
842 template< typename MT // Type of the adapted dense matrix
843  , bool SO > // Storage order of the adapted dense matrix
844 inline StrictlyLowerMatrix<MT,SO,true>::StrictlyLowerMatrix()
845  : matrix_() // The adapted dense matrix
846 {
847  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly lower matrix detected" );
848  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
849 }
851 //*************************************************************************************************
852 
853 
854 //*************************************************************************************************
872 template< typename MT // Type of the adapted dense matrix
873  , bool SO > // Storage order of the adapted dense matrix
874 template< typename A1 > // Type of the constructor argument
875 inline StrictlyLowerMatrix<MT,SO,true>::StrictlyLowerMatrix( const A1& a1 )
876  : matrix_( construct( a1, typename IsResizable<MT>::Type() ) ) // The adapted dense matrix
877 {
878  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly lower matrix detected" );
879  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
880 }
882 //*************************************************************************************************
883 
884 
885 //*************************************************************************************************
892 template< typename MT // Type of the adapted dense matrix
893  , bool SO > // Storage order of the adapted dense matrix
894 inline StrictlyLowerMatrix<MT,SO,true>::StrictlyLowerMatrix( size_t n, const ElementType& init )
895  : matrix_( n, n, ElementType() ) // The adapted dense matrix
896 {
898 
899  if( SO ) {
900  for( size_t j=0UL; j<columns(); ++j ) {
901  for( size_t i=j+1UL; i<rows(); ++i )
902  matrix_(i,j) = init;
903  }
904  }
905  else {
906  for( size_t i=0UL; i<rows(); ++i ) {
907  for( size_t j=0UL; j<i; ++j )
908  matrix_(i,j) = init;
909  }
910  }
911 
912  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly lower matrix detected" );
913  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
914 }
916 //*************************************************************************************************
917 
918 
919 //*************************************************************************************************
942 template< typename MT // Type of the adapted dense matrix
943  , bool SO > // Storage order of the adapted dense matrix
944 inline StrictlyLowerMatrix<MT,SO,true>::StrictlyLowerMatrix( initializer_list< initializer_list<ElementType> > list )
945  : matrix_( list ) // The adapted dense matrix
946 {
947  if( !isStrictlyLower( matrix_ ) ) {
948  BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of strictly lower matrix" );
949  }
950 
951  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
952 }
954 //*************************************************************************************************
955 
956 
957 //*************************************************************************************************
983 template< typename MT // Type of the adapted dense matrix
984  , bool SO > // Storage order of the adapted dense matrix
985 template< typename Other > // Data type of the initialization array
986 inline StrictlyLowerMatrix<MT,SO,true>::StrictlyLowerMatrix( size_t n, const Other* array )
987  : matrix_( n, n, array ) // The adapted dense matrix
988 {
989  if( !isStrictlyLower( matrix_ ) ) {
990  BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of strictly lower matrix" );
991  }
992 
993  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
994 }
996 //*************************************************************************************************
997 
998 
999 //*************************************************************************************************
1022 template< typename MT // Type of the adapted dense matrix
1023  , bool SO > // Storage order of the adapted dense matrix
1024 template< typename Other // Data type of the initialization array
1025  , size_t N > // Number of rows and columns of the initialization array
1026 inline StrictlyLowerMatrix<MT,SO,true>::StrictlyLowerMatrix( const Other (&array)[N][N] )
1027  : matrix_( array ) // The adapted dense matrix
1028 {
1029  if( !isStrictlyLower( matrix_ ) ) {
1030  BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of strictly lower matrix" );
1031  }
1032 
1033  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1034 }
1036 //*************************************************************************************************
1037 
1038 
1039 //*************************************************************************************************
1072 template< typename MT // Type of the adapted dense matrix
1073  , bool SO > // Storage order of the adapted dense matrix
1074 inline StrictlyLowerMatrix<MT,SO,true>::StrictlyLowerMatrix( ElementType* ptr, size_t n )
1075  : matrix_( ptr, n, n ) // The adapted dense matrix
1076 {
1077  if( !isStrictlyLower( matrix_ ) ) {
1078  BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of strictly lower matrix" );
1079  }
1080 
1081  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1082 }
1084 //*************************************************************************************************
1085 
1086 
1087 //*************************************************************************************************
1121 template< typename MT // Type of the adapted dense matrix
1122  , bool SO > // Storage order of the adapted dense matrix
1123 inline StrictlyLowerMatrix<MT,SO,true>::StrictlyLowerMatrix( ElementType* ptr, size_t n, size_t nn )
1124  : matrix_( ptr, n, n, nn ) // The adapted dense matrix
1125 {
1126  if( !isStrictlyLower( matrix_ ) ) {
1127  BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of strictly lower matrix" );
1128  }
1129 
1130  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1131 }
1133 //*************************************************************************************************
1134 
1135 
1136 //*************************************************************************************************
1142 template< typename MT // Type of the adapted dense matrix
1143  , bool SO > // Storage order of the adapted dense matrix
1144 inline StrictlyLowerMatrix<MT,SO,true>::StrictlyLowerMatrix( const StrictlyLowerMatrix& m )
1145  : matrix_( m.matrix_ ) // The adapted dense matrix
1146 {
1147  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly lower matrix detected" );
1148  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1149 }
1151 //*************************************************************************************************
1152 
1153 
1154 //*************************************************************************************************
1160 template< typename MT // Type of the adapted dense matrix
1161  , bool SO > // Storage order of the adapted dense matrix
1162 inline StrictlyLowerMatrix<MT,SO,true>::StrictlyLowerMatrix( StrictlyLowerMatrix&& m ) noexcept
1163  : matrix_( std::move( m.matrix_ ) ) // The adapted dense matrix
1164 {
1165  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly lower matrix detected" );
1166  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1167 }
1169 //*************************************************************************************************
1170 
1171 
1172 
1173 
1174 //=================================================================================================
1175 //
1176 // DATA ACCESS FUNCTIONS
1177 //
1178 //=================================================================================================
1179 
1180 //*************************************************************************************************
1196 template< typename MT // Type of the adapted dense matrix
1197  , bool SO > // Storage order of the adapted dense matrix
1199  StrictlyLowerMatrix<MT,SO,true>::operator()( size_t i, size_t j )
1200 {
1201  BLAZE_USER_ASSERT( i<rows() , "Invalid row access index" );
1202  BLAZE_USER_ASSERT( j<columns(), "Invalid column access index" );
1203 
1204  return Reference( matrix_, i, j );
1205 }
1207 //*************************************************************************************************
1208 
1209 
1210 //*************************************************************************************************
1226 template< typename MT // Type of the adapted dense matrix
1227  , bool SO > // Storage order of the adapted dense matrix
1229  StrictlyLowerMatrix<MT,SO,true>::operator()( size_t i, size_t j ) const
1230 {
1231  BLAZE_USER_ASSERT( i<rows() , "Invalid row access index" );
1232  BLAZE_USER_ASSERT( j<columns(), "Invalid column access index" );
1233 
1234  return matrix_(i,j);
1235 }
1237 //*************************************************************************************************
1238 
1239 
1240 //*************************************************************************************************
1257 template< typename MT // Type of the adapted dense matrix
1258  , bool SO > // Storage order of the adapted dense matrix
1260  StrictlyLowerMatrix<MT,SO,true>::at( size_t i, size_t j )
1261 {
1262  if( i >= rows() ) {
1263  BLAZE_THROW_OUT_OF_RANGE( "Invalid row access index" );
1264  }
1265  if( j >= columns() ) {
1266  BLAZE_THROW_OUT_OF_RANGE( "Invalid column access index" );
1267  }
1268  return (*this)(i,j);
1269 }
1271 //*************************************************************************************************
1272 
1273 
1274 //*************************************************************************************************
1291 template< typename MT // Type of the adapted dense matrix
1292  , bool SO > // Storage order of the adapted dense matrix
1294  StrictlyLowerMatrix<MT,SO,true>::at( size_t i, size_t j ) const
1295 {
1296  if( i >= rows() ) {
1297  BLAZE_THROW_OUT_OF_RANGE( "Invalid row access index" );
1298  }
1299  if( j >= columns() ) {
1300  BLAZE_THROW_OUT_OF_RANGE( "Invalid column access index" );
1301  }
1302  return (*this)(i,j);
1303 }
1305 //*************************************************************************************************
1306 
1307 
1308 //*************************************************************************************************
1321 template< typename MT // Type of the adapted dense matrix
1322  , bool SO > // Storage order of the adapted dense matrix
1323 inline typename StrictlyLowerMatrix<MT,SO,true>::ConstPointer
1324  StrictlyLowerMatrix<MT,SO,true>::data() const noexcept
1325 {
1326  return matrix_.data();
1327 }
1329 //*************************************************************************************************
1330 
1331 
1332 //*************************************************************************************************
1341 template< typename MT // Type of the adapted dense matrix
1342  , bool SO > // Storage order of the adapted dense matrix
1343 inline typename StrictlyLowerMatrix<MT,SO,true>::ConstPointer
1344  StrictlyLowerMatrix<MT,SO,true>::data( size_t i ) const noexcept
1345 {
1346  return matrix_.data(i);
1347 }
1349 //*************************************************************************************************
1350 
1351 
1352 //*************************************************************************************************
1364 template< typename MT // Type of the adapted dense matrix
1365  , bool SO > // Storage order of the adapted dense matrix
1368 {
1369  if( SO )
1370  return Iterator( matrix_, 0UL, i );
1371  else
1372  return Iterator( matrix_, i, 0UL );
1373 }
1375 //*************************************************************************************************
1376 
1377 
1378 //*************************************************************************************************
1390 template< typename MT // Type of the adapted dense matrix
1391  , bool SO > // Storage order of the adapted dense matrix
1393  StrictlyLowerMatrix<MT,SO,true>::begin( size_t i ) const
1394 {
1395  return matrix_.begin(i);
1396 }
1398 //*************************************************************************************************
1399 
1400 
1401 //*************************************************************************************************
1413 template< typename MT // Type of the adapted dense matrix
1414  , bool SO > // Storage order of the adapted dense matrix
1416  StrictlyLowerMatrix<MT,SO,true>::cbegin( size_t i ) const
1417 {
1418  return matrix_.cbegin(i);
1419 }
1421 //*************************************************************************************************
1422 
1423 
1424 //*************************************************************************************************
1436 template< typename MT // Type of the adapted dense matrix
1437  , bool SO > // Storage order of the adapted dense matrix
1440 {
1441  if( SO )
1442  return Iterator( matrix_, rows(), i );
1443  else
1444  return Iterator( matrix_, i, columns() );
1445 }
1447 //*************************************************************************************************
1448 
1449 
1450 //*************************************************************************************************
1462 template< typename MT // Type of the adapted dense matrix
1463  , bool SO > // Storage order of the adapted dense matrix
1465  StrictlyLowerMatrix<MT,SO,true>::end( size_t i ) const
1466 {
1467  return matrix_.end(i);
1468 }
1470 //*************************************************************************************************
1471 
1472 
1473 //*************************************************************************************************
1485 template< typename MT // Type of the adapted dense matrix
1486  , bool SO > // Storage order of the adapted dense matrix
1488  StrictlyLowerMatrix<MT,SO,true>::cend( size_t i ) const
1489 {
1490  return matrix_.cend(i);
1491 }
1493 //*************************************************************************************************
1494 
1495 
1496 
1497 
1498 //=================================================================================================
1499 //
1500 // ASSIGNMENT OPERATORS
1501 //
1502 //=================================================================================================
1503 
1504 //*************************************************************************************************
1511 template< typename MT // Type of the adapted dense matrix
1512  , bool SO > // Storage order of the adapted dense matrix
1513 inline StrictlyLowerMatrix<MT,SO,true>&
1514  StrictlyLowerMatrix<MT,SO,true>::operator=( const ElementType& rhs )
1515 {
1516  if( SO ) {
1517  for( size_t j=0UL; j<columns(); ++j )
1518  for( size_t i=j+1UL; i<rows(); ++i )
1519  matrix_(i,j) = rhs;
1520  }
1521  else {
1522  for( size_t i=1UL; i<rows(); ++i )
1523  for( size_t j=0UL; j<i; ++j )
1524  matrix_(i,j) = rhs;
1525  }
1526 
1527  return *this;
1528 }
1530 //*************************************************************************************************
1531 
1532 
1533 //*************************************************************************************************
1557 template< typename MT // Type of the adapted dense matrix
1558  , bool SO > // Storage order of the adapted dense matrix
1559 inline StrictlyLowerMatrix<MT,SO,true>&
1560  StrictlyLowerMatrix<MT,SO,true>::operator=( initializer_list< initializer_list<ElementType> > list )
1561 {
1562  MT tmp( list );
1563 
1564  if( !isStrictlyLower( tmp ) ) {
1565  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to strictly lower matrix" );
1566  }
1567 
1568  matrix_ = std::move( tmp );
1569 
1570  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly lower matrix detected" );
1571  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1572 
1573  return *this;
1574 }
1576 //*************************************************************************************************
1577 
1578 
1579 //*************************************************************************************************
1604 template< typename MT // Type of the adapted dense matrix
1605  , bool SO > // Storage order of the adapted dense matrix
1606 template< typename Other // Data type of the initialization array
1607  , size_t N > // Number of rows and columns of the initialization array
1608 inline StrictlyLowerMatrix<MT,SO,true>&
1609  StrictlyLowerMatrix<MT,SO,true>::operator=( const Other (&array)[N][N] )
1610 {
1611  MT tmp( array );
1612 
1613  if( !isStrictlyLower( tmp ) ) {
1614  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to strictly lower matrix" );
1615  }
1616 
1617  matrix_ = std::move( tmp );
1618 
1619  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly lower matrix detected" );
1620  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1621 
1622  return *this;
1623 }
1625 //*************************************************************************************************
1626 
1627 
1628 //*************************************************************************************************
1638 template< typename MT // Type of the adapted dense matrix
1639  , bool SO > // Storage order of the adapted dense matrix
1640 inline StrictlyLowerMatrix<MT,SO,true>&
1641  StrictlyLowerMatrix<MT,SO,true>::operator=( const StrictlyLowerMatrix& rhs )
1642 {
1643  matrix_ = rhs.matrix_;
1644 
1645  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly lower matrix detected" );
1646  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1647 
1648  return *this;
1649 }
1651 //*************************************************************************************************
1652 
1653 
1654 //*************************************************************************************************
1661 template< typename MT // Type of the adapted dense matrix
1662  , bool SO > // Storage order of the adapted dense matrix
1663 inline StrictlyLowerMatrix<MT,SO,true>&
1664  StrictlyLowerMatrix<MT,SO,true>::operator=( StrictlyLowerMatrix&& rhs ) noexcept
1665 {
1666  matrix_ = std::move( rhs.matrix_ );
1667 
1668  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly lower matrix detected" );
1669  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1670 
1671  return *this;
1672 }
1674 //*************************************************************************************************
1675 
1676 
1677 //*************************************************************************************************
1690 template< typename MT // Type of the adapted dense matrix
1691  , bool SO > // Storage order of the adapted dense matrix
1692 template< typename MT2 // Type of the right-hand side matrix
1693  , bool SO2 > // Storage order of the right-hand side matrix
1694 inline DisableIf_< IsComputation<MT2>, StrictlyLowerMatrix<MT,SO,true>& >
1695  StrictlyLowerMatrix<MT,SO,true>::operator=( const Matrix<MT2,SO2>& rhs )
1696 {
1697  if( IsUniTriangular<MT2>::value ||
1698  ( !IsStrictlyLower<MT2>::value && !isStrictlyLower( ~rhs ) ) ) {
1699  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to strictly lower matrix" );
1700  }
1701 
1702  matrix_ = decllow( ~rhs );
1703 
1704  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly lower matrix detected" );
1705  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1706 
1707  return *this;
1708 }
1710 //*************************************************************************************************
1711 
1712 
1713 //*************************************************************************************************
1726 template< typename MT // Type of the adapted dense matrix
1727  , bool SO > // Storage order of the adapted dense matrix
1728 template< typename MT2 // Type of the right-hand side matrix
1729  , bool SO2 > // Storage order of the right-hand side matrix
1730 inline EnableIf_< IsComputation<MT2>, StrictlyLowerMatrix<MT,SO,true>& >
1731  StrictlyLowerMatrix<MT,SO,true>::operator=( const Matrix<MT2,SO2>& rhs )
1732 {
1733  if( IsUniTriangular<MT2>::value || ( !IsSquare<MT2>::value && !isSquare( ~rhs ) ) ) {
1734  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to strictly lower matrix" );
1735  }
1736 
1737  if( IsStrictlyLower<MT2>::value ) {
1738  matrix_ = ~rhs;
1739  }
1740  else {
1741  MT tmp( ~rhs );
1742 
1743  if( !isStrictlyLower( tmp ) ) {
1744  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to strictly lower matrix" );
1745  }
1746 
1747  matrix_ = std::move( tmp );
1748  }
1749 
1750  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly lower matrix detected" );
1751  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1752 
1753  return *this;
1754 }
1756 //*************************************************************************************************
1757 
1758 
1759 //*************************************************************************************************
1772 template< typename MT // Type of the adapted dense matrix
1773  , bool SO > // Storage order of the adapted dense matrix
1774 template< typename MT2 // Type of the right-hand side matrix
1775  , bool SO2 > // Storage order of the right-hand side matrix
1776 inline DisableIf_< IsComputation<MT2>, StrictlyLowerMatrix<MT,SO,true>& >
1777  StrictlyLowerMatrix<MT,SO,true>::operator+=( const Matrix<MT2,SO2>& rhs )
1778 {
1779  if( IsUniTriangular<MT2>::value ||
1780  ( !IsStrictlyLower<MT2>::value && !isStrictlyLower( ~rhs ) ) ) {
1781  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to strictly lower matrix" );
1782  }
1783 
1784  matrix_ += decllow( ~rhs );
1785 
1786  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly 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 EnableIf_< IsComputation<MT2>, StrictlyLowerMatrix<MT,SO,true>& >
1813  StrictlyLowerMatrix<MT,SO,true>::operator+=( const Matrix<MT2,SO2>& rhs )
1814 {
1815  if( IsUniTriangular<MT2>::value || ( !IsSquare<MT2>::value && !isSquare( ~rhs ) ) ) {
1816  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to strictly lower matrix" );
1817  }
1818 
1819  if( IsStrictlyLower<MT2>::value ) {
1820  matrix_ += ~rhs;
1821  }
1822  else {
1823  const ResultType_<MT2> tmp( ~rhs );
1824 
1825  if( !isStrictlyLower( tmp ) ) {
1826  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to strictly lower matrix" );
1827  }
1828 
1829  matrix_ += decllow( tmp );
1830  }
1831 
1832  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly 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 DisableIf_< IsComputation<MT2>, StrictlyLowerMatrix<MT,SO,true>& >
1859  StrictlyLowerMatrix<MT,SO,true>::operator-=( const Matrix<MT2,SO2>& rhs )
1860 {
1861  if( IsUniTriangular<MT2>::value ||
1862  ( !IsStrictlyLower<MT2>::value && !isStrictlyLower( ~rhs ) ) ) {
1863  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to strictly lower matrix" );
1864  }
1865 
1866  matrix_ -= decllow( ~rhs );
1867 
1868  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly lower matrix detected" );
1869  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1870 
1871  return *this;
1872 }
1874 //*************************************************************************************************
1875 
1876 
1877 //*************************************************************************************************
1890 template< typename MT // Type of the adapted dense matrix
1891  , bool SO > // Storage order of the adapted dense matrix
1892 template< typename MT2 // Type of the right-hand side matrix
1893  , bool SO2 > // Storage order of the right-hand side matrix
1894 inline EnableIf_< IsComputation<MT2>, StrictlyLowerMatrix<MT,SO,true>& >
1895  StrictlyLowerMatrix<MT,SO,true>::operator-=( const Matrix<MT2,SO2>& rhs )
1896 {
1897  if( IsUniTriangular<MT2>::value || ( !IsSquare<MT2>::value && !isSquare( ~rhs ) ) ) {
1898  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to strictly lower matrix" );
1899  }
1900 
1901  if( IsStrictlyLower<MT2>::value ) {
1902  matrix_ -= ~rhs;
1903  }
1904  else {
1905  const ResultType_<MT2> tmp( ~rhs );
1906 
1907  if( !isStrictlyLower( tmp ) ) {
1908  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to strictly lower matrix" );
1909  }
1910 
1911  matrix_ -= decllow( tmp );
1912  }
1913 
1914  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly lower matrix detected" );
1915  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1916 
1917  return *this;
1918 }
1920 //*************************************************************************************************
1921 
1922 
1923 //*************************************************************************************************
1934 template< typename MT // Type of the adapted dense matrix
1935  , bool SO > // Storage order of the adapted dense matrix
1936 template< typename MT2 // Type of the right-hand side matrix
1937  , bool SO2 > // Storage order of the right-hand side matrix
1938 inline StrictlyLowerMatrix<MT,SO,true>&
1939  StrictlyLowerMatrix<MT,SO,true>::operator%=( const Matrix<MT2,SO2>& rhs )
1940 {
1941  if( !IsSquare<MT2>::value && !isSquare( ~rhs ) ) {
1942  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to strictly lower matrix" );
1943  }
1944 
1945  matrix_ %= ~rhs;
1946 
1947  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly lower 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 StrictlyLowerMatrix<MT,SO,true>&
1973  StrictlyLowerMatrix<MT,SO,true>::operator*=( const Matrix<MT2,SO2>& rhs )
1974 {
1975  if( matrix_.rows() != (~rhs).columns() ) {
1976  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to strictly lower matrix" );
1977  }
1978 
1979  MT tmp( matrix_ * ~rhs );
1980 
1981  if( !isStrictlyLower( tmp ) ) {
1982  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to strictly lower matrix" );
1983  }
1984 
1985  matrix_ = std::move( tmp );
1986 
1987  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly lower matrix detected" );
1988  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1989 
1990  return *this;
1991 }
1993 //*************************************************************************************************
1994 
1995 
1996 //*************************************************************************************************
2004 template< typename MT // Type of the adapted dense matrix
2005  , bool SO > // Storage order of the adapted dense matrix
2006 template< typename Other > // Data type of the right-hand side scalar
2007 inline EnableIf_< IsNumeric<Other>, StrictlyLowerMatrix<MT,SO,true> >&
2009 {
2010  matrix_ *= rhs;
2011  return *this;
2012 }
2013 //*************************************************************************************************
2014 
2015 
2016 //*************************************************************************************************
2024 template< typename MT // Type of the adapted dense matrix
2025  , bool SO > // Storage order of the adapted dense matrix
2026 template< typename Other > // Data type of the right-hand side scalar
2027 inline EnableIf_< IsNumeric<Other>, StrictlyLowerMatrix<MT,SO,true> >&
2029 {
2030  BLAZE_USER_ASSERT( rhs != Other(0), "Division by zero detected" );
2031 
2032  matrix_ /= rhs;
2033  return *this;
2034 }
2036 //*************************************************************************************************
2037 
2038 
2039 
2040 
2041 //=================================================================================================
2042 //
2043 // UTILITY FUNCTIONS
2044 //
2045 //=================================================================================================
2046 
2047 //*************************************************************************************************
2053 template< typename MT // Type of the adapted dense matrix
2054  , bool SO > // Storage order of the adapted dense matrix
2055 inline size_t StrictlyLowerMatrix<MT,SO,true>::rows() const noexcept
2056 {
2057  return matrix_.rows();
2058 }
2060 //*************************************************************************************************
2061 
2062 
2063 //*************************************************************************************************
2069 template< typename MT // Type of the adapted dense matrix
2070  , bool SO > // Storage order of the adapted dense matrix
2071 inline size_t StrictlyLowerMatrix<MT,SO,true>::columns() const noexcept
2072 {
2073  return matrix_.columns();
2074 }
2076 //*************************************************************************************************
2077 
2078 
2079 //*************************************************************************************************
2090 template< typename MT // Type of the adapted dense matrix
2091  , bool SO > // Storage order of the adapted dense matrix
2092 inline size_t StrictlyLowerMatrix<MT,SO,true>::spacing() const noexcept
2093 {
2094  return matrix_.spacing();
2095 }
2097 //*************************************************************************************************
2098 
2099 
2100 //*************************************************************************************************
2106 template< typename MT // Type of the adapted dense matrix
2107  , bool SO > // Storage order of the adapted dense matrix
2108 inline size_t StrictlyLowerMatrix<MT,SO,true>::capacity() const noexcept
2109 {
2110  return matrix_.capacity();
2111 }
2113 //*************************************************************************************************
2114 
2115 
2116 //*************************************************************************************************
2128 template< typename MT // Type of the adapted dense matrix
2129  , bool SO > // Storage order of the adapted dense matrix
2130 inline size_t StrictlyLowerMatrix<MT,SO,true>::capacity( size_t i ) const noexcept
2131 {
2132  return matrix_.capacity(i);
2133 }
2135 //*************************************************************************************************
2136 
2137 
2138 //*************************************************************************************************
2144 template< typename MT // Type of the adapted dense matrix
2145  , bool SO > // Storage order of the adapted dense matrix
2146 inline size_t StrictlyLowerMatrix<MT,SO,true>::nonZeros() const
2147 {
2148  return matrix_.nonZeros();
2149 }
2151 //*************************************************************************************************
2152 
2153 
2154 //*************************************************************************************************
2166 template< typename MT // Type of the adapted dense matrix
2167  , bool SO > // Storage order of the adapted dense matrix
2168 inline size_t StrictlyLowerMatrix<MT,SO,true>::nonZeros( size_t i ) const
2169 {
2170  return matrix_.nonZeros(i);
2171 }
2173 //*************************************************************************************************
2174 
2175 
2176 //*************************************************************************************************
2182 template< typename MT // Type of the adapted dense matrix
2183  , bool SO > // Storage order of the adapted dense matrix
2185 {
2186  using blaze::clear;
2187 
2188  if( SO ) {
2189  for( size_t j=0UL; j<columns(); ++j )
2190  for( size_t i=j+1UL; i<rows(); ++i )
2191  clear( matrix_(i,j) );
2192  }
2193  else {
2194  for( size_t i=1UL; i<rows(); ++i )
2195  for( size_t j=0UL; j<i; ++j )
2196  clear( matrix_(i,j) );
2197  }
2198 }
2200 //*************************************************************************************************
2201 
2202 
2203 //*************************************************************************************************
2216 template< typename MT // Type of the adapted dense matrix
2217  , bool SO > // Storage order of the adapted dense matrix
2218 inline void StrictlyLowerMatrix<MT,SO,true>::reset( size_t i )
2219 {
2220  using blaze::clear;
2221 
2222  if( SO ) {
2223  for( size_t j=i+1UL; j<rows(); ++j )
2224  clear( matrix_(j,i) );
2225  }
2226  else {
2227  for( size_t j=0UL; j<i; ++j )
2228  clear( matrix_(i,j) );
2229  }
2230 }
2232 //*************************************************************************************************
2233 
2234 
2235 //*************************************************************************************************
2247 template< typename MT // Type of the adapted dense matrix
2248  , bool SO > // Storage order of the adapted dense matrix
2250 {
2251  using blaze::clear;
2252 
2253  if( IsResizable<MT>::value ) {
2254  clear( matrix_ );
2255  }
2256  else {
2257  reset();
2258  }
2259 }
2261 //*************************************************************************************************
2262 
2263 
2264 //*************************************************************************************************
2300 template< typename MT // Type of the adapted dense matrix
2301  , bool SO > // Storage order of the adapted dense matrix
2302 void StrictlyLowerMatrix<MT,SO,true>::resize( size_t n, bool preserve )
2303 {
2305 
2306  UNUSED_PARAMETER( preserve );
2307 
2308  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly lower matrix detected" );
2309 
2310  const size_t oldsize( matrix_.rows() );
2311 
2312  matrix_.resize( n, n, true );
2313 
2314  if( n > oldsize )
2315  {
2316  const size_t increment( n - oldsize );
2317  submatrix( matrix_, 0UL, oldsize, n, increment ).reset();
2318  }
2319 }
2321 //*************************************************************************************************
2322 
2323 
2324 //*************************************************************************************************
2337 template< typename MT // Type of the adapted dense matrix
2338  , bool SO > // Storage order of the adapted dense matrix
2339 inline void StrictlyLowerMatrix<MT,SO,true>::extend( size_t n, bool preserve )
2340 {
2342 
2343  UNUSED_PARAMETER( preserve );
2344 
2345  resize( rows() + n, true );
2346 }
2347 //*************************************************************************************************
2348 
2349 
2350 //*************************************************************************************************
2360 template< typename MT // Type of the adapted dense matrix
2361  , bool SO > // Storage order of the adapted dense matrix
2362 inline void StrictlyLowerMatrix<MT,SO,true>::reserve( size_t elements )
2363 {
2364  matrix_.reserve( elements );
2365 }
2367 //*************************************************************************************************
2368 
2369 
2370 //*************************************************************************************************
2380 template< typename MT // Type of the adapted dense matrix
2381  , bool SO > // Storage order of the adapted dense matrix
2383 {
2384  matrix_.shrinkToFit();
2385 }
2387 //*************************************************************************************************
2388 
2389 
2390 //*************************************************************************************************
2397 template< typename MT // Type of the adapted dense matrix
2398  , bool SO > // Storage order of the adapted dense matrix
2399 inline void StrictlyLowerMatrix<MT,SO,true>::swap( StrictlyLowerMatrix& m ) noexcept
2400 {
2401  using std::swap;
2402 
2403  swap( matrix_, m.matrix_ );
2404 }
2406 //*************************************************************************************************
2407 
2408 
2409 //*************************************************************************************************
2421 template< typename MT // Type of the adapted dense matrix
2422  , bool SO > // Storage order of the adapted dense matrix
2423 inline constexpr size_t StrictlyLowerMatrix<MT,SO,true>::maxNonZeros() noexcept
2424 {
2426 
2427  return maxNonZeros( Rows<MT>::value );
2428 }
2430 //*************************************************************************************************
2431 
2432 
2433 //*************************************************************************************************
2443 template< typename MT // Type of the adapted dense matrix
2444  , bool SO > // Storage order of the adapted dense matrix
2445 inline constexpr size_t StrictlyLowerMatrix<MT,SO,true>::maxNonZeros( size_t n ) noexcept
2446 {
2447  return ( ( n - 1UL ) * n ) / 2UL;
2448 }
2450 //*************************************************************************************************
2451 
2452 
2453 
2454 
2455 //=================================================================================================
2456 //
2457 // NUMERIC FUNCTIONS
2458 //
2459 //=================================================================================================
2460 
2461 //*************************************************************************************************
2479 template< typename MT // Type of the adapted dense matrix
2480  , bool SO > // Storage order of the adapted dense matrix
2481 template< typename Other > // Data type of the scalar value
2482 inline StrictlyLowerMatrix<MT,SO,true>&
2483  StrictlyLowerMatrix<MT,SO,true>::scale( const Other& scalar )
2484 {
2485  matrix_.scale( scalar );
2486  return *this;
2487 }
2489 //*************************************************************************************************
2490 
2491 
2492 
2493 
2494 //=================================================================================================
2495 //
2496 // DEBUGGING FUNCTIONS
2497 //
2498 //=================================================================================================
2499 
2500 //*************************************************************************************************
2510 template< typename MT // Type of the adapted dense matrix
2511  , bool SO > // Storage order of the adapted dense matrix
2512 inline bool StrictlyLowerMatrix<MT,SO,true>::isIntact() const noexcept
2513 {
2514  using blaze::isIntact;
2515 
2516  return ( isIntact( matrix_ ) && isStrictlyLower( matrix_ ) );
2517 }
2519 //*************************************************************************************************
2520 
2521 
2522 
2523 
2524 //=================================================================================================
2525 //
2526 // EXPRESSION TEMPLATE EVALUATION FUNCTIONS
2527 //
2528 //=================================================================================================
2529 
2530 //*************************************************************************************************
2541 template< typename MT // Type of the adapted dense matrix
2542  , bool SO > // Storage order of the adapted dense matrix
2543 template< typename Other > // Data type of the foreign expression
2544 inline bool StrictlyLowerMatrix<MT,SO,true>::canAlias( const Other* alias ) const noexcept
2545 {
2546  return matrix_.canAlias( alias );
2547 }
2549 //*************************************************************************************************
2550 
2551 
2552 //*************************************************************************************************
2563 template< typename MT // Type of the adapted dense matrix
2564  , bool SO > // Storage order of the adapted dense matrix
2565 template< typename Other > // Data type of the foreign expression
2566 inline bool StrictlyLowerMatrix<MT,SO,true>::isAliased( const Other* alias ) const noexcept
2567 {
2568  return matrix_.isAliased( alias );
2569 }
2571 //*************************************************************************************************
2572 
2573 
2574 //*************************************************************************************************
2584 template< typename MT // Type of the adapted dense matrix
2585  , bool SO > // Storage order of the adapted dense matrix
2586 inline bool StrictlyLowerMatrix<MT,SO,true>::isAligned() const noexcept
2587 {
2588  return matrix_.isAligned();
2589 }
2591 //*************************************************************************************************
2592 
2593 
2594 //*************************************************************************************************
2605 template< typename MT // Type of the adapted dense matrix
2606  , bool SO > // Storage order of the adapted dense matrix
2607 inline bool StrictlyLowerMatrix<MT,SO,true>::canSMPAssign() const noexcept
2608 {
2609  return matrix_.canSMPAssign();
2610 }
2612 //*************************************************************************************************
2613 
2614 
2615 //*************************************************************************************************
2631 template< typename MT // Type of the adapted dense matrix
2632  , bool SO > // Storage order of the adapted dense matrix
2633 BLAZE_ALWAYS_INLINE typename StrictlyLowerMatrix<MT,SO,true>::SIMDType
2634  StrictlyLowerMatrix<MT,SO,true>::load( size_t i, size_t j ) const noexcept
2635 {
2636  return matrix_.load( i, j );
2637 }
2639 //*************************************************************************************************
2640 
2641 
2642 //*************************************************************************************************
2658 template< typename MT // Type of the adapted dense matrix
2659  , bool SO > // Storage order of the adapted dense matrix
2660 BLAZE_ALWAYS_INLINE typename StrictlyLowerMatrix<MT,SO,true>::SIMDType
2661  StrictlyLowerMatrix<MT,SO,true>::loada( size_t i, size_t j ) const noexcept
2662 {
2663  return matrix_.loada( i, j );
2664 }
2666 //*************************************************************************************************
2667 
2668 
2669 //*************************************************************************************************
2685 template< typename MT // Type of the adapted dense matrix
2686  , bool SO > // Storage order of the adapted dense matrix
2687 BLAZE_ALWAYS_INLINE typename StrictlyLowerMatrix<MT,SO,true>::SIMDType
2688  StrictlyLowerMatrix<MT,SO,true>::loadu( size_t i, size_t j ) const noexcept
2689 {
2690  return matrix_.loadu( i, j );
2691 }
2693 //*************************************************************************************************
2694 
2695 
2696 
2697 
2698 //=================================================================================================
2699 //
2700 // CONSTRUCTION FUNCTIONS
2701 //
2702 //=================================================================================================
2703 
2704 //*************************************************************************************************
2711 template< typename MT // Type of the adapted dense matrix
2712  , bool SO > // Storage order of the adapted dense matrix
2713 inline const MT StrictlyLowerMatrix<MT,SO,true>::construct( size_t n, TrueType )
2714 {
2716 
2717  return MT( n, n, ElementType() );
2718 }
2720 //*************************************************************************************************
2721 
2722 
2723 //*************************************************************************************************
2730 template< typename MT // Type of the adapted dense matrix
2731  , bool SO > // Storage order of the adapted dense matrix
2732 inline const MT StrictlyLowerMatrix<MT,SO,true>::construct( const ElementType& init, FalseType )
2733 {
2736 
2737  MT tmp;
2738 
2739  if( SO ) {
2740  for( size_t j=0UL; j<tmp.columns(); ++j ) {
2741  for( size_t i=j+1UL; i<tmp.rows(); ++i )
2742  tmp(i,j) = init;
2743  }
2744  }
2745  else {
2746  for( size_t i=0UL; i<tmp.rows(); ++i ) {
2747  for( size_t j=0UL; j<i; ++j )
2748  tmp(i,j) = init;
2749  }
2750  }
2751 
2752  return tmp;
2753 }
2755 //*************************************************************************************************
2756 
2757 
2758 //*************************************************************************************************
2769 template< typename MT // Type of the adapted dense matrix
2770  , bool SO > // Storage order of the adapted dense matrix
2771 template< typename MT2 // Type of the foreign matrix
2772  , bool SO2 // Storage order of the foreign matrix
2773  , typename T > // Type of the third argument
2774 inline const MT StrictlyLowerMatrix<MT,SO,true>::construct( const Matrix<MT2,SO2>& m, T )
2775 {
2776  const MT tmp( ~m );
2777 
2778  if( IsUniTriangular<MT2>::value ||
2779  ( !IsStrictlyLower<MT2>::value && !isStrictlyLower( tmp ) ) ) {
2780  BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of strictly lower matrix" );
2781  }
2782 
2783  return tmp;
2784 }
2786 //*************************************************************************************************
2787 
2788 } // namespace blaze
2789 
2790 #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.
CompressedMatrix< Type, false > OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: CompressedMatrix.h:3079
bool isStrictlyLower(const DenseMatrix< MT, SO > &dm)
Checks if the given dense matrix is a strictly lower triangular matrix.
Definition: DenseMatrix.h:1245
#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.
BLAZE_ALWAYS_INLINE size_t capacity(const Matrix< MT, SO > &matrix) noexcept
Returns the maximum capacity of the matrix.
Definition: Matrix.h:356
Header file for basic type definitions.
Header file for the implementation of the base template of the StrictlyLowerMatrix.
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
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:329
BLAZE_ALWAYS_INLINE T1 & operator/=(SIMDPack< T1 > &lhs, const SIMDPack< T2 > &rhs)
Division assignment operator for the division of two SIMD packs.
Definition: BasicTypes.h:1411
Constraint on the data type.
This ResultType
Result type for expression template evaluations.
Definition: CompressedMatrix.h:3078
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:198
CompressedMatrix< Type, true > This
Type of this CompressedMatrix instance.
Definition: CompressedMatrix.h:3076
Constraint on the data type.
void reset(const DiagonalProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: DiagonalProxy.h:560
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
BLAZE_ALWAYS_INLINE void shrinkToFit(Matrix< MT, SO > &matrix)
Requesting the removal of unused capacity.
Definition: Matrix.h:609
typename DisableIf< Condition, T >::Type DisableIf_
Auxiliary type for the DisableIf class template.The DisableIf_ alias declaration provides a convenien...
Definition: DisableIf.h:224
void clear(CompressedMatrix< Type, SO > &m)
Clearing the given compressed matrix.
Definition: CompressedMatrix.h:5845
CompressedMatrix< Type, false > TransposeType
Transpose type for expression template evaluations.
Definition: CompressedMatrix.h:3080
Submatrix< MT, AF > 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:352
const Type & ConstReference
Reference to a constant matrix value.
Definition: CompressedMatrix.h:3085
#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:394
Column< MT > column(Matrix< MT, SO > &matrix, size_t index)
Creating a view on a specific column of the given matrix.
Definition: Column.h:124
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
Element * Iterator
Iterator over non-constant elements.
Definition: CompressedMatrix.h:3086
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:1393
Constraint on the data type.
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
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:308
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:242
Constraint on the data type.
Constraint on the data type.
Constraint on the data type.
BLAZE_ALWAYS_INLINE size_t spacing(const DenseMatrix< MT, SO > &dm) noexcept
Returns the spacing between the beginning of two rows/columns.
Definition: DenseMatrix.h:110
#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 std::initializer_list aliases.
Header file for the IsSquare type trait.
Row< MT > row(Matrix< MT, SO > &matrix, size_t index)
Creating a view on a specific row of the given matrix.
Definition: Row.h:124
Constraint on the data type.
Constraint on the data type.
Header file for the DisableIf class template.
MatrixAccessProxy< This > Reference
Reference to a non-constant matrix value.
Definition: CompressedMatrix.h:3084
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
#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:5924
Compile time assertion.
bool isIntact(const CompressedMatrix< Type, SO > &m)
Returns whether the invariants of the given compressed matrix are intact.
Definition: CompressedMatrix.h:5907
SparseMatrix< This, true > BaseType
Base type of this CompressedMatrix instance.
Definition: CompressedMatrix.h:3077
#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:3081
#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.
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:367
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:443
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:3087
constexpr bool operator==(const NegativeAccuracy< A > &lhs, const T &rhs)
Equality comparison between a NegativeAccuracy object and a floating point value. ...
Definition: Accuracy.h:250
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:1027
BLAZE_ALWAYS_INLINE size_t columns(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of columns of the matrix.
Definition: Matrix.h:340
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.
Constraints on the storage order of matrix types.
Header file for the exception macros of the math module.
#define BLAZE_CONSTRAINT_MUST_NOT_BE_UPPER_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is a upper triangular matrix type...
Definition: Upper.h:81
BLAZE_ALWAYS_INLINE void resize(Matrix< MT, SO > &matrix, size_t rows, size_t columns, bool preserve=true)
Changing the size of the matrix.
Definition: Matrix.h:548
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:264
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:8893
constexpr bool operator!=(const NegativeAccuracy< A > &lhs, const T &rhs)
Inequality comparison between a NegativeAccuracy object and a floating point value.
Definition: Accuracy.h:290
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:580
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.
#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:270
Constraint on the data type.
Constraint on the data type.
Header file for the StrictlyLowerProxy class.
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:405
typename EnableIf< Condition, T >::Type EnableIf_
Auxiliary alias declaration for the EnableIf class template.The EnableIf_ alias declaration provides ...
Definition: EnableIf.h:224
BLAZE_ALWAYS_INLINE size_t rows(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of rows of the matrix.
Definition: Matrix.h:324
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:3082
#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 IsComputation type trait class.
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:3083
#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 isIntact(const DiagonalMatrix< MT, SO, DF > &m)
Returns whether the invariants of the given diagonal matrix are intact.
Definition: DiagonalMatrix.h:252
#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
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
BLAZE_ALWAYS_INLINE bool isSquare(const Matrix< MT, SO > &matrix) noexcept
Checks if the given matrix is a square matrix.
Definition: Matrix.h:742
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.