Blaze  3.6
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>
63 #include <blaze/math/Exception.h>
66 #include <blaze/math/shims/Clear.h>
76 #include <blaze/system/Inline.h>
77 #include <blaze/util/Assert.h>
83 #include <blaze/util/DisableIf.h>
84 #include <blaze/util/EnableIf.h>
86 #include <blaze/util/MaybeUnused.h>
88 #include <blaze/util/Types.h>
89 
90 
91 namespace blaze {
92 
93 //=================================================================================================
94 //
95 // CLASS TEMPLATE SPECIALIZATION FOR DENSE MATRICES
96 //
97 //=================================================================================================
98 
99 //*************************************************************************************************
107 template< typename MT // Type of the adapted dense matrix
108  , bool SO > // Storage order of the adapted dense matrix
109 class StrictlyLowerMatrix<MT,SO,true>
110  : public DenseMatrix< StrictlyLowerMatrix<MT,SO,true>, SO >
111 {
112  private:
113  //**Type definitions****************************************************************************
114  using OT = OppositeType_t<MT>;
115  using TT = TransposeType_t<MT>;
116  using ET = ElementType_t<MT>;
117  //**********************************************************************************************
118 
119  public:
120  //**Type definitions****************************************************************************
121  using This = StrictlyLowerMatrix<MT,SO,true>;
122  using BaseType = DenseMatrix<This,SO>;
123  using ResultType = This;
124  using OppositeType = StrictlyLowerMatrix<OT,!SO,true>;
125  using TransposeType = StrictlyUpperMatrix<TT,!SO,true>;
126  using ElementType = ET;
127  using SIMDType = SIMDType_t<MT>;
128  using ReturnType = ReturnType_t<MT>;
129  using CompositeType = const This&;
130  using Reference = StrictlyLowerProxy<MT>;
131  using ConstReference = ConstReference_t<MT>;
132  using Pointer = Pointer_t<MT>;
133  using ConstPointer = ConstPointer_t<MT>;
134  using ConstIterator = ConstIterator_t<MT>;
135  //**********************************************************************************************
136 
137  //**Rebind struct definition********************************************************************
140  template< typename NewType > // Data type of the other matrix
141  struct Rebind {
143  using Other = StrictlyLowerMatrix< typename MT::template Rebind<NewType>::Other >;
144  };
145  //**********************************************************************************************
146 
147  //**Resize struct definition********************************************************************
150  template< size_t NewM // Number of rows of the other matrix
151  , size_t NewN > // Number of columns of the other matrix
152  struct Resize {
154  using Other = StrictlyLowerMatrix< typename MT::template Resize<NewM,NewN>::Other >;
155  };
156  //**********************************************************************************************
157 
158  //**Iterator class definition*******************************************************************
161  class Iterator
162  {
163  public:
164  //**Type definitions*************************************************************************
165  using IteratorCategory = std::random_access_iterator_tag;
166  using ValueType = ElementType_t<MT>;
167  using PointerType = StrictlyLowerProxy<MT>;
168  using ReferenceType = StrictlyLowerProxy<MT>;
169  using DifferenceType = ptrdiff_t;
170 
171  // STL iterator requirements
172  using iterator_category = IteratorCategory;
173  using value_type = ValueType;
174  using pointer = PointerType;
175  using reference = ReferenceType;
176  using difference_type = DifferenceType;
177  //*******************************************************************************************
178 
179  //**Constructor******************************************************************************
182  inline Iterator() noexcept
183  : matrix_( nullptr ) // Reference to the adapted dense matrix
184  , row_ ( 0UL ) // The current row index of the iterator
185  , column_( 0UL ) // The current column index of the iterator
186  {}
187  //*******************************************************************************************
188 
189  //**Constructor******************************************************************************
196  inline Iterator( MT& matrix, size_t row, size_t column ) noexcept
197  : matrix_( &matrix ) // Reference to the adapted dense matrix
198  , row_ ( row ) // The current row-index of the iterator
199  , column_( column ) // The current column-index of the iterator
200  {}
201  //*******************************************************************************************
202 
203  //**Addition assignment operator*************************************************************
209  inline Iterator& operator+=( size_t inc ) noexcept {
210  ( SO )?( row_ += inc ):( column_ += inc );
211  return *this;
212  }
213  //*******************************************************************************************
214 
215  //**Subtraction assignment operator**********************************************************
221  inline Iterator& operator-=( size_t dec ) noexcept {
222  ( SO )?( row_ -= dec ):( column_ -= dec );
223  return *this;
224  }
225  //*******************************************************************************************
226 
227  //**Prefix increment operator****************************************************************
232  inline Iterator& operator++() noexcept {
233  ( SO )?( ++row_ ):( ++column_ );
234  return *this;
235  }
236  //*******************************************************************************************
237 
238  //**Postfix increment operator***************************************************************
243  inline const Iterator operator++( int ) noexcept {
244  const Iterator tmp( *this );
245  ++(*this);
246  return tmp;
247  }
248  //*******************************************************************************************
249 
250  //**Prefix decrement operator****************************************************************
255  inline Iterator& operator--() noexcept {
256  ( SO )?( --row_ ):( --column_ );
257  return *this;
258  }
259  //*******************************************************************************************
260 
261  //**Postfix decrement operator***************************************************************
266  inline const Iterator operator--( int ) noexcept {
267  const Iterator tmp( *this );
268  --(*this);
269  return tmp;
270  }
271  //*******************************************************************************************
272 
273  //**Element access operator******************************************************************
278  inline ReferenceType operator*() const {
279  return ReferenceType( *matrix_, row_, column_ );
280  }
281  //*******************************************************************************************
282 
283  //**Element access operator******************************************************************
288  inline PointerType operator->() const {
289  return PointerType( *matrix_, row_, column_ );
290  }
291  //*******************************************************************************************
292 
293  //**Load function****************************************************************************
303  inline SIMDType load() const {
304  return (*matrix_).load(row_,column_);
305  }
306  //*******************************************************************************************
307 
308  //**Loada function***************************************************************************
318  inline SIMDType loada() const {
319  return (*matrix_).loada(row_,column_);
320  }
321  //*******************************************************************************************
322 
323  //**Loadu function***************************************************************************
333  inline SIMDType loadu() const {
334  return (*matrix_).loadu(row_,column_);
335  }
336  //*******************************************************************************************
337 
338  //**Conversion operator**********************************************************************
343  inline operator ConstIterator() const {
344  if( SO )
345  return matrix_->begin( column_ ) + row_;
346  else
347  return matrix_->begin( row_ ) + column_;
348  }
349  //*******************************************************************************************
350 
351  //**Equality operator************************************************************************
358  friend inline bool operator==( const Iterator& lhs, const Iterator& rhs ) noexcept {
359  return ( SO )?( lhs.row_ == rhs.row_ ):( lhs.column_ == rhs.column_ );
360  }
361  //*******************************************************************************************
362 
363  //**Equality operator************************************************************************
370  friend inline bool operator==( const Iterator& lhs, const ConstIterator& rhs ) {
371  return ( ConstIterator( lhs ) == rhs );
372  }
373  //*******************************************************************************************
374 
375  //**Equality operator************************************************************************
382  friend inline bool operator==( const ConstIterator& lhs, const Iterator& rhs ) {
383  return ( lhs == ConstIterator( rhs ) );
384  }
385  //*******************************************************************************************
386 
387  //**Inequality operator**********************************************************************
394  friend inline bool operator!=( const Iterator& lhs, const Iterator& rhs ) noexcept {
395  return ( SO )?( lhs.row_ != rhs.row_ ):( lhs.column_ != rhs.column_ );
396  }
397  //*******************************************************************************************
398 
399  //**Inequality operator**********************************************************************
406  friend inline bool operator!=( const Iterator& lhs, const ConstIterator& rhs ) {
407  return ( ConstIterator( lhs ) != rhs );
408  }
409  //*******************************************************************************************
410 
411  //**Inequality operator**********************************************************************
418  friend inline bool operator!=( const ConstIterator& lhs, const Iterator& rhs ) {
419  return ( lhs != ConstIterator( rhs ) );
420  }
421  //*******************************************************************************************
422 
423  //**Less-than operator***********************************************************************
430  friend inline bool operator<( const Iterator& lhs, const Iterator& rhs ) noexcept {
431  return ( SO )?( lhs.row_ < rhs.row_ ):( lhs.column_ < rhs.column_ );
432  }
433  //*******************************************************************************************
434 
435  //**Less-than operator***********************************************************************
442  friend inline bool operator<( const Iterator& lhs, const ConstIterator& rhs ) {
443  return ( ConstIterator( lhs ) < rhs );
444  }
445  //*******************************************************************************************
446 
447  //**Less-than operator***********************************************************************
454  friend inline bool operator<( const ConstIterator& lhs, const Iterator& rhs ) {
455  return ( lhs < ConstIterator( rhs ) );
456  }
457  //*******************************************************************************************
458 
459  //**Greater-than operator********************************************************************
466  friend inline bool operator>( const Iterator& lhs, const Iterator& rhs ) noexcept {
467  return ( SO )?( lhs.row_ > rhs.row_ ):( lhs.column_ > rhs.column_ );
468  }
469  //*******************************************************************************************
470 
471  //**Greater-than operator********************************************************************
478  friend inline bool operator>( const Iterator& lhs, const ConstIterator& rhs ) {
479  return ( ConstIterator( lhs ) > rhs );
480  }
481  //*******************************************************************************************
482 
483  //**Greater-than operator********************************************************************
490  friend inline bool operator>( const ConstIterator& lhs, const Iterator& rhs ) {
491  return ( lhs > ConstIterator( rhs ) );
492  }
493  //*******************************************************************************************
494 
495  //**Less-or-equal-than operator**************************************************************
502  friend inline bool operator<=( const Iterator& lhs, const Iterator& rhs ) noexcept {
503  return ( SO )?( lhs.row_ <= rhs.row_ ):( lhs.column_ <= rhs.column_ );
504  }
505  //*******************************************************************************************
506 
507  //**Less-or-equal-than operator**************************************************************
514  friend inline bool operator<=( const Iterator& lhs, const ConstIterator& rhs ) {
515  return ( ConstIterator( lhs ) <= rhs );
516  }
517  //*******************************************************************************************
518 
519  //**Less-or-equal-than operator**************************************************************
526  friend inline bool operator<=( const ConstIterator& lhs, const Iterator& rhs ) {
527  return ( lhs <= ConstIterator( rhs ) );
528  }
529  //*******************************************************************************************
530 
531  //**Greater-or-equal-than operator***********************************************************
538  friend inline bool operator>=( const Iterator& lhs, const Iterator& rhs ) noexcept {
539  return ( SO )?( lhs.row_ >= rhs.row_ ):( lhs.column_ >= rhs.column_ );
540  }
541  //*******************************************************************************************
542 
543  //**Greater-or-equal-than operator***********************************************************
550  friend inline bool operator>=( const Iterator& lhs, const ConstIterator& rhs ) {
551  return ( ConstIterator( lhs ) >= rhs );
552  }
553  //*******************************************************************************************
554 
555  //**Greater-or-equal-than operator***********************************************************
562  friend inline bool operator>=( const ConstIterator& lhs, const Iterator& rhs ) {
563  return ( lhs >= ConstIterator( rhs ) );
564  }
565  //*******************************************************************************************
566 
567  //**Subtraction operator*********************************************************************
573  inline DifferenceType operator-( const Iterator& rhs ) const noexcept {
574  return ( SO )?( row_ - rhs.row_ ):( column_ - rhs.column_ );
575  }
576  //*******************************************************************************************
577 
578  //**Addition operator************************************************************************
585  friend inline const Iterator operator+( const Iterator& it, size_t inc ) noexcept {
586  if( SO )
587  return Iterator( *it.matrix_, it.row_ + inc, it.column_ );
588  else
589  return Iterator( *it.matrix_, it.row_, it.column_ + inc );
590  }
591  //*******************************************************************************************
592 
593  //**Addition operator************************************************************************
600  friend inline const Iterator operator+( size_t inc, const Iterator& it ) noexcept {
601  if( SO )
602  return Iterator( *it.matrix_, it.row_ + inc, it.column_ );
603  else
604  return Iterator( *it.matrix_, it.row_, it.column_ + inc );
605  }
606  //*******************************************************************************************
607 
608  //**Subtraction operator*********************************************************************
615  friend inline const Iterator operator-( const Iterator& it, size_t dec ) noexcept {
616  if( SO )
617  return Iterator( *it.matrix_, it.row_ - dec, it.column_ );
618  else
619  return Iterator( *it.matrix_, it.row_, it.column_ - dec );
620  }
621  //*******************************************************************************************
622 
623  private:
624  //**Member variables*************************************************************************
625  MT* matrix_;
626  size_t row_;
627  size_t column_;
628  //*******************************************************************************************
629  };
630  //**********************************************************************************************
631 
632  //**Compilation flags***************************************************************************
634  static constexpr bool simdEnabled = MT::simdEnabled;
635 
637  static constexpr bool smpAssignable = MT::smpAssignable;
638  //**********************************************************************************************
639 
640  //**Constructors********************************************************************************
643  explicit inline StrictlyLowerMatrix();
644  template< typename A1 > explicit inline StrictlyLowerMatrix( const A1& a1 );
645  explicit inline StrictlyLowerMatrix( size_t n, const ElementType& init );
646 
647  inline StrictlyLowerMatrix( initializer_list< initializer_list<ElementType> > list );
648 
649  template< typename Other >
650  explicit inline StrictlyLowerMatrix( size_t n, const Other* array );
651 
652  template< typename Other, size_t N >
653  explicit inline StrictlyLowerMatrix( const Other (&array)[N][N] );
654 
655  explicit inline StrictlyLowerMatrix( ElementType* ptr, size_t n );
656  explicit inline StrictlyLowerMatrix( ElementType* ptr, size_t n, size_t nn );
657 
658  inline StrictlyLowerMatrix( const StrictlyLowerMatrix& m );
659  inline StrictlyLowerMatrix( StrictlyLowerMatrix&& m ) noexcept;
661  //**********************************************************************************************
662 
663  //**Destructor**********************************************************************************
666  ~StrictlyLowerMatrix() = default;
668  //**********************************************************************************************
669 
670  //**Data access functions***********************************************************************
673  inline Reference operator()( size_t i, size_t j );
674  inline ConstReference operator()( size_t i, size_t j ) const;
675  inline Reference at( size_t i, size_t j );
676  inline ConstReference at( size_t i, size_t j ) const;
677  inline ConstPointer data () const noexcept;
678  inline ConstPointer data ( size_t i ) const noexcept;
679  inline Iterator begin ( size_t i );
680  inline ConstIterator begin ( size_t i ) const;
681  inline ConstIterator cbegin( size_t i ) const;
682  inline Iterator end ( size_t i );
683  inline ConstIterator end ( size_t i ) const;
684  inline ConstIterator cend ( size_t i ) const;
686  //**********************************************************************************************
687 
688  //**Assignment operators************************************************************************
691  inline StrictlyLowerMatrix& operator=( const ElementType& rhs );
692  inline StrictlyLowerMatrix& operator=( initializer_list< initializer_list<ElementType> > list );
693 
694  template< typename Other, size_t N >
695  inline StrictlyLowerMatrix& operator=( const Other (&array)[N][N] );
696 
697  inline StrictlyLowerMatrix& operator=( const StrictlyLowerMatrix& rhs );
698  inline StrictlyLowerMatrix& operator=( StrictlyLowerMatrix&& rhs ) noexcept;
699 
700  template< typename MT2, bool SO2 >
701  inline auto operator=( const Matrix<MT2,SO2>& rhs )
702  -> DisableIf_t< IsComputation_v<MT2>, StrictlyLowerMatrix& >;
703 
704  template< typename MT2, bool SO2 >
705  inline auto operator=( const Matrix<MT2,SO2>& rhs )
706  -> EnableIf_t< IsComputation_v<MT2>, StrictlyLowerMatrix& >;
707 
708  template< typename MT2, bool SO2 >
709  inline auto operator+=( const Matrix<MT2,SO2>& rhs )
710  -> DisableIf_t< IsComputation_v<MT2>, StrictlyLowerMatrix& >;
711 
712  template< typename MT2, bool SO2 >
713  inline auto operator+=( const Matrix<MT2,SO2>& rhs )
714  -> EnableIf_t< IsComputation_v<MT2>, StrictlyLowerMatrix& >;
715 
716  template< typename MT2, bool SO2 >
717  inline auto operator-=( const Matrix<MT2,SO2>& rhs )
718  -> DisableIf_t< IsComputation_v<MT2>, StrictlyLowerMatrix& >;
719 
720  template< typename MT2, bool SO2 >
721  inline auto operator-=( const Matrix<MT2,SO2>& rhs )
722  -> EnableIf_t< IsComputation_v<MT2>, StrictlyLowerMatrix& >;
723 
724  template< typename MT2, bool SO2 >
725  inline auto operator%=( const Matrix<MT2,SO2>& rhs ) -> StrictlyLowerMatrix&;
726 
727  template< typename ST >
728  inline auto operator*=( ST rhs ) -> EnableIf_t< IsNumeric_v<ST>, StrictlyLowerMatrix& >;
729 
730  template< typename ST >
731  inline auto operator/=( ST rhs ) -> EnableIf_t< IsNumeric_v<ST>, StrictlyLowerMatrix& >;
733  //**********************************************************************************************
734 
735  //**Utility functions***************************************************************************
738  inline size_t rows() const noexcept;
739  inline size_t columns() const noexcept;
740  inline size_t spacing() const noexcept;
741  inline size_t capacity() const noexcept;
742  inline size_t capacity( size_t i ) const noexcept;
743  inline size_t nonZeros() const;
744  inline size_t nonZeros( size_t i ) const;
745  inline void reset();
746  inline void reset( size_t i );
747  inline void clear();
748  void resize ( size_t n, bool preserve=true );
749  inline void extend ( size_t n, bool preserve=true );
750  inline void reserve( size_t elements );
751  inline void shrinkToFit();
752  inline void swap( StrictlyLowerMatrix& m ) noexcept;
753 
754  static inline constexpr size_t maxNonZeros() noexcept;
755  static inline constexpr size_t maxNonZeros( size_t n ) noexcept;
757  //**********************************************************************************************
758 
759  //**Numeric functions***************************************************************************
762  template< typename Other > inline StrictlyLowerMatrix& scale( const Other& scalar );
764  //**********************************************************************************************
765 
766  //**Debugging functions*************************************************************************
769  inline bool isIntact() const noexcept;
771  //**********************************************************************************************
772 
773  //**Expression template evaluation functions****************************************************
776  template< typename Other > inline bool canAlias ( const Other* alias ) const noexcept;
777  template< typename Other > inline bool isAliased( const Other* alias ) const noexcept;
778 
779  inline bool isAligned () const noexcept;
780  inline bool canSMPAssign() const noexcept;
781 
782  BLAZE_ALWAYS_INLINE SIMDType load ( size_t i, size_t j ) const noexcept;
783  BLAZE_ALWAYS_INLINE SIMDType loada( size_t i, size_t j ) const noexcept;
784  BLAZE_ALWAYS_INLINE SIMDType loadu( size_t i, size_t j ) const noexcept;
786  //**********************************************************************************************
787 
788  private:
789  //**Construction functions**********************************************************************
792  inline const MT construct( size_t n , TrueType );
793  inline const MT construct( const ElementType& value, FalseType );
794 
795  template< typename MT2, bool SO2, typename T >
796  inline const MT construct( const Matrix<MT2,SO2>& m, T );
798  //**********************************************************************************************
799 
800  //**Member variables****************************************************************************
803  MT matrix_;
804 
805  //**********************************************************************************************
806 
807  //**Friend declarations*************************************************************************
808  template< typename MT2, bool SO2, bool DF2 >
809  friend MT2& derestrict( StrictlyLowerMatrix<MT2,SO2,DF2>& m );
810  //**********************************************************************************************
811 
812  //**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 StrictlyLowerMatrix<MT,SO,true>::StrictlyLowerMatrix()
849  : matrix_() // The adapted dense matrix
850 {
851  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly 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 StrictlyLowerMatrix<MT,SO,true>::StrictlyLowerMatrix( const A1& a1 )
880  : matrix_( construct( a1, typename IsResizable<MT>::Type() ) ) // The adapted dense matrix
881 {
882  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly 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 StrictlyLowerMatrix<MT,SO,true>::StrictlyLowerMatrix( 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+1UL; i<rows(); ++i )
906  matrix_(i,j) = init;
907  }
908  }
909  else {
910  for( size_t i=0UL; i<rows(); ++i ) {
911  for( size_t j=0UL; j<i; ++j )
912  matrix_(i,j) = init;
913  }
914  }
915 
916  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly lower matrix detected" );
917  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
918 }
920 //*************************************************************************************************
921 
922 
923 //*************************************************************************************************
947 template< typename MT // Type of the adapted dense matrix
948  , bool SO > // Storage order of the adapted dense matrix
949 inline StrictlyLowerMatrix<MT,SO,true>::StrictlyLowerMatrix( initializer_list< initializer_list<ElementType> > list )
950  : matrix_( list ) // The adapted dense matrix
951 {
952  if( !isStrictlyLower( matrix_ ) ) {
953  BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of strictly lower matrix" );
954  }
955 
956  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
957 }
959 //*************************************************************************************************
960 
961 
962 //*************************************************************************************************
988 template< typename MT // Type of the adapted dense matrix
989  , bool SO > // Storage order of the adapted dense matrix
990 template< typename Other > // Data type of the initialization array
991 inline StrictlyLowerMatrix<MT,SO,true>::StrictlyLowerMatrix( size_t n, const Other* array )
992  : matrix_( n, n, array ) // The adapted dense matrix
993 {
994  if( !isStrictlyLower( matrix_ ) ) {
995  BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of strictly lower matrix" );
996  }
997 
998  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
999 }
1001 //*************************************************************************************************
1002 
1003 
1004 //*************************************************************************************************
1027 template< typename MT // Type of the adapted dense matrix
1028  , bool SO > // Storage order of the adapted dense matrix
1029 template< typename Other // Data type of the initialization array
1030  , size_t N > // Number of rows and columns of the initialization array
1031 inline StrictlyLowerMatrix<MT,SO,true>::StrictlyLowerMatrix( const Other (&array)[N][N] )
1032  : matrix_( array ) // The adapted dense matrix
1033 {
1034  if( !isStrictlyLower( matrix_ ) ) {
1035  BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of strictly lower matrix" );
1036  }
1037 
1038  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1039 }
1041 //*************************************************************************************************
1042 
1043 
1044 //*************************************************************************************************
1077 template< typename MT // Type of the adapted dense matrix
1078  , bool SO > // Storage order of the adapted dense matrix
1079 inline StrictlyLowerMatrix<MT,SO,true>::StrictlyLowerMatrix( ElementType* ptr, size_t n )
1080  : matrix_( ptr, n, n ) // The adapted dense matrix
1081 {
1082  if( !isStrictlyLower( matrix_ ) ) {
1083  BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of strictly lower matrix" );
1084  }
1085 
1086  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1087 }
1089 //*************************************************************************************************
1090 
1091 
1092 //*************************************************************************************************
1126 template< typename MT // Type of the adapted dense matrix
1127  , bool SO > // Storage order of the adapted dense matrix
1128 inline StrictlyLowerMatrix<MT,SO,true>::StrictlyLowerMatrix( ElementType* ptr, size_t n, size_t nn )
1129  : matrix_( ptr, n, n, nn ) // The adapted dense matrix
1130 {
1131  if( !isStrictlyLower( matrix_ ) ) {
1132  BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of strictly lower matrix" );
1133  }
1134 
1135  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1136 }
1138 //*************************************************************************************************
1139 
1140 
1141 //*************************************************************************************************
1147 template< typename MT // Type of the adapted dense matrix
1148  , bool SO > // Storage order of the adapted dense matrix
1149 inline StrictlyLowerMatrix<MT,SO,true>::StrictlyLowerMatrix( const StrictlyLowerMatrix& m )
1150  : matrix_( m.matrix_ ) // The adapted dense matrix
1151 {
1152  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly lower matrix detected" );
1153  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1154 }
1156 //*************************************************************************************************
1157 
1158 
1159 //*************************************************************************************************
1165 template< typename MT // Type of the adapted dense matrix
1166  , bool SO > // Storage order of the adapted dense matrix
1167 inline StrictlyLowerMatrix<MT,SO,true>::StrictlyLowerMatrix( StrictlyLowerMatrix&& m ) noexcept
1168  : matrix_( std::move( m.matrix_ ) ) // The adapted dense matrix
1169 {
1170  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly lower matrix detected" );
1171  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1172 }
1174 //*************************************************************************************************
1175 
1176 
1177 
1178 
1179 //=================================================================================================
1180 //
1181 // DATA ACCESS FUNCTIONS
1182 //
1183 //=================================================================================================
1184 
1185 //*************************************************************************************************
1201 template< typename MT // Type of the adapted dense matrix
1202  , bool SO > // Storage order of the adapted dense matrix
1203 inline typename StrictlyLowerMatrix<MT,SO,true>::Reference
1204  StrictlyLowerMatrix<MT,SO,true>::operator()( size_t i, size_t j )
1205 {
1206  BLAZE_USER_ASSERT( i<rows() , "Invalid row access index" );
1207  BLAZE_USER_ASSERT( j<columns(), "Invalid column access index" );
1208 
1209  return Reference( matrix_, i, j );
1210 }
1212 //*************************************************************************************************
1213 
1214 
1215 //*************************************************************************************************
1231 template< typename MT // Type of the adapted dense matrix
1232  , bool SO > // Storage order of the adapted dense matrix
1233 inline typename StrictlyLowerMatrix<MT,SO,true>::ConstReference
1234  StrictlyLowerMatrix<MT,SO,true>::operator()( size_t i, size_t j ) const
1235 {
1236  BLAZE_USER_ASSERT( i<rows() , "Invalid row access index" );
1237  BLAZE_USER_ASSERT( j<columns(), "Invalid column access index" );
1238 
1239  return matrix_(i,j);
1240 }
1242 //*************************************************************************************************
1243 
1244 
1245 //*************************************************************************************************
1262 template< typename MT // Type of the adapted dense matrix
1263  , bool SO > // Storage order of the adapted dense matrix
1264 inline typename StrictlyLowerMatrix<MT,SO,true>::Reference
1265  StrictlyLowerMatrix<MT,SO,true>::at( size_t i, size_t j )
1266 {
1267  if( i >= rows() ) {
1268  BLAZE_THROW_OUT_OF_RANGE( "Invalid row access index" );
1269  }
1270  if( j >= columns() ) {
1271  BLAZE_THROW_OUT_OF_RANGE( "Invalid column access index" );
1272  }
1273  return (*this)(i,j);
1274 }
1276 //*************************************************************************************************
1277 
1278 
1279 //*************************************************************************************************
1296 template< typename MT // Type of the adapted dense matrix
1297  , bool SO > // Storage order of the adapted dense matrix
1298 inline typename StrictlyLowerMatrix<MT,SO,true>::ConstReference
1299  StrictlyLowerMatrix<MT,SO,true>::at( size_t i, size_t j ) const
1300 {
1301  if( i >= rows() ) {
1302  BLAZE_THROW_OUT_OF_RANGE( "Invalid row access index" );
1303  }
1304  if( j >= columns() ) {
1305  BLAZE_THROW_OUT_OF_RANGE( "Invalid column access index" );
1306  }
1307  return (*this)(i,j);
1308 }
1310 //*************************************************************************************************
1311 
1312 
1313 //*************************************************************************************************
1326 template< typename MT // Type of the adapted dense matrix
1327  , bool SO > // Storage order of the adapted dense matrix
1328 inline typename StrictlyLowerMatrix<MT,SO,true>::ConstPointer
1329  StrictlyLowerMatrix<MT,SO,true>::data() const noexcept
1330 {
1331  return matrix_.data();
1332 }
1334 //*************************************************************************************************
1335 
1336 
1337 //*************************************************************************************************
1346 template< typename MT // Type of the adapted dense matrix
1347  , bool SO > // Storage order of the adapted dense matrix
1348 inline typename StrictlyLowerMatrix<MT,SO,true>::ConstPointer
1349  StrictlyLowerMatrix<MT,SO,true>::data( size_t i ) const noexcept
1350 {
1351  return matrix_.data(i);
1352 }
1354 //*************************************************************************************************
1355 
1356 
1357 //*************************************************************************************************
1369 template< typename MT // Type of the adapted dense matrix
1370  , bool SO > // Storage order of the adapted dense matrix
1371 inline typename StrictlyLowerMatrix<MT,SO,true>::Iterator
1373 {
1374  if( SO )
1375  return Iterator( matrix_, 0UL, i );
1376  else
1377  return Iterator( matrix_, i, 0UL );
1378 }
1380 //*************************************************************************************************
1381 
1382 
1383 //*************************************************************************************************
1395 template< typename MT // Type of the adapted dense matrix
1396  , bool SO > // Storage order of the adapted dense matrix
1397 inline typename StrictlyLowerMatrix<MT,SO,true>::ConstIterator
1398  StrictlyLowerMatrix<MT,SO,true>::begin( size_t i ) const
1399 {
1400  return matrix_.begin(i);
1401 }
1403 //*************************************************************************************************
1404 
1405 
1406 //*************************************************************************************************
1418 template< typename MT // Type of the adapted dense matrix
1419  , bool SO > // Storage order of the adapted dense matrix
1420 inline typename StrictlyLowerMatrix<MT,SO,true>::ConstIterator
1421  StrictlyLowerMatrix<MT,SO,true>::cbegin( size_t i ) const
1422 {
1423  return matrix_.cbegin(i);
1424 }
1426 //*************************************************************************************************
1427 
1428 
1429 //*************************************************************************************************
1441 template< typename MT // Type of the adapted dense matrix
1442  , bool SO > // Storage order of the adapted dense matrix
1443 inline typename StrictlyLowerMatrix<MT,SO,true>::Iterator
1445 {
1446  if( SO )
1447  return Iterator( matrix_, rows(), i );
1448  else
1449  return Iterator( matrix_, i, columns() );
1450 }
1452 //*************************************************************************************************
1453 
1454 
1455 //*************************************************************************************************
1467 template< typename MT // Type of the adapted dense matrix
1468  , bool SO > // Storage order of the adapted dense matrix
1469 inline typename StrictlyLowerMatrix<MT,SO,true>::ConstIterator
1470  StrictlyLowerMatrix<MT,SO,true>::end( size_t i ) const
1471 {
1472  return matrix_.end(i);
1473 }
1475 //*************************************************************************************************
1476 
1477 
1478 //*************************************************************************************************
1490 template< typename MT // Type of the adapted dense matrix
1491  , bool SO > // Storage order of the adapted dense matrix
1492 inline typename StrictlyLowerMatrix<MT,SO,true>::ConstIterator
1493  StrictlyLowerMatrix<MT,SO,true>::cend( size_t i ) const
1494 {
1495  return matrix_.cend(i);
1496 }
1498 //*************************************************************************************************
1499 
1500 
1501 
1502 
1503 //=================================================================================================
1504 //
1505 // ASSIGNMENT OPERATORS
1506 //
1507 //=================================================================================================
1508 
1509 //*************************************************************************************************
1516 template< typename MT // Type of the adapted dense matrix
1517  , bool SO > // Storage order of the adapted dense matrix
1518 inline StrictlyLowerMatrix<MT,SO,true>&
1519  StrictlyLowerMatrix<MT,SO,true>::operator=( const ElementType& rhs )
1520 {
1521  if( SO ) {
1522  for( size_t j=0UL; j<columns(); ++j )
1523  for( size_t i=j+1UL; i<rows(); ++i )
1524  matrix_(i,j) = rhs;
1525  }
1526  else {
1527  for( size_t i=1UL; i<rows(); ++i )
1528  for( size_t j=0UL; j<i; ++j )
1529  matrix_(i,j) = rhs;
1530  }
1531 
1532  return *this;
1533 }
1535 //*************************************************************************************************
1536 
1537 
1538 //*************************************************************************************************
1563 template< typename MT // Type of the adapted dense matrix
1564  , bool SO > // Storage order of the adapted dense matrix
1565 inline StrictlyLowerMatrix<MT,SO,true>&
1566  StrictlyLowerMatrix<MT,SO,true>::operator=( initializer_list< initializer_list<ElementType> > list )
1567 {
1568  const InitializerMatrix<ElementType> tmp( list, list.size() );
1569 
1570  if( !isStrictlyLower( tmp ) ) {
1571  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to strictly lower matrix" );
1572  }
1573 
1574  matrix_ = list;
1575 
1576  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly lower matrix detected" );
1577  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1578 
1579  return *this;
1580 }
1582 //*************************************************************************************************
1583 
1584 
1585 //*************************************************************************************************
1610 template< typename MT // Type of the adapted dense matrix
1611  , bool SO > // Storage order of the adapted dense matrix
1612 template< typename Other // Data type of the initialization array
1613  , size_t N > // Number of rows and columns of the initialization array
1614 inline StrictlyLowerMatrix<MT,SO,true>&
1615  StrictlyLowerMatrix<MT,SO,true>::operator=( const Other (&array)[N][N] )
1616 {
1617  MT tmp( array );
1618 
1619  if( !isStrictlyLower( tmp ) ) {
1620  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to strictly lower matrix" );
1621  }
1622 
1623  matrix_ = std::move( tmp );
1624 
1625  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly lower matrix detected" );
1626  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1627 
1628  return *this;
1629 }
1631 //*************************************************************************************************
1632 
1633 
1634 //*************************************************************************************************
1644 template< typename MT // Type of the adapted dense matrix
1645  , bool SO > // Storage order of the adapted dense matrix
1646 inline StrictlyLowerMatrix<MT,SO,true>&
1647  StrictlyLowerMatrix<MT,SO,true>::operator=( const StrictlyLowerMatrix& rhs )
1648 {
1649  matrix_ = rhs.matrix_;
1650 
1651  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly lower matrix detected" );
1652  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1653 
1654  return *this;
1655 }
1657 //*************************************************************************************************
1658 
1659 
1660 //*************************************************************************************************
1667 template< typename MT // Type of the adapted dense matrix
1668  , bool SO > // Storage order of the adapted dense matrix
1669 inline StrictlyLowerMatrix<MT,SO,true>&
1670  StrictlyLowerMatrix<MT,SO,true>::operator=( StrictlyLowerMatrix&& rhs ) noexcept
1671 {
1672  matrix_ = std::move( rhs.matrix_ );
1673 
1674  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly lower matrix detected" );
1675  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1676 
1677  return *this;
1678 }
1680 //*************************************************************************************************
1681 
1682 
1683 //*************************************************************************************************
1696 template< typename MT // Type of the adapted dense matrix
1697  , bool SO > // Storage order of the adapted dense matrix
1698 template< typename MT2 // Type of the right-hand side matrix
1699  , bool SO2 > // Storage order of the right-hand side matrix
1700 inline auto StrictlyLowerMatrix<MT,SO,true>::operator=( const Matrix<MT2,SO2>& rhs )
1701  -> DisableIf_t< IsComputation_v<MT2>, StrictlyLowerMatrix& >
1702 {
1703  if( IsUniTriangular_v<MT2> ||
1704  ( !IsStrictlyLower_v<MT2> && !isStrictlyLower( ~rhs ) ) ) {
1705  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to strictly lower matrix" );
1706  }
1707 
1708  matrix_ = decllow( ~rhs );
1709 
1710  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly lower matrix detected" );
1711  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1712 
1713  return *this;
1714 }
1716 //*************************************************************************************************
1717 
1718 
1719 //*************************************************************************************************
1732 template< typename MT // Type of the adapted dense matrix
1733  , bool SO > // Storage order of the adapted dense matrix
1734 template< typename MT2 // Type of the right-hand side matrix
1735  , bool SO2 > // Storage order of the right-hand side matrix
1736 inline auto StrictlyLowerMatrix<MT,SO,true>::operator=( const Matrix<MT2,SO2>& rhs )
1737  -> EnableIf_t< IsComputation_v<MT2>, StrictlyLowerMatrix& >
1738 {
1739  if( IsUniTriangular_v<MT2> || ( !IsSquare_v<MT2> && !isSquare( ~rhs ) ) ) {
1740  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to strictly lower matrix" );
1741  }
1742 
1743  if( IsStrictlyLower_v<MT2> ) {
1744  matrix_ = ~rhs;
1745  }
1746  else {
1747  MT tmp( ~rhs );
1748 
1749  if( !isStrictlyLower( tmp ) ) {
1750  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to strictly lower matrix" );
1751  }
1752 
1753  matrix_ = std::move( tmp );
1754  }
1755 
1756  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly lower matrix detected" );
1757  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1758 
1759  return *this;
1760 }
1762 //*************************************************************************************************
1763 
1764 
1765 //*************************************************************************************************
1778 template< typename MT // Type of the adapted dense matrix
1779  , bool SO > // Storage order of the adapted dense matrix
1780 template< typename MT2 // Type of the right-hand side matrix
1781  , bool SO2 > // Storage order of the right-hand side matrix
1782 inline auto StrictlyLowerMatrix<MT,SO,true>::operator+=( const Matrix<MT2,SO2>& rhs )
1783  -> DisableIf_t< IsComputation_v<MT2>, StrictlyLowerMatrix& >
1784 {
1785  if( IsUniTriangular_v<MT2> ||
1786  ( !IsStrictlyLower_v<MT2> && !isStrictlyLower( ~rhs ) ) ) {
1787  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to strictly lower matrix" );
1788  }
1789 
1790  matrix_ += decllow( ~rhs );
1791 
1792  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly lower matrix detected" );
1793  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1794 
1795  return *this;
1796 }
1798 //*************************************************************************************************
1799 
1800 
1801 //*************************************************************************************************
1814 template< typename MT // Type of the adapted dense matrix
1815  , bool SO > // Storage order of the adapted dense matrix
1816 template< typename MT2 // Type of the right-hand side matrix
1817  , bool SO2 > // Storage order of the right-hand side matrix
1818 inline auto StrictlyLowerMatrix<MT,SO,true>::operator+=( const Matrix<MT2,SO2>& rhs )
1819  -> EnableIf_t< IsComputation_v<MT2>, StrictlyLowerMatrix& >
1820 {
1821  if( IsUniTriangular_v<MT2> || ( !IsSquare_v<MT2> && !isSquare( ~rhs ) ) ) {
1822  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to strictly lower matrix" );
1823  }
1824 
1825  if( IsStrictlyLower_v<MT2> ) {
1826  matrix_ += ~rhs;
1827  }
1828  else {
1829  const ResultType_t<MT2> tmp( ~rhs );
1830 
1831  if( !isStrictlyLower( tmp ) ) {
1832  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to strictly lower matrix" );
1833  }
1834 
1835  matrix_ += decllow( tmp );
1836  }
1837 
1838  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly lower matrix detected" );
1839  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1840 
1841  return *this;
1842 }
1844 //*************************************************************************************************
1845 
1846 
1847 //*************************************************************************************************
1860 template< typename MT // Type of the adapted dense matrix
1861  , bool SO > // Storage order of the adapted dense matrix
1862 template< typename MT2 // Type of the right-hand side matrix
1863  , bool SO2 > // Storage order of the right-hand side matrix
1864 inline auto StrictlyLowerMatrix<MT,SO,true>::operator-=( const Matrix<MT2,SO2>& rhs )
1865  -> DisableIf_t< IsComputation_v<MT2>, StrictlyLowerMatrix& >
1866 {
1867  if( IsUniTriangular_v<MT2> ||
1868  ( !IsStrictlyLower_v<MT2> && !isStrictlyLower( ~rhs ) ) ) {
1869  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to strictly lower matrix" );
1870  }
1871 
1872  matrix_ -= decllow( ~rhs );
1873 
1874  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly lower matrix detected" );
1875  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1876 
1877  return *this;
1878 }
1880 //*************************************************************************************************
1881 
1882 
1883 //*************************************************************************************************
1896 template< typename MT // Type of the adapted dense matrix
1897  , bool SO > // Storage order of the adapted dense matrix
1898 template< typename MT2 // Type of the right-hand side matrix
1899  , bool SO2 > // Storage order of the right-hand side matrix
1900 inline auto StrictlyLowerMatrix<MT,SO,true>::operator-=( const Matrix<MT2,SO2>& rhs )
1901  -> EnableIf_t< IsComputation_v<MT2>, StrictlyLowerMatrix& >
1902 {
1903  if( IsUniTriangular_v<MT2> || ( !IsSquare_v<MT2> && !isSquare( ~rhs ) ) ) {
1904  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to strictly lower matrix" );
1905  }
1906 
1907  if( IsStrictlyLower_v<MT2> ) {
1908  matrix_ -= ~rhs;
1909  }
1910  else {
1911  const ResultType_t<MT2> tmp( ~rhs );
1912 
1913  if( !isStrictlyLower( tmp ) ) {
1914  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to strictly lower matrix" );
1915  }
1916 
1917  matrix_ -= decllow( tmp );
1918  }
1919 
1920  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly lower matrix detected" );
1921  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1922 
1923  return *this;
1924 }
1926 //*************************************************************************************************
1927 
1928 
1929 //*************************************************************************************************
1940 template< typename MT // Type of the adapted dense matrix
1941  , bool SO > // Storage order of the adapted dense matrix
1942 template< typename MT2 // Type of the right-hand side matrix
1943  , bool SO2 > // Storage order of the right-hand side matrix
1944 inline auto StrictlyLowerMatrix<MT,SO,true>::operator%=( const Matrix<MT2,SO2>& rhs )
1945  -> StrictlyLowerMatrix&
1946 {
1947  if( !IsSquare_v<MT2> && !isSquare( ~rhs ) ) {
1948  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to strictly lower matrix" );
1949  }
1950 
1951  matrix_ %= ~rhs;
1952 
1953  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly lower matrix detected" );
1954  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1955 
1956  return *this;
1957 }
1959 //*************************************************************************************************
1960 
1961 
1962 //*************************************************************************************************
1970 template< typename MT // Type of the adapted dense matrix
1971  , bool SO > // Storage order of the adapted dense matrix
1972 template< typename ST > // Data type of the right-hand side scalar
1973 inline auto StrictlyLowerMatrix<MT,SO,true>::operator*=( ST rhs )
1974  -> EnableIf_t< IsNumeric_v<ST>, StrictlyLowerMatrix& >
1975 {
1976  matrix_ *= rhs;
1977  return *this;
1978 }
1979 //*************************************************************************************************
1980 
1981 
1982 //*************************************************************************************************
1990 template< typename MT // Type of the adapted dense matrix
1991  , bool SO > // Storage order of the adapted dense matrix
1992 template< typename ST > // Data type of the right-hand side scalar
1993 inline auto StrictlyLowerMatrix<MT,SO,true>::operator/=( ST rhs )
1994  -> EnableIf_t< IsNumeric_v<ST>, StrictlyLowerMatrix& >
1995 {
1996  BLAZE_USER_ASSERT( !isZero( rhs ), "Division by zero detected" );
1997 
1998  matrix_ /= rhs;
1999  return *this;
2000 }
2002 //*************************************************************************************************
2003 
2004 
2005 
2006 
2007 //=================================================================================================
2008 //
2009 // UTILITY FUNCTIONS
2010 //
2011 //=================================================================================================
2012 
2013 //*************************************************************************************************
2019 template< typename MT // Type of the adapted dense matrix
2020  , bool SO > // Storage order of the adapted dense matrix
2021 inline size_t StrictlyLowerMatrix<MT,SO,true>::rows() const noexcept
2022 {
2023  return matrix_.rows();
2024 }
2026 //*************************************************************************************************
2027 
2028 
2029 //*************************************************************************************************
2035 template< typename MT // Type of the adapted dense matrix
2036  , bool SO > // Storage order of the adapted dense matrix
2037 inline size_t StrictlyLowerMatrix<MT,SO,true>::columns() const noexcept
2038 {
2039  return matrix_.columns();
2040 }
2042 //*************************************************************************************************
2043 
2044 
2045 //*************************************************************************************************
2056 template< typename MT // Type of the adapted dense matrix
2057  , bool SO > // Storage order of the adapted dense matrix
2058 inline size_t StrictlyLowerMatrix<MT,SO,true>::spacing() const noexcept
2059 {
2060  return matrix_.spacing();
2061 }
2063 //*************************************************************************************************
2064 
2065 
2066 //*************************************************************************************************
2072 template< typename MT // Type of the adapted dense matrix
2073  , bool SO > // Storage order of the adapted dense matrix
2074 inline size_t StrictlyLowerMatrix<MT,SO,true>::capacity() const noexcept
2075 {
2076  return matrix_.capacity();
2077 }
2079 //*************************************************************************************************
2080 
2081 
2082 //*************************************************************************************************
2094 template< typename MT // Type of the adapted dense matrix
2095  , bool SO > // Storage order of the adapted dense matrix
2096 inline size_t StrictlyLowerMatrix<MT,SO,true>::capacity( size_t i ) const noexcept
2097 {
2098  return matrix_.capacity(i);
2099 }
2101 //*************************************************************************************************
2102 
2103 
2104 //*************************************************************************************************
2110 template< typename MT // Type of the adapted dense matrix
2111  , bool SO > // Storage order of the adapted dense matrix
2112 inline size_t StrictlyLowerMatrix<MT,SO,true>::nonZeros() const
2113 {
2114  return matrix_.nonZeros();
2115 }
2117 //*************************************************************************************************
2118 
2119 
2120 //*************************************************************************************************
2132 template< typename MT // Type of the adapted dense matrix
2133  , bool SO > // Storage order of the adapted dense matrix
2134 inline size_t StrictlyLowerMatrix<MT,SO,true>::nonZeros( size_t i ) const
2135 {
2136  return matrix_.nonZeros(i);
2137 }
2139 //*************************************************************************************************
2140 
2141 
2142 //*************************************************************************************************
2148 template< typename MT // Type of the adapted dense matrix
2149  , bool SO > // Storage order of the adapted dense matrix
2151 {
2152  using blaze::clear;
2153 
2154  if( SO ) {
2155  for( size_t j=0UL; j<columns(); ++j )
2156  for( size_t i=j+1UL; i<rows(); ++i )
2157  clear( matrix_(i,j) );
2158  }
2159  else {
2160  for( size_t i=1UL; i<rows(); ++i )
2161  for( size_t j=0UL; j<i; ++j )
2162  clear( matrix_(i,j) );
2163  }
2164 }
2166 //*************************************************************************************************
2167 
2168 
2169 //*************************************************************************************************
2182 template< typename MT // Type of the adapted dense matrix
2183  , bool SO > // Storage order of the adapted dense matrix
2184 inline void StrictlyLowerMatrix<MT,SO,true>::reset( size_t i )
2185 {
2186  using blaze::clear;
2187 
2188  if( SO ) {
2189  for( size_t j=i+1UL; j<rows(); ++j )
2190  clear( matrix_(j,i) );
2191  }
2192  else {
2193  for( size_t j=0UL; j<i; ++j )
2194  clear( matrix_(i,j) );
2195  }
2196 }
2198 //*************************************************************************************************
2199 
2200 
2201 //*************************************************************************************************
2213 template< typename MT // Type of the adapted dense matrix
2214  , bool SO > // Storage order of the adapted dense matrix
2216 {
2217  using blaze::clear;
2218 
2219  if( IsResizable_v<MT> ) {
2220  clear( matrix_ );
2221  }
2222  else {
2223  reset();
2224  }
2225 }
2227 //*************************************************************************************************
2228 
2229 
2230 //*************************************************************************************************
2266 template< typename MT // Type of the adapted dense matrix
2267  , bool SO > // Storage order of the adapted dense matrix
2268 void StrictlyLowerMatrix<MT,SO,true>::resize( size_t n, bool preserve )
2269 {
2271 
2272  MAYBE_UNUSED( preserve );
2273 
2274  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly lower matrix detected" );
2275 
2276  const size_t oldsize( matrix_.rows() );
2277 
2278  matrix_.resize( n, n, true );
2279 
2280  if( n > oldsize )
2281  {
2282  const size_t increment( n - oldsize );
2283  submatrix( matrix_, 0UL, oldsize, n, increment ).reset();
2284  }
2285 }
2287 //*************************************************************************************************
2288 
2289 
2290 //*************************************************************************************************
2303 template< typename MT // Type of the adapted dense matrix
2304  , bool SO > // Storage order of the adapted dense matrix
2305 inline void StrictlyLowerMatrix<MT,SO,true>::extend( size_t n, bool preserve )
2306 {
2308 
2309  MAYBE_UNUSED( preserve );
2310 
2311  resize( rows() + n, true );
2312 }
2313 //*************************************************************************************************
2314 
2315 
2316 //*************************************************************************************************
2326 template< typename MT // Type of the adapted dense matrix
2327  , bool SO > // Storage order of the adapted dense matrix
2328 inline void StrictlyLowerMatrix<MT,SO,true>::reserve( size_t elements )
2329 {
2330  matrix_.reserve( elements );
2331 }
2333 //*************************************************************************************************
2334 
2335 
2336 //*************************************************************************************************
2346 template< typename MT // Type of the adapted dense matrix
2347  , bool SO > // Storage order of the adapted dense matrix
2349 {
2350  matrix_.shrinkToFit();
2351 }
2353 //*************************************************************************************************
2354 
2355 
2356 //*************************************************************************************************
2363 template< typename MT // Type of the adapted dense matrix
2364  , bool SO > // Storage order of the adapted dense matrix
2365 inline void StrictlyLowerMatrix<MT,SO,true>::swap( StrictlyLowerMatrix& m ) noexcept
2366 {
2367  using std::swap;
2368 
2369  swap( matrix_, m.matrix_ );
2370 }
2372 //*************************************************************************************************
2373 
2374 
2375 //*************************************************************************************************
2387 template< typename MT // Type of the adapted dense matrix
2388  , bool SO > // Storage order of the adapted dense matrix
2389 inline constexpr size_t StrictlyLowerMatrix<MT,SO,true>::maxNonZeros() noexcept
2390 {
2392 
2393  return maxNonZeros( Size_v<MT,0UL> );
2394 }
2396 //*************************************************************************************************
2397 
2398 
2399 //*************************************************************************************************
2409 template< typename MT // Type of the adapted dense matrix
2410  , bool SO > // Storage order of the adapted dense matrix
2411 inline constexpr size_t StrictlyLowerMatrix<MT,SO,true>::maxNonZeros( size_t n ) noexcept
2412 {
2413  return ( ( n - 1UL ) * n ) / 2UL;
2414 }
2416 //*************************************************************************************************
2417 
2418 
2419 
2420 
2421 //=================================================================================================
2422 //
2423 // NUMERIC FUNCTIONS
2424 //
2425 //=================================================================================================
2426 
2427 //*************************************************************************************************
2445 template< typename MT // Type of the adapted dense matrix
2446  , bool SO > // Storage order of the adapted dense matrix
2447 template< typename Other > // Data type of the scalar value
2448 inline StrictlyLowerMatrix<MT,SO,true>&
2449  StrictlyLowerMatrix<MT,SO,true>::scale( const Other& scalar )
2450 {
2451  matrix_.scale( scalar );
2452  return *this;
2453 }
2455 //*************************************************************************************************
2456 
2457 
2458 
2459 
2460 //=================================================================================================
2461 //
2462 // DEBUGGING FUNCTIONS
2463 //
2464 //=================================================================================================
2465 
2466 //*************************************************************************************************
2476 template< typename MT // Type of the adapted dense matrix
2477  , bool SO > // Storage order of the adapted dense matrix
2478 inline bool StrictlyLowerMatrix<MT,SO,true>::isIntact() const noexcept
2479 {
2480  using blaze::isIntact;
2481 
2482  return ( isIntact( matrix_ ) && isStrictlyLower( matrix_ ) );
2483 }
2485 //*************************************************************************************************
2486 
2487 
2488 
2489 
2490 //=================================================================================================
2491 //
2492 // EXPRESSION TEMPLATE EVALUATION FUNCTIONS
2493 //
2494 //=================================================================================================
2495 
2496 //*************************************************************************************************
2507 template< typename MT // Type of the adapted dense matrix
2508  , bool SO > // Storage order of the adapted dense matrix
2509 template< typename Other > // Data type of the foreign expression
2510 inline bool StrictlyLowerMatrix<MT,SO,true>::canAlias( const Other* alias ) const noexcept
2511 {
2512  return matrix_.canAlias( alias );
2513 }
2515 //*************************************************************************************************
2516 
2517 
2518 //*************************************************************************************************
2529 template< typename MT // Type of the adapted dense matrix
2530  , bool SO > // Storage order of the adapted dense matrix
2531 template< typename Other > // Data type of the foreign expression
2532 inline bool StrictlyLowerMatrix<MT,SO,true>::isAliased( const Other* alias ) const noexcept
2533 {
2534  return matrix_.isAliased( alias );
2535 }
2537 //*************************************************************************************************
2538 
2539 
2540 //*************************************************************************************************
2550 template< typename MT // Type of the adapted dense matrix
2551  , bool SO > // Storage order of the adapted dense matrix
2552 inline bool StrictlyLowerMatrix<MT,SO,true>::isAligned() const noexcept
2553 {
2554  return matrix_.isAligned();
2555 }
2557 //*************************************************************************************************
2558 
2559 
2560 //*************************************************************************************************
2571 template< typename MT // Type of the adapted dense matrix
2572  , bool SO > // Storage order of the adapted dense matrix
2573 inline bool StrictlyLowerMatrix<MT,SO,true>::canSMPAssign() const noexcept
2574 {
2575  return matrix_.canSMPAssign();
2576 }
2578 //*************************************************************************************************
2579 
2580 
2581 //*************************************************************************************************
2597 template< typename MT // Type of the adapted dense matrix
2598  , bool SO > // Storage order of the adapted dense matrix
2599 BLAZE_ALWAYS_INLINE typename StrictlyLowerMatrix<MT,SO,true>::SIMDType
2600  StrictlyLowerMatrix<MT,SO,true>::load( size_t i, size_t j ) const noexcept
2601 {
2602  return matrix_.load( i, j );
2603 }
2605 //*************************************************************************************************
2606 
2607 
2608 //*************************************************************************************************
2624 template< typename MT // Type of the adapted dense matrix
2625  , bool SO > // Storage order of the adapted dense matrix
2626 BLAZE_ALWAYS_INLINE typename StrictlyLowerMatrix<MT,SO,true>::SIMDType
2627  StrictlyLowerMatrix<MT,SO,true>::loada( size_t i, size_t j ) const noexcept
2628 {
2629  return matrix_.loada( i, j );
2630 }
2632 //*************************************************************************************************
2633 
2634 
2635 //*************************************************************************************************
2651 template< typename MT // Type of the adapted dense matrix
2652  , bool SO > // Storage order of the adapted dense matrix
2653 BLAZE_ALWAYS_INLINE typename StrictlyLowerMatrix<MT,SO,true>::SIMDType
2654  StrictlyLowerMatrix<MT,SO,true>::loadu( size_t i, size_t j ) const noexcept
2655 {
2656  return matrix_.loadu( i, j );
2657 }
2659 //*************************************************************************************************
2660 
2661 
2662 
2663 
2664 //=================================================================================================
2665 //
2666 // CONSTRUCTION FUNCTIONS
2667 //
2668 //=================================================================================================
2669 
2670 //*************************************************************************************************
2677 template< typename MT // Type of the adapted dense matrix
2678  , bool SO > // Storage order of the adapted dense matrix
2679 inline const MT StrictlyLowerMatrix<MT,SO,true>::construct( size_t n, TrueType )
2680 {
2682 
2683  return MT( n, n, ElementType() );
2684 }
2686 //*************************************************************************************************
2687 
2688 
2689 //*************************************************************************************************
2696 template< typename MT // Type of the adapted dense matrix
2697  , bool SO > // Storage order of the adapted dense matrix
2698 inline const MT StrictlyLowerMatrix<MT,SO,true>::construct( const ElementType& init, FalseType )
2699 {
2702 
2703  MT tmp;
2704 
2705  if( SO ) {
2706  for( size_t j=0UL; j<tmp.columns(); ++j ) {
2707  for( size_t i=j+1UL; i<tmp.rows(); ++i )
2708  tmp(i,j) = init;
2709  }
2710  }
2711  else {
2712  for( size_t i=0UL; i<tmp.rows(); ++i ) {
2713  for( size_t j=0UL; j<i; ++j )
2714  tmp(i,j) = init;
2715  }
2716  }
2717 
2718  return tmp;
2719 }
2721 //*************************************************************************************************
2722 
2723 
2724 //*************************************************************************************************
2735 template< typename MT // Type of the adapted dense matrix
2736  , bool SO > // Storage order of the adapted dense matrix
2737 template< typename MT2 // Type of the foreign matrix
2738  , bool SO2 // Storage order of the foreign matrix
2739  , typename T > // Type of the third argument
2740 inline const MT StrictlyLowerMatrix<MT,SO,true>::construct( const Matrix<MT2,SO2>& m, T )
2741 {
2742  const MT tmp( ~m );
2743 
2744  if( IsUniTriangular_v<MT2> ||
2745  ( !IsStrictlyLower_v<MT2> && !isStrictlyLower( tmp ) ) ) {
2746  BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of strictly lower matrix" );
2747  }
2748 
2749  return tmp;
2750 }
2752 //*************************************************************************************************
2753 
2754 } // namespace blaze
2755 
2756 #endif
#define BLAZE_CONSTRAINT_MUST_NOT_BE_TRANSFORMATION_TYPE(T)
Constraint on the data type.In case the given data type T is a transformation expression (i....
Definition: Transformation.h:81
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,...
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: IntegralConstant.h:121
#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
Constraint on the data type.
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
auto operator-=(DenseMatrix< MT, SO > &mat, ST scalar) -> EnableIf_t< IsNumeric_v< ST >, MT & >
Subtraction assignment operator for the subtraction of a dense matrix and a scalar value ( ).
Definition: DenseMatrix.h:432
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
bool isStrictlyLower(const DenseMatrix< MT, SO > &dm)
Checks if the given dense matrix is a strictly lower triangular matrix.
Definition: DenseMatrix.h:1968
Constraint on the data type.
#define BLAZE_USER_ASSERT(expr, msg)
Run time assertion macro for user checks.In case of an invalid run time expression,...
Definition: Assert.h:117
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:170
decltype(auto) submatrix(Matrix< MT, SO > &, RSAs...)
Creating a view on a specific submatrix of the given matrix.
Definition: Submatrix.h:178
Header file for the implementation of the base template of the StrictlyLowerMatrix.
#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_NOT_BE_COMPUTATION_TYPE(T)
Constraint on the data type.In case the given data type T is a computational expression (i....
Definition: Computation.h:81
#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.
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
void reset(const DiagonalProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: DiagonalProxy.h:595
void shrinkToFit(Matrix< MT, SO > &matrix)
Requesting the removal of unused capacity.
Definition: Matrix.h:799
Header file for the MAYBE_UNUSED function template.
Header file for all adaptor forward declarations.
#define BLAZE_CONSTRAINT_MUST_NOT_BE_VOLATILE(T)
Constraint on the data type.In case the given data type is a volatile-qualified type,...
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: IntegralConstant.h:132
Header file for the extended initializer_list functionality.
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:253
#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,...
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:677
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.
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,...
Definition: Static.h:61
Compile time assertion.
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:9091
#define BLAZE_CONSTRAINT_MUST_NOT_BE_POINTER_TYPE(T)
Constraint on the data type.In case the given data type T is not a pointer type, a compilation error ...
Definition: Pointer.h:79
#define BLAZE_THROW_OUT_OF_RANGE(MESSAGE)
Macro for the emission of a std::out_of_range exception.This macro encapsulates the default way of Bl...
Definition: Exception.h:331
Header file for the DenseMatrix base class.
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
auto operator+=(DenseMatrix< MT, SO > &mat, ST scalar) -> EnableIf_t< IsNumeric_v< ST >, MT & >
Addition assignment operator for the addition of a dense matrix and a scalar value ( ).
Definition: DenseMatrix.h:370
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:1001
constexpr void MAYBE_UNUSED(const Args &...)
Suppression of unused parameter warnings.
Definition: MaybeUnused.h:81
Header file for the IsUniTriangular type trait.
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:139
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
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
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:615
constexpr bool IsComputation_v
Auxiliary variable template for the IsComputation type trait.The IsComputation_v variable template pr...
Definition: IsComputation.h:90
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:558
#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,...
Definition: Symmetric.h:79
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 'resize' 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,...
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:282
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:408
#define BLAZE_CONSTRAINT_MUST_NOT_BE_VIEW_TYPE(T)
Constraint on the data type.In case the given data type T is a view type (i.e. a subvector,...
Definition: View.h:81
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
#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 'res...
Definition: Resizable.h:61
Header file for the IsComputation type trait class.
Header file for the IntegralConstant class template.
bool isIntact(const DiagonalMatrix< MT, SO, DF > &m)
Returns whether the invariants of the given diagonal matrix are intact.
Definition: DiagonalMatrix.h:264
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:494
#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,...
Definition: Hermitian.h:79
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.
Constraint on the data type.
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,...
Definition: Assert.h:101
Header file for the clear shim.