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 <algorithm>
44 #include <stdexcept>
45 #include <vector>
57 #include <blaze/math/Functions.h>
58 #include <blaze/math/shims/Clear.h>
60 #include <blaze/math/shims/Move.h>
68 #include <blaze/util/Assert.h>
73 #include <blaze/util/DisableIf.h>
74 #include <blaze/util/EnableIf.h>
76 #include <blaze/util/Types.h>
77 
78 
79 namespace blaze {
80 
81 //=================================================================================================
82 //
83 // CLASS TEMPLATE SPECIALIZATION FOR SPARSE MATRICES
84 //
85 //=================================================================================================
86 
87 //*************************************************************************************************
95 template< typename MT // Type of the adapted sparse matrix
96  , bool SO > // Storage order of the adapted sparse matrix
97 class StrictlyUpperMatrix<MT,SO,false>
98  : public SparseMatrix< StrictlyUpperMatrix<MT,SO,false>, SO >
99 {
100  private:
101  //**Type definitions****************************************************************************
102  typedef typename MT::OppositeType OT;
103  typedef typename MT::TransposeType TT;
104  typedef typename MT::ElementType ET;
105  //**********************************************************************************************
106 
107  public:
108  //**Type definitions****************************************************************************
109  typedef StrictlyUpperMatrix<MT,SO,false> This;
110  typedef This ResultType;
111  typedef StrictlyUpperMatrix<OT,!SO,false> OppositeType;
112  typedef StrictlyLowerMatrix<TT,!SO,false> TransposeType;
113  typedef ET ElementType;
114  typedef typename MT::ReturnType ReturnType;
115  typedef const This& CompositeType;
116  typedef StrictlyUpperProxy<MT> Reference;
117  typedef typename MT::ConstReference ConstReference;
118  typedef typename MT::Iterator Iterator;
119  typedef typename MT::ConstIterator ConstIterator;
120  //**********************************************************************************************
121 
122  //**Rebind struct definition********************************************************************
125  template< typename ET > // Data type of the other matrix
126  struct Rebind {
128  typedef StrictlyUpperMatrix< typename MT::template Rebind<ET>::Other > Other;
129  };
130  //**********************************************************************************************
131 
132  //**Compilation flags***************************************************************************
134  enum { smpAssignable = 0 };
135  //**********************************************************************************************
136 
137  //**Constructors********************************************************************************
140  explicit inline StrictlyUpperMatrix();
141  explicit inline StrictlyUpperMatrix( size_t n );
142  explicit inline StrictlyUpperMatrix( size_t n, size_t nonzeros );
143  explicit inline StrictlyUpperMatrix( size_t n, const std::vector<size_t>& nonzeros );
144 
145  inline StrictlyUpperMatrix( const StrictlyUpperMatrix& m );
146  template< typename MT2, bool SO2 > inline StrictlyUpperMatrix( const Matrix<MT2,SO2>& m );
148  //**********************************************************************************************
149 
150  //**Destructor**********************************************************************************
151  // No explicitly declared destructor.
152  //**********************************************************************************************
153 
154  //**Data access functions***********************************************************************
157  inline Reference operator()( size_t i, size_t j );
158  inline ConstReference operator()( size_t i, size_t j ) const;
159  inline Iterator begin ( size_t i );
160  inline ConstIterator begin ( size_t i ) const;
161  inline ConstIterator cbegin( size_t i ) const;
162  inline Iterator end ( size_t i );
163  inline ConstIterator end ( size_t i ) const;
164  inline ConstIterator cend ( size_t i ) const;
166  //**********************************************************************************************
167 
168  //**Assignment operators************************************************************************
171  inline StrictlyUpperMatrix& operator=( const StrictlyUpperMatrix& rhs );
172 
173  template< typename MT2, bool SO2 >
174  inline typename DisableIf< IsComputation<MT2>, StrictlyUpperMatrix& >::Type
175  operator=( const Matrix<MT2,SO2>& rhs );
176 
177  template< typename MT2, bool SO2 >
178  inline typename EnableIf< IsComputation<MT2>, StrictlyUpperMatrix& >::Type
179  operator=( const Matrix<MT2,SO2>& rhs );
180 
181  template< typename MT2, bool SO2 >
182  inline typename DisableIf< IsComputation<MT2>, StrictlyUpperMatrix& >::Type
183  operator+=( const Matrix<MT2,SO2>& rhs );
184 
185  template< typename MT2, bool SO2 >
186  inline typename EnableIf< IsComputation<MT2>, StrictlyUpperMatrix& >::Type
187  operator+=( const Matrix<MT2,SO2>& rhs );
188 
189  template< typename MT2, bool SO2 >
190  inline typename DisableIf< IsComputation<MT2>, StrictlyUpperMatrix& >::Type
191  operator-=( const Matrix<MT2,SO2>& rhs );
192 
193  template< typename MT2, bool SO2 >
194  inline typename EnableIf< IsComputation<MT2>, StrictlyUpperMatrix& >::Type
195  operator-=( const Matrix<MT2,SO2>& rhs );
196 
197  template< typename MT2, bool SO2 >
198  inline StrictlyUpperMatrix& operator*=( const Matrix<MT2,SO2>& rhs );
199 
200  template< typename Other >
201  inline typename EnableIf< IsNumeric<Other>, StrictlyUpperMatrix >::Type&
202  operator*=( Other rhs );
203 
204  template< typename Other >
205  inline typename EnableIf< IsNumeric<Other>, StrictlyUpperMatrix >::Type&
206  operator/=( Other rhs );
208  //**********************************************************************************************
209 
210  //**Utility functions***************************************************************************
213  inline size_t rows() const;
214  inline size_t columns() const;
215  inline size_t capacity() const;
216  inline size_t capacity( size_t i ) const;
217  inline size_t nonZeros() const;
218  inline size_t nonZeros( size_t i ) const;
219  inline void reset();
220  inline void reset( size_t i );
221  inline void clear();
222  inline Iterator set( size_t i, size_t j, const ElementType& value );
223  inline Iterator insert( size_t i, size_t j, const ElementType& value );
224  inline void erase( size_t i, size_t j );
225  inline Iterator erase( size_t i, Iterator pos );
226  inline Iterator erase( size_t i, Iterator first, Iterator last );
227  inline void resize ( size_t n, bool preserve=true );
228  inline void reserve( size_t nonzeros );
229  inline void reserve( size_t i, size_t nonzeros );
230  inline void trim();
231  inline void trim( size_t i );
232 
233  template< typename Other > inline StrictlyUpperMatrix& scale( const Other& scalar );
234  template< typename Other > inline StrictlyUpperMatrix& scaleDiagonal( Other scale );
235 
236  inline void swap( StrictlyUpperMatrix& m ) /* throw() */;
237 
238  static inline size_t maxNonZeros();
239  static inline size_t maxNonZeros( size_t n );
241  //**********************************************************************************************
242 
243  //**Lookup functions****************************************************************************
246  inline Iterator find ( size_t i, size_t j );
247  inline ConstIterator find ( size_t i, size_t j ) const;
248  inline Iterator lowerBound( size_t i, size_t j );
249  inline ConstIterator lowerBound( size_t i, size_t j ) const;
250  inline Iterator upperBound( size_t i, size_t j );
251  inline ConstIterator upperBound( size_t i, size_t j ) const;
253  //**********************************************************************************************
254 
255  //**Low-level utility functions*****************************************************************
258  inline void append ( size_t i, size_t j, const ElementType& value, bool check=false );
259  inline void finalize( size_t i );
261  //**********************************************************************************************
262 
263  //**Expression template evaluation functions****************************************************
266  template< typename Other > inline bool canAlias ( const Other* alias ) const;
267  template< typename Other > inline bool isAliased( const Other* alias ) const;
268 
269  inline bool canSMPAssign() const;
271  //**********************************************************************************************
272 
273  private:
274  //**Utility functions***************************************************************************
277  inline void resetLower();
279  //**********************************************************************************************
280 
281  //**Member variables****************************************************************************
284  MT matrix_;
285 
286  //**********************************************************************************************
287 
288  //**Friend declarations*************************************************************************
289  template< typename MT2, bool SO2, bool DF2 >
290  friend MT2& derestrict( StrictlyUpperMatrix<MT2,SO2,DF2>& m );
291  //**********************************************************************************************
292 
293  //**Compile time checks*************************************************************************
305  BLAZE_STATIC_ASSERT( IsResizable<MT>::value || IsSquare<MT>::value );
306  //**********************************************************************************************
307 };
309 //*************************************************************************************************
310 
311 
312 
313 
314 //=================================================================================================
315 //
316 // CONSTRUCTORS
317 //
318 //=================================================================================================
319 
320 //*************************************************************************************************
324 template< typename MT // Type of the adapted sparse matrix
325  , bool SO > // Storage order of the adapted sparse matrix
326 inline StrictlyUpperMatrix<MT,SO,false>::StrictlyUpperMatrix()
327  : matrix_() // The adapted sparse matrix
328 {
329  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly upper matrix detected" );
330 }
332 //*************************************************************************************************
333 
334 
335 //*************************************************************************************************
343 template< typename MT // Type of the adapted sparse matrix
344  , bool SO > // Storage order of the adapted sparse matrix
345 inline StrictlyUpperMatrix<MT,SO,false>::StrictlyUpperMatrix( size_t n )
346  : matrix_( n, n, n ) // The adapted sparse matrix
347 {
349 
350  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly upper matrix detected" );
351 }
353 //*************************************************************************************************
354 
355 
356 //*************************************************************************************************
366 template< typename MT // Type of the adapted sparse matrix
367  , bool SO > // Storage order of the adapted sparse matrix
368 inline StrictlyUpperMatrix<MT,SO,false>::StrictlyUpperMatrix( size_t n, size_t nonzeros )
369  : matrix_( n, n, max( nonzeros, n ) ) // The adapted sparse matrix
370 {
372 
373  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly upper matrix detected" );
374 }
376 //*************************************************************************************************
377 
378 
379 //*************************************************************************************************
393 template< typename MT // Type of the adapted sparse matrix
394  , bool SO > // Storage order of the adapted sparse matrix
395 inline StrictlyUpperMatrix<MT,SO,false>::StrictlyUpperMatrix( size_t n, const std::vector<size_t>& nonzeros )
396  : matrix_( n, n, nonzeros ) // The adapted sparse matrix
397 {
399 
400  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly upper matrix detected" );
401 }
403 //*************************************************************************************************
404 
405 
406 //*************************************************************************************************
412 template< typename MT // Type of the adapted sparse matrix
413  , bool SO > // Storage order of the adapted sparse matrix
414 inline StrictlyUpperMatrix<MT,SO,false>::StrictlyUpperMatrix( const StrictlyUpperMatrix& m )
415  : matrix_( m.matrix_ ) // The adapted sparse matrix
416 {
417  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly upper matrix detected" );
418 }
420 //*************************************************************************************************
421 
422 
423 //*************************************************************************************************
434 template< typename MT // Type of the adapted sparse matrix
435  , bool SO > // Storage order of the adapted sparse matrix
436 template< typename MT2 // Type of the foreign matrix
437  , bool SO2 > // Storage order of the foreign matrix
438 inline StrictlyUpperMatrix<MT,SO,false>::StrictlyUpperMatrix( const Matrix<MT2,SO2>& m )
439  : matrix_( ~m ) // The adapted sparse matrix
440 {
441  if( IsUniTriangular<MT2>::value ||
442  ( !IsStrictlyUpper<MT2>::value && !isStrictlyUpper( matrix_ ) ) )
443  throw std::invalid_argument( "Invalid setup of strictly upper matrix" );
444 
445  if( !IsStrictlyUpper<MT2>::value )
446  resetLower();
447 
448  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly upper matrix detected" );
449 }
451 //*************************************************************************************************
452 
453 
454 
455 
456 //=================================================================================================
457 //
458 // DATA ACCESS FUNCTIONS
459 //
460 //=================================================================================================
461 
462 //*************************************************************************************************
474 template< typename MT // Type of the adapted sparse matrix
475  , bool SO > // Storage order of the adapted sparse matrix
477  StrictlyUpperMatrix<MT,SO,false>::operator()( size_t i, size_t j )
478 {
479  BLAZE_USER_ASSERT( i<rows() , "Invalid row access index" );
480  BLAZE_USER_ASSERT( j<columns(), "Invalid column access index" );
481 
482  return Reference( matrix_, i, j );
483 }
485 //*************************************************************************************************
486 
487 
488 //*************************************************************************************************
500 template< typename MT // Type of the adapted sparse matrix
501  , bool SO > // Storage order of the adapted sparse matrix
503  StrictlyUpperMatrix<MT,SO,false>::operator()( size_t i, size_t j ) const
504 {
505  BLAZE_USER_ASSERT( i<rows() , "Invalid row access index" );
506  BLAZE_USER_ASSERT( j<columns(), "Invalid column access index" );
507 
508  return matrix_(i,j);
509 }
511 //*************************************************************************************************
512 
513 
514 //*************************************************************************************************
526 template< typename MT // Type of the adapted sparse matrix
527  , bool SO > // Storage order of the adapted sparse matrix
530 {
531  return matrix_.begin(i);
532 }
534 //*************************************************************************************************
535 
536 
537 //*************************************************************************************************
549 template< typename MT // Type of the adapted sparse matrix
550  , bool SO > // Storage order of the adapted sparse matrix
553 {
554  return matrix_.begin(i);
555 }
557 //*************************************************************************************************
558 
559 
560 //*************************************************************************************************
572 template< typename MT // Type of the adapted sparse matrix
573  , bool SO > // Storage order of the adapted sparse matrix
576 {
577  return matrix_.cbegin(i);
578 }
580 //*************************************************************************************************
581 
582 
583 //*************************************************************************************************
595 template< typename MT // Type of the adapted sparse matrix
596  , bool SO > // Storage order of the adapted sparse matrix
599 {
600  return matrix_.end(i);
601 }
603 //*************************************************************************************************
604 
605 
606 //*************************************************************************************************
618 template< typename MT // Type of the adapted sparse matrix
619  , bool SO > // Storage order of the adapted sparse matrix
621  StrictlyUpperMatrix<MT,SO,false>::end( size_t i ) const
622 {
623  return matrix_.end(i);
624 }
626 //*************************************************************************************************
627 
628 
629 //*************************************************************************************************
641 template< typename MT // Type of the adapted sparse matrix
642  , bool SO > // Storage order of the adapted sparse matrix
645 {
646  return matrix_.cend(i);
647 }
649 //*************************************************************************************************
650 
651 
652 
653 
654 //=================================================================================================
655 //
656 // ASSIGNMENT OPERATORS
657 //
658 //=================================================================================================
659 
660 //*************************************************************************************************
670 template< typename MT // Type of the adapted sparse matrix
671  , bool SO > // Storage order of the adapted sparse matrix
672 inline StrictlyUpperMatrix<MT,SO,false>&
673  StrictlyUpperMatrix<MT,SO,false>::operator=( const StrictlyUpperMatrix& rhs )
674 {
675  matrix_ = rhs.matrix_;
676 
677  return *this;
678 }
680 //*************************************************************************************************
681 
682 
683 //*************************************************************************************************
696 template< typename MT // Type of the adapted sparse matrix
697  , bool SO > // Storage order of the adapted sparse matrix
698 template< typename MT2 // Type of the right-hand side matrix
699  , bool SO2 > // Storage order of the right-hand side matrix
700 inline typename DisableIf< IsComputation<MT2>, StrictlyUpperMatrix<MT,SO,false>& >::Type
701  StrictlyUpperMatrix<MT,SO,false>::operator=( const Matrix<MT2,SO2>& rhs )
702 {
703  if( IsUniTriangular<MT2>::value ||
704  ( !IsStrictlyUpper<MT2>::value && !isStrictlyUpper( ~rhs ) ) )
705  throw std::invalid_argument( "Invalid assignment to strictly upper matrix" );
706 
707  matrix_ = ~rhs;
708 
709  if( !IsStrictlyUpper<MT2>::value )
710  resetLower();
711 
712  return *this;
713 }
715 //*************************************************************************************************
716 
717 
718 //*************************************************************************************************
731 template< typename MT // Type of the adapted sparse matrix
732  , bool SO > // Storage order of the adapted sparse matrix
733 template< typename MT2 // Type of the right-hand side matrix
734  , bool SO2 > // Storage order of the right-hand side matrix
735 inline typename EnableIf< IsComputation<MT2>, StrictlyUpperMatrix<MT,SO,false>& >::Type
736  StrictlyUpperMatrix<MT,SO,false>::operator=( const Matrix<MT2,SO2>& rhs )
737 {
738  if( IsUniTriangular<MT2>::value || ( !IsSquare<MT2>::value && !isSquare( ~rhs ) ) )
739  throw std::invalid_argument( "Invalid assignment to strictly upper matrix" );
740 
741  if( IsStrictlyUpper<MT2>::value ) {
742  matrix_ = ~rhs;
743  }
744  else {
745  MT tmp( ~rhs );
746 
747  if( !isStrictlyUpper( tmp ) )
748  throw std::invalid_argument( "Invalid assignment to strictly upper matrix" );
749 
750  move( matrix_, tmp );
751  }
752 
753  if( !IsStrictlyUpper<MT2>::value )
754  resetLower();
755 
756  return *this;
757 }
759 //*************************************************************************************************
760 
761 
762 //*************************************************************************************************
775 template< typename MT // Type of the adapted sparse matrix
776  , bool SO > // Storage order of the adapted sparse matrix
777 template< typename MT2 // Type of the right-hand side matrix
778  , bool SO2 > // Storage order of the right-hand side matrix
779 inline typename DisableIf< IsComputation<MT2>, StrictlyUpperMatrix<MT,SO,false>& >::Type
780  StrictlyUpperMatrix<MT,SO,false>::operator+=( const Matrix<MT2,SO2>& rhs )
781 {
782  if( IsUniTriangular<MT2>::value ||
783  ( !IsStrictlyUpper<MT2>::value && !isStrictlyUpper( ~rhs ) ) )
784  throw std::invalid_argument( "Invalid assignment to strictly upper matrix" );
785 
786  matrix_ += ~rhs;
787 
788  if( !IsStrictlyUpper<MT2>::value )
789  resetLower();
790 
791  return *this;
792 }
794 //*************************************************************************************************
795 
796 
797 //*************************************************************************************************
810 template< typename MT // Type of the adapted sparse matrix
811  , bool SO > // Storage order of the adapted sparse matrix
812 template< typename MT2 // Type of the right-hand side matrix
813  , bool SO2 > // Storage order of the right-hand side matrix
814 inline typename EnableIf< IsComputation<MT2>, StrictlyUpperMatrix<MT,SO,false>& >::Type
815  StrictlyUpperMatrix<MT,SO,false>::operator+=( const Matrix<MT2,SO2>& rhs )
816 {
817  if( IsUniTriangular<MT2>::value || ( IsSquare<MT2>::value && !isSquare( ~rhs ) ) )
818  throw std::invalid_argument( "Invalid assignment to strictly upper matrix" );
819 
820  if( IsStrictlyUpper<MT2>::value ) {
821  matrix_ += ~rhs;
822  }
823  else {
824  typename MT2::ResultType tmp( ~rhs );
825 
826  if( !isStrictlyUpper( tmp ) )
827  throw std::invalid_argument( "Invalid assignment to strictly upper matrix" );
828 
829  matrix_ += tmp;
830  }
831 
832  if( !IsStrictlyUpper<MT2>::value )
833  resetLower();
834 
835  return *this;
836 }
838 //*************************************************************************************************
839 
840 
841 //*************************************************************************************************
854 template< typename MT // Type of the adapted sparse matrix
855  , bool SO > // Storage order of the adapted sparse matrix
856 template< typename MT2 // Type of the right-hand side matrix
857  , bool SO2 > // Storage order of the right-hand side matrix
858 inline typename DisableIf< IsComputation<MT2>, StrictlyUpperMatrix<MT,SO,false>& >::Type
859  StrictlyUpperMatrix<MT,SO,false>::operator-=( const Matrix<MT2,SO2>& rhs )
860 {
861  if( IsUniTriangular<MT2>::value ||
862  ( !IsStrictlyUpper<MT2>::value && !isStrictlyUpper( ~rhs ) ) )
863  throw std::invalid_argument( "Invalid assignment to strictly upper matrix" );
864 
865  matrix_ -= ~rhs;
866 
867  if( !IsStrictlyUpper<MT2>::value )
868  resetLower();
869 
870  return *this;
871 }
873 //*************************************************************************************************
874 
875 
876 //*************************************************************************************************
889 template< typename MT // Type of the adapted sparse matrix
890  , bool SO > // Storage order of the adapted sparse matrix
891 template< typename MT2 // Type of the right-hand side matrix
892  , bool SO2 > // Storage order of the right-hand side matrix
893 inline typename EnableIf< IsComputation<MT2>, StrictlyUpperMatrix<MT,SO,false>& >::Type
894  StrictlyUpperMatrix<MT,SO,false>::operator-=( const Matrix<MT2,SO2>& rhs )
895 {
896  if( IsUniTriangular<MT2>::value || ( !IsSquare<MT2>::value && !isSquare( ~rhs ) ) )
897  throw std::invalid_argument( "Invalid assignment to strictly upper matrix" );
898 
899  if( IsStrictlyUpper<MT2>::value ) {
900  matrix_ -= ~rhs;
901  }
902  else {
903  typename MT2::ResultType tmp( ~rhs );
904 
905  if( !isStrictlyUpper( tmp ) )
906  throw std::invalid_argument( "Invalid assignment to strictly upper matrix" );
907 
908  matrix_ -= tmp;
909  }
910 
911  if( !IsStrictlyUpper<MT2>::value )
912  resetLower();
913 
914  return *this;
915 }
917 //*************************************************************************************************
918 
919 
920 //*************************************************************************************************
932 template< typename MT // Type of the adapted sparse matrix
933  , bool SO > // Storage order of the adapted sparse matrix
934 template< typename MT2 // Type of the right-hand side matrix
935  , bool SO2 > // Storage order of the right-hand side matrix
936 inline StrictlyUpperMatrix<MT,SO,false>&
937  StrictlyUpperMatrix<MT,SO,false>::operator*=( const Matrix<MT2,SO2>& rhs )
938 {
939  if( matrix_.rows() != (~rhs).columns() )
940  throw std::invalid_argument( "Invalid assignment to strictly upper matrix" );
941 
942  MT tmp( matrix_ * ~rhs );
943 
944  if( !isStrictlyUpper( tmp ) )
945  throw std::invalid_argument( "Invalid assignment to strictly upper matrix" );
946 
947  move( matrix_, tmp );
948 
949  if( !IsStrictlyUpper<MT2>::value )
950  resetLower();
951 
952  return *this;
953 }
955 //*************************************************************************************************
956 
957 
958 //*************************************************************************************************
966 template< typename MT // Type of the adapted sparse matrix
967  , bool SO > // Storage order of the adapted sparse matrix
968 template< typename Other > // Data type of the right-hand side scalar
969 inline typename EnableIf< IsNumeric<Other>, StrictlyUpperMatrix<MT,SO,false> >::Type&
970  StrictlyUpperMatrix<MT,SO,false>::operator*=( Other rhs )
971 {
972  matrix_ *= rhs;
973  return *this;
974 }
975 //*************************************************************************************************
976 
977 
978 //*************************************************************************************************
986 template< typename MT // Type of the adapted sparse matrix
987  , bool SO > // Storage order of the adapted sparse matrix
988 template< typename Other > // Data type of the right-hand side scalar
989 inline typename EnableIf< IsNumeric<Other>, StrictlyUpperMatrix<MT,SO,false> >::Type&
990  StrictlyUpperMatrix<MT,SO,false>::operator/=( Other rhs )
991 {
992  BLAZE_USER_ASSERT( rhs != Other(0), "Division by zero detected" );
993 
994  matrix_ /= rhs;
995  return *this;
996 }
998 //*************************************************************************************************
999 
1000 
1001 
1002 
1003 //=================================================================================================
1004 //
1005 // UTILITY FUNCTIONS
1006 //
1007 //=================================================================================================
1008 
1009 //*************************************************************************************************
1015 template< typename MT // Type of the adapted sparse matrix
1016  , bool SO > // Storage order of the adapted sparse matrix
1017 inline size_t StrictlyUpperMatrix<MT,SO,false>::rows() const
1018 {
1019  return matrix_.rows();
1020 }
1022 //*************************************************************************************************
1023 
1024 
1025 //*************************************************************************************************
1031 template< typename MT // Type of the adapted sparse matrix
1032  , bool SO > // Storage order of the adapted sparse matrix
1033 inline size_t StrictlyUpperMatrix<MT,SO,false>::columns() const
1034 {
1035  return matrix_.columns();
1036 }
1038 //*************************************************************************************************
1039 
1040 
1041 //*************************************************************************************************
1047 template< typename MT // Type of the adapted sparse matrix
1048  , bool SO > // Storage order of the adapted sparse matrix
1049 inline size_t StrictlyUpperMatrix<MT,SO,false>::capacity() const
1050 {
1051  return matrix_.capacity();
1052 }
1054 //*************************************************************************************************
1055 
1056 
1057 //*************************************************************************************************
1069 template< typename MT // Type of the adapted sparse matrix
1070  , bool SO > // Storage order of the adapted sparse matrix
1071 inline size_t StrictlyUpperMatrix<MT,SO,false>::capacity( size_t i ) const
1072 {
1073  return matrix_.capacity(i);
1074 }
1076 //*************************************************************************************************
1077 
1078 
1079 //*************************************************************************************************
1085 template< typename MT // Type of the adapted sparse matrix
1086  , bool SO > // Storage order of the adapted sparse matrix
1087 inline size_t StrictlyUpperMatrix<MT,SO,false>::nonZeros() const
1088 {
1089  return matrix_.nonZeros();
1090 }
1092 //*************************************************************************************************
1093 
1094 
1095 //*************************************************************************************************
1107 template< typename MT // Type of the adapted sparse matrix
1108  , bool SO > // Storage order of the adapted sparse matrix
1109 inline size_t StrictlyUpperMatrix<MT,SO,false>::nonZeros( size_t i ) const
1110 {
1111  return matrix_.nonZeros(i);
1112 }
1114 //*************************************************************************************************
1115 
1116 
1117 //*************************************************************************************************
1123 template< typename MT // Type of the adapted sparse matrix
1124  , bool SO > // Storage order of the adapted sparse matrix
1126 {
1127  if( SO ) {
1128  for( size_t j=1UL; j<columns(); ++j ) {
1129  matrix_.erase( j, matrix_.begin(j), matrix_.lowerBound(j,j) );
1130  }
1131  }
1132  else {
1133  for( size_t i=0UL; i<rows(); ++i ) {
1134  matrix_.erase( i, matrix_.lowerBound(i,i+1UL), matrix_.end(i) );
1135  }
1136  }
1137 }
1139 //*************************************************************************************************
1140 
1141 
1142 //*************************************************************************************************
1155 template< typename MT // Type of the adapted sparse matrix
1156  , bool SO > // Storage order of the adapted sparse matrix
1157 inline void StrictlyUpperMatrix<MT,SO,false>::reset( size_t i )
1158 {
1159  if( SO ) {
1160  matrix_.erase( i, matrix_.begin(i), matrix_.lowerBound(i,i) );
1161  }
1162  else {
1163  matrix_.erase( i, matrix_.lowerBound(i,i+1UL), matrix_.end(i) );
1164  }
1165 }
1167 //*************************************************************************************************
1168 
1169 
1170 //*************************************************************************************************
1178 template< typename MT // Type of the adapted sparse matrix
1179  , bool SO > // Storage order of the adapted sparse matrix
1181 {
1182  using blaze::clear;
1183 
1184  if( IsResizable<MT>::value ) {
1185  clear( matrix_ );
1186  }
1187  else {
1188  reset();
1189  }
1190 }
1192 //*************************************************************************************************
1193 
1194 
1195 //*************************************************************************************************
1211 template< typename MT // Type of the adapted sparse matrix
1212  , bool SO > // Storage order of the adapted sparse matrix
1214  StrictlyUpperMatrix<MT,SO,false>::set( size_t i, size_t j, const ElementType& value )
1215 {
1216  if( i >= j )
1217  throw std::invalid_argument( "Invalid access to diagonal or lower matrix element" );
1218 
1219  return matrix_.set( i, j, value );
1220 }
1222 //*************************************************************************************************
1223 
1224 
1225 //*************************************************************************************************
1242 template< typename MT // Type of the adapted sparse matrix
1243  , bool SO > // Storage order of the adapted sparse matrix
1245  StrictlyUpperMatrix<MT,SO,false>::insert( size_t i, size_t j, const ElementType& value )
1246 {
1247  if( i >= j )
1248  throw std::invalid_argument( "Invalid access to diagonal or lower matrix element" );
1249 
1250  return matrix_.insert( i, j, value );
1251 }
1253 //*************************************************************************************************
1254 
1255 
1256 //*************************************************************************************************
1266 template< typename MT // Type of the adapted sparse matrix
1267  , bool SO > // Storage order of the adapted sparse matrix
1268 inline void StrictlyUpperMatrix<MT,SO,false>::erase( size_t i, size_t j )
1269 {
1270  matrix_.erase( i, j );
1271 }
1273 //*************************************************************************************************
1274 
1275 
1276 //*************************************************************************************************
1288 template< typename MT // Type of the adapted sparse matrix
1289  , bool SO > // Storage order of the adapted sparse matrix
1291  StrictlyUpperMatrix<MT,SO,false>::erase( size_t i, Iterator pos )
1292 {
1293  return matrix_.erase( i, pos );
1294 }
1296 //*************************************************************************************************
1297 
1298 
1299 //*************************************************************************************************
1313 template< typename MT // Type of the adapted sparse matrix
1314  , bool SO > // Storage order of the adapted sparse matrix
1316  StrictlyUpperMatrix<MT,SO,false>::erase( size_t i, Iterator first, Iterator last )
1317 {
1318  return matrix_.erase( i, first, last );
1319 }
1321 //*************************************************************************************************
1322 
1323 
1324 //*************************************************************************************************
1339 template< typename MT // Type of the adapted sparse matrix
1340  , bool SO > // Storage order of the adapted sparse matrix
1341 void StrictlyUpperMatrix<MT,SO,false>::resize( size_t n, bool preserve )
1342 {
1344 
1345  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly upper matrix detected" );
1346 
1347  matrix_.resize( n, n, preserve );
1348 }
1350 //*************************************************************************************************
1351 
1352 
1353 //*************************************************************************************************
1364 template< typename MT // Type of the adapted sparse matrix
1365  , bool SO > // Storage order of the adapted sparse matrix
1366 inline void StrictlyUpperMatrix<MT,SO,false>::reserve( size_t nonzeros )
1367 {
1368  matrix_.reserve( nonzeros );
1369 }
1371 //*************************************************************************************************
1372 
1373 
1374 //*************************************************************************************************
1389 template< typename MT // Type of the adapted sparse matrix
1390  , bool SO > // Storage order of the adapted sparse matrix
1391 inline void StrictlyUpperMatrix<MT,SO,false>::reserve( size_t i, size_t nonzeros )
1392 {
1393  matrix_.reserve( i, nonzeros );
1394 }
1396 //*************************************************************************************************
1397 
1398 
1399 //*************************************************************************************************
1410 template< typename MT // Type of the adapted sparse matrix
1411  , bool SO > // Storage order of the adapted sparse matrix
1412 inline void StrictlyUpperMatrix<MT,SO,false>::trim()
1413 {
1414  matrix_.trim();
1415 }
1417 //*************************************************************************************************
1418 
1419 
1420 //*************************************************************************************************
1432 template< typename MT // Type of the adapted sparse matrix
1433  , bool SO > // Storage order of the adapted sparse matrix
1434 inline void StrictlyUpperMatrix<MT,SO,false>::trim( size_t i )
1435 {
1436  matrix_.trim( i );
1437 }
1439 //*************************************************************************************************
1440 
1441 
1442 //*************************************************************************************************
1449 template< typename MT // Type of the adapted sparse matrix
1450  , bool SO > // Storage order of the adapted sparse matrix
1451 template< typename Other > // Data type of the scalar value
1452 inline StrictlyUpperMatrix<MT,SO,false>&
1453  StrictlyUpperMatrix<MT,SO,false>::scale( const Other& scalar )
1454 {
1455  matrix_.scale( scalar );
1456  return *this;
1457 }
1459 //*************************************************************************************************
1460 
1461 
1462 //*************************************************************************************************
1469 template< typename MT // Type of the adapted sparse matrix
1470  , bool SO > // Storage order of the adapted sparse matrix
1471 template< typename Other > // Data type of the scalar value
1472 inline StrictlyUpperMatrix<MT,SO,false>&
1473  StrictlyUpperMatrix<MT,SO,false>::scaleDiagonal( Other scalar )
1474 {
1475  matrix_.scaleDiagonal( scalar );
1476  return *this;
1477 }
1479 //*************************************************************************************************
1480 
1481 
1482 //*************************************************************************************************
1490 template< typename MT // Type of the adapted sparse matrix
1491  , bool SO > // Storage order of the adapted sparse matrix
1492 inline void StrictlyUpperMatrix<MT,SO,false>::swap( StrictlyUpperMatrix& m ) /* throw() */
1493 {
1494  using std::swap;
1495 
1496  swap( matrix_, m.matrix_ );
1497 }
1499 //*************************************************************************************************
1500 
1501 
1502 //*************************************************************************************************
1514 template< typename MT // Type of the adapted dense matrix
1515  , bool SO > // Storage order of the adapted dense matrix
1516 inline size_t StrictlyUpperMatrix<MT,SO,false>::maxNonZeros()
1517 {
1519 
1520  return maxNonZeros( Rows<MT>::value );
1521 }
1523 //*************************************************************************************************
1524 
1525 
1526 //*************************************************************************************************
1536 template< typename MT // Type of the adapted dense matrix
1537  , bool SO > // Storage order of the adapted dense matrix
1538 inline size_t StrictlyUpperMatrix<MT,SO,false>::maxNonZeros( size_t n )
1539 {
1540  return ( ( n - 1UL ) * n ) / 2UL;
1541 }
1543 //*************************************************************************************************
1544 
1545 
1546 //*************************************************************************************************
1552 template< typename MT // Type of the adapted dense matrix
1553  , bool SO > // Storage order of the adapted dense matrix
1554 inline void StrictlyUpperMatrix<MT,SO,false>::resetLower()
1555 {
1556  if( SO ) {
1557  for( size_t j=0UL; j<columns(); ++j )
1558  matrix_.erase( j, matrix_.upperBound( j, j ), matrix_.end( j ) );
1559  }
1560  else {
1561  for( size_t i=1UL; i<rows(); ++i )
1562  matrix_.erase( i, matrix_.begin( i ), matrix_.lowerBound( i, i ) );
1563  }
1564 }
1566 //*************************************************************************************************
1567 
1568 
1569 
1570 
1571 //=================================================================================================
1572 //
1573 // LOOKUP FUNCTIONS
1574 //
1575 //=================================================================================================
1576 
1577 //*************************************************************************************************
1593 template< typename MT // Type of the adapted sparse matrix
1594  , bool SO > // Storage order of the adapted sparse matrix
1596  StrictlyUpperMatrix<MT,SO,false>::find( size_t i, size_t j )
1597 {
1598  return matrix_.find( i, j );
1599 }
1601 //*************************************************************************************************
1602 
1603 
1604 //*************************************************************************************************
1620 template< typename MT // Type of the adapted sparse matrix
1621  , bool SO > // Storage order of the adapted sparse matrix
1623  StrictlyUpperMatrix<MT,SO,false>::find( size_t i, size_t j ) const
1624 {
1625  return matrix_.find( i, j );
1626 }
1628 //*************************************************************************************************
1629 
1630 
1631 //*************************************************************************************************
1647 template< typename MT // Type of the adapted sparse matrix
1648  , bool SO > // Storage order of the adapted sparse matrix
1650  StrictlyUpperMatrix<MT,SO,false>::lowerBound( size_t i, size_t j )
1651 {
1652  return matrix_.lowerBound( i, j );
1653 }
1655 //*************************************************************************************************
1656 
1657 
1658 //*************************************************************************************************
1674 template< typename MT // Type of the adapted sparse matrix
1675  , bool SO > // Storage order of the adapted sparse matrix
1677  StrictlyUpperMatrix<MT,SO,false>::lowerBound( size_t i, size_t j ) const
1678 {
1679  return matrix_.lowerBound( i, j );
1680 }
1682 //*************************************************************************************************
1683 
1684 
1685 //*************************************************************************************************
1701 template< typename MT // Type of the adapted sparse matrix
1702  , bool SO > // Storage order of the adapted sparse matrix
1704  StrictlyUpperMatrix<MT,SO,false>::upperBound( size_t i, size_t j )
1705 {
1706  return matrix_.upperBound( i, j );
1707 }
1709 //*************************************************************************************************
1710 
1711 
1712 //*************************************************************************************************
1728 template< typename MT // Type of the adapted sparse matrix
1729  , bool SO > // Storage order of the adapted sparse matrix
1731  StrictlyUpperMatrix<MT,SO,false>::upperBound( size_t i, size_t j ) const
1732 {
1733  return matrix_.upperBound( i, j );
1734 }
1736 //*************************************************************************************************
1737 
1738 
1739 
1740 
1741 //=================================================================================================
1742 //
1743 // LOW-LEVEL UTILITY FUNCTIONS
1744 //
1745 //=================================================================================================
1746 
1747 //*************************************************************************************************
1797 template< typename MT // Type of the adapted sparse matrix
1798  , bool SO > // Storage order of the adapted sparse matrix
1799 inline void StrictlyUpperMatrix<MT,SO,false>::append( size_t i, size_t j, const ElementType& value, bool check )
1800 {
1801  if( i >= j )
1802  throw std::invalid_argument( "Invalid access to diagonal or lower matrix element" );
1803 
1804  matrix_.append( i, j, value, check );
1805 }
1807 //*************************************************************************************************
1808 
1809 
1810 //*************************************************************************************************
1824 template< typename MT // Type of the adapted sparse matrix
1825  , bool SO > // Storage order of the adapted sparse matrix
1826 inline void StrictlyUpperMatrix<MT,SO,false>::finalize( size_t i )
1827 {
1828  matrix_.finalize( i );
1829 }
1831 //*************************************************************************************************
1832 
1833 
1834 
1835 
1836 //=================================================================================================
1837 //
1838 // EXPRESSION TEMPLATE EVALUATION FUNCTIONS
1839 //
1840 //=================================================================================================
1841 
1842 //*************************************************************************************************
1853 template< typename MT // Type of the adapted sparse matrix
1854  , bool SO > // Storage order of the adapted sparse matrix
1855 template< typename Other > // Data type of the foreign expression
1856 inline bool StrictlyUpperMatrix<MT,SO,false>::canAlias( const Other* alias ) const
1857 {
1858  return matrix_.canAlias( alias );
1859 }
1861 //*************************************************************************************************
1862 
1863 
1864 //*************************************************************************************************
1875 template< typename MT // Type of the adapted sparse matrix
1876  , bool SO > // Storage order of the adapted sparse matrix
1877 template< typename Other > // Data type of the foreign expression
1878 inline bool StrictlyUpperMatrix<MT,SO,false>::isAliased( const Other* alias ) const
1879 {
1880  return matrix_.isAliased( alias );
1881 }
1883 //*************************************************************************************************
1884 
1885 
1886 //*************************************************************************************************
1897 template< typename MT // Type of the adapted sparse matrix
1898  , bool SO > // Storage order of the adapted sparse matrix
1899 inline bool StrictlyUpperMatrix<MT,SO,false>::canSMPAssign() const
1900 {
1901  return matrix_.canSMPAssign();
1902 }
1904 //*************************************************************************************************
1905 
1906 } // namespace blaze
1907 
1908 #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:116
const MT::ElementType max(const DenseMatrix< MT, SO > &dm)
Returns the largest element of the dense matrix.
Definition: DenseMatrix.h:1649
Header file for mathematical functions.
#define BLAZE_USER_ASSERT(expr, msg)
Run time assertion macro for user checks.In case of an invalid run time expression, the program execution is terminated. The BLAZE_USER_ASSERT macro can be disabled by setting the BLAZE_USER_ASSERT flag to zero or by defining NDEBUG during the compilation.
Definition: Assert.h:117
Header file for the Rows type trait.
Header file for basic type definitions.
BLAZE_ALWAYS_INLINE bool isSquare(const Matrix< MT, SO > &matrix)
Checks if the given matrix is a square matrix.
Definition: Matrix.h:902
BLAZE_ALWAYS_INLINE MT::ConstIterator cbegin(const Matrix< MT, SO > &matrix, size_t i)
Returns an iterator to the first element of row/column i.
Definition: Matrix.h:237
void move(CompressedMatrix< Type, SO > &dst, CompressedMatrix< Type, SO > &src)
Moving the contents of one compressed matrix to another.
Definition: CompressedMatrix.h:4825
BLAZE_ALWAYS_INLINE MT::ConstIterator cend(const Matrix< MT, SO > &matrix, size_t i)
Returns an iterator just past the last element of row/column i.
Definition: Matrix.h:300
BLAZE_ALWAYS_INLINE MT::Iterator end(Matrix< MT, SO > &matrix, size_t i)
Returns an iterator just past the last element of row/column i.
Definition: Matrix.h:258
bool isStrictlyUpper(const DenseMatrix< MT, SO > &dm)
Checks if the given dense matrix is a strictly upper triangular matrix.
Definition: DenseMatrix.h:1354
#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:242
Constraint on the data type.
Constraint on the data type.
void reset(const DiagonalProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: DiagonalProxy.h:821
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:2507
BLAZE_ALWAYS_INLINE size_t capacity(const Matrix< MT, SO > &matrix)
Returns the maximum capacity of the matrix.
Definition: Matrix.h:348
BLAZE_ALWAYS_INLINE size_t rows(const Matrix< MT, SO > &matrix)
Returns the current number of rows of the matrix.
Definition: Matrix.h:316
void clear(CompressedMatrix< Type, SO > &m)
Clearing the given compressed matrix.
Definition: CompressedMatrix.h:4762
CompressedMatrix< Type, true > This
Type of this CompressedMatrix instance.
Definition: CompressedMatrix.h:2501
#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:116
BLAZE_ALWAYS_INLINE size_t nonZeros(const Matrix< MT, SO > &matrix)
Returns the total number of non-zero elements in the matrix.
Definition: Matrix.h:386
Constraint on the data type.
CompressedMatrix< Type, false > OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: CompressedMatrix.h:2503
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 DisableIf class template.
Header file for the IsStrictlyUpper type trait.
Header file for the clear shim.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
void swap(CompressedMatrix< Type, SO > &a, CompressedMatrix< Type, SO > &b)
Swapping the contents of two compressed matrices.
Definition: CompressedMatrix.h:4807
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2511
#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:116
Constraint on the data type.
Header file for the IsUniTriangular type trait.
CompressedMatrix< Type, false > TransposeType
Transpose type for expression template evaluations.
Definition: CompressedMatrix.h:2504
Constraints on the storage order of matrix types.
#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:118
BLAZE_ALWAYS_INLINE MT::Iterator begin(Matrix< MT, SO > &matrix, size_t i)
Returns an iterator to the first element of row/column i.
Definition: Matrix.h:195
BLAZE_ALWAYS_INLINE void resize(Matrix< MT, SO > &matrix, size_t rows, size_t columns, bool preserve=true)
Changing the size of the matrix.
Definition: Matrix.h:535
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:2505
const Type & ConstReference
Reference to a constant matrix value.
Definition: CompressedMatrix.h:2509
Header file for the EnableIf class template.
void clear(const DiagonalProxy< MT > &proxy)
Clearing the represented element.
Definition: DiagonalProxy.h:841
Header file for the implementation of the base template of the StrictlyUpperMatrix.
Header file for the IsNumeric type trait.
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:116
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:2506
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:118
#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:116
Element * Iterator
Iterator over non-constant elements.
Definition: CompressedMatrix.h:2510
Header file for the isDefault shim.
Constraint on the data type.
Constraint on the data type.
#define BLAZE_CONSTRAINT_MUST_NOT_BE_RESIZABLE(T)
Constraint on the data type.In case the given data type T is resizable, i.e. has a 'resize' member fu...
Definition: Resizable.h:118
void swap(DiagonalMatrix< MT, SO, DF > &a, DiagonalMatrix< MT, SO, DF > &b)
Swapping the contents of two matrices.
Definition: DiagonalMatrix.h:200
BLAZE_ALWAYS_INLINE EnableIf< And< IsIntegral< T >, HasSize< T, 2UL > >, sse_int16_t >::Type set(T value)
Sets all values in the vector to the given 2-byte integral value.
Definition: Set.h:73
Header file for the move shim.
#define BLAZE_CONSTRAINT_MUST_BE_RESIZABLE(T)
Constraint on the data type.In case the given data type T is not resizable, i.e. does not have a 'res...
Definition: Resizable.h:79
Header file for the IsComputation type trait class.
#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:118
This ResultType
Result type for expression template evaluations.
Definition: CompressedMatrix.h:2502
BLAZE_ALWAYS_INLINE size_t columns(const Matrix< MT, SO > &matrix)
Returns the current number of columns of the matrix.
Definition: Matrix.h:332
MatrixAccessProxy< This > Reference
Reference to a non-constant matrix value.
Definition: CompressedMatrix.h:2508
#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:143
Header file for the IsResizable 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:79