Sparse.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_ADAPTORS_STRICTLYLOWERMATRIX_SPARSE_H_
36 #define _BLAZE_MATH_ADAPTORS_STRICTLYLOWERMATRIX_SPARSE_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
43 #include <utility>
44 #include <vector>
48 #include <blaze/math/Aliases.h>
59 #include <blaze/math/Exception.h>
62 #include <blaze/math/shims/Clear.h>
73 #include <blaze/util/Assert.h>
78 #include <blaze/util/DisableIf.h>
79 #include <blaze/util/EnableIf.h>
81 #include <blaze/util/Types.h>
82 
83 
84 namespace blaze {
85 
86 //=================================================================================================
87 //
88 // CLASS TEMPLATE SPECIALIZATION FOR SPARSE MATRICES
89 //
90 //=================================================================================================
91 
92 //*************************************************************************************************
100 template< typename MT // Type of the adapted sparse matrix
101  , bool SO > // Storage order of the adapted sparse matrix
102 class StrictlyLowerMatrix<MT,SO,false>
103  : public SparseMatrix< StrictlyLowerMatrix<MT,SO,false>, SO >
104 {
105  private:
106  //**Type definitions****************************************************************************
107  using OT = OppositeType_t<MT>;
108  using TT = TransposeType_t<MT>;
109  using ET = ElementType_t<MT>;
110  //**********************************************************************************************
111 
112  public:
113  //**Type definitions****************************************************************************
114  using This = StrictlyLowerMatrix<MT,SO,false>;
115  using BaseType = SparseMatrix<This,SO>;
116  using ResultType = This;
117  using OppositeType = StrictlyLowerMatrix<OT,!SO,false>;
118  using TransposeType = StrictlyUpperMatrix<TT,!SO,false>;
119  using ElementType = ET;
120  using ReturnType = ReturnType_t<MT>;
121  using CompositeType = const This&;
122  using Reference = StrictlyLowerProxy<MT>;
123  using ConstReference = ConstReference_t<MT>;
124  using Iterator = Iterator_t<MT>;
125  using ConstIterator = ConstIterator_t<MT>;
126  //**********************************************************************************************
127 
128  //**Rebind struct definition********************************************************************
131  template< typename NewType > // Data type of the other matrix
132  struct Rebind {
134  using Other = StrictlyLowerMatrix< typename MT::template Rebind<NewType>::Other >;
135  };
136  //**********************************************************************************************
137 
138  //**Resize struct definition********************************************************************
141  template< size_t NewM // Number of rows of the other matrix
142  , size_t NewN > // Number of columns of the other matrix
143  struct Resize {
145  using Other = StrictlyLowerMatrix< typename MT::template Resize<NewM,NewN>::Other >;
146  };
147  //**********************************************************************************************
148 
149  //**Compilation flags***************************************************************************
151  static constexpr bool smpAssignable = false;
152  //**********************************************************************************************
153 
154  //**Constructors********************************************************************************
157  explicit inline StrictlyLowerMatrix();
158  explicit inline StrictlyLowerMatrix( size_t n );
159  explicit inline StrictlyLowerMatrix( size_t n, size_t nonzeros );
160  explicit inline StrictlyLowerMatrix( size_t n, const std::vector<size_t>& nonzeros );
161  explicit inline StrictlyLowerMatrix( initializer_list< initializer_list<ElementType> > list );
162 
163  inline StrictlyLowerMatrix( const StrictlyLowerMatrix& m );
164  inline StrictlyLowerMatrix( StrictlyLowerMatrix&& m ) noexcept;
165 
166  template< typename MT2, bool SO2 >
167  inline StrictlyLowerMatrix( const Matrix<MT2,SO2>& m );
169  //**********************************************************************************************
170 
171  //**Destructor**********************************************************************************
174  ~StrictlyLowerMatrix() = default;
176  //**********************************************************************************************
177 
178  //**Data access functions***********************************************************************
181  inline Reference operator()( size_t i, size_t j );
182  inline ConstReference operator()( size_t i, size_t j ) const;
183  inline Reference at( size_t i, size_t j );
184  inline ConstReference at( size_t i, size_t j ) const;
185  inline Iterator begin ( size_t i );
186  inline ConstIterator begin ( size_t i ) const;
187  inline ConstIterator cbegin( size_t i ) const;
188  inline Iterator end ( size_t i );
189  inline ConstIterator end ( size_t i ) const;
190  inline ConstIterator cend ( size_t i ) const;
192  //**********************************************************************************************
193 
194  //**Assignment operators************************************************************************
197  inline StrictlyLowerMatrix& operator=( initializer_list< initializer_list<ElementType> > list );
198 
199  inline StrictlyLowerMatrix& operator=( const StrictlyLowerMatrix& rhs );
200  inline StrictlyLowerMatrix& operator=( StrictlyLowerMatrix&& rhs ) noexcept;
201 
202  template< typename MT2, bool SO2 >
203  inline auto operator=( const Matrix<MT2,SO2>& rhs )
204  -> DisableIf_t< IsComputation_v<MT2>, StrictlyLowerMatrix& >;
205 
206  template< typename MT2, bool SO2 >
207  inline auto operator=( const Matrix<MT2,SO2>& rhs )
208  -> EnableIf_t< IsComputation_v<MT2>, StrictlyLowerMatrix& >;
209 
210  template< typename MT2, bool SO2 >
211  inline auto operator+=( const Matrix<MT2,SO2>& rhs )
212  -> DisableIf_t< IsComputation_v<MT2>, StrictlyLowerMatrix& >;
213 
214  template< typename MT2, bool SO2 >
215  inline auto operator+=( const Matrix<MT2,SO2>& rhs )
216  -> EnableIf_t< IsComputation_v<MT2>, StrictlyLowerMatrix& >;
217 
218  template< typename MT2, bool SO2 >
219  inline auto operator-=( const Matrix<MT2,SO2>& rhs )
220  -> DisableIf_t< IsComputation_v<MT2>, StrictlyLowerMatrix& >;
221 
222  template< typename MT2, bool SO2 >
223  inline auto operator-=( const Matrix<MT2,SO2>& rhs )
224  -> EnableIf_t< IsComputation_v<MT2>, StrictlyLowerMatrix& >;
225 
226  template< typename MT2, bool SO2 >
227  inline auto operator%=( const Matrix<MT2,SO2>& rhs ) -> StrictlyLowerMatrix&;
229  //**********************************************************************************************
230 
231  //**Utility functions***************************************************************************
234  inline size_t rows() const noexcept;
235  inline size_t columns() const noexcept;
236  inline size_t capacity() const noexcept;
237  inline size_t capacity( size_t i ) const noexcept;
238  inline size_t nonZeros() const;
239  inline size_t nonZeros( size_t i ) const;
240  inline void reset();
241  inline void reset( size_t i );
242  inline void clear();
243  inline void resize ( size_t n, bool preserve=true );
244  inline void reserve( size_t nonzeros );
245  inline void reserve( size_t i, size_t nonzeros );
246  inline void trim();
247  inline void trim( size_t i );
248  inline void shrinkToFit();
249  inline void swap( StrictlyLowerMatrix& m ) noexcept;
250 
251  static inline constexpr size_t maxNonZeros() noexcept;
252  static inline constexpr size_t maxNonZeros( size_t n ) noexcept;
254  //**********************************************************************************************
255 
256  //**Insertion functions*************************************************************************
259  inline Iterator set ( size_t i, size_t j, const ElementType& value );
260  inline Iterator insert ( size_t i, size_t j, const ElementType& value );
261  inline void append ( size_t i, size_t j, const ElementType& value, bool check=false );
262  inline void finalize( size_t i );
264  //**********************************************************************************************
265 
266  //**Erase functions*****************************************************************************
269  inline void erase( size_t i, size_t j );
270  inline Iterator erase( size_t i, Iterator pos );
271  inline Iterator erase( size_t i, Iterator first, Iterator last );
272 
273  template< typename Pred >
274  inline void erase( Pred predicate );
275 
276  template< typename Pred >
277  inline void erase( size_t i, Iterator first, Iterator last, Pred predicate );
279  //**********************************************************************************************
280 
281  //**Lookup functions****************************************************************************
284  inline Iterator find ( size_t i, size_t j );
285  inline ConstIterator find ( size_t i, size_t j ) const;
286  inline Iterator lowerBound( size_t i, size_t j );
287  inline ConstIterator lowerBound( size_t i, size_t j ) const;
288  inline Iterator upperBound( size_t i, size_t j );
289  inline ConstIterator upperBound( size_t i, size_t j ) const;
291  //**********************************************************************************************
292 
293  //**Numeric functions***************************************************************************
296  template< typename Other > inline StrictlyLowerMatrix& scale( const Other& scalar );
298  //**********************************************************************************************
299 
300  //**Debugging functions*************************************************************************
303  inline bool isIntact() const noexcept;
305  //**********************************************************************************************
306 
307  //**Expression template evaluation functions****************************************************
310  template< typename Other > inline bool canAlias ( const Other* alias ) const noexcept;
311  template< typename Other > inline bool isAliased( const Other* alias ) const noexcept;
312 
313  inline bool canSMPAssign() const noexcept;
315  //**********************************************************************************************
316 
317  private:
318  //**Utility functions***************************************************************************
321  inline void resetUpper();
323  //**********************************************************************************************
324 
325  //**Member variables****************************************************************************
328  MT matrix_;
329 
330  //**********************************************************************************************
331 
332  //**Friend declarations*************************************************************************
333  template< typename MT2, bool SO2, bool DF2 >
334  friend MT2& derestrict( StrictlyLowerMatrix<MT2,SO2,DF2>& m );
335  //**********************************************************************************************
336 
337  //**Compile time checks*************************************************************************
350  BLAZE_STATIC_ASSERT( ( Size_v<MT,0UL> == Size_v<MT,1UL> ) );
351  //**********************************************************************************************
352 };
354 //*************************************************************************************************
355 
356 
357 
358 
359 //=================================================================================================
360 //
361 // CONSTRUCTORS
362 //
363 //=================================================================================================
364 
365 //*************************************************************************************************
369 template< typename MT // Type of the adapted sparse matrix
370  , bool SO > // Storage order of the adapted sparse matrix
371 inline StrictlyLowerMatrix<MT,SO,false>::StrictlyLowerMatrix()
372  : matrix_() // The adapted sparse matrix
373 {
374  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly lower matrix detected" );
375 }
377 //*************************************************************************************************
378 
379 
380 //*************************************************************************************************
388 template< typename MT // Type of the adapted sparse matrix
389  , bool SO > // Storage order of the adapted sparse matrix
390 inline StrictlyLowerMatrix<MT,SO,false>::StrictlyLowerMatrix( size_t n )
391  : matrix_( n, n ) // The adapted sparse matrix
392 {
394 
395  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly lower matrix detected" );
396 }
398 //*************************************************************************************************
399 
400 
401 //*************************************************************************************************
411 template< typename MT // Type of the adapted sparse matrix
412  , bool SO > // Storage order of the adapted sparse matrix
413 inline StrictlyLowerMatrix<MT,SO,false>::StrictlyLowerMatrix( size_t n, size_t nonzeros )
414  : matrix_( n, n, max( nonzeros, n ) ) // The adapted sparse matrix
415 {
417 
418  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly lower matrix detected" );
419 }
421 //*************************************************************************************************
422 
423 
424 //*************************************************************************************************
438 template< typename MT // Type of the adapted sparse matrix
439  , bool SO > // Storage order of the adapted sparse matrix
440 inline StrictlyLowerMatrix<MT,SO,false>::StrictlyLowerMatrix( size_t n, const std::vector<size_t>& nonzeros )
441  : matrix_( n, n, nonzeros ) // The adapted sparse matrix
442 {
444 
445  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly lower matrix detected" );
446 }
448 //*************************************************************************************************
449 
450 
451 //*************************************************************************************************
475 template< typename MT // Type of the adapted sparse matrix
476  , bool SO > // Storage order of the adapted sparse matrix
477 inline StrictlyLowerMatrix<MT,SO,false>::StrictlyLowerMatrix( initializer_list< initializer_list<ElementType> > list )
478  : matrix_( list ) // The adapted sparse matrix
479 {
480  if( !isStrictlyLower( matrix_ ) ) {
481  BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of strictly lower matrix" );
482  }
483 
484  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
485 }
487 //*************************************************************************************************
488 
489 
490 //*************************************************************************************************
496 template< typename MT // Type of the adapted sparse matrix
497  , bool SO > // Storage order of the adapted sparse matrix
498 inline StrictlyLowerMatrix<MT,SO,false>::StrictlyLowerMatrix( const StrictlyLowerMatrix& m )
499  : matrix_( m.matrix_ ) // The adapted sparse matrix
500 {
501  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly lower matrix detected" );
502  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
503 }
505 //*************************************************************************************************
506 
507 
508 //*************************************************************************************************
514 template< typename MT // Type of the adapted sparse matrix
515  , bool SO > // Storage order of the adapted sparse matrix
516 inline StrictlyLowerMatrix<MT,SO,false>::StrictlyLowerMatrix( StrictlyLowerMatrix&& m ) noexcept
517  : matrix_( std::move( m.matrix_ ) ) // The adapted sparse matrix
518 {
519  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly lower matrix detected" );
520  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
521 }
523 //*************************************************************************************************
524 
525 
526 //*************************************************************************************************
537 template< typename MT // Type of the adapted sparse matrix
538  , bool SO > // Storage order of the adapted sparse matrix
539 template< typename MT2 // Type of the foreign matrix
540  , bool SO2 > // Storage order of the foreign matrix
541 inline StrictlyLowerMatrix<MT,SO,false>::StrictlyLowerMatrix( const Matrix<MT2,SO2>& m )
542  : matrix_( ~m ) // The adapted sparse matrix
543 {
544  if( IsUniTriangular_v<MT2> ||
545  ( !IsStrictlyLower_v<MT2> && !isStrictlyLower( matrix_ ) ) ) {
546  BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of strictly lower matrix" );
547  }
548 
549  if( !IsStrictlyLower_v<MT2> )
550  resetUpper();
551 
552  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly lower matrix detected" );
553  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
554 }
556 //*************************************************************************************************
557 
558 
559 
560 
561 //=================================================================================================
562 //
563 // DATA ACCESS FUNCTIONS
564 //
565 //=================================================================================================
566 
567 //*************************************************************************************************
583 template< typename MT // Type of the adapted sparse matrix
584  , bool SO > // Storage order of the adapted sparse matrix
586  StrictlyLowerMatrix<MT,SO,false>::operator()( size_t i, size_t j )
587 {
588  BLAZE_USER_ASSERT( i<rows() , "Invalid row access index" );
589  BLAZE_USER_ASSERT( j<columns(), "Invalid column access index" );
590 
591  return Reference( matrix_, i, j );
592 }
594 //*************************************************************************************************
595 
596 
597 //*************************************************************************************************
613 template< typename MT // Type of the adapted sparse matrix
614  , bool SO > // Storage order of the adapted sparse matrix
616  StrictlyLowerMatrix<MT,SO,false>::operator()( size_t i, size_t j ) const
617 {
618  BLAZE_USER_ASSERT( i<rows() , "Invalid row access index" );
619  BLAZE_USER_ASSERT( j<columns(), "Invalid column access index" );
620 
621  return matrix_(i,j);
622 }
624 //*************************************************************************************************
625 
626 
627 //*************************************************************************************************
644 template< typename MT // Type of the adapted sparse matrix
645  , bool SO > // Storage order of the adapted sparse matrix
647  StrictlyLowerMatrix<MT,SO,false>::at( size_t i, size_t j )
648 {
649  if( i >= rows() ) {
650  BLAZE_THROW_OUT_OF_RANGE( "Invalid row access index" );
651  }
652  if( j >= columns() ) {
653  BLAZE_THROW_OUT_OF_RANGE( "Invalid column access index" );
654  }
655  return (*this)(i,j);
656 }
658 //*************************************************************************************************
659 
660 
661 //*************************************************************************************************
678 template< typename MT // Type of the adapted sparse matrix
679  , bool SO > // Storage order of the adapted sparse matrix
681  StrictlyLowerMatrix<MT,SO,false>::at( size_t i, size_t j ) const
682 {
683  if( i >= rows() ) {
684  BLAZE_THROW_OUT_OF_RANGE( "Invalid row access index" );
685  }
686  if( j >= columns() ) {
687  BLAZE_THROW_OUT_OF_RANGE( "Invalid column access index" );
688  }
689  return (*this)(i,j);
690 }
692 //*************************************************************************************************
693 
694 
695 //*************************************************************************************************
707 template< typename MT // Type of the adapted sparse matrix
708  , bool SO > // Storage order of the adapted sparse matrix
711 {
712  return matrix_.begin(i);
713 }
715 //*************************************************************************************************
716 
717 
718 //*************************************************************************************************
730 template< typename MT // Type of the adapted sparse matrix
731  , bool SO > // Storage order of the adapted sparse matrix
734 {
735  return matrix_.begin(i);
736 }
738 //*************************************************************************************************
739 
740 
741 //*************************************************************************************************
753 template< typename MT // Type of the adapted sparse matrix
754  , bool SO > // Storage order of the adapted sparse matrix
757 {
758  return matrix_.cbegin(i);
759 }
761 //*************************************************************************************************
762 
763 
764 //*************************************************************************************************
776 template< typename MT // Type of the adapted sparse matrix
777  , bool SO > // Storage order of the adapted sparse matrix
780 {
781  return matrix_.end(i);
782 }
784 //*************************************************************************************************
785 
786 
787 //*************************************************************************************************
799 template< typename MT // Type of the adapted sparse matrix
800  , bool SO > // Storage order of the adapted sparse matrix
802  StrictlyLowerMatrix<MT,SO,false>::end( size_t i ) const
803 {
804  return matrix_.end(i);
805 }
807 //*************************************************************************************************
808 
809 
810 //*************************************************************************************************
822 template< typename MT // Type of the adapted sparse matrix
823  , bool SO > // Storage order of the adapted sparse matrix
826 {
827  return matrix_.cend(i);
828 }
830 //*************************************************************************************************
831 
832 
833 
834 
835 //=================================================================================================
836 //
837 // ASSIGNMENT OPERATORS
838 //
839 //=================================================================================================
840 
841 //*************************************************************************************************
866 template< typename MT // Type of the adapted sparse matrix
867  , bool SO > // Storage order of the adapted sparse matrix
868 inline StrictlyLowerMatrix<MT,SO,false>&
869  StrictlyLowerMatrix<MT,SO,false>::operator=( initializer_list< initializer_list<ElementType> > list )
870 {
871  const InitializerMatrix<ElementType> tmp( list, list.size() );
872 
873  if( !isStrictlyLower( tmp ) ) {
874  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to strictly lower matrix" );
875  }
876 
877  matrix_ = list;
878 
879  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly lower matrix detected" );
880  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
881 
882  return *this;
883 }
885 //*************************************************************************************************
886 
887 
888 //*************************************************************************************************
898 template< typename MT // Type of the adapted sparse matrix
899  , bool SO > // Storage order of the adapted sparse matrix
900 inline StrictlyLowerMatrix<MT,SO,false>&
901  StrictlyLowerMatrix<MT,SO,false>::operator=( const StrictlyLowerMatrix& rhs )
902 {
903  matrix_ = rhs.matrix_;
904 
905  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly lower matrix detected" );
906  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
907 
908  return *this;
909 }
911 //*************************************************************************************************
912 
913 
914 //*************************************************************************************************
921 template< typename MT // Type of the adapted sparse matrix
922  , bool SO > // Storage order of the adapted sparse matrix
923 inline StrictlyLowerMatrix<MT,SO,false>&
924  StrictlyLowerMatrix<MT,SO,false>::operator=( StrictlyLowerMatrix&& rhs ) noexcept
925 {
926  matrix_ = std::move( rhs.matrix_ );
927 
928  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly lower matrix detected" );
929  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
930 
931  return *this;
932 }
934 //*************************************************************************************************
935 
936 
937 //*************************************************************************************************
950 template< typename MT // Type of the adapted sparse matrix
951  , bool SO > // Storage order of the adapted sparse matrix
952 template< typename MT2 // Type of the right-hand side matrix
953  , bool SO2 > // Storage order of the right-hand side matrix
954 inline auto StrictlyLowerMatrix<MT,SO,false>::operator=( const Matrix<MT2,SO2>& rhs )
955  -> DisableIf_t< IsComputation_v<MT2>, StrictlyLowerMatrix& >
956 {
957  if( IsUniTriangular_v<MT2> ||
958  ( !IsStrictlyLower_v<MT2> && !isStrictlyLower( ~rhs ) ) ) {
959  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to strictly lower matrix" );
960  }
961 
962  matrix_ = decllow( ~rhs );
963 
964  if( !IsStrictlyLower_v<MT2> )
965  resetUpper();
966 
967  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly lower matrix detected" );
968  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
969 
970  return *this;
971 }
973 //*************************************************************************************************
974 
975 
976 //*************************************************************************************************
989 template< typename MT // Type of the adapted sparse matrix
990  , bool SO > // Storage order of the adapted sparse matrix
991 template< typename MT2 // Type of the right-hand side matrix
992  , bool SO2 > // Storage order of the right-hand side matrix
993 inline auto StrictlyLowerMatrix<MT,SO,false>::operator=( const Matrix<MT2,SO2>& rhs )
994  -> EnableIf_t< IsComputation_v<MT2>, StrictlyLowerMatrix& >
995 {
996  if( IsUniTriangular_v<MT2> || ( !IsSquare_v<MT2> && !isSquare( ~rhs ) ) ) {
997  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to strictly lower matrix" );
998  }
999 
1000  if( IsStrictlyLower_v<MT2> ) {
1001  matrix_ = ~rhs;
1002  }
1003  else {
1004  MT tmp( ~rhs );
1005 
1006  if( !isStrictlyLower( tmp ) ) {
1007  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to strictly lower matrix" );
1008  }
1009 
1010  matrix_ = std::move( tmp );
1011  }
1012 
1013  if( !IsStrictlyLower_v<MT2> )
1014  resetUpper();
1015 
1016  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly lower matrix detected" );
1017  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1018 
1019  return *this;
1020 }
1022 //*************************************************************************************************
1023 
1024 
1025 //*************************************************************************************************
1038 template< typename MT // Type of the adapted sparse matrix
1039  , bool SO > // Storage order of the adapted sparse matrix
1040 template< typename MT2 // Type of the right-hand side matrix
1041  , bool SO2 > // Storage order of the right-hand side matrix
1042 inline auto StrictlyLowerMatrix<MT,SO,false>::operator+=( const Matrix<MT2,SO2>& rhs )
1043  -> DisableIf_t< IsComputation_v<MT2>, StrictlyLowerMatrix& >
1044 {
1045  if( IsUniTriangular_v<MT2> ||
1046  ( !IsStrictlyLower_v<MT2> && !isStrictlyLower( ~rhs ) ) ) {
1047  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to strictly lower matrix" );
1048  }
1049 
1050  matrix_ += decllow( ~rhs );
1051 
1052  if( !IsStrictlyLower_v<MT2> )
1053  resetUpper();
1054 
1055  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly lower matrix detected" );
1056  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1057 
1058  return *this;
1059 }
1061 //*************************************************************************************************
1062 
1063 
1064 //*************************************************************************************************
1077 template< typename MT // Type of the adapted sparse matrix
1078  , bool SO > // Storage order of the adapted sparse matrix
1079 template< typename MT2 // Type of the right-hand side matrix
1080  , bool SO2 > // Storage order of the right-hand side matrix
1081 inline auto StrictlyLowerMatrix<MT,SO,false>::operator+=( const Matrix<MT2,SO2>& rhs )
1082  -> EnableIf_t< IsComputation_v<MT2>, StrictlyLowerMatrix& >
1083 {
1084  if( IsUniTriangular_v<MT2> || ( !IsSquare_v<MT2> && !isSquare( ~rhs ) ) ) {
1085  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to strictly lower matrix" );
1086  }
1087 
1088  if( IsStrictlyLower_v<MT2> ) {
1089  matrix_ += ~rhs;
1090  }
1091  else {
1092  const ResultType_t<MT2> tmp( ~rhs );
1093 
1094  if( !isStrictlyLower( tmp ) ) {
1095  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to strictly lower matrix" );
1096  }
1097 
1098  matrix_ += decllow( tmp );
1099  }
1100 
1101  if( !IsStrictlyLower_v<MT2> )
1102  resetUpper();
1103 
1104  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly lower matrix detected" );
1105  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1106 
1107  return *this;
1108 }
1110 //*************************************************************************************************
1111 
1112 
1113 //*************************************************************************************************
1126 template< typename MT // Type of the adapted sparse matrix
1127  , bool SO > // Storage order of the adapted sparse matrix
1128 template< typename MT2 // Type of the right-hand side matrix
1129  , bool SO2 > // Storage order of the right-hand side matrix
1130 inline auto StrictlyLowerMatrix<MT,SO,false>::operator-=( const Matrix<MT2,SO2>& rhs )
1131  -> DisableIf_t< IsComputation_v<MT2>, StrictlyLowerMatrix& >
1132 {
1133  if( IsUniTriangular_v<MT2> ||
1134  ( !IsStrictlyLower_v<MT2> && !isStrictlyLower( ~rhs ) ) ) {
1135  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to strictly lower matrix" );
1136  }
1137 
1138  matrix_ -= decllow( ~rhs );
1139 
1140  if( !IsStrictlyLower_v<MT2> )
1141  resetUpper();
1142 
1143  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly lower matrix detected" );
1144  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1145 
1146  return *this;
1147 }
1149 //*************************************************************************************************
1150 
1151 
1152 //*************************************************************************************************
1165 template< typename MT // Type of the adapted sparse matrix
1166  , bool SO > // Storage order of the adapted sparse matrix
1167 template< typename MT2 // Type of the right-hand side matrix
1168  , bool SO2 > // Storage order of the right-hand side matrix
1169 inline auto StrictlyLowerMatrix<MT,SO,false>::operator-=( const Matrix<MT2,SO2>& rhs )
1170  -> EnableIf_t< IsComputation_v<MT2>, StrictlyLowerMatrix& >
1171 {
1172  if( IsUniTriangular_v<MT2> || ( !IsSquare_v<MT2> && !isSquare( ~rhs ) ) ) {
1173  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to strictly lower matrix" );
1174  }
1175 
1176  if( IsStrictlyLower_v<MT2> ) {
1177  matrix_ -= ~rhs;
1178  }
1179  else {
1180  const ResultType_t<MT2> tmp( ~rhs );
1181 
1182  if( !isStrictlyLower( tmp ) ) {
1183  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to strictly lower matrix" );
1184  }
1185 
1186  matrix_ -= decllow( tmp );
1187  }
1188 
1189  if( !IsStrictlyLower_v<MT2> )
1190  resetUpper();
1191 
1192  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly lower matrix detected" );
1193  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1194 
1195  return *this;
1196 }
1198 //*************************************************************************************************
1199 
1200 
1201 //*************************************************************************************************
1213 template< typename MT // Type of the adapted sparse matrix
1214  , bool SO > // Storage order of the adapted sparse matrix
1215 template< typename MT2 // Type of the right-hand side matrix
1216  , bool SO2 > // Storage order of the right-hand side matrix
1217 inline auto StrictlyLowerMatrix<MT,SO,false>::operator%=( const Matrix<MT2,SO2>& rhs )
1218  -> StrictlyLowerMatrix&
1219 {
1220  if( !IsSquare_v<MT2> && !isSquare( ~rhs ) ) {
1221  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to strictly lower matrix" );
1222  }
1223 
1224  matrix_ %= ~rhs;
1225 
1226  if( !IsStrictlyLower_v<MT2> )
1227  resetUpper();
1228 
1229  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly lower matrix detected" );
1230  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1231 
1232  return *this;
1233 }
1235 //*************************************************************************************************
1236 
1237 
1238 
1239 
1240 //=================================================================================================
1241 //
1242 // UTILITY FUNCTIONS
1243 //
1244 //=================================================================================================
1245 
1246 //*************************************************************************************************
1252 template< typename MT // Type of the adapted sparse matrix
1253  , bool SO > // Storage order of the adapted sparse matrix
1254 inline size_t StrictlyLowerMatrix<MT,SO,false>::rows() const noexcept
1255 {
1256  return matrix_.rows();
1257 }
1259 //*************************************************************************************************
1260 
1261 
1262 //*************************************************************************************************
1268 template< typename MT // Type of the adapted sparse matrix
1269  , bool SO > // Storage order of the adapted sparse matrix
1270 inline size_t StrictlyLowerMatrix<MT,SO,false>::columns() const noexcept
1271 {
1272  return matrix_.columns();
1273 }
1275 //*************************************************************************************************
1276 
1277 
1278 //*************************************************************************************************
1284 template< typename MT // Type of the adapted sparse matrix
1285  , bool SO > // Storage order of the adapted sparse matrix
1286 inline size_t StrictlyLowerMatrix<MT,SO,false>::capacity() const noexcept
1287 {
1288  return matrix_.capacity();
1289 }
1291 //*************************************************************************************************
1292 
1293 
1294 //*************************************************************************************************
1306 template< typename MT // Type of the adapted sparse matrix
1307  , bool SO > // Storage order of the adapted sparse matrix
1308 inline size_t StrictlyLowerMatrix<MT,SO,false>::capacity( size_t i ) const noexcept
1309 {
1310  return matrix_.capacity(i);
1311 }
1313 //*************************************************************************************************
1314 
1315 
1316 //*************************************************************************************************
1322 template< typename MT // Type of the adapted sparse matrix
1323  , bool SO > // Storage order of the adapted sparse matrix
1324 inline size_t StrictlyLowerMatrix<MT,SO,false>::nonZeros() const
1325 {
1326  return matrix_.nonZeros();
1327 }
1329 //*************************************************************************************************
1330 
1331 
1332 //*************************************************************************************************
1344 template< typename MT // Type of the adapted sparse matrix
1345  , bool SO > // Storage order of the adapted sparse matrix
1346 inline size_t StrictlyLowerMatrix<MT,SO,false>::nonZeros( size_t i ) const
1347 {
1348  return matrix_.nonZeros(i);
1349 }
1351 //*************************************************************************************************
1352 
1353 
1354 //*************************************************************************************************
1360 template< typename MT // Type of the adapted sparse matrix
1361  , bool SO > // Storage order of the adapted sparse matrix
1363 {
1364  using blaze::erase;
1365 
1366  if( SO ) {
1367  for( size_t j=0UL; j<columns(); ++j ) {
1368  erase( matrix_, j, matrix_.lowerBound(j+1UL,j), matrix_.end(j) );
1369  }
1370  }
1371  else {
1372  for( size_t i=1UL; i<rows(); ++i ) {
1373  erase( matrix_, i, matrix_.begin(i), matrix_.lowerBound(i,i) );
1374  }
1375  }
1376 }
1378 //*************************************************************************************************
1379 
1380 
1381 //*************************************************************************************************
1394 template< typename MT // Type of the adapted sparse matrix
1395  , bool SO > // Storage order of the adapted sparse matrix
1396 inline void StrictlyLowerMatrix<MT,SO,false>::reset( size_t i )
1397 {
1398  using blaze::erase;
1399 
1400  if( SO ) {
1401  erase( matrix_, i, matrix_.lowerBound(i+1UL,i), matrix_.end(i) );
1402  }
1403  else {
1404  erase( matrix_, i, matrix_.begin(i), matrix_.lowerBound(i,i) );
1405  }
1406 }
1408 //*************************************************************************************************
1409 
1410 
1411 //*************************************************************************************************
1419 template< typename MT // Type of the adapted sparse matrix
1420  , bool SO > // Storage order of the adapted sparse matrix
1422 {
1423  using blaze::clear;
1424 
1425  if( IsResizable_v<MT> ) {
1426  clear( matrix_ );
1427  }
1428  else {
1429  reset();
1430  }
1431 }
1433 //*************************************************************************************************
1434 
1435 
1436 //*************************************************************************************************
1451 template< typename MT // Type of the adapted sparse matrix
1452  , bool SO > // Storage order of the adapted sparse matrix
1453 void StrictlyLowerMatrix<MT,SO,false>::resize( size_t n, bool preserve )
1454 {
1456 
1457  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly lower matrix detected" );
1458 
1459  matrix_.resize( n, n, preserve );
1460 }
1462 //*************************************************************************************************
1463 
1464 
1465 //*************************************************************************************************
1476 template< typename MT // Type of the adapted sparse matrix
1477  , bool SO > // Storage order of the adapted sparse matrix
1478 inline void StrictlyLowerMatrix<MT,SO,false>::reserve( size_t nonzeros )
1479 {
1480  matrix_.reserve( nonzeros );
1481 }
1483 //*************************************************************************************************
1484 
1485 
1486 //*************************************************************************************************
1501 template< typename MT // Type of the adapted sparse matrix
1502  , bool SO > // Storage order of the adapted sparse matrix
1503 inline void StrictlyLowerMatrix<MT,SO,false>::reserve( size_t i, size_t nonzeros )
1504 {
1505  matrix_.reserve( i, nonzeros );
1506 }
1508 //*************************************************************************************************
1509 
1510 
1511 //*************************************************************************************************
1522 template< typename MT // Type of the adapted sparse matrix
1523  , bool SO > // Storage order of the adapted sparse matrix
1524 inline void StrictlyLowerMatrix<MT,SO,false>::trim()
1525 {
1526  matrix_.trim();
1527 }
1529 //*************************************************************************************************
1530 
1531 
1532 //*************************************************************************************************
1544 template< typename MT // Type of the adapted sparse matrix
1545  , bool SO > // Storage order of the adapted sparse matrix
1546 inline void StrictlyLowerMatrix<MT,SO,false>::trim( size_t i )
1547 {
1548  matrix_.trim( i );
1549 }
1551 //*************************************************************************************************
1552 
1553 
1554 //*************************************************************************************************
1564 template< typename MT // Type of the adapted sparse matrix
1565  , bool SO > // Storage order of the adapted sparse matrix
1567 {
1568  matrix_.shrinkToFit();
1569 }
1571 //*************************************************************************************************
1572 
1573 
1574 //*************************************************************************************************
1581 template< typename MT // Type of the adapted sparse matrix
1582  , bool SO > // Storage order of the adapted sparse matrix
1583 inline void StrictlyLowerMatrix<MT,SO,false>::swap( StrictlyLowerMatrix& m ) noexcept
1584 {
1585  using std::swap;
1586 
1587  swap( matrix_, m.matrix_ );
1588 }
1590 //*************************************************************************************************
1591 
1592 
1593 //*************************************************************************************************
1605 template< typename MT // Type of the adapted dense matrix
1606  , bool SO > // Storage order of the adapted dense matrix
1607 inline constexpr size_t StrictlyLowerMatrix<MT,SO,false>::maxNonZeros() noexcept
1608 {
1610 
1611  return maxNonZeros( Size_v<MT,0UL> );
1612 }
1614 //*************************************************************************************************
1615 
1616 
1617 //*************************************************************************************************
1627 template< typename MT // Type of the adapted dense matrix
1628  , bool SO > // Storage order of the adapted dense matrix
1629 inline constexpr size_t StrictlyLowerMatrix<MT,SO,false>::maxNonZeros( size_t n ) noexcept
1630 {
1631  return ( ( n - 1UL ) * n ) / 2UL;
1632 }
1634 //*************************************************************************************************
1635 
1636 
1637 //*************************************************************************************************
1643 template< typename MT // Type of the adapted dense matrix
1644  , bool SO > // Storage order of the adapted dense matrix
1645 inline void StrictlyLowerMatrix<MT,SO,false>::resetUpper()
1646 {
1647  using blaze::erase;
1648 
1649  if( SO ) {
1650  for( size_t j=1UL; j<columns(); ++j )
1651  erase( matrix_, j, matrix_.begin( j ), matrix_.lowerBound( j, j ) );
1652  }
1653  else {
1654  for( size_t i=0UL; i<rows(); ++i )
1655  erase( matrix_, i, matrix_.upperBound( i, i ), matrix_.end( i ) );
1656  }
1657 }
1659 //*************************************************************************************************
1660 
1661 
1662 
1663 
1664 //=================================================================================================
1665 //
1666 // INSERTION FUNCTIONS
1667 //
1668 //=================================================================================================
1669 
1670 //*************************************************************************************************
1686 template< typename MT // Type of the adapted sparse matrix
1687  , bool SO > // Storage order of the adapted sparse matrix
1689  StrictlyLowerMatrix<MT,SO,false>::set( size_t i, size_t j, const ElementType& value )
1690 {
1691  if( i <= j ) {
1692  BLAZE_THROW_INVALID_ARGUMENT( "Invalid access to diagonal or upper matrix element" );
1693  }
1694 
1695  return matrix_.set( i, j, value );
1696 }
1698 //*************************************************************************************************
1699 
1700 
1701 //*************************************************************************************************
1718 template< typename MT // Type of the adapted sparse matrix
1719  , bool SO > // Storage order of the adapted sparse matrix
1721  StrictlyLowerMatrix<MT,SO,false>::insert( size_t i, size_t j, const ElementType& value )
1722 {
1723  if( i <= j ) {
1724  BLAZE_THROW_INVALID_ARGUMENT( "Invalid access to diagonal or upper matrix element" );
1725  }
1726 
1727  return matrix_.insert( i, j, value );
1728 }
1730 //*************************************************************************************************
1731 
1732 
1733 //*************************************************************************************************
1783 template< typename MT // Type of the adapted sparse matrix
1784  , bool SO > // Storage order of the adapted sparse matrix
1785 inline void StrictlyLowerMatrix<MT,SO,false>::append( size_t i, size_t j, const ElementType& value, bool check )
1786 {
1787  if( i <= j ) {
1788  BLAZE_THROW_INVALID_ARGUMENT( "Invalid access to diagonal or upper matrix element" );
1789  }
1790 
1791  matrix_.append( i, j, value, check );
1792 }
1794 //*************************************************************************************************
1795 
1796 
1797 //*************************************************************************************************
1811 template< typename MT // Type of the adapted sparse matrix
1812  , bool SO > // Storage order of the adapted sparse matrix
1813 inline void StrictlyLowerMatrix<MT,SO,false>::finalize( size_t i )
1814 {
1815  matrix_.finalize( i );
1816 }
1818 //*************************************************************************************************
1819 
1820 
1821 
1822 
1823 //=================================================================================================
1824 //
1825 // ERASE FUNCTIONS
1826 //
1827 //=================================================================================================
1828 
1829 //*************************************************************************************************
1839 template< typename MT // Type of the adapted sparse matrix
1840  , bool SO > // Storage order of the adapted sparse matrix
1841 inline void StrictlyLowerMatrix<MT,SO,false>::erase( size_t i, size_t j )
1842 {
1843  using blaze::erase;
1844 
1845  erase( matrix_, i, j );
1846 }
1848 //*************************************************************************************************
1849 
1850 
1851 //*************************************************************************************************
1863 template< typename MT // Type of the adapted sparse matrix
1864  , bool SO > // Storage order of the adapted sparse matrix
1866  StrictlyLowerMatrix<MT,SO,false>::erase( size_t i, Iterator pos )
1867 {
1868  using blaze::erase;
1869 
1870  return erase( matrix_, i, pos );
1871 }
1873 //*************************************************************************************************
1874 
1875 
1876 //*************************************************************************************************
1890 template< typename MT // Type of the adapted sparse matrix
1891  , bool SO > // Storage order of the adapted sparse matrix
1893  StrictlyLowerMatrix<MT,SO,false>::erase( size_t i, Iterator first, Iterator last )
1894 {
1895  using blaze::erase;
1896 
1897  return erase( matrix_, i, first, last );
1898 }
1900 //*************************************************************************************************
1901 
1902 
1903 //*************************************************************************************************
1925 template< typename MT // Type of the adapted sparse matrix
1926  , bool SO > // Storage order of the adapted sparse matrix
1927 template< typename Pred > // Type of the unary predicate
1928 inline void StrictlyLowerMatrix<MT,SO,false>::erase( Pred predicate )
1929 {
1930  using blaze::erase;
1931 
1932  erase( matrix_, predicate );
1933 
1934  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1935 }
1937 //*************************************************************************************************
1938 
1939 
1940 //*************************************************************************************************
1968 template< typename MT // Type of the adapted sparse matrix
1969  , bool SO > // Storage order of the adapted sparse matrix
1970 template< typename Pred > // Type of the unary predicate
1971 inline void StrictlyLowerMatrix<MT,SO,false>::erase( size_t i, Iterator first, Iterator last, Pred predicate )
1972 {
1973  using blaze::erase;
1974 
1975  erase( matrix_, i, first, last, predicate );
1976 
1977  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1978 }
1980 //*************************************************************************************************
1981 
1982 
1983 
1984 
1985 //=================================================================================================
1986 //
1987 // LOOKUP FUNCTIONS
1988 //
1989 //=================================================================================================
1990 
1991 //*************************************************************************************************
2007 template< typename MT // Type of the adapted sparse matrix
2008  , bool SO > // Storage order of the adapted sparse matrix
2010  StrictlyLowerMatrix<MT,SO,false>::find( size_t i, size_t j )
2011 {
2012  return matrix_.find( i, j );
2013 }
2015 //*************************************************************************************************
2016 
2017 
2018 //*************************************************************************************************
2034 template< typename MT // Type of the adapted sparse matrix
2035  , bool SO > // Storage order of the adapted sparse matrix
2037  StrictlyLowerMatrix<MT,SO,false>::find( size_t i, size_t j ) const
2038 {
2039  return matrix_.find( i, j );
2040 }
2042 //*************************************************************************************************
2043 
2044 
2045 //*************************************************************************************************
2061 template< typename MT // Type of the adapted sparse matrix
2062  , bool SO > // Storage order of the adapted sparse matrix
2064  StrictlyLowerMatrix<MT,SO,false>::lowerBound( size_t i, size_t j )
2065 {
2066  return matrix_.lowerBound( i, j );
2067 }
2069 //*************************************************************************************************
2070 
2071 
2072 //*************************************************************************************************
2088 template< typename MT // Type of the adapted sparse matrix
2089  , bool SO > // Storage order of the adapted sparse matrix
2091  StrictlyLowerMatrix<MT,SO,false>::lowerBound( size_t i, size_t j ) const
2092 {
2093  return matrix_.lowerBound( i, j );
2094 }
2096 //*************************************************************************************************
2097 
2098 
2099 //*************************************************************************************************
2115 template< typename MT // Type of the adapted sparse matrix
2116  , bool SO > // Storage order of the adapted sparse matrix
2118  StrictlyLowerMatrix<MT,SO,false>::upperBound( size_t i, size_t j )
2119 {
2120  return matrix_.upperBound( i, j );
2121 }
2123 //*************************************************************************************************
2124 
2125 
2126 //*************************************************************************************************
2142 template< typename MT // Type of the adapted sparse matrix
2143  , bool SO > // Storage order of the adapted sparse matrix
2145  StrictlyLowerMatrix<MT,SO,false>::upperBound( size_t i, size_t j ) const
2146 {
2147  return matrix_.upperBound( i, j );
2148 }
2150 //*************************************************************************************************
2151 
2152 
2153 
2154 
2155 //=================================================================================================
2156 //
2157 // NUMERIC FUNCTIONS
2158 //
2159 //=================================================================================================
2160 
2161 //*************************************************************************************************
2179 template< typename MT // Type of the adapted sparse matrix
2180  , bool SO > // Storage order of the adapted sparse matrix
2181 template< typename Other > // Data type of the scalar value
2182 inline StrictlyLowerMatrix<MT,SO,false>&
2183  StrictlyLowerMatrix<MT,SO,false>::scale( const Other& scalar )
2184 {
2185  matrix_.scale( scalar );
2186  return *this;
2187 }
2189 //*************************************************************************************************
2190 
2191 
2192 
2193 
2194 //=================================================================================================
2195 //
2196 // DEBUGGING FUNCTIONS
2197 //
2198 //=================================================================================================
2199 
2200 //*************************************************************************************************
2210 template< typename MT // Type of the adapted sparse matrix
2211  , bool SO > // Storage order of the adapted sparse matrix
2212 inline bool StrictlyLowerMatrix<MT,SO,false>::isIntact() const noexcept
2213 {
2214  using blaze::isIntact;
2215 
2216  return ( isIntact( matrix_ ) && isStrictlyLower( matrix_ ) );
2217 }
2219 //*************************************************************************************************
2220 
2221 
2222 
2223 
2224 //=================================================================================================
2225 //
2226 // EXPRESSION TEMPLATE EVALUATION FUNCTIONS
2227 //
2228 //=================================================================================================
2229 
2230 //*************************************************************************************************
2241 template< typename MT // Type of the adapted sparse matrix
2242  , bool SO > // Storage order of the adapted sparse matrix
2243 template< typename Other > // Data type of the foreign expression
2244 inline bool StrictlyLowerMatrix<MT,SO,false>::canAlias( const Other* alias ) const noexcept
2245 {
2246  return matrix_.canAlias( alias );
2247 }
2249 //*************************************************************************************************
2250 
2251 
2252 //*************************************************************************************************
2263 template< typename MT // Type of the adapted sparse matrix
2264  , bool SO > // Storage order of the adapted sparse matrix
2265 template< typename Other > // Data type of the foreign expression
2266 inline bool StrictlyLowerMatrix<MT,SO,false>::isAliased( const Other* alias ) const noexcept
2267 {
2268  return matrix_.isAliased( alias );
2269 }
2271 //*************************************************************************************************
2272 
2273 
2274 //*************************************************************************************************
2285 template< typename MT // Type of the adapted sparse matrix
2286  , bool SO > // Storage order of the adapted sparse matrix
2287 inline bool StrictlyLowerMatrix<MT,SO,false>::canSMPAssign() const noexcept
2288 {
2289  return matrix_.canSMPAssign();
2290 }
2292 //*************************************************************************************************
2293 
2294 } // namespace blaze
2295 
2296 #endif
#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
#define BLAZE_THROW_INVALID_ARGUMENT(MESSAGE)
Macro for the emission of a std::invalid_argument exception.This macro encapsulates the default way o...
Definition: Exception.h:235
Header file for auxiliary alias declarations.
CompressedMatrix< Type, false > OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: CompressedMatrix.h: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
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.
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
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
Element * Iterator
Iterator over non-constant elements.
Definition: CompressedMatrix.h:3085
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.
Header file for the SparseMatrix base class.
Header file for utility functions for sparse matrices.
Header file for the IsSquare type trait.
Constraint on the data type.
Header file for the implementation of a matrix representation of an initializer list.
Headerfile for the generic max algorithm.
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_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
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:3086
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 SparseElement base class.
Header file for the IsUniTriangular type trait.
Constraints on the storage order of matrix types.
Header file for the exception macros of the math module.
#define BLAZE_CONSTRAINT_MUST_NOT_BE_UPPER_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is a upper triangular matrix type...
Definition: Upper.h:81
decltype(auto) max(const DenseMatrix< MT1, SO1 > &lhs, const DenseMatrix< MT2, SO2 > &rhs)
Computes the componentwise maximum of the dense matrices lhs and rhs.
Definition: DMatDMatMapExpr.h:1179
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
Header file for the EnableIf class template.
Header file for the IsStrictlyLower type trait.
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.
#define BLAZE_CONSTRAINT_MUST_NOT_BE_LOWER_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is a lower triangular matrix type...
Definition: Lower.h:81
#define BLAZE_CONSTRAINT_MUST_NOT_BE_REFERENCE_TYPE(T)
Constraint on the data type.In case the given data type T is not a reference type, a compilation error is created.
Definition: Reference.h:79
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
BLAZE_ALWAYS_INLINE const EnableIf_t< IsIntegral_v< T > &&HasSize_v< T, 1UL >, If_t< IsSigned_v< T >, SIMDint8, SIMDuint8 > > set(T value) noexcept
Sets all values in the vector to the given 1-byte integral value.
Definition: Set.h:75
Constraint on the data type.
Constraint on the data type.
Header file for the StrictlyLowerProxy class.
constexpr size_t rows(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of rows of the matrix.
Definition: Matrix.h:498
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
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
#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.
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
#define BLAZE_CONSTRAINT_MUST_BE_SPARSE_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is not a sparse, N-dimensional matrix type...
Definition: SparseMatrix.h:61
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 clear shim.