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>
61 #include <blaze/math/Exception.h>
64 #include <blaze/math/shims/Clear.h>
74 #include <blaze/system/Inline.h>
75 #include <blaze/util/Assert.h>
81 #include <blaze/util/DisableIf.h>
82 #include <blaze/util/EnableIf.h>
83 #include <blaze/util/FalseType.h>
85 #include <blaze/util/TrueType.h>
86 #include <blaze/util/Types.h>
87 #include <blaze/util/Unused.h>
88 
89 
90 namespace blaze {
91 
92 //=================================================================================================
93 //
94 // CLASS TEMPLATE SPECIALIZATION FOR DENSE MATRICES
95 //
96 //=================================================================================================
97 
98 //*************************************************************************************************
106 template< typename MT // Type of the adapted dense matrix
107  , bool SO > // Storage order of the adapted dense matrix
108 class StrictlyLowerMatrix<MT,SO,true>
109  : public DenseMatrix< StrictlyLowerMatrix<MT,SO,true>, SO >
110 {
111  private:
112  //**Type definitions****************************************************************************
113  using OT = OppositeType_t<MT>;
114  using TT = TransposeType_t<MT>;
115  using ET = ElementType_t<MT>;
116  //**********************************************************************************************
117 
118  public:
119  //**Type definitions****************************************************************************
120  using This = StrictlyLowerMatrix<MT,SO,true>;
121  using BaseType = DenseMatrix<This,SO>;
122  using ResultType = This;
123  using OppositeType = StrictlyLowerMatrix<OT,!SO,true>;
124  using TransposeType = StrictlyUpperMatrix<TT,!SO,true>;
125  using ElementType = ET;
126  using SIMDType = SIMDType_t<MT>;
127  using ReturnType = ReturnType_t<MT>;
128  using CompositeType = const This&;
129  using Reference = StrictlyLowerProxy<MT>;
130  using ConstReference = ConstReference_t<MT>;
131  using Pointer = Pointer_t<MT>;
132  using ConstPointer = ConstPointer_t<MT>;
133  using ConstIterator = ConstIterator_t<MT>;
134  //**********************************************************************************************
135 
136  //**Rebind struct definition********************************************************************
139  template< typename NewType > // Data type of the other matrix
140  struct Rebind {
142  using Other = StrictlyLowerMatrix< typename MT::template Rebind<NewType>::Other >;
143  };
144  //**********************************************************************************************
145 
146  //**Resize struct definition********************************************************************
149  template< size_t NewM // Number of rows of the other matrix
150  , size_t NewN > // Number of columns of the other matrix
151  struct Resize {
153  using Other = StrictlyLowerMatrix< typename MT::template Resize<NewM,NewN>::Other >;
154  };
155  //**********************************************************************************************
156 
157  //**Iterator class definition*******************************************************************
160  class Iterator
161  {
162  public:
163  //**Type definitions*************************************************************************
164  using IteratorCategory = std::random_access_iterator_tag;
165  using ValueType = ElementType_t<MT>;
166  using PointerType = StrictlyLowerProxy<MT>;
167  using ReferenceType = StrictlyLowerProxy<MT>;
168  using DifferenceType = ptrdiff_t;
169 
170  // STL iterator requirements
171  using iterator_category = IteratorCategory;
172  using value_type = ValueType;
173  using pointer = PointerType;
174  using reference = ReferenceType;
175  using difference_type = DifferenceType;
176  //*******************************************************************************************
177 
178  //**Constructor******************************************************************************
181  inline Iterator() noexcept
182  : matrix_( nullptr ) // Reference to the adapted dense matrix
183  , row_ ( 0UL ) // The current row index of the iterator
184  , column_( 0UL ) // The current column index of the iterator
185  {}
186  //*******************************************************************************************
187 
188  //**Constructor******************************************************************************
195  inline Iterator( MT& matrix, size_t row, size_t column ) noexcept
196  : matrix_( &matrix ) // Reference to the adapted dense matrix
197  , row_ ( row ) // The current row-index of the iterator
198  , column_( column ) // The current column-index of the iterator
199  {}
200  //*******************************************************************************************
201 
202  //**Addition assignment operator*************************************************************
208  inline Iterator& operator+=( size_t inc ) noexcept {
209  ( SO )?( row_ += inc ):( column_ += inc );
210  return *this;
211  }
212  //*******************************************************************************************
213 
214  //**Subtraction assignment operator**********************************************************
220  inline Iterator& operator-=( size_t dec ) noexcept {
221  ( SO )?( row_ -= dec ):( column_ -= dec );
222  return *this;
223  }
224  //*******************************************************************************************
225 
226  //**Prefix increment operator****************************************************************
231  inline Iterator& operator++() noexcept {
232  ( SO )?( ++row_ ):( ++column_ );
233  return *this;
234  }
235  //*******************************************************************************************
236 
237  //**Postfix increment operator***************************************************************
242  inline const Iterator operator++( int ) noexcept {
243  const Iterator tmp( *this );
244  ++(*this);
245  return tmp;
246  }
247  //*******************************************************************************************
248 
249  //**Prefix decrement operator****************************************************************
254  inline Iterator& operator--() noexcept {
255  ( SO )?( --row_ ):( --column_ );
256  return *this;
257  }
258  //*******************************************************************************************
259 
260  //**Postfix decrement operator***************************************************************
265  inline const Iterator operator--( int ) noexcept {
266  const Iterator tmp( *this );
267  --(*this);
268  return tmp;
269  }
270  //*******************************************************************************************
271 
272  //**Element access operator******************************************************************
277  inline ReferenceType operator*() const {
278  return ReferenceType( *matrix_, row_, column_ );
279  }
280  //*******************************************************************************************
281 
282  //**Element access operator******************************************************************
287  inline PointerType operator->() const {
288  return PointerType( *matrix_, row_, column_ );
289  }
290  //*******************************************************************************************
291 
292  //**Load function****************************************************************************
302  inline SIMDType load() const {
303  return (*matrix_).load(row_,column_);
304  }
305  //*******************************************************************************************
306 
307  //**Loada function***************************************************************************
317  inline SIMDType loada() const {
318  return (*matrix_).loada(row_,column_);
319  }
320  //*******************************************************************************************
321 
322  //**Loadu function***************************************************************************
332  inline SIMDType loadu() const {
333  return (*matrix_).loadu(row_,column_);
334  }
335  //*******************************************************************************************
336 
337  //**Conversion operator**********************************************************************
342  inline operator ConstIterator() const {
343  if( SO )
344  return matrix_->begin( column_ ) + row_;
345  else
346  return matrix_->begin( row_ ) + column_;
347  }
348  //*******************************************************************************************
349 
350  //**Equality operator************************************************************************
357  friend inline bool operator==( const Iterator& lhs, const Iterator& rhs ) noexcept {
358  return ( SO )?( lhs.row_ == rhs.row_ ):( lhs.column_ == rhs.column_ );
359  }
360  //*******************************************************************************************
361 
362  //**Equality operator************************************************************************
369  friend inline bool operator==( const Iterator& lhs, const ConstIterator& rhs ) {
370  return ( ConstIterator( lhs ) == rhs );
371  }
372  //*******************************************************************************************
373 
374  //**Equality operator************************************************************************
381  friend inline bool operator==( const ConstIterator& lhs, const Iterator& rhs ) {
382  return ( lhs == ConstIterator( rhs ) );
383  }
384  //*******************************************************************************************
385 
386  //**Inequality operator**********************************************************************
393  friend inline bool operator!=( const Iterator& lhs, const Iterator& rhs ) noexcept {
394  return ( SO )?( lhs.row_ != rhs.row_ ):( lhs.column_ != rhs.column_ );
395  }
396  //*******************************************************************************************
397 
398  //**Inequality operator**********************************************************************
405  friend inline bool operator!=( const Iterator& lhs, const ConstIterator& rhs ) {
406  return ( ConstIterator( lhs ) != rhs );
407  }
408  //*******************************************************************************************
409 
410  //**Inequality operator**********************************************************************
417  friend inline bool operator!=( const ConstIterator& lhs, const Iterator& rhs ) {
418  return ( lhs != ConstIterator( rhs ) );
419  }
420  //*******************************************************************************************
421 
422  //**Less-than operator***********************************************************************
429  friend inline bool operator<( const Iterator& lhs, const Iterator& rhs ) noexcept {
430  return ( SO )?( lhs.row_ < rhs.row_ ):( lhs.column_ < rhs.column_ );
431  }
432  //*******************************************************************************************
433 
434  //**Less-than operator***********************************************************************
441  friend inline bool operator<( const Iterator& lhs, const ConstIterator& rhs ) {
442  return ( ConstIterator( lhs ) < rhs );
443  }
444  //*******************************************************************************************
445 
446  //**Less-than operator***********************************************************************
453  friend inline bool operator<( const ConstIterator& lhs, const Iterator& rhs ) {
454  return ( lhs < ConstIterator( rhs ) );
455  }
456  //*******************************************************************************************
457 
458  //**Greater-than operator********************************************************************
465  friend inline bool operator>( const Iterator& lhs, const Iterator& rhs ) noexcept {
466  return ( SO )?( lhs.row_ > rhs.row_ ):( lhs.column_ > rhs.column_ );
467  }
468  //*******************************************************************************************
469 
470  //**Greater-than operator********************************************************************
477  friend inline bool operator>( const Iterator& lhs, const ConstIterator& rhs ) {
478  return ( ConstIterator( lhs ) > rhs );
479  }
480  //*******************************************************************************************
481 
482  //**Greater-than operator********************************************************************
489  friend inline bool operator>( const ConstIterator& lhs, const Iterator& rhs ) {
490  return ( lhs > ConstIterator( rhs ) );
491  }
492  //*******************************************************************************************
493 
494  //**Less-or-equal-than operator**************************************************************
501  friend inline bool operator<=( const Iterator& lhs, const Iterator& rhs ) noexcept {
502  return ( SO )?( lhs.row_ <= rhs.row_ ):( lhs.column_ <= rhs.column_ );
503  }
504  //*******************************************************************************************
505 
506  //**Less-or-equal-than operator**************************************************************
513  friend inline bool operator<=( const Iterator& lhs, const ConstIterator& rhs ) {
514  return ( ConstIterator( lhs ) <= rhs );
515  }
516  //*******************************************************************************************
517 
518  //**Less-or-equal-than operator**************************************************************
525  friend inline bool operator<=( const ConstIterator& lhs, const Iterator& rhs ) {
526  return ( lhs <= ConstIterator( rhs ) );
527  }
528  //*******************************************************************************************
529 
530  //**Greater-or-equal-than operator***********************************************************
537  friend inline bool operator>=( const Iterator& lhs, const Iterator& rhs ) noexcept {
538  return ( SO )?( lhs.row_ >= rhs.row_ ):( lhs.column_ >= rhs.column_ );
539  }
540  //*******************************************************************************************
541 
542  //**Greater-or-equal-than operator***********************************************************
549  friend inline bool operator>=( const Iterator& lhs, const ConstIterator& rhs ) {
550  return ( ConstIterator( lhs ) >= rhs );
551  }
552  //*******************************************************************************************
553 
554  //**Greater-or-equal-than operator***********************************************************
561  friend inline bool operator>=( const ConstIterator& lhs, const Iterator& rhs ) {
562  return ( lhs >= ConstIterator( rhs ) );
563  }
564  //*******************************************************************************************
565 
566  //**Subtraction operator*********************************************************************
572  inline DifferenceType operator-( const Iterator& rhs ) const noexcept {
573  return ( SO )?( row_ - rhs.row_ ):( column_ - rhs.column_ );
574  }
575  //*******************************************************************************************
576 
577  //**Addition operator************************************************************************
584  friend inline const Iterator operator+( const Iterator& it, size_t inc ) noexcept {
585  if( SO )
586  return Iterator( *it.matrix_, it.row_ + inc, it.column_ );
587  else
588  return Iterator( *it.matrix_, it.row_, it.column_ + inc );
589  }
590  //*******************************************************************************************
591 
592  //**Addition operator************************************************************************
599  friend inline const Iterator operator+( size_t inc, const Iterator& it ) noexcept {
600  if( SO )
601  return Iterator( *it.matrix_, it.row_ + inc, it.column_ );
602  else
603  return Iterator( *it.matrix_, it.row_, it.column_ + inc );
604  }
605  //*******************************************************************************************
606 
607  //**Subtraction operator*********************************************************************
614  friend inline const Iterator operator-( const Iterator& it, size_t dec ) noexcept {
615  if( SO )
616  return Iterator( *it.matrix_, it.row_ - dec, it.column_ );
617  else
618  return Iterator( *it.matrix_, it.row_, it.column_ - dec );
619  }
620  //*******************************************************************************************
621 
622  private:
623  //**Member variables*************************************************************************
624  MT* matrix_;
625  size_t row_;
626  size_t column_;
627  //*******************************************************************************************
628  };
629  //**********************************************************************************************
630 
631  //**Compilation flags***************************************************************************
633  static constexpr bool simdEnabled = MT::simdEnabled;
634 
636  static constexpr bool smpAssignable = MT::smpAssignable;
637  //**********************************************************************************************
638 
639  //**Constructors********************************************************************************
642  explicit inline StrictlyLowerMatrix();
643  template< typename A1 > explicit inline StrictlyLowerMatrix( const A1& a1 );
644  explicit inline StrictlyLowerMatrix( size_t n, const ElementType& init );
645 
646  explicit inline StrictlyLowerMatrix( initializer_list< initializer_list<ElementType> > list );
647 
648  template< typename Other >
649  explicit inline StrictlyLowerMatrix( size_t n, const Other* array );
650 
651  template< typename Other, size_t N >
652  explicit inline StrictlyLowerMatrix( const Other (&array)[N][N] );
653 
654  explicit inline StrictlyLowerMatrix( ElementType* ptr, size_t n );
655  explicit inline StrictlyLowerMatrix( ElementType* ptr, size_t n, size_t nn );
656 
657  inline StrictlyLowerMatrix( const StrictlyLowerMatrix& m );
658  inline StrictlyLowerMatrix( StrictlyLowerMatrix&& m ) noexcept;
660  //**********************************************************************************************
661 
662  //**Destructor**********************************************************************************
665  ~StrictlyLowerMatrix() = default;
667  //**********************************************************************************************
668 
669  //**Data access functions***********************************************************************
672  inline Reference operator()( size_t i, size_t j );
673  inline ConstReference operator()( size_t i, size_t j ) const;
674  inline Reference at( size_t i, size_t j );
675  inline ConstReference at( size_t i, size_t j ) const;
676  inline ConstPointer data () const noexcept;
677  inline ConstPointer data ( size_t i ) const noexcept;
678  inline Iterator begin ( size_t i );
679  inline ConstIterator begin ( size_t i ) const;
680  inline ConstIterator cbegin( size_t i ) const;
681  inline Iterator end ( size_t i );
682  inline ConstIterator end ( size_t i ) const;
683  inline ConstIterator cend ( size_t i ) const;
685  //**********************************************************************************************
686 
687  //**Assignment operators************************************************************************
690  inline StrictlyLowerMatrix& operator=( const ElementType& rhs );
691  inline StrictlyLowerMatrix& operator=( initializer_list< initializer_list<ElementType> > list );
692 
693  template< typename Other, size_t N >
694  inline StrictlyLowerMatrix& operator=( const Other (&array)[N][N] );
695 
696  inline StrictlyLowerMatrix& operator=( const StrictlyLowerMatrix& rhs );
697  inline StrictlyLowerMatrix& operator=( StrictlyLowerMatrix&& rhs ) noexcept;
698 
699  template< typename MT2, bool SO2 >
700  inline auto operator=( const Matrix<MT2,SO2>& rhs )
701  -> DisableIf_t< IsComputation_v<MT2>, StrictlyLowerMatrix& >;
702 
703  template< typename MT2, bool SO2 >
704  inline auto operator=( const Matrix<MT2,SO2>& rhs )
705  -> EnableIf_t< IsComputation_v<MT2>, StrictlyLowerMatrix& >;
706 
707  template< typename MT2, bool SO2 >
708  inline auto operator+=( const Matrix<MT2,SO2>& rhs )
709  -> DisableIf_t< IsComputation_v<MT2>, StrictlyLowerMatrix& >;
710 
711  template< typename MT2, bool SO2 >
712  inline auto operator+=( const Matrix<MT2,SO2>& rhs )
713  -> EnableIf_t< IsComputation_v<MT2>, StrictlyLowerMatrix& >;
714 
715  template< typename MT2, bool SO2 >
716  inline auto operator-=( const Matrix<MT2,SO2>& rhs )
717  -> DisableIf_t< IsComputation_v<MT2>, StrictlyLowerMatrix& >;
718 
719  template< typename MT2, bool SO2 >
720  inline auto operator-=( const Matrix<MT2,SO2>& rhs )
721  -> EnableIf_t< IsComputation_v<MT2>, StrictlyLowerMatrix& >;
722 
723  template< typename MT2, bool SO2 >
724  inline auto operator%=( const Matrix<MT2,SO2>& rhs ) -> StrictlyLowerMatrix&;
725 
726  template< typename ST >
727  inline auto operator*=( ST rhs ) -> EnableIf_t< IsNumeric_v<ST>, StrictlyLowerMatrix& >;
728 
729  template< typename ST >
730  inline auto operator/=( ST rhs ) -> EnableIf_t< IsNumeric_v<ST>, StrictlyLowerMatrix& >;
732  //**********************************************************************************************
733 
734  //**Utility functions***************************************************************************
737  inline size_t rows() const noexcept;
738  inline size_t columns() const noexcept;
739  inline size_t spacing() const noexcept;
740  inline size_t capacity() const noexcept;
741  inline size_t capacity( size_t i ) const noexcept;
742  inline size_t nonZeros() const;
743  inline size_t nonZeros( size_t i ) const;
744  inline void reset();
745  inline void reset( size_t i );
746  inline void clear();
747  void resize ( size_t n, bool preserve=true );
748  inline void extend ( size_t n, bool preserve=true );
749  inline void reserve( size_t elements );
750  inline void shrinkToFit();
751  inline void swap( StrictlyLowerMatrix& m ) noexcept;
752 
753  static inline constexpr size_t maxNonZeros() noexcept;
754  static inline constexpr size_t maxNonZeros( size_t n ) noexcept;
756  //**********************************************************************************************
757 
758  //**Numeric functions***************************************************************************
761  template< typename Other > inline StrictlyLowerMatrix& scale( const Other& scalar );
763  //**********************************************************************************************
764 
765  //**Debugging functions*************************************************************************
768  inline bool isIntact() const noexcept;
770  //**********************************************************************************************
771 
772  //**Expression template evaluation functions****************************************************
775  template< typename Other > inline bool canAlias ( const Other* alias ) const noexcept;
776  template< typename Other > inline bool isAliased( const Other* alias ) const noexcept;
777 
778  inline bool isAligned () const noexcept;
779  inline bool canSMPAssign() const noexcept;
780 
781  BLAZE_ALWAYS_INLINE SIMDType load ( size_t i, size_t j ) const noexcept;
782  BLAZE_ALWAYS_INLINE SIMDType loada( size_t i, size_t j ) const noexcept;
783  BLAZE_ALWAYS_INLINE SIMDType loadu( size_t i, size_t j ) const noexcept;
785  //**********************************************************************************************
786 
787  private:
788  //**Construction functions**********************************************************************
791  inline const MT construct( size_t n , TrueType );
792  inline const MT construct( const ElementType& value, FalseType );
793 
794  template< typename MT2, bool SO2, typename T >
795  inline const MT construct( const Matrix<MT2,SO2>& m, T );
797  //**********************************************************************************************
798 
799  //**Member variables****************************************************************************
802  MT matrix_;
803 
804  //**********************************************************************************************
805 
806  //**Friend declarations*************************************************************************
807  template< typename MT2, bool SO2, bool DF2 >
808  friend MT2& derestrict( StrictlyLowerMatrix<MT2,SO2,DF2>& m );
809  //**********************************************************************************************
810 
811  //**Compile time checks*************************************************************************
824  BLAZE_STATIC_ASSERT( ( Size_v<MT,0UL> == Size_v<MT,1UL> ) );
825  //**********************************************************************************************
826 };
828 //*************************************************************************************************
829 
830 
831 
832 
833 //=================================================================================================
834 //
835 // CONSTRUCTORS
836 //
837 //=================================================================================================
838 
839 //*************************************************************************************************
843 template< typename MT // Type of the adapted dense matrix
844  , bool SO > // Storage order of the adapted dense matrix
845 inline StrictlyLowerMatrix<MT,SO,true>::StrictlyLowerMatrix()
846  : matrix_() // The adapted dense matrix
847 {
848  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly lower matrix detected" );
849  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
850 }
852 //*************************************************************************************************
853 
854 
855 //*************************************************************************************************
873 template< typename MT // Type of the adapted dense matrix
874  , bool SO > // Storage order of the adapted dense matrix
875 template< typename A1 > // Type of the constructor argument
876 inline StrictlyLowerMatrix<MT,SO,true>::StrictlyLowerMatrix( const A1& a1 )
877  : matrix_( construct( a1, typename IsResizable<MT>::Type() ) ) // The adapted dense matrix
878 {
879  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly lower matrix detected" );
880  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
881 }
883 //*************************************************************************************************
884 
885 
886 //*************************************************************************************************
893 template< typename MT // Type of the adapted dense matrix
894  , bool SO > // Storage order of the adapted dense matrix
895 inline StrictlyLowerMatrix<MT,SO,true>::StrictlyLowerMatrix( size_t n, const ElementType& init )
896  : matrix_( n, n, ElementType() ) // The adapted dense matrix
897 {
899 
900  if( SO ) {
901  for( size_t j=0UL; j<columns(); ++j ) {
902  for( size_t i=j+1UL; i<rows(); ++i )
903  matrix_(i,j) = init;
904  }
905  }
906  else {
907  for( size_t i=0UL; i<rows(); ++i ) {
908  for( size_t j=0UL; j<i; ++j )
909  matrix_(i,j) = init;
910  }
911  }
912 
913  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly lower matrix detected" );
914  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
915 }
917 //*************************************************************************************************
918 
919 
920 //*************************************************************************************************
944 template< typename MT // Type of the adapted dense matrix
945  , bool SO > // Storage order of the adapted dense matrix
946 inline StrictlyLowerMatrix<MT,SO,true>::StrictlyLowerMatrix( initializer_list< initializer_list<ElementType> > list )
947  : matrix_( list ) // The adapted dense matrix
948 {
949  if( !isStrictlyLower( matrix_ ) ) {
950  BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of strictly lower matrix" );
951  }
952 
953  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
954 }
956 //*************************************************************************************************
957 
958 
959 //*************************************************************************************************
985 template< typename MT // Type of the adapted dense matrix
986  , bool SO > // Storage order of the adapted dense matrix
987 template< typename Other > // Data type of the initialization array
988 inline StrictlyLowerMatrix<MT,SO,true>::StrictlyLowerMatrix( size_t n, const Other* array )
989  : matrix_( n, n, array ) // The adapted dense matrix
990 {
991  if( !isStrictlyLower( matrix_ ) ) {
992  BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of strictly lower matrix" );
993  }
994 
995  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
996 }
998 //*************************************************************************************************
999 
1000 
1001 //*************************************************************************************************
1024 template< typename MT // Type of the adapted dense matrix
1025  , bool SO > // Storage order of the adapted dense matrix
1026 template< typename Other // Data type of the initialization array
1027  , size_t N > // Number of rows and columns of the initialization array
1028 inline StrictlyLowerMatrix<MT,SO,true>::StrictlyLowerMatrix( const Other (&array)[N][N] )
1029  : matrix_( array ) // The adapted dense matrix
1030 {
1031  if( !isStrictlyLower( matrix_ ) ) {
1032  BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of strictly lower matrix" );
1033  }
1034 
1035  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1036 }
1038 //*************************************************************************************************
1039 
1040 
1041 //*************************************************************************************************
1074 template< typename MT // Type of the adapted dense matrix
1075  , bool SO > // Storage order of the adapted dense matrix
1076 inline StrictlyLowerMatrix<MT,SO,true>::StrictlyLowerMatrix( ElementType* ptr, size_t n )
1077  : matrix_( ptr, n, n ) // The adapted dense matrix
1078 {
1079  if( !isStrictlyLower( matrix_ ) ) {
1080  BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of strictly lower matrix" );
1081  }
1082 
1083  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1084 }
1086 //*************************************************************************************************
1087 
1088 
1089 //*************************************************************************************************
1123 template< typename MT // Type of the adapted dense matrix
1124  , bool SO > // Storage order of the adapted dense matrix
1125 inline StrictlyLowerMatrix<MT,SO,true>::StrictlyLowerMatrix( ElementType* ptr, size_t n, size_t nn )
1126  : matrix_( ptr, n, n, nn ) // The adapted dense matrix
1127 {
1128  if( !isStrictlyLower( matrix_ ) ) {
1129  BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of strictly lower matrix" );
1130  }
1131 
1132  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1133 }
1135 //*************************************************************************************************
1136 
1137 
1138 //*************************************************************************************************
1144 template< typename MT // Type of the adapted dense matrix
1145  , bool SO > // Storage order of the adapted dense matrix
1146 inline StrictlyLowerMatrix<MT,SO,true>::StrictlyLowerMatrix( const StrictlyLowerMatrix& m )
1147  : matrix_( m.matrix_ ) // The adapted dense matrix
1148 {
1149  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly lower matrix detected" );
1150  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1151 }
1153 //*************************************************************************************************
1154 
1155 
1156 //*************************************************************************************************
1162 template< typename MT // Type of the adapted dense matrix
1163  , bool SO > // Storage order of the adapted dense matrix
1164 inline StrictlyLowerMatrix<MT,SO,true>::StrictlyLowerMatrix( StrictlyLowerMatrix&& m ) noexcept
1165  : matrix_( std::move( m.matrix_ ) ) // The adapted dense matrix
1166 {
1167  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly lower matrix detected" );
1168  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1169 }
1171 //*************************************************************************************************
1172 
1173 
1174 
1175 
1176 //=================================================================================================
1177 //
1178 // DATA ACCESS FUNCTIONS
1179 //
1180 //=================================================================================================
1181 
1182 //*************************************************************************************************
1198 template< typename MT // Type of the adapted dense matrix
1199  , bool SO > // Storage order of the adapted dense matrix
1201  StrictlyLowerMatrix<MT,SO,true>::operator()( size_t i, size_t j )
1202 {
1203  BLAZE_USER_ASSERT( i<rows() , "Invalid row access index" );
1204  BLAZE_USER_ASSERT( j<columns(), "Invalid column access index" );
1205 
1206  return Reference( matrix_, i, j );
1207 }
1209 //*************************************************************************************************
1210 
1211 
1212 //*************************************************************************************************
1228 template< typename MT // Type of the adapted dense matrix
1229  , bool SO > // Storage order of the adapted dense matrix
1231  StrictlyLowerMatrix<MT,SO,true>::operator()( size_t i, size_t j ) const
1232 {
1233  BLAZE_USER_ASSERT( i<rows() , "Invalid row access index" );
1234  BLAZE_USER_ASSERT( j<columns(), "Invalid column access index" );
1235 
1236  return matrix_(i,j);
1237 }
1239 //*************************************************************************************************
1240 
1241 
1242 //*************************************************************************************************
1259 template< typename MT // Type of the adapted dense matrix
1260  , bool SO > // Storage order of the adapted dense matrix
1262  StrictlyLowerMatrix<MT,SO,true>::at( size_t i, size_t j )
1263 {
1264  if( i >= rows() ) {
1265  BLAZE_THROW_OUT_OF_RANGE( "Invalid row access index" );
1266  }
1267  if( j >= columns() ) {
1268  BLAZE_THROW_OUT_OF_RANGE( "Invalid column access index" );
1269  }
1270  return (*this)(i,j);
1271 }
1273 //*************************************************************************************************
1274 
1275 
1276 //*************************************************************************************************
1293 template< typename MT // Type of the adapted dense matrix
1294  , bool SO > // Storage order of the adapted dense matrix
1296  StrictlyLowerMatrix<MT,SO,true>::at( size_t i, size_t j ) const
1297 {
1298  if( i >= rows() ) {
1299  BLAZE_THROW_OUT_OF_RANGE( "Invalid row access index" );
1300  }
1301  if( j >= columns() ) {
1302  BLAZE_THROW_OUT_OF_RANGE( "Invalid column access index" );
1303  }
1304  return (*this)(i,j);
1305 }
1307 //*************************************************************************************************
1308 
1309 
1310 //*************************************************************************************************
1323 template< typename MT // Type of the adapted dense matrix
1324  , bool SO > // Storage order of the adapted dense matrix
1325 inline typename StrictlyLowerMatrix<MT,SO,true>::ConstPointer
1326  StrictlyLowerMatrix<MT,SO,true>::data() const noexcept
1327 {
1328  return matrix_.data();
1329 }
1331 //*************************************************************************************************
1332 
1333 
1334 //*************************************************************************************************
1343 template< typename MT // Type of the adapted dense matrix
1344  , bool SO > // Storage order of the adapted dense matrix
1345 inline typename StrictlyLowerMatrix<MT,SO,true>::ConstPointer
1346  StrictlyLowerMatrix<MT,SO,true>::data( size_t i ) const noexcept
1347 {
1348  return matrix_.data(i);
1349 }
1351 //*************************************************************************************************
1352 
1353 
1354 //*************************************************************************************************
1366 template< typename MT // Type of the adapted dense matrix
1367  , bool SO > // Storage order of the adapted dense matrix
1370 {
1371  if( SO )
1372  return Iterator( matrix_, 0UL, i );
1373  else
1374  return Iterator( matrix_, i, 0UL );
1375 }
1377 //*************************************************************************************************
1378 
1379 
1380 //*************************************************************************************************
1392 template< typename MT // Type of the adapted dense matrix
1393  , bool SO > // Storage order of the adapted dense matrix
1395  StrictlyLowerMatrix<MT,SO,true>::begin( size_t i ) const
1396 {
1397  return matrix_.begin(i);
1398 }
1400 //*************************************************************************************************
1401 
1402 
1403 //*************************************************************************************************
1415 template< typename MT // Type of the adapted dense matrix
1416  , bool SO > // Storage order of the adapted dense matrix
1418  StrictlyLowerMatrix<MT,SO,true>::cbegin( size_t i ) const
1419 {
1420  return matrix_.cbegin(i);
1421 }
1423 //*************************************************************************************************
1424 
1425 
1426 //*************************************************************************************************
1438 template< typename MT // Type of the adapted dense matrix
1439  , bool SO > // Storage order of the adapted dense matrix
1442 {
1443  if( SO )
1444  return Iterator( matrix_, rows(), i );
1445  else
1446  return Iterator( matrix_, i, columns() );
1447 }
1449 //*************************************************************************************************
1450 
1451 
1452 //*************************************************************************************************
1464 template< typename MT // Type of the adapted dense matrix
1465  , bool SO > // Storage order of the adapted dense matrix
1467  StrictlyLowerMatrix<MT,SO,true>::end( size_t i ) const
1468 {
1469  return matrix_.end(i);
1470 }
1472 //*************************************************************************************************
1473 
1474 
1475 //*************************************************************************************************
1487 template< typename MT // Type of the adapted dense matrix
1488  , bool SO > // Storage order of the adapted dense matrix
1490  StrictlyLowerMatrix<MT,SO,true>::cend( size_t i ) const
1491 {
1492  return matrix_.cend(i);
1493 }
1495 //*************************************************************************************************
1496 
1497 
1498 
1499 
1500 //=================================================================================================
1501 //
1502 // ASSIGNMENT OPERATORS
1503 //
1504 //=================================================================================================
1505 
1506 //*************************************************************************************************
1513 template< typename MT // Type of the adapted dense matrix
1514  , bool SO > // Storage order of the adapted dense matrix
1515 inline StrictlyLowerMatrix<MT,SO,true>&
1516  StrictlyLowerMatrix<MT,SO,true>::operator=( const ElementType& rhs )
1517 {
1518  if( SO ) {
1519  for( size_t j=0UL; j<columns(); ++j )
1520  for( size_t i=j+1UL; i<rows(); ++i )
1521  matrix_(i,j) = rhs;
1522  }
1523  else {
1524  for( size_t i=1UL; i<rows(); ++i )
1525  for( size_t j=0UL; j<i; ++j )
1526  matrix_(i,j) = rhs;
1527  }
1528 
1529  return *this;
1530 }
1532 //*************************************************************************************************
1533 
1534 
1535 //*************************************************************************************************
1560 template< typename MT // Type of the adapted dense matrix
1561  , bool SO > // Storage order of the adapted dense matrix
1562 inline StrictlyLowerMatrix<MT,SO,true>&
1563  StrictlyLowerMatrix<MT,SO,true>::operator=( initializer_list< initializer_list<ElementType> > list )
1564 {
1565  const InitializerMatrix<ElementType> tmp( list, list.size() );
1566 
1567  if( !isStrictlyLower( tmp ) ) {
1568  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to strictly lower matrix" );
1569  }
1570 
1571  matrix_ = list;
1572 
1573  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly lower matrix detected" );
1574  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1575 
1576  return *this;
1577 }
1579 //*************************************************************************************************
1580 
1581 
1582 //*************************************************************************************************
1607 template< typename MT // Type of the adapted dense matrix
1608  , bool SO > // Storage order of the adapted dense matrix
1609 template< typename Other // Data type of the initialization array
1610  , size_t N > // Number of rows and columns of the initialization array
1611 inline StrictlyLowerMatrix<MT,SO,true>&
1612  StrictlyLowerMatrix<MT,SO,true>::operator=( const Other (&array)[N][N] )
1613 {
1614  MT tmp( array );
1615 
1616  if( !isStrictlyLower( tmp ) ) {
1617  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to strictly lower matrix" );
1618  }
1619 
1620  matrix_ = std::move( tmp );
1621 
1622  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly lower matrix detected" );
1623  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1624 
1625  return *this;
1626 }
1628 //*************************************************************************************************
1629 
1630 
1631 //*************************************************************************************************
1641 template< typename MT // Type of the adapted dense matrix
1642  , bool SO > // Storage order of the adapted dense matrix
1643 inline StrictlyLowerMatrix<MT,SO,true>&
1644  StrictlyLowerMatrix<MT,SO,true>::operator=( const StrictlyLowerMatrix& rhs )
1645 {
1646  matrix_ = rhs.matrix_;
1647 
1648  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly lower matrix detected" );
1649  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1650 
1651  return *this;
1652 }
1654 //*************************************************************************************************
1655 
1656 
1657 //*************************************************************************************************
1664 template< typename MT // Type of the adapted dense matrix
1665  , bool SO > // Storage order of the adapted dense matrix
1666 inline StrictlyLowerMatrix<MT,SO,true>&
1667  StrictlyLowerMatrix<MT,SO,true>::operator=( StrictlyLowerMatrix&& rhs ) noexcept
1668 {
1669  matrix_ = std::move( rhs.matrix_ );
1670 
1671  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly lower matrix detected" );
1672  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1673 
1674  return *this;
1675 }
1677 //*************************************************************************************************
1678 
1679 
1680 //*************************************************************************************************
1693 template< typename MT // Type of the adapted dense matrix
1694  , bool SO > // Storage order of the adapted dense matrix
1695 template< typename MT2 // Type of the right-hand side matrix
1696  , bool SO2 > // Storage order of the right-hand side matrix
1697 inline auto StrictlyLowerMatrix<MT,SO,true>::operator=( const Matrix<MT2,SO2>& rhs )
1698  -> DisableIf_t< IsComputation_v<MT2>, StrictlyLowerMatrix& >
1699 {
1700  if( IsUniTriangular_v<MT2> ||
1701  ( !IsStrictlyLower_v<MT2> && !isStrictlyLower( ~rhs ) ) ) {
1702  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to strictly lower matrix" );
1703  }
1704 
1705  matrix_ = decllow( ~rhs );
1706 
1707  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly lower matrix detected" );
1708  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1709 
1710  return *this;
1711 }
1713 //*************************************************************************************************
1714 
1715 
1716 //*************************************************************************************************
1729 template< typename MT // Type of the adapted dense matrix
1730  , bool SO > // Storage order of the adapted dense matrix
1731 template< typename MT2 // Type of the right-hand side matrix
1732  , bool SO2 > // Storage order of the right-hand side matrix
1733 inline auto StrictlyLowerMatrix<MT,SO,true>::operator=( const Matrix<MT2,SO2>& rhs )
1734  -> EnableIf_t< IsComputation_v<MT2>, StrictlyLowerMatrix& >
1735 {
1736  if( IsUniTriangular_v<MT2> || ( !IsSquare_v<MT2> && !isSquare( ~rhs ) ) ) {
1737  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to strictly lower matrix" );
1738  }
1739 
1740  if( IsStrictlyLower_v<MT2> ) {
1741  matrix_ = ~rhs;
1742  }
1743  else {
1744  MT tmp( ~rhs );
1745 
1746  if( !isStrictlyLower( tmp ) ) {
1747  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to strictly lower matrix" );
1748  }
1749 
1750  matrix_ = std::move( tmp );
1751  }
1752 
1753  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly lower matrix detected" );
1754  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1755 
1756  return *this;
1757 }
1759 //*************************************************************************************************
1760 
1761 
1762 //*************************************************************************************************
1775 template< typename MT // Type of the adapted dense matrix
1776  , bool SO > // Storage order of the adapted dense matrix
1777 template< typename MT2 // Type of the right-hand side matrix
1778  , bool SO2 > // Storage order of the right-hand side matrix
1779 inline auto StrictlyLowerMatrix<MT,SO,true>::operator+=( const Matrix<MT2,SO2>& rhs )
1780  -> DisableIf_t< IsComputation_v<MT2>, StrictlyLowerMatrix& >
1781 {
1782  if( IsUniTriangular_v<MT2> ||
1783  ( !IsStrictlyLower_v<MT2> && !isStrictlyLower( ~rhs ) ) ) {
1784  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to strictly lower matrix" );
1785  }
1786 
1787  matrix_ += decllow( ~rhs );
1788 
1789  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly lower matrix detected" );
1790  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1791 
1792  return *this;
1793 }
1795 //*************************************************************************************************
1796 
1797 
1798 //*************************************************************************************************
1811 template< typename MT // Type of the adapted dense matrix
1812  , bool SO > // Storage order of the adapted dense matrix
1813 template< typename MT2 // Type of the right-hand side matrix
1814  , bool SO2 > // Storage order of the right-hand side matrix
1815 inline auto StrictlyLowerMatrix<MT,SO,true>::operator+=( const Matrix<MT2,SO2>& rhs )
1816  -> EnableIf_t< IsComputation_v<MT2>, StrictlyLowerMatrix& >
1817 {
1818  if( IsUniTriangular_v<MT2> || ( !IsSquare_v<MT2> && !isSquare( ~rhs ) ) ) {
1819  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to strictly lower matrix" );
1820  }
1821 
1822  if( IsStrictlyLower_v<MT2> ) {
1823  matrix_ += ~rhs;
1824  }
1825  else {
1826  const ResultType_t<MT2> tmp( ~rhs );
1827 
1828  if( !isStrictlyLower( tmp ) ) {
1829  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to strictly lower matrix" );
1830  }
1831 
1832  matrix_ += decllow( tmp );
1833  }
1834 
1835  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly lower matrix detected" );
1836  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1837 
1838  return *this;
1839 }
1841 //*************************************************************************************************
1842 
1843 
1844 //*************************************************************************************************
1857 template< typename MT // Type of the adapted dense matrix
1858  , bool SO > // Storage order of the adapted dense matrix
1859 template< typename MT2 // Type of the right-hand side matrix
1860  , bool SO2 > // Storage order of the right-hand side matrix
1861 inline auto StrictlyLowerMatrix<MT,SO,true>::operator-=( const Matrix<MT2,SO2>& rhs )
1862  -> DisableIf_t< IsComputation_v<MT2>, StrictlyLowerMatrix& >
1863 {
1864  if( IsUniTriangular_v<MT2> ||
1865  ( !IsStrictlyLower_v<MT2> && !isStrictlyLower( ~rhs ) ) ) {
1866  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to strictly lower matrix" );
1867  }
1868 
1869  matrix_ -= decllow( ~rhs );
1870 
1871  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly lower matrix detected" );
1872  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1873 
1874  return *this;
1875 }
1877 //*************************************************************************************************
1878 
1879 
1880 //*************************************************************************************************
1893 template< typename MT // Type of the adapted dense matrix
1894  , bool SO > // Storage order of the adapted dense matrix
1895 template< typename MT2 // Type of the right-hand side matrix
1896  , bool SO2 > // Storage order of the right-hand side matrix
1897 inline auto StrictlyLowerMatrix<MT,SO,true>::operator-=( const Matrix<MT2,SO2>& rhs )
1898  -> EnableIf_t< IsComputation_v<MT2>, StrictlyLowerMatrix& >
1899 {
1900  if( IsUniTriangular_v<MT2> || ( !IsSquare_v<MT2> && !isSquare( ~rhs ) ) ) {
1901  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to strictly lower matrix" );
1902  }
1903 
1904  if( IsStrictlyLower_v<MT2> ) {
1905  matrix_ -= ~rhs;
1906  }
1907  else {
1908  const ResultType_t<MT2> tmp( ~rhs );
1909 
1910  if( !isStrictlyLower( tmp ) ) {
1911  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to strictly lower matrix" );
1912  }
1913 
1914  matrix_ -= decllow( tmp );
1915  }
1916 
1917  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly lower matrix detected" );
1918  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1919 
1920  return *this;
1921 }
1923 //*************************************************************************************************
1924 
1925 
1926 //*************************************************************************************************
1937 template< typename MT // Type of the adapted dense matrix
1938  , bool SO > // Storage order of the adapted dense matrix
1939 template< typename MT2 // Type of the right-hand side matrix
1940  , bool SO2 > // Storage order of the right-hand side matrix
1941 inline auto StrictlyLowerMatrix<MT,SO,true>::operator%=( const Matrix<MT2,SO2>& rhs )
1942  -> StrictlyLowerMatrix&
1943 {
1944  if( !IsSquare_v<MT2> && !isSquare( ~rhs ) ) {
1945  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to strictly lower matrix" );
1946  }
1947 
1948  matrix_ %= ~rhs;
1949 
1950  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly lower matrix detected" );
1951  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1952 
1953  return *this;
1954 }
1956 //*************************************************************************************************
1957 
1958 
1959 //*************************************************************************************************
1967 template< typename MT // Type of the adapted dense matrix
1968  , bool SO > // Storage order of the adapted dense matrix
1969 template< typename ST > // Data type of the right-hand side scalar
1970 inline auto StrictlyLowerMatrix<MT,SO,true>::operator*=( ST rhs )
1971  -> EnableIf_t< IsNumeric_v<ST>, StrictlyLowerMatrix& >
1972 {
1973  matrix_ *= rhs;
1974  return *this;
1975 }
1976 //*************************************************************************************************
1977 
1978 
1979 //*************************************************************************************************
1987 template< typename MT // Type of the adapted dense matrix
1988  , bool SO > // Storage order of the adapted dense matrix
1989 template< typename ST > // Data type of the right-hand side scalar
1990 inline auto StrictlyLowerMatrix<MT,SO,true>::operator/=( ST rhs )
1991  -> EnableIf_t< IsNumeric_v<ST>, StrictlyLowerMatrix& >
1992 {
1993  BLAZE_USER_ASSERT( !isZero( rhs ), "Division by zero detected" );
1994 
1995  matrix_ /= rhs;
1996  return *this;
1997 }
1999 //*************************************************************************************************
2000 
2001 
2002 
2003 
2004 //=================================================================================================
2005 //
2006 // UTILITY FUNCTIONS
2007 //
2008 //=================================================================================================
2009 
2010 //*************************************************************************************************
2016 template< typename MT // Type of the adapted dense matrix
2017  , bool SO > // Storage order of the adapted dense matrix
2018 inline size_t StrictlyLowerMatrix<MT,SO,true>::rows() const noexcept
2019 {
2020  return matrix_.rows();
2021 }
2023 //*************************************************************************************************
2024 
2025 
2026 //*************************************************************************************************
2032 template< typename MT // Type of the adapted dense matrix
2033  , bool SO > // Storage order of the adapted dense matrix
2034 inline size_t StrictlyLowerMatrix<MT,SO,true>::columns() const noexcept
2035 {
2036  return matrix_.columns();
2037 }
2039 //*************************************************************************************************
2040 
2041 
2042 //*************************************************************************************************
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>::spacing() const noexcept
2056 {
2057  return matrix_.spacing();
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>::capacity() const noexcept
2072 {
2073  return matrix_.capacity();
2074 }
2076 //*************************************************************************************************
2077 
2078 
2079 //*************************************************************************************************
2091 template< typename MT // Type of the adapted dense matrix
2092  , bool SO > // Storage order of the adapted dense matrix
2093 inline size_t StrictlyLowerMatrix<MT,SO,true>::capacity( size_t i ) const noexcept
2094 {
2095  return matrix_.capacity(i);
2096 }
2098 //*************************************************************************************************
2099 
2100 
2101 //*************************************************************************************************
2107 template< typename MT // Type of the adapted dense matrix
2108  , bool SO > // Storage order of the adapted dense matrix
2109 inline size_t StrictlyLowerMatrix<MT,SO,true>::nonZeros() const
2110 {
2111  return matrix_.nonZeros();
2112 }
2114 //*************************************************************************************************
2115 
2116 
2117 //*************************************************************************************************
2129 template< typename MT // Type of the adapted dense matrix
2130  , bool SO > // Storage order of the adapted dense matrix
2131 inline size_t StrictlyLowerMatrix<MT,SO,true>::nonZeros( size_t i ) const
2132 {
2133  return matrix_.nonZeros(i);
2134 }
2136 //*************************************************************************************************
2137 
2138 
2139 //*************************************************************************************************
2145 template< typename MT // Type of the adapted dense matrix
2146  , bool SO > // Storage order of the adapted dense matrix
2148 {
2149  using blaze::clear;
2150 
2151  if( SO ) {
2152  for( size_t j=0UL; j<columns(); ++j )
2153  for( size_t i=j+1UL; i<rows(); ++i )
2154  clear( matrix_(i,j) );
2155  }
2156  else {
2157  for( size_t i=1UL; i<rows(); ++i )
2158  for( size_t j=0UL; j<i; ++j )
2159  clear( matrix_(i,j) );
2160  }
2161 }
2163 //*************************************************************************************************
2164 
2165 
2166 //*************************************************************************************************
2179 template< typename MT // Type of the adapted dense matrix
2180  , bool SO > // Storage order of the adapted dense matrix
2181 inline void StrictlyLowerMatrix<MT,SO,true>::reset( size_t i )
2182 {
2183  using blaze::clear;
2184 
2185  if( SO ) {
2186  for( size_t j=i+1UL; j<rows(); ++j )
2187  clear( matrix_(j,i) );
2188  }
2189  else {
2190  for( size_t j=0UL; j<i; ++j )
2191  clear( matrix_(i,j) );
2192  }
2193 }
2195 //*************************************************************************************************
2196 
2197 
2198 //*************************************************************************************************
2210 template< typename MT // Type of the adapted dense matrix
2211  , bool SO > // Storage order of the adapted dense matrix
2213 {
2214  using blaze::clear;
2215 
2216  if( IsResizable_v<MT> ) {
2217  clear( matrix_ );
2218  }
2219  else {
2220  reset();
2221  }
2222 }
2224 //*************************************************************************************************
2225 
2226 
2227 //*************************************************************************************************
2263 template< typename MT // Type of the adapted dense matrix
2264  , bool SO > // Storage order of the adapted dense matrix
2265 void StrictlyLowerMatrix<MT,SO,true>::resize( size_t n, bool preserve )
2266 {
2268 
2269  UNUSED_PARAMETER( preserve );
2270 
2271  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly lower matrix detected" );
2272 
2273  const size_t oldsize( matrix_.rows() );
2274 
2275  matrix_.resize( n, n, true );
2276 
2277  if( n > oldsize )
2278  {
2279  const size_t increment( n - oldsize );
2280  submatrix( matrix_, 0UL, oldsize, n, increment ).reset();
2281  }
2282 }
2284 //*************************************************************************************************
2285 
2286 
2287 //*************************************************************************************************
2300 template< typename MT // Type of the adapted dense matrix
2301  , bool SO > // Storage order of the adapted dense matrix
2302 inline void StrictlyLowerMatrix<MT,SO,true>::extend( size_t n, bool preserve )
2303 {
2305 
2306  UNUSED_PARAMETER( preserve );
2307 
2308  resize( rows() + n, true );
2309 }
2310 //*************************************************************************************************
2311 
2312 
2313 //*************************************************************************************************
2323 template< typename MT // Type of the adapted dense matrix
2324  , bool SO > // Storage order of the adapted dense matrix
2325 inline void StrictlyLowerMatrix<MT,SO,true>::reserve( size_t elements )
2326 {
2327  matrix_.reserve( elements );
2328 }
2330 //*************************************************************************************************
2331 
2332 
2333 //*************************************************************************************************
2343 template< typename MT // Type of the adapted dense matrix
2344  , bool SO > // Storage order of the adapted dense matrix
2346 {
2347  matrix_.shrinkToFit();
2348 }
2350 //*************************************************************************************************
2351 
2352 
2353 //*************************************************************************************************
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>::swap( StrictlyLowerMatrix& m ) noexcept
2363 {
2364  using std::swap;
2365 
2366  swap( matrix_, m.matrix_ );
2367 }
2369 //*************************************************************************************************
2370 
2371 
2372 //*************************************************************************************************
2384 template< typename MT // Type of the adapted dense matrix
2385  , bool SO > // Storage order of the adapted dense matrix
2386 inline constexpr size_t StrictlyLowerMatrix<MT,SO,true>::maxNonZeros() noexcept
2387 {
2389 
2390  return maxNonZeros( Size_v<MT,0UL> );
2391 }
2393 //*************************************************************************************************
2394 
2395 
2396 //*************************************************************************************************
2406 template< typename MT // Type of the adapted dense matrix
2407  , bool SO > // Storage order of the adapted dense matrix
2408 inline constexpr size_t StrictlyLowerMatrix<MT,SO,true>::maxNonZeros( size_t n ) noexcept
2409 {
2410  return ( ( n - 1UL ) * n ) / 2UL;
2411 }
2413 //*************************************************************************************************
2414 
2415 
2416 
2417 
2418 //=================================================================================================
2419 //
2420 // NUMERIC FUNCTIONS
2421 //
2422 //=================================================================================================
2423 
2424 //*************************************************************************************************
2442 template< typename MT // Type of the adapted dense matrix
2443  , bool SO > // Storage order of the adapted dense matrix
2444 template< typename Other > // Data type of the scalar value
2445 inline StrictlyLowerMatrix<MT,SO,true>&
2446  StrictlyLowerMatrix<MT,SO,true>::scale( const Other& scalar )
2447 {
2448  matrix_.scale( scalar );
2449  return *this;
2450 }
2452 //*************************************************************************************************
2453 
2454 
2455 
2456 
2457 //=================================================================================================
2458 //
2459 // DEBUGGING FUNCTIONS
2460 //
2461 //=================================================================================================
2462 
2463 //*************************************************************************************************
2473 template< typename MT // Type of the adapted dense matrix
2474  , bool SO > // Storage order of the adapted dense matrix
2475 inline bool StrictlyLowerMatrix<MT,SO,true>::isIntact() const noexcept
2476 {
2477  using blaze::isIntact;
2478 
2479  return ( isIntact( matrix_ ) && isStrictlyLower( matrix_ ) );
2480 }
2482 //*************************************************************************************************
2483 
2484 
2485 
2486 
2487 //=================================================================================================
2488 //
2489 // EXPRESSION TEMPLATE EVALUATION FUNCTIONS
2490 //
2491 //=================================================================================================
2492 
2493 //*************************************************************************************************
2504 template< typename MT // Type of the adapted dense matrix
2505  , bool SO > // Storage order of the adapted dense matrix
2506 template< typename Other > // Data type of the foreign expression
2507 inline bool StrictlyLowerMatrix<MT,SO,true>::canAlias( const Other* alias ) const noexcept
2508 {
2509  return matrix_.canAlias( alias );
2510 }
2512 //*************************************************************************************************
2513 
2514 
2515 //*************************************************************************************************
2526 template< typename MT // Type of the adapted dense matrix
2527  , bool SO > // Storage order of the adapted dense matrix
2528 template< typename Other > // Data type of the foreign expression
2529 inline bool StrictlyLowerMatrix<MT,SO,true>::isAliased( const Other* alias ) const noexcept
2530 {
2531  return matrix_.isAliased( alias );
2532 }
2534 //*************************************************************************************************
2535 
2536 
2537 //*************************************************************************************************
2547 template< typename MT // Type of the adapted dense matrix
2548  , bool SO > // Storage order of the adapted dense matrix
2549 inline bool StrictlyLowerMatrix<MT,SO,true>::isAligned() const noexcept
2550 {
2551  return matrix_.isAligned();
2552 }
2554 //*************************************************************************************************
2555 
2556 
2557 //*************************************************************************************************
2568 template< typename MT // Type of the adapted dense matrix
2569  , bool SO > // Storage order of the adapted dense matrix
2570 inline bool StrictlyLowerMatrix<MT,SO,true>::canSMPAssign() const noexcept
2571 {
2572  return matrix_.canSMPAssign();
2573 }
2575 //*************************************************************************************************
2576 
2577 
2578 //*************************************************************************************************
2594 template< typename MT // Type of the adapted dense matrix
2595  , bool SO > // Storage order of the adapted dense matrix
2596 BLAZE_ALWAYS_INLINE typename StrictlyLowerMatrix<MT,SO,true>::SIMDType
2597  StrictlyLowerMatrix<MT,SO,true>::load( size_t i, size_t j ) const noexcept
2598 {
2599  return matrix_.load( i, j );
2600 }
2602 //*************************************************************************************************
2603 
2604 
2605 //*************************************************************************************************
2621 template< typename MT // Type of the adapted dense matrix
2622  , bool SO > // Storage order of the adapted dense matrix
2623 BLAZE_ALWAYS_INLINE typename StrictlyLowerMatrix<MT,SO,true>::SIMDType
2624  StrictlyLowerMatrix<MT,SO,true>::loada( size_t i, size_t j ) const noexcept
2625 {
2626  return matrix_.loada( i, j );
2627 }
2629 //*************************************************************************************************
2630 
2631 
2632 //*************************************************************************************************
2648 template< typename MT // Type of the adapted dense matrix
2649  , bool SO > // Storage order of the adapted dense matrix
2650 BLAZE_ALWAYS_INLINE typename StrictlyLowerMatrix<MT,SO,true>::SIMDType
2651  StrictlyLowerMatrix<MT,SO,true>::loadu( size_t i, size_t j ) const noexcept
2652 {
2653  return matrix_.loadu( i, j );
2654 }
2656 //*************************************************************************************************
2657 
2658 
2659 
2660 
2661 //=================================================================================================
2662 //
2663 // CONSTRUCTION FUNCTIONS
2664 //
2665 //=================================================================================================
2666 
2667 //*************************************************************************************************
2674 template< typename MT // Type of the adapted dense matrix
2675  , bool SO > // Storage order of the adapted dense matrix
2676 inline const MT StrictlyLowerMatrix<MT,SO,true>::construct( size_t n, TrueType )
2677 {
2679 
2680  return MT( n, n, ElementType() );
2681 }
2683 //*************************************************************************************************
2684 
2685 
2686 //*************************************************************************************************
2693 template< typename MT // Type of the adapted dense matrix
2694  , bool SO > // Storage order of the adapted dense matrix
2695 inline const MT StrictlyLowerMatrix<MT,SO,true>::construct( const ElementType& init, FalseType )
2696 {
2699 
2700  MT tmp;
2701 
2702  if( SO ) {
2703  for( size_t j=0UL; j<tmp.columns(); ++j ) {
2704  for( size_t i=j+1UL; i<tmp.rows(); ++i )
2705  tmp(i,j) = init;
2706  }
2707  }
2708  else {
2709  for( size_t i=0UL; i<tmp.rows(); ++i ) {
2710  for( size_t j=0UL; j<i; ++j )
2711  tmp(i,j) = init;
2712  }
2713  }
2714 
2715  return tmp;
2716 }
2718 //*************************************************************************************************
2719 
2720 
2721 //*************************************************************************************************
2732 template< typename MT // Type of the adapted dense matrix
2733  , bool SO > // Storage order of the adapted dense matrix
2734 template< typename MT2 // Type of the foreign matrix
2735  , bool SO2 // Storage order of the foreign matrix
2736  , typename T > // Type of the third argument
2737 inline const MT StrictlyLowerMatrix<MT,SO,true>::construct( const Matrix<MT2,SO2>& m, T )
2738 {
2739  const MT tmp( ~m );
2740 
2741  if( IsUniTriangular_v<MT2> ||
2742  ( !IsStrictlyLower_v<MT2> && !isStrictlyLower( tmp ) ) ) {
2743  BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of strictly lower matrix" );
2744  }
2745 
2746  return tmp;
2747 }
2749 //*************************************************************************************************
2750 
2751 } // namespace blaze
2752 
2753 #endif
Constraint on the data type.
Header file for the implementation of the Submatrix view.
#define BLAZE_CONSTRAINT_MUST_NOT_BE_CONST(T)
Constraint on the data type.In case the given data type is a const-qualified type, a compilation error is created.
Definition: Const.h:79
BoolConstant< false > FalseType
Type/value traits base class.The FalseType class is used as base class for type traits and value trai...
Definition: FalseType.h:61
#define BLAZE_THROW_INVALID_ARGUMENT(MESSAGE)
Macro for the emission of a std::invalid_argument exception.This macro encapsulates the default way o...
Definition: Exception.h:235
Header file for auxiliary alias declarations.
decltype(auto) column(Matrix< MT, SO > &matrix, RCAs... args)
Creating a view on a specific column of the given matrix.
Definition: Column.h:133
CompressedMatrix< Type, false > OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: CompressedMatrix.h:3078
bool isStrictlyLower(const DenseMatrix< MT, SO > &dm)
Checks if the given dense matrix is a strictly lower triangular matrix.
Definition: DenseMatrix.h:1179
#define BLAZE_USER_ASSERT(expr, msg)
Run time assertion macro for user checks.In case of an invalid run time expression, the program execution is terminated. The BLAZE_USER_ASSERT macro can be disabled by setting the BLAZE_USER_ASSERT flag to zero or by defining NDEBUG during the compilation.
Definition: Assert.h:117
auto operator/=(DenseMatrix< MT, SO > &mat, ST scalar) -> EnableIf_t< IsNumeric_v< ST >, MT & >
Division assignment operator for the division of a dense matrix by a scalar value ( )...
Definition: DenseMatrix.h:354
Header file for the UNUSED_PARAMETER function template.
size_t capacity(const Matrix< MT, SO > &matrix) noexcept
Returns the maximum capacity of the matrix.
Definition: Matrix.h:546
Header file for basic type definitions.
constexpr const DenseIterator< Type, AF > operator-(const DenseIterator< Type, AF > &it, ptrdiff_t inc) noexcept
Subtraction between a DenseIterator and an integral value.
Definition: DenseIterator.h:750
MT::ElementType * data(DenseMatrix< MT, SO > &dm) noexcept
Low-level data access to the dense matrix elements.
Definition: DenseMatrix.h:169
Header file for the 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
Header file for the isZero shim.
#define BLAZE_CONSTRAINT_MUST_BE_DENSE_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is not a dense, N-dimensional matrix type...
Definition: DenseMatrix.h:61
constexpr bool operator<(const NegativeAccuracy< A > &lhs, const T &rhs)
Less-than comparison between a NegativeAccuracy object and a floating point value.
Definition: Accuracy.h:332
BLAZE_ALWAYS_INLINE const EnableIf_t< IsIntegral_v< T > &&HasSize_v< T, 1UL >, If_t< IsSigned_v< T >, SIMDint8, SIMDuint8 > > loadu(const T *address) noexcept
Loads a vector of 1-byte integral values.
Definition: Loadu.h:76
Constraint on the data type.
This ResultType
Result type for expression template evaluations.
Definition: CompressedMatrix.h:3077
MT::Iterator begin(Matrix< MT, SO > &matrix, size_t i)
Returns an iterator to the first element of row/column i.
Definition: Matrix.h:372
CompressedMatrix< Type, true > This
Type of this CompressedMatrix instance.
Definition: CompressedMatrix.h:3075
Constraint on the data type.
void reset(const DiagonalProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: DiagonalProxy.h:591
static constexpr bool smpAssignable
Compilation flag for SMP assignments.
Definition: CompressedMatrix.h:3113
void shrinkToFit(Matrix< MT, SO > &matrix)
Requesting the removal of unused capacity.
Definition: Matrix.h:799
void clear(CompressedMatrix< Type, SO > &m)
Clearing the given compressed matrix.
Definition: CompressedMatrix.h:5828
CompressedMatrix< Type, false > TransposeType
Transpose type for expression template evaluations.
Definition: CompressedMatrix.h:3079
const Type & ConstReference
Reference to a constant matrix value.
Definition: CompressedMatrix.h:3084
#define BLAZE_CONSTRAINT_MUST_NOT_BE_VOLATILE(T)
Constraint on the data type.In case the given data type is a volatile-qualified type, a compilation error is created.
Definition: Volatile.h:79
size_t nonZeros(const Matrix< MT, SO > &matrix)
Returns the total number of non-zero elements in the matrix.
Definition: Matrix.h:584
BoolConstant< true > TrueType
Type traits base class.The TrueType class is used as base class for type traits and value traits that...
Definition: TrueType.h:61
Element * Iterator
Iterator over non-constant elements.
Definition: CompressedMatrix.h:3085
Header file for the extended initializer_list functionality.
constexpr void UNUSED_PARAMETER(const Args &...)
Suppression of unused parameter warnings.
Definition: Unused.h:81
Constraint on the data type.
constexpr size_t columns(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of columns of the matrix.
Definition: Matrix.h:514
MT::ConstIterator cend(const Matrix< MT, SO > &matrix, size_t i)
Returns an iterator just past the last element of row/column i.
Definition: Matrix.h:482
MT::ConstIterator cbegin(const Matrix< MT, SO > &matrix, size_t i)
Returns an iterator to the first element of row/column i.
Definition: Matrix.h:416
Constraint on the data type.
Constraint on the data type.
Constraint on the data type.
size_t spacing(const DenseMatrix< MT, SO > &dm) noexcept
Returns the spacing between the beginning of two rows/columns.
Definition: DenseMatrix.h:252
#define BLAZE_CONSTRAINT_MUST_BE_SQUARE_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is not a square matrix type, a compilation error is created.
Definition: Square.h:60
Header file for the IsSquare type trait.
bool isZero(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is 0.
Definition: DiagonalProxy.h:673
Constraint on the data type.
Header file for the implementation of a matrix representation of an initializer list.
typename EnableIf< Condition, T >::Type EnableIf_t
Auxiliary type for the EnableIf class template.The EnableIf_t alias declaration provides a convenient...
Definition: EnableIf.h:138
Header file for the DisableIf class template.
MatrixAccessProxy< This > Reference
Reference to a non-constant matrix value.
Definition: CompressedMatrix.h:3083
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58
#define BLAZE_ALWAYS_INLINE
Platform dependent setup of an enforced inline keyword.
Definition: Inline.h:85
#define BLAZE_CONSTRAINT_MUST_BE_STATIC_TYPE(T)
Constraint on the data type.In case the given data type T is not a static data type, i.e. a vector or matrix with dimensions fixed at compile time, a compilation error is created.
Definition: Static.h:61
void swap(CompressedMatrix< Type, SO > &a, CompressedMatrix< Type, SO > &b) noexcept
Swapping the contents of two compressed matrices.
Definition: CompressedMatrix.h:5907
Compile time assertion.
bool isIntact(const CompressedMatrix< Type, SO > &m)
Returns whether the invariants of the given compressed matrix are intact.
Definition: CompressedMatrix.h:5890
SparseMatrix< This, true > BaseType
Base type of this CompressedMatrix instance.
Definition: CompressedMatrix.h:3076
#define BLAZE_CONSTRAINT_MUST_NOT_BE_POINTER_TYPE(T)
Constraint on the data type.In case the given data type T is not a pointer type, a compilation error ...
Definition: Pointer.h:79
Type ElementType
Type of the compressed matrix elements.
Definition: CompressedMatrix.h:3080
#define BLAZE_THROW_OUT_OF_RANGE(MESSAGE)
Macro for the emission of a std::out_of_range exception.This macro encapsulates the default way of Bl...
Definition: Exception.h:331
Header file for the DenseMatrix base class.
constexpr bool operator>(const NegativeAccuracy< A > &lhs, const T &rhs)
Greater-than comparison between a NegativeAccuracy object and a floating point value.
Definition: Accuracy.h:370
constexpr bool operator>=(const NegativeAccuracy< A > &, const T &rhs)
Greater-or-equal-than comparison between a NegativeAccuracy object and a floating point value...
Definition: Accuracy.h:446
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:3086
constexpr bool operator==(const NegativeAccuracy< A > &lhs, const T &rhs)
Equality comparison between a NegativeAccuracy object and a floating point value. ...
Definition: Accuracy.h:253
constexpr bool IsNumeric_v
Auxiliary variable template for the IsNumeric type trait.The IsNumeric_v variable template provides a...
Definition: IsNumeric.h:143
Constraint on the data type.
decltype(auto) decllow(const DenseMatrix< MT, SO > &dm)
Declares the given dense matrix expression dm as lower.
Definition: DMatDeclLowExpr.h:1002
Header file for the 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:135
Header file for the exception macros of the math module.
#define BLAZE_CONSTRAINT_MUST_NOT_BE_UPPER_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is a upper triangular matrix type...
Definition: Upper.h:81
void resize(Matrix< MT, SO > &matrix, size_t rows, size_t columns, bool preserve=true)
Changing the size of the matrix.
Definition: Matrix.h:738
MT::Iterator end(Matrix< MT, SO > &matrix, size_t i)
Returns an iterator just past the last element of row/column i.
Definition: Matrix.h:438
decltype(auto) operator*(const DenseMatrix< MT1, false > &lhs, const DenseMatrix< MT2, false > &rhs)
Multiplication operator for the multiplication of two row-major dense matrices ( ).
Definition: DMatDMatMultExpr.h:8908
constexpr bool operator!=(const NegativeAccuracy< A > &lhs, const T &rhs)
Inequality comparison between a NegativeAccuracy object and a floating point value.
Definition: Accuracy.h:293
decltype(auto) submatrix(Matrix< MT, SO > &, RSAs...)
Creating a view on a specific submatrix of the given matrix.
Definition: Submatrix.h:360
Header file for the EnableIf class template.
Header file for 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:611
Header file for all adaptor forward declarations.
#define BLAZE_CONSTRAINT_MUST_NOT_BE_SYMMETRIC_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is a symmetric matrix type, a compilation error is created.
Definition: Symmetric.h:79
BLAZE_ALWAYS_INLINE T1 & operator+=(SIMDPack< T1 > &lhs, const SIMDPack< T2 > &rhs)
Addition assignment operator for the addition of two SIMD packs.
Definition: BasicTypes.h:1357
Header file for run time assertion macros.
Constraint on the data type.
Constraint on the data type.
Constraint on the data type.
decltype(auto) row(Matrix< MT, SO > &, RRAs...)
Creating a view on a specific row of the given matrix.
Definition: Row.h:133
#define BLAZE_CONSTRAINT_MUST_NOT_BE_LOWER_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is a lower triangular matrix type...
Definition: Lower.h:81
#define BLAZE_CONSTRAINT_MUST_NOT_BE_RESIZABLE_TYPE(T)
Constraint on the data type.In case the given data type T is resizable, i.e. has a &#39;resize&#39; member fu...
Definition: Resizable.h:81
#define BLAZE_CONSTRAINT_MUST_NOT_BE_REFERENCE_TYPE(T)
Constraint on the data type.In case the given data type T is not a reference type, a compilation error is created.
Definition: Reference.h:79
Header file for the isDefault shim.
void swap(DiagonalMatrix< MT, SO, DF > &a, DiagonalMatrix< MT, SO, DF > &b) noexcept
Swapping the contents of two matrices.
Definition: DiagonalMatrix.h:281
Constraint on the data type.
Constraint on the data type.
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
constexpr size_t rows(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of rows of the matrix.
Definition: Matrix.h:498
constexpr const DenseIterator< Type, AF > operator+(const DenseIterator< Type, AF > &it, ptrdiff_t inc) noexcept
Addition between a DenseIterator and an integral value.
Definition: DenseIterator.h:718
BLAZE_ALWAYS_INLINE const EnableIf_t< IsIntegral_v< T > &&HasSize_v< T, 1UL >, If_t< IsSigned_v< T >, SIMDint8, SIMDuint8 > > loada(const T *address) noexcept
Loads a vector of 1-byte integral values.
Definition: Loada.h:79
constexpr bool IsComputation_v
Auxiliary variable template for the IsComputation type trait.The IsComputation_v variable template pr...
Definition: IsComputation.h:90
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:3081
#define BLAZE_CONSTRAINT_MUST_BE_RESIZABLE_TYPE(T)
Constraint on the data type.In case the given data type T is not resizable, i.e. does not have a &#39;res...
Definition: Resizable.h:61
Header file for the IsComputation type trait class.
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:3082
#define BLAZE_CONSTRAINT_MUST_NOT_BE_EXPRESSION_TYPE(T)
Constraint on the data type.In case the given data type T is an expression (i.e. a type derived from ...
Definition: Expression.h:81
auto operator*=(DenseMatrix< MT, SO > &mat, ST scalar) -> EnableIf_t< IsNumeric_v< ST >, MT & >
Multiplication assignment operator for the multiplication of a dense matrix and a scalar value ( )...
Definition: DenseMatrix.h:290
bool isIntact(const DiagonalMatrix< MT, SO, DF > &m)
Returns whether the invariants of the given diagonal matrix are intact.
Definition: DiagonalMatrix.h:263
#define BLAZE_CONSTRAINT_MUST_NOT_BE_HERMITIAN_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is an Hermitian matrix type, a compilation error is created.
Definition: Hermitian.h:79
BLAZE_ALWAYS_INLINE T1 & operator-=(SIMDPack< T1 > &lhs, const SIMDPack< T2 > &rhs)
Subtraction assignment operator for the subtraction of two SIMD packs.
Definition: BasicTypes.h:1375
typename DisableIf< Condition, T >::Type DisableIf_t
Auxiliary type for the DisableIf class template.The DisableIf_t alias declaration provides a convenie...
Definition: DisableIf.h:138
#define BLAZE_STATIC_ASSERT(expr)
Compile time assertion macro.In case of an invalid compile time expression, a compilation error is cr...
Definition: StaticAssert.h:112
bool isSquare(const Matrix< MT, SO > &matrix) noexcept
Checks if the given matrix is a square matrix.
Definition: Matrix.h:951
Header file for the IsResizable type trait.
System settings for the inline keywords.
Header file for the Size type trait.
#define BLAZE_INTERNAL_ASSERT(expr, msg)
Run time assertion macro for internal checks.In case of an invalid run time expression, the program execution is terminated. The BLAZE_INTERNAL_ASSERT macro can be disabled by setting the BLAZE_USER_ASSERTION flag to zero or by defining NDEBUG during the compilation.
Definition: Assert.h:101
constexpr ptrdiff_t Size_v
Auxiliary variable template for the Size type trait.The Size_v variable template provides a convenien...
Definition: Size.h:176
Header file for the TrueType type/value trait base class.
Header file for the clear shim.