Sparse.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_ADAPTORS_STRICTLYUPPERMATRIX_SPARSE_H_
36 #define _BLAZE_MATH_ADAPTORS_STRICTLYUPPERMATRIX_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>
72 #include <blaze/util/Assert.h>
77 #include <blaze/util/DisableIf.h>
78 #include <blaze/util/EnableIf.h>
80 #include <blaze/util/Types.h>
81 
82 
83 namespace blaze {
84 
85 //=================================================================================================
86 //
87 // CLASS TEMPLATE SPECIALIZATION FOR SPARSE MATRICES
88 //
89 //=================================================================================================
90 
91 //*************************************************************************************************
99 template< typename MT // Type of the adapted sparse matrix
100  , bool SO > // Storage order of the adapted sparse matrix
101 class StrictlyUpperMatrix<MT,SO,false>
102  : public SparseMatrix< StrictlyUpperMatrix<MT,SO,false>, SO >
103 {
104  private:
105  //**Type definitions****************************************************************************
106  using OT = OppositeType_t<MT>;
107  using TT = TransposeType_t<MT>;
108  using ET = ElementType_t<MT>;
109  //**********************************************************************************************
110 
111  public:
112  //**Type definitions****************************************************************************
113  using This = StrictlyUpperMatrix<MT,SO,false>;
114  using BaseType = SparseMatrix<This,SO>;
115  using ResultType = This;
116  using OppositeType = StrictlyUpperMatrix<OT,!SO,false>;
117  using TransposeType = StrictlyLowerMatrix<TT,!SO,false>;
118  using ElementType = ET;
119  using ReturnType = ReturnType_t<MT>;
120  using CompositeType = const This&;
121  using Reference = StrictlyUpperProxy<MT>;
122  using ConstReference = ConstReference_t<MT>;
123  using Iterator = Iterator_t<MT>;
124  using ConstIterator = ConstIterator_t<MT>;
125  //**********************************************************************************************
126 
127  //**Rebind struct definition********************************************************************
130  template< typename NewType > // Data type of the other matrix
131  struct Rebind {
133  using Other = StrictlyUpperMatrix< typename MT::template Rebind<NewType>::Other >;
134  };
135  //**********************************************************************************************
136 
137  //**Resize struct definition********************************************************************
140  template< size_t NewM // Number of rows of the other matrix
141  , size_t NewN > // Number of columns of the other matrix
142  struct Resize {
144  using Other = StrictlyUpperMatrix< typename MT::template Resize<NewM,NewN>::Other >;
145  };
146  //**********************************************************************************************
147 
148  //**Compilation flags***************************************************************************
150  static constexpr bool smpAssignable = false;
151  //**********************************************************************************************
152 
153  //**Constructors********************************************************************************
156  explicit inline StrictlyUpperMatrix();
157  explicit inline StrictlyUpperMatrix( size_t n );
158  explicit inline StrictlyUpperMatrix( size_t n, size_t nonzeros );
159  explicit inline StrictlyUpperMatrix( size_t n, const std::vector<size_t>& nonzeros );
160  explicit inline StrictlyUpperMatrix( initializer_list< initializer_list<ElementType> > list );
161 
162  inline StrictlyUpperMatrix( const StrictlyUpperMatrix& m );
163  inline StrictlyUpperMatrix( StrictlyUpperMatrix&& m ) noexcept;
164 
165  template< typename MT2, bool SO2 >
166  inline StrictlyUpperMatrix( const Matrix<MT2,SO2>& m );
168  //**********************************************************************************************
169 
170  //**Destructor**********************************************************************************
173  ~StrictlyUpperMatrix() = default;
175  //**********************************************************************************************
176 
177  //**Data access functions***********************************************************************
180  inline Reference operator()( size_t i, size_t j );
181  inline ConstReference operator()( size_t i, size_t j ) const;
182  inline Reference at( size_t i, size_t j );
183  inline ConstReference at( size_t i, size_t j ) const;
184  inline Iterator begin ( size_t i );
185  inline ConstIterator begin ( size_t i ) const;
186  inline ConstIterator cbegin( size_t i ) const;
187  inline Iterator end ( size_t i );
188  inline ConstIterator end ( size_t i ) const;
189  inline ConstIterator cend ( size_t i ) const;
191  //**********************************************************************************************
192 
193  //**Assignment operators************************************************************************
196  inline StrictlyUpperMatrix& operator=( initializer_list< initializer_list<ElementType> > list );
197 
198  inline StrictlyUpperMatrix& operator=( const StrictlyUpperMatrix& rhs );
199  inline StrictlyUpperMatrix& operator=( StrictlyUpperMatrix&& rhs ) noexcept;
200 
201  template< typename MT2, bool SO2 >
202  inline auto operator=( const Matrix<MT2,SO2>& rhs )
203  -> DisableIf_t< IsComputation_v<MT2>, StrictlyUpperMatrix& >;
204 
205  template< typename MT2, bool SO2 >
206  inline auto operator=( const Matrix<MT2,SO2>& rhs )
207  -> EnableIf_t< IsComputation_v<MT2>, StrictlyUpperMatrix& >;
208 
209  template< typename MT2, bool SO2 >
210  inline auto operator+=( const Matrix<MT2,SO2>& rhs )
211  -> DisableIf_t< IsComputation_v<MT2>, StrictlyUpperMatrix& >;
212 
213  template< typename MT2, bool SO2 >
214  inline auto operator+=( const Matrix<MT2,SO2>& rhs )
215  -> EnableIf_t< IsComputation_v<MT2>, StrictlyUpperMatrix& >;
216 
217  template< typename MT2, bool SO2 >
218  inline auto operator-=( const Matrix<MT2,SO2>& rhs )
219  -> DisableIf_t< IsComputation_v<MT2>, StrictlyUpperMatrix& >;
220 
221  template< typename MT2, bool SO2 >
222  inline auto operator-=( const Matrix<MT2,SO2>& rhs )
223  -> EnableIf_t< IsComputation_v<MT2>, StrictlyUpperMatrix& >;
224 
225  template< typename MT2, bool SO2 >
226  inline auto operator%=( const Matrix<MT2,SO2>& rhs ) -> StrictlyUpperMatrix&;
228  //**********************************************************************************************
229 
230  //**Utility functions***************************************************************************
233  inline size_t rows() const noexcept;
234  inline size_t columns() const noexcept;
235  inline size_t capacity() const noexcept;
236  inline size_t capacity( size_t i ) const noexcept;
237  inline size_t nonZeros() const;
238  inline size_t nonZeros( size_t i ) const;
239  inline void reset();
240  inline void reset( size_t i );
241  inline void clear();
242  inline void resize ( size_t n, bool preserve=true );
243  inline void reserve( size_t nonzeros );
244  inline void reserve( size_t i, size_t nonzeros );
245  inline void trim();
246  inline void trim( size_t i );
247  inline void shrinkToFit();
248  inline void swap( StrictlyUpperMatrix& m ) noexcept;
249 
250  static inline constexpr size_t maxNonZeros() noexcept;
251  static inline constexpr size_t maxNonZeros( size_t n ) noexcept;
253  //**********************************************************************************************
254 
255  //**Insertion functions*************************************************************************
258  inline Iterator set ( size_t i, size_t j, const ElementType& value );
259  inline Iterator insert ( size_t i, size_t j, const ElementType& value );
260  inline void append ( size_t i, size_t j, const ElementType& value, bool check=false );
261  inline void finalize( size_t i );
263  //**********************************************************************************************
264 
265  //**Erase functions*****************************************************************************
268  inline void erase( size_t i, size_t j );
269  inline Iterator erase( size_t i, Iterator pos );
270  inline Iterator erase( size_t i, Iterator first, Iterator last );
271 
272  template< typename Pred >
273  inline void erase( Pred predicate );
274 
275  template< typename Pred >
276  inline void erase( size_t i, Iterator first, Iterator last, Pred predicate );
278  //**********************************************************************************************
279 
280  //**Lookup functions****************************************************************************
283  inline Iterator find ( size_t i, size_t j );
284  inline ConstIterator find ( size_t i, size_t j ) const;
285  inline Iterator lowerBound( size_t i, size_t j );
286  inline ConstIterator lowerBound( size_t i, size_t j ) const;
287  inline Iterator upperBound( size_t i, size_t j );
288  inline ConstIterator upperBound( size_t i, size_t j ) const;
290  //**********************************************************************************************
291 
292  //**Numeric functions***************************************************************************
295  template< typename Other > inline StrictlyUpperMatrix& scale( const Other& scalar );
297  //**********************************************************************************************
298 
299  //**Debugging functions*************************************************************************
302  inline bool isIntact() const noexcept;
304  //**********************************************************************************************
305 
306  //**Expression template evaluation functions****************************************************
309  template< typename Other > inline bool canAlias ( const Other* alias ) const noexcept;
310  template< typename Other > inline bool isAliased( const Other* alias ) const noexcept;
311 
312  inline bool canSMPAssign() const noexcept;
314  //**********************************************************************************************
315 
316  private:
317  //**Utility functions***************************************************************************
320  inline void resetLower();
322  //**********************************************************************************************
323 
324  //**Member variables****************************************************************************
327  MT matrix_;
328 
329  //**********************************************************************************************
330 
331  //**Friend declarations*************************************************************************
332  template< typename MT2, bool SO2, bool DF2 >
333  friend MT2& derestrict( StrictlyUpperMatrix<MT2,SO2,DF2>& m );
334  //**********************************************************************************************
335 
336  //**Compile time checks*************************************************************************
349  BLAZE_STATIC_ASSERT( ( Size_v<MT,0UL> == Size_v<MT,1UL> ) );
350  //**********************************************************************************************
351 };
353 //*************************************************************************************************
354 
355 
356 
357 
358 //=================================================================================================
359 //
360 // CONSTRUCTORS
361 //
362 //=================================================================================================
363 
364 //*************************************************************************************************
368 template< typename MT // Type of the adapted sparse matrix
369  , bool SO > // Storage order of the adapted sparse matrix
370 inline StrictlyUpperMatrix<MT,SO,false>::StrictlyUpperMatrix()
371  : matrix_() // The adapted sparse matrix
372 {
373  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly upper matrix detected" );
374 }
376 //*************************************************************************************************
377 
378 
379 //*************************************************************************************************
387 template< typename MT // Type of the adapted sparse matrix
388  , bool SO > // Storage order of the adapted sparse matrix
389 inline StrictlyUpperMatrix<MT,SO,false>::StrictlyUpperMatrix( size_t n )
390  : matrix_( n, n ) // The adapted sparse matrix
391 {
393 
394  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly upper matrix detected" );
395 }
397 //*************************************************************************************************
398 
399 
400 //*************************************************************************************************
410 template< typename MT // Type of the adapted sparse matrix
411  , bool SO > // Storage order of the adapted sparse matrix
412 inline StrictlyUpperMatrix<MT,SO,false>::StrictlyUpperMatrix( size_t n, size_t nonzeros )
413  : matrix_( n, n, max( nonzeros, n ) ) // The adapted sparse matrix
414 {
416 
417  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly upper matrix detected" );
418 }
420 //*************************************************************************************************
421 
422 
423 //*************************************************************************************************
437 template< typename MT // Type of the adapted sparse matrix
438  , bool SO > // Storage order of the adapted sparse matrix
439 inline StrictlyUpperMatrix<MT,SO,false>::StrictlyUpperMatrix( size_t n, const std::vector<size_t>& nonzeros )
440  : matrix_( n, n, nonzeros ) // The adapted sparse matrix
441 {
443 
444  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly upper matrix detected" );
445 }
447 //*************************************************************************************************
448 
449 
450 //*************************************************************************************************
474 template< typename MT // Type of the adapted sparse matrix
475  , bool SO > // Storage order of the adapted sparse matrix
476 inline StrictlyUpperMatrix<MT,SO,false>::StrictlyUpperMatrix( initializer_list< initializer_list<ElementType> > list )
477  : matrix_( list ) // The adapted sparse matrix
478 {
479  if( !isStrictlyUpper( matrix_ ) ) {
480  BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of strictly upper matrix" );
481  }
482 
483  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
484 }
486 //*************************************************************************************************
487 
488 
489 //*************************************************************************************************
495 template< typename MT // Type of the adapted sparse matrix
496  , bool SO > // Storage order of the adapted sparse matrix
497 inline StrictlyUpperMatrix<MT,SO,false>::StrictlyUpperMatrix( const StrictlyUpperMatrix& m )
498  : matrix_( m.matrix_ ) // The adapted sparse matrix
499 {
500  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly upper matrix detected" );
501  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
502 }
504 //*************************************************************************************************
505 
506 
507 //*************************************************************************************************
513 template< typename MT // Type of the adapted sparse matrix
514  , bool SO > // Storage order of the adapted sparse matrix
515 inline StrictlyUpperMatrix<MT,SO,false>::StrictlyUpperMatrix( StrictlyUpperMatrix&& m ) noexcept
516  : matrix_( std::move( m.matrix_ ) ) // The adapted sparse matrix
517 {
518  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly upper matrix detected" );
519  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
520 }
522 //*************************************************************************************************
523 
524 
525 //*************************************************************************************************
536 template< typename MT // Type of the adapted sparse matrix
537  , bool SO > // Storage order of the adapted sparse matrix
538 template< typename MT2 // Type of the foreign matrix
539  , bool SO2 > // Storage order of the foreign matrix
540 inline StrictlyUpperMatrix<MT,SO,false>::StrictlyUpperMatrix( const Matrix<MT2,SO2>& m )
541  : matrix_( ~m ) // The adapted sparse matrix
542 {
543  if( IsUniTriangular_v<MT2> ||
544  ( !IsStrictlyUpper_v<MT2> && !isStrictlyUpper( matrix_ ) ) ) {
545  BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of strictly upper matrix" );
546  }
547 
548  if( !IsStrictlyUpper_v<MT2> )
549  resetLower();
550 
551  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly upper matrix detected" );
552  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
553 }
555 //*************************************************************************************************
556 
557 
558 
559 
560 //=================================================================================================
561 //
562 // DATA ACCESS FUNCTIONS
563 //
564 //=================================================================================================
565 
566 //*************************************************************************************************
582 template< typename MT // Type of the adapted sparse matrix
583  , bool SO > // Storage order of the adapted sparse matrix
585  StrictlyUpperMatrix<MT,SO,false>::operator()( size_t i, size_t j )
586 {
587  BLAZE_USER_ASSERT( i<rows() , "Invalid row access index" );
588  BLAZE_USER_ASSERT( j<columns(), "Invalid column access index" );
589 
590  return Reference( matrix_, i, j );
591 }
593 //*************************************************************************************************
594 
595 
596 //*************************************************************************************************
612 template< typename MT // Type of the adapted sparse matrix
613  , bool SO > // Storage order of the adapted sparse matrix
615  StrictlyUpperMatrix<MT,SO,false>::operator()( size_t i, size_t j ) const
616 {
617  BLAZE_USER_ASSERT( i<rows() , "Invalid row access index" );
618  BLAZE_USER_ASSERT( j<columns(), "Invalid column access index" );
619 
620  return matrix_(i,j);
621 }
623 //*************************************************************************************************
624 
625 
626 //*************************************************************************************************
643 template< typename MT // Type of the adapted sparse matrix
644  , bool SO > // Storage order of the adapted sparse matrix
646  StrictlyUpperMatrix<MT,SO,false>::at( size_t i, size_t j )
647 {
648  if( i >= rows() ) {
649  BLAZE_THROW_OUT_OF_RANGE( "Invalid row access index" );
650  }
651  if( j >= columns() ) {
652  BLAZE_THROW_OUT_OF_RANGE( "Invalid column access index" );
653  }
654  return (*this)(i,j);
655 }
657 //*************************************************************************************************
658 
659 
660 //*************************************************************************************************
677 template< typename MT // Type of the adapted sparse matrix
678  , bool SO > // Storage order of the adapted sparse matrix
680  StrictlyUpperMatrix<MT,SO,false>::at( size_t i, size_t j ) const
681 {
682  if( i >= rows() ) {
683  BLAZE_THROW_OUT_OF_RANGE( "Invalid row access index" );
684  }
685  if( j >= columns() ) {
686  BLAZE_THROW_OUT_OF_RANGE( "Invalid column access index" );
687  }
688  return (*this)(i,j);
689 }
691 //*************************************************************************************************
692 
693 
694 //*************************************************************************************************
706 template< typename MT // Type of the adapted sparse matrix
707  , bool SO > // Storage order of the adapted sparse matrix
710 {
711  return matrix_.begin(i);
712 }
714 //*************************************************************************************************
715 
716 
717 //*************************************************************************************************
729 template< typename MT // Type of the adapted sparse matrix
730  , bool SO > // Storage order of the adapted sparse matrix
733 {
734  return matrix_.begin(i);
735 }
737 //*************************************************************************************************
738 
739 
740 //*************************************************************************************************
752 template< typename MT // Type of the adapted sparse matrix
753  , bool SO > // Storage order of the adapted sparse matrix
756 {
757  return matrix_.cbegin(i);
758 }
760 //*************************************************************************************************
761 
762 
763 //*************************************************************************************************
775 template< typename MT // Type of the adapted sparse matrix
776  , bool SO > // Storage order of the adapted sparse matrix
779 {
780  return matrix_.end(i);
781 }
783 //*************************************************************************************************
784 
785 
786 //*************************************************************************************************
798 template< typename MT // Type of the adapted sparse matrix
799  , bool SO > // Storage order of the adapted sparse matrix
801  StrictlyUpperMatrix<MT,SO,false>::end( size_t i ) const
802 {
803  return matrix_.end(i);
804 }
806 //*************************************************************************************************
807 
808 
809 //*************************************************************************************************
821 template< typename MT // Type of the adapted sparse matrix
822  , bool SO > // Storage order of the adapted sparse matrix
825 {
826  return matrix_.cend(i);
827 }
829 //*************************************************************************************************
830 
831 
832 
833 
834 //=================================================================================================
835 //
836 // ASSIGNMENT OPERATORS
837 //
838 //=================================================================================================
839 
840 //*************************************************************************************************
865 template< typename MT // Type of the adapted sparse matrix
866  , bool SO > // Storage order of the adapted sparse matrix
867 inline StrictlyUpperMatrix<MT,SO,false>&
868  StrictlyUpperMatrix<MT,SO,false>::operator=( initializer_list< initializer_list<ElementType> > list )
869 {
870  const InitializerMatrix<ElementType> tmp( list, list.size() );
871 
872  if( !isStrictlyUpper( tmp ) ) {
873  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to strictly upper matrix" );
874  }
875 
876  matrix_ = list;
877 
878  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly upper matrix detected" );
879  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
880 
881  return *this;
882 }
884 //*************************************************************************************************
885 
886 
887 //*************************************************************************************************
897 template< typename MT // Type of the adapted sparse matrix
898  , bool SO > // Storage order of the adapted sparse matrix
899 inline StrictlyUpperMatrix<MT,SO,false>&
900  StrictlyUpperMatrix<MT,SO,false>::operator=( const StrictlyUpperMatrix& rhs )
901 {
902  matrix_ = rhs.matrix_;
903 
904  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly upper matrix detected" );
905  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
906 
907  return *this;
908 }
910 //*************************************************************************************************
911 
912 
913 //*************************************************************************************************
920 template< typename MT // Type of the adapted sparse matrix
921  , bool SO > // Storage order of the adapted sparse matrix
922 inline StrictlyUpperMatrix<MT,SO,false>&
923  StrictlyUpperMatrix<MT,SO,false>::operator=( StrictlyUpperMatrix&& rhs ) noexcept
924 {
925  matrix_ = std::move( rhs.matrix_ );
926 
927  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly upper matrix detected" );
928  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
929 
930  return *this;
931 }
933 //*************************************************************************************************
934 
935 
936 //*************************************************************************************************
949 template< typename MT // Type of the adapted sparse matrix
950  , bool SO > // Storage order of the adapted sparse matrix
951 template< typename MT2 // Type of the right-hand side matrix
952  , bool SO2 > // Storage order of the right-hand side matrix
953 inline auto StrictlyUpperMatrix<MT,SO,false>::operator=( const Matrix<MT2,SO2>& rhs )
954  -> DisableIf_t< IsComputation_v<MT2>, StrictlyUpperMatrix& >
955 {
956  if( IsUniTriangular_v<MT2> ||
957  ( !IsStrictlyUpper_v<MT2> && !isStrictlyUpper( ~rhs ) ) ) {
958  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to strictly upper matrix" );
959  }
960 
961  matrix_ = declupp( ~rhs );
962 
963  if( !IsStrictlyUpper_v<MT2> )
964  resetLower();
965 
966  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly upper matrix detected" );
967  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
968 
969  return *this;
970 }
972 //*************************************************************************************************
973 
974 
975 //*************************************************************************************************
988 template< typename MT // Type of the adapted sparse matrix
989  , bool SO > // Storage order of the adapted sparse matrix
990 template< typename MT2 // Type of the right-hand side matrix
991  , bool SO2 > // Storage order of the right-hand side matrix
992 inline auto StrictlyUpperMatrix<MT,SO,false>::operator=( const Matrix<MT2,SO2>& rhs )
993  -> EnableIf_t< IsComputation_v<MT2>, StrictlyUpperMatrix& >
994 {
995  if( IsUniTriangular_v<MT2> || ( !IsSquare_v<MT2> && !isSquare( ~rhs ) ) ) {
996  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to strictly upper matrix" );
997  }
998 
999  if( IsStrictlyUpper_v<MT2> ) {
1000  matrix_ = ~rhs;
1001  }
1002  else {
1003  MT tmp( ~rhs );
1004 
1005  if( !isStrictlyUpper( tmp ) ) {
1006  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to strictly upper matrix" );
1007  }
1008 
1009  matrix_ = std::move( tmp );
1010  }
1011 
1012  if( !IsStrictlyUpper_v<MT2> )
1013  resetLower();
1014 
1015  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly upper matrix detected" );
1016  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1017 
1018  return *this;
1019 }
1021 //*************************************************************************************************
1022 
1023 
1024 //*************************************************************************************************
1037 template< typename MT // Type of the adapted sparse matrix
1038  , bool SO > // Storage order of the adapted sparse matrix
1039 template< typename MT2 // Type of the right-hand side matrix
1040  , bool SO2 > // Storage order of the right-hand side matrix
1041 inline auto StrictlyUpperMatrix<MT,SO,false>::operator+=( const Matrix<MT2,SO2>& rhs )
1042  -> DisableIf_t< IsComputation_v<MT2>, StrictlyUpperMatrix& >
1043 {
1044  if( IsUniTriangular_v<MT2> ||
1045  ( !IsStrictlyUpper_v<MT2> && !isStrictlyUpper( ~rhs ) ) ) {
1046  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to strictly upper matrix" );
1047  }
1048 
1049  matrix_ += declupp( ~rhs );
1050 
1051  if( !IsStrictlyUpper_v<MT2> )
1052  resetLower();
1053 
1054  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly upper matrix detected" );
1055  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1056 
1057  return *this;
1058 }
1060 //*************************************************************************************************
1061 
1062 
1063 //*************************************************************************************************
1076 template< typename MT // Type of the adapted sparse matrix
1077  , bool SO > // Storage order of the adapted sparse matrix
1078 template< typename MT2 // Type of the right-hand side matrix
1079  , bool SO2 > // Storage order of the right-hand side matrix
1080 inline auto StrictlyUpperMatrix<MT,SO,false>::operator+=( const Matrix<MT2,SO2>& rhs )
1081  -> EnableIf_t< IsComputation_v<MT2>, StrictlyUpperMatrix& >
1082 {
1083  if( IsUniTriangular_v<MT2> || ( IsSquare_v<MT2> && !isSquare( ~rhs ) ) ) {
1084  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to strictly upper matrix" );
1085  }
1086 
1087  if( IsStrictlyUpper_v<MT2> ) {
1088  matrix_ += ~rhs;
1089  }
1090  else {
1091  const ResultType_t<MT2> tmp( ~rhs );
1092 
1093  if( !isStrictlyUpper( tmp ) ) {
1094  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to strictly upper matrix" );
1095  }
1096 
1097  matrix_ += declupp( tmp );
1098  }
1099 
1100  if( !IsStrictlyUpper_v<MT2> )
1101  resetLower();
1102 
1103  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly upper matrix detected" );
1104  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1105 
1106  return *this;
1107 }
1109 //*************************************************************************************************
1110 
1111 
1112 //*************************************************************************************************
1125 template< typename MT // Type of the adapted sparse matrix
1126  , bool SO > // Storage order of the adapted sparse matrix
1127 template< typename MT2 // Type of the right-hand side matrix
1128  , bool SO2 > // Storage order of the right-hand side matrix
1129 inline auto StrictlyUpperMatrix<MT,SO,false>::operator-=( const Matrix<MT2,SO2>& rhs )
1130  -> DisableIf_t< IsComputation_v<MT2>, StrictlyUpperMatrix& >
1131 {
1132  if( IsUniTriangular_v<MT2> ||
1133  ( !IsStrictlyUpper_v<MT2> && !isStrictlyUpper( ~rhs ) ) ) {
1134  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to strictly upper matrix" );
1135  }
1136 
1137  matrix_ -= declupp( ~rhs );
1138 
1139  if( !IsStrictlyUpper_v<MT2> )
1140  resetLower();
1141 
1142  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly upper matrix detected" );
1143  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1144 
1145  return *this;
1146 }
1148 //*************************************************************************************************
1149 
1150 
1151 //*************************************************************************************************
1164 template< typename MT // Type of the adapted sparse matrix
1165  , bool SO > // Storage order of the adapted sparse matrix
1166 template< typename MT2 // Type of the right-hand side matrix
1167  , bool SO2 > // Storage order of the right-hand side matrix
1168 inline auto StrictlyUpperMatrix<MT,SO,false>::operator-=( const Matrix<MT2,SO2>& rhs )
1169  -> EnableIf_t< IsComputation_v<MT2>, StrictlyUpperMatrix& >
1170 {
1171  if( IsUniTriangular_v<MT2> || ( !IsSquare_v<MT2> && !isSquare( ~rhs ) ) ) {
1172  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to strictly upper matrix" );
1173  }
1174 
1175  if( IsStrictlyUpper_v<MT2> ) {
1176  matrix_ -= ~rhs;
1177  }
1178  else {
1179  const ResultType_t<MT2> tmp( ~rhs );
1180 
1181  if( !isStrictlyUpper( tmp ) ) {
1182  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to strictly upper matrix" );
1183  }
1184 
1185  matrix_ -= declupp( tmp );
1186  }
1187 
1188  if( !IsStrictlyUpper_v<MT2> )
1189  resetLower();
1190 
1191  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly upper matrix detected" );
1192  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1193 
1194  return *this;
1195 }
1197 //*************************************************************************************************
1198 
1199 
1200 //*************************************************************************************************
1211 template< typename MT // Type of the adapted sparse matrix
1212  , bool SO > // Storage order of the adapted sparse matrix
1213 template< typename MT2 // Type of the right-hand side matrix
1214  , bool SO2 > // Storage order of the right-hand side matrix
1215 inline auto StrictlyUpperMatrix<MT,SO,false>::operator%=( const Matrix<MT2,SO2>& rhs )
1216  -> StrictlyUpperMatrix&
1217 {
1218  if( !IsSquare_v<MT2> && !isSquare( ~rhs ) ) {
1219  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to strictly upper matrix" );
1220  }
1221 
1222  matrix_ %= ~rhs;
1223 
1224  if( !IsStrictlyUpper_v<MT2> )
1225  resetLower();
1226 
1227  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly upper matrix detected" );
1228  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1229 
1230  return *this;
1231 }
1233 //*************************************************************************************************
1234 
1235 
1236 
1237 
1238 //=================================================================================================
1239 //
1240 // UTILITY FUNCTIONS
1241 //
1242 //=================================================================================================
1243 
1244 //*************************************************************************************************
1250 template< typename MT // Type of the adapted sparse matrix
1251  , bool SO > // Storage order of the adapted sparse matrix
1252 inline size_t StrictlyUpperMatrix<MT,SO,false>::rows() const noexcept
1253 {
1254  return matrix_.rows();
1255 }
1257 //*************************************************************************************************
1258 
1259 
1260 //*************************************************************************************************
1266 template< typename MT // Type of the adapted sparse matrix
1267  , bool SO > // Storage order of the adapted sparse matrix
1268 inline size_t StrictlyUpperMatrix<MT,SO,false>::columns() const noexcept
1269 {
1270  return matrix_.columns();
1271 }
1273 //*************************************************************************************************
1274 
1275 
1276 //*************************************************************************************************
1282 template< typename MT // Type of the adapted sparse matrix
1283  , bool SO > // Storage order of the adapted sparse matrix
1284 inline size_t StrictlyUpperMatrix<MT,SO,false>::capacity() const noexcept
1285 {
1286  return matrix_.capacity();
1287 }
1289 //*************************************************************************************************
1290 
1291 
1292 //*************************************************************************************************
1304 template< typename MT // Type of the adapted sparse matrix
1305  , bool SO > // Storage order of the adapted sparse matrix
1306 inline size_t StrictlyUpperMatrix<MT,SO,false>::capacity( size_t i ) const noexcept
1307 {
1308  return matrix_.capacity(i);
1309 }
1311 //*************************************************************************************************
1312 
1313 
1314 //*************************************************************************************************
1320 template< typename MT // Type of the adapted sparse matrix
1321  , bool SO > // Storage order of the adapted sparse matrix
1322 inline size_t StrictlyUpperMatrix<MT,SO,false>::nonZeros() const
1323 {
1324  return matrix_.nonZeros();
1325 }
1327 //*************************************************************************************************
1328 
1329 
1330 //*************************************************************************************************
1342 template< typename MT // Type of the adapted sparse matrix
1343  , bool SO > // Storage order of the adapted sparse matrix
1344 inline size_t StrictlyUpperMatrix<MT,SO,false>::nonZeros( size_t i ) const
1345 {
1346  return matrix_.nonZeros(i);
1347 }
1349 //*************************************************************************************************
1350 
1351 
1352 //*************************************************************************************************
1358 template< typename MT // Type of the adapted sparse matrix
1359  , bool SO > // Storage order of the adapted sparse matrix
1361 {
1362  using blaze::erase;
1363 
1364  if( SO ) {
1365  for( size_t j=1UL; j<columns(); ++j ) {
1366  erase( matrix_, j, matrix_.begin(j), matrix_.lowerBound(j,j) );
1367  }
1368  }
1369  else {
1370  for( size_t i=0UL; i<rows(); ++i ) {
1371  erase( matrix_, i, matrix_.lowerBound(i,i+1UL), matrix_.end(i) );
1372  }
1373  }
1374 }
1376 //*************************************************************************************************
1377 
1378 
1379 //*************************************************************************************************
1392 template< typename MT // Type of the adapted sparse matrix
1393  , bool SO > // Storage order of the adapted sparse matrix
1394 inline void StrictlyUpperMatrix<MT,SO,false>::reset( size_t i )
1395 {
1396  using blaze::erase;
1397 
1398  if( SO ) {
1399  erase( matrix_, i, matrix_.begin(i), matrix_.lowerBound(i,i) );
1400  }
1401  else {
1402  erase( matrix_, i, matrix_.lowerBound(i,i+1UL), matrix_.end(i) );
1403  }
1404 }
1406 //*************************************************************************************************
1407 
1408 
1409 //*************************************************************************************************
1417 template< typename MT // Type of the adapted sparse matrix
1418  , bool SO > // Storage order of the adapted sparse matrix
1420 {
1421  using blaze::clear;
1422 
1423  if( IsResizable_v<MT> ) {
1424  clear( matrix_ );
1425  }
1426  else {
1427  reset();
1428  }
1429 }
1431 //*************************************************************************************************
1432 
1433 
1434 //*************************************************************************************************
1449 template< typename MT // Type of the adapted sparse matrix
1450  , bool SO > // Storage order of the adapted sparse matrix
1451 void StrictlyUpperMatrix<MT,SO,false>::resize( size_t n, bool preserve )
1452 {
1454 
1455  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly upper matrix detected" );
1456 
1457  matrix_.resize( n, n, preserve );
1458 }
1460 //*************************************************************************************************
1461 
1462 
1463 //*************************************************************************************************
1474 template< typename MT // Type of the adapted sparse matrix
1475  , bool SO > // Storage order of the adapted sparse matrix
1476 inline void StrictlyUpperMatrix<MT,SO,false>::reserve( size_t nonzeros )
1477 {
1478  matrix_.reserve( nonzeros );
1479 }
1481 //*************************************************************************************************
1482 
1483 
1484 //*************************************************************************************************
1499 template< typename MT // Type of the adapted sparse matrix
1500  , bool SO > // Storage order of the adapted sparse matrix
1501 inline void StrictlyUpperMatrix<MT,SO,false>::reserve( size_t i, size_t nonzeros )
1502 {
1503  matrix_.reserve( i, nonzeros );
1504 }
1506 //*************************************************************************************************
1507 
1508 
1509 //*************************************************************************************************
1520 template< typename MT // Type of the adapted sparse matrix
1521  , bool SO > // Storage order of the adapted sparse matrix
1522 inline void StrictlyUpperMatrix<MT,SO,false>::trim()
1523 {
1524  matrix_.trim();
1525 }
1527 //*************************************************************************************************
1528 
1529 
1530 //*************************************************************************************************
1542 template< typename MT // Type of the adapted sparse matrix
1543  , bool SO > // Storage order of the adapted sparse matrix
1544 inline void StrictlyUpperMatrix<MT,SO,false>::trim( size_t i )
1545 {
1546  matrix_.trim( i );
1547 }
1549 //*************************************************************************************************
1550 
1551 
1552 //*************************************************************************************************
1562 template< typename MT // Type of the adapted sparse matrix
1563  , bool SO > // Storage order of the adapted sparse matrix
1565 {
1566  matrix_.shrinkToFit();
1567 }
1569 //*************************************************************************************************
1570 
1571 
1572 //*************************************************************************************************
1579 template< typename MT // Type of the adapted sparse matrix
1580  , bool SO > // Storage order of the adapted sparse matrix
1581 inline void StrictlyUpperMatrix<MT,SO,false>::swap( StrictlyUpperMatrix& m ) noexcept
1582 {
1583  using std::swap;
1584 
1585  swap( matrix_, m.matrix_ );
1586 }
1588 //*************************************************************************************************
1589 
1590 
1591 //*************************************************************************************************
1603 template< typename MT // Type of the adapted dense matrix
1604  , bool SO > // Storage order of the adapted dense matrix
1605 inline constexpr size_t StrictlyUpperMatrix<MT,SO,false>::maxNonZeros() noexcept
1606 {
1608 
1609  return maxNonZeros( Size_v<MT,0UL> );
1610 }
1612 //*************************************************************************************************
1613 
1614 
1615 //*************************************************************************************************
1625 template< typename MT // Type of the adapted dense matrix
1626  , bool SO > // Storage order of the adapted dense matrix
1627 inline constexpr size_t StrictlyUpperMatrix<MT,SO,false>::maxNonZeros( size_t n ) noexcept
1628 {
1629  return ( ( n - 1UL ) * n ) / 2UL;
1630 }
1632 //*************************************************************************************************
1633 
1634 
1635 //*************************************************************************************************
1641 template< typename MT // Type of the adapted dense matrix
1642  , bool SO > // Storage order of the adapted dense matrix
1643 inline void StrictlyUpperMatrix<MT,SO,false>::resetLower()
1644 {
1645  using blaze::erase;
1646 
1647  if( SO ) {
1648  for( size_t j=0UL; j<columns(); ++j )
1649  erase( matrix_, j, matrix_.upperBound( j, j ), matrix_.end( j ) );
1650  }
1651  else {
1652  for( size_t i=1UL; i<rows(); ++i )
1653  erase( matrix_, i, matrix_.begin( i ), matrix_.lowerBound( i, i ) );
1654  }
1655 }
1657 //*************************************************************************************************
1658 
1659 
1660 
1661 
1662 //=================================================================================================
1663 //
1664 // INSERTION FUNCTIONS
1665 //
1666 //=================================================================================================
1667 
1668 //*************************************************************************************************
1684 template< typename MT // Type of the adapted sparse matrix
1685  , bool SO > // Storage order of the adapted sparse matrix
1687  StrictlyUpperMatrix<MT,SO,false>::set( size_t i, size_t j, const ElementType& value )
1688 {
1689  if( i >= j ) {
1690  BLAZE_THROW_INVALID_ARGUMENT( "Invalid access to diagonal or lower matrix element" );
1691  }
1692 
1693  return matrix_.set( i, j, value );
1694 }
1696 //*************************************************************************************************
1697 
1698 
1699 //*************************************************************************************************
1716 template< typename MT // Type of the adapted sparse matrix
1717  , bool SO > // Storage order of the adapted sparse matrix
1719  StrictlyUpperMatrix<MT,SO,false>::insert( size_t i, size_t j, const ElementType& value )
1720 {
1721  if( i >= j ) {
1722  BLAZE_THROW_INVALID_ARGUMENT( "Invalid access to diagonal or lower matrix element" );
1723  }
1724 
1725  return matrix_.insert( i, j, value );
1726 }
1728 //*************************************************************************************************
1729 
1730 
1731 //*************************************************************************************************
1781 template< typename MT // Type of the adapted sparse matrix
1782  , bool SO > // Storage order of the adapted sparse matrix
1783 inline void StrictlyUpperMatrix<MT,SO,false>::append( size_t i, size_t j, const ElementType& value, bool check )
1784 {
1785  if( i >= j ) {
1786  BLAZE_THROW_INVALID_ARGUMENT( "Invalid access to diagonal or lower matrix element" );
1787  }
1788 
1789  matrix_.append( i, j, value, check );
1790 }
1792 //*************************************************************************************************
1793 
1794 
1795 //*************************************************************************************************
1809 template< typename MT // Type of the adapted sparse matrix
1810  , bool SO > // Storage order of the adapted sparse matrix
1811 inline void StrictlyUpperMatrix<MT,SO,false>::finalize( size_t i )
1812 {
1813  matrix_.finalize( i );
1814 }
1816 //*************************************************************************************************
1817 
1818 
1819 
1820 
1821 //=================================================================================================
1822 //
1823 // ERASE FUNCTIONS
1824 //
1825 //=================================================================================================
1826 
1827 //*************************************************************************************************
1837 template< typename MT // Type of the adapted sparse matrix
1838  , bool SO > // Storage order of the adapted sparse matrix
1839 inline void StrictlyUpperMatrix<MT,SO,false>::erase( size_t i, size_t j )
1840 {
1841  using blaze::erase;
1842 
1843  erase( matrix_, i, j );
1844 }
1846 //*************************************************************************************************
1847 
1848 
1849 //*************************************************************************************************
1861 template< typename MT // Type of the adapted sparse matrix
1862  , bool SO > // Storage order of the adapted sparse matrix
1864  StrictlyUpperMatrix<MT,SO,false>::erase( size_t i, Iterator pos )
1865 {
1866  using blaze::erase;
1867 
1868  return erase( matrix_, i, pos );
1869 }
1871 //*************************************************************************************************
1872 
1873 
1874 //*************************************************************************************************
1888 template< typename MT // Type of the adapted sparse matrix
1889  , bool SO > // Storage order of the adapted sparse matrix
1891  StrictlyUpperMatrix<MT,SO,false>::erase( size_t i, Iterator first, Iterator last )
1892 {
1893  using blaze::erase;
1894 
1895  return erase( matrix_, i, first, last );
1896 }
1898 //*************************************************************************************************
1899 
1900 
1901 //*************************************************************************************************
1923 template< typename MT // Type of the adapted sparse matrix
1924  , bool SO > // Storage order of the adapted sparse matrix
1925 template< typename Pred > // Type of the unary predicate
1926 inline void StrictlyUpperMatrix<MT,SO,false>::erase( Pred predicate )
1927 {
1928  using blaze::erase;
1929 
1930  erase( matrix_, predicate );
1931 
1932  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1933 }
1935 //*************************************************************************************************
1936 
1937 
1938 //*************************************************************************************************
1966 template< typename MT // Type of the adapted sparse matrix
1967  , bool SO > // Storage order of the adapted sparse matrix
1968 template< typename Pred > // Type of the unary predicate
1969 inline void StrictlyUpperMatrix<MT,SO,false>::erase( size_t i, Iterator first, Iterator last, Pred predicate )
1970 {
1971  using blaze::erase;
1972 
1973  erase( matrix_, i, first, last, predicate );
1974 
1975  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1976 }
1978 //*************************************************************************************************
1979 
1980 
1981 
1982 
1983 //=================================================================================================
1984 //
1985 // LOOKUP FUNCTIONS
1986 //
1987 //=================================================================================================
1988 
1989 //*************************************************************************************************
2005 template< typename MT // Type of the adapted sparse matrix
2006  , bool SO > // Storage order of the adapted sparse matrix
2008  StrictlyUpperMatrix<MT,SO,false>::find( size_t i, size_t j )
2009 {
2010  return matrix_.find( i, j );
2011 }
2013 //*************************************************************************************************
2014 
2015 
2016 //*************************************************************************************************
2032 template< typename MT // Type of the adapted sparse matrix
2033  , bool SO > // Storage order of the adapted sparse matrix
2035  StrictlyUpperMatrix<MT,SO,false>::find( size_t i, size_t j ) const
2036 {
2037  return matrix_.find( i, j );
2038 }
2040 //*************************************************************************************************
2041 
2042 
2043 //*************************************************************************************************
2059 template< typename MT // Type of the adapted sparse matrix
2060  , bool SO > // Storage order of the adapted sparse matrix
2062  StrictlyUpperMatrix<MT,SO,false>::lowerBound( size_t i, size_t j )
2063 {
2064  return matrix_.lowerBound( i, j );
2065 }
2067 //*************************************************************************************************
2068 
2069 
2070 //*************************************************************************************************
2086 template< typename MT // Type of the adapted sparse matrix
2087  , bool SO > // Storage order of the adapted sparse matrix
2089  StrictlyUpperMatrix<MT,SO,false>::lowerBound( size_t i, size_t j ) const
2090 {
2091  return matrix_.lowerBound( i, j );
2092 }
2094 //*************************************************************************************************
2095 
2096 
2097 //*************************************************************************************************
2113 template< typename MT // Type of the adapted sparse matrix
2114  , bool SO > // Storage order of the adapted sparse matrix
2116  StrictlyUpperMatrix<MT,SO,false>::upperBound( size_t i, size_t j )
2117 {
2118  return matrix_.upperBound( i, j );
2119 }
2121 //*************************************************************************************************
2122 
2123 
2124 //*************************************************************************************************
2140 template< typename MT // Type of the adapted sparse matrix
2141  , bool SO > // Storage order of the adapted sparse matrix
2143  StrictlyUpperMatrix<MT,SO,false>::upperBound( size_t i, size_t j ) const
2144 {
2145  return matrix_.upperBound( i, j );
2146 }
2148 //*************************************************************************************************
2149 
2150 
2151 
2152 
2153 //=================================================================================================
2154 //
2155 // NUMERIC FUNCTIONS
2156 //
2157 //=================================================================================================
2158 
2159 //*************************************************************************************************
2177 template< typename MT // Type of the adapted sparse matrix
2178  , bool SO > // Storage order of the adapted sparse matrix
2179 template< typename Other > // Data type of the scalar value
2180 inline StrictlyUpperMatrix<MT,SO,false>&
2181  StrictlyUpperMatrix<MT,SO,false>::scale( const Other& scalar )
2182 {
2183  matrix_.scale( scalar );
2184  return *this;
2185 }
2187 //*************************************************************************************************
2188 
2189 
2190 
2191 
2192 //=================================================================================================
2193 //
2194 // DEBUGGING FUNCTIONS
2195 //
2196 //=================================================================================================
2197 
2198 //*************************************************************************************************
2208 template< typename MT // Type of the adapted sparse matrix
2209  , bool SO > // Storage order of the adapted sparse matrix
2210 inline bool StrictlyUpperMatrix<MT,SO,false>::isIntact() const noexcept
2211 {
2212  using blaze::isIntact;
2213 
2214  return ( isIntact( matrix_ ) && isStrictlyUpper( matrix_ ) );
2215 }
2217 //*************************************************************************************************
2218 
2219 
2220 
2221 
2222 //=================================================================================================
2223 //
2224 // EXPRESSION TEMPLATE EVALUATION FUNCTIONS
2225 //
2226 //=================================================================================================
2227 
2228 //*************************************************************************************************
2239 template< typename MT // Type of the adapted sparse matrix
2240  , bool SO > // Storage order of the adapted sparse matrix
2241 template< typename Other > // Data type of the foreign expression
2242 inline bool StrictlyUpperMatrix<MT,SO,false>::canAlias( const Other* alias ) const noexcept
2243 {
2244  return matrix_.canAlias( alias );
2245 }
2247 //*************************************************************************************************
2248 
2249 
2250 //*************************************************************************************************
2261 template< typename MT // Type of the adapted sparse matrix
2262  , bool SO > // Storage order of the adapted sparse matrix
2263 template< typename Other > // Data type of the foreign expression
2264 inline bool StrictlyUpperMatrix<MT,SO,false>::isAliased( const Other* alias ) const noexcept
2265 {
2266  return matrix_.isAliased( alias );
2267 }
2269 //*************************************************************************************************
2270 
2271 
2272 //*************************************************************************************************
2283 template< typename MT // Type of the adapted sparse matrix
2284  , bool SO > // Storage order of the adapted sparse matrix
2285 inline bool StrictlyUpperMatrix<MT,SO,false>::canSMPAssign() const noexcept
2286 {
2287  return matrix_.canSMPAssign();
2288 }
2290 //*************************************************************************************************
2291 
2292 } // namespace blaze
2293 
2294 #endif
Header file for the StrictlyUpperProxy class.
#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
#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.
#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
decltype(auto) declupp(const DenseMatrix< MT, SO > &dm)
Declares the given dense matrix expression dm as upper.
Definition: DMatDeclUppExpr.h:1002
#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.
Header file for the IsStrictlyUpper type trait.
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.
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.
void clear(const DiagonalProxy< MT > &proxy)
Clearing the represented element.
Definition: DiagonalProxy.h:611
Header file for the implementation of the base template of the StrictlyUpperMatrix.
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
bool isStrictlyUpper(const DenseMatrix< MT, SO > &dm)
Checks if the given dense matrix is a strictly upper triangular matrix.
Definition: DenseMatrix.h:1446
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.
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.