Sparse.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_ADAPTORS_HERMITIANMATRIX_SPARSE_H_
36 #define _BLAZE_MATH_ADAPTORS_HERMITIANMATRIX_SPARSE_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
43 #include <iterator>
44 #include <utility>
45 #include <vector>
49 #include <blaze/math/Aliases.h>
59 #include <blaze/math/Exception.h>
63 #include <blaze/math/shims/Clear.h>
74 #include <blaze/util/Assert.h>
80 #include <blaze/util/DisableIf.h>
81 #include <blaze/util/EnableIf.h>
83 #include <blaze/util/TrueType.h>
84 #include <blaze/util/Types.h>
88 #include <blaze/util/Unused.h>
89 
90 
91 namespace blaze {
92 
93 //=================================================================================================
94 //
95 // CLASS TEMPLATE SPECIALIZATION FOR SPARSE MATRICES
96 //
97 //=================================================================================================
98 
99 //*************************************************************************************************
107 template< typename MT // Type of the adapted sparse matrix
108  , bool SO > // Storage order of the adapted sparse matrix
109 class HermitianMatrix<MT,SO,false>
110  : public SparseMatrix< HermitianMatrix<MT,SO,false>, SO >
111 {
112  private:
113  //**Type definitions****************************************************************************
114  using OT = OppositeType_<MT>;
115  using TT = TransposeType_<MT>;
116  using ET = ElementType_<MT>;
117  //**********************************************************************************************
118 
119  public:
120  //**Type definitions****************************************************************************
121  using This = HermitianMatrix<MT,SO,false>;
122  using BaseType = SparseMatrix<This,SO>;
123  using ResultType = This;
124  using OppositeType = HermitianMatrix<OT,!SO,false>;
125  using TransposeType = HermitianMatrix<TT,!SO,false>;
126  using ElementType = ET;
127  using ReturnType = ReturnType_<MT>;
128  using CompositeType = const This&;
129  using Reference = HermitianProxy<MT>;
130  using ConstReference = ConstReference_<MT>;
131  using ConstIterator = ConstIterator_<MT>;
132  //**********************************************************************************************
133 
134  //**Rebind struct definition********************************************************************
137  template< typename NewType > // Data type of the other matrix
138  struct Rebind {
140  using Other = HermitianMatrix< typename MT::template Rebind<NewType>::Other >;
141  };
142  //**********************************************************************************************
143 
144  //**Resize struct definition********************************************************************
147  template< size_t NewM // Number of rows of the other matrix
148  , size_t NewN > // Number of columns of the other matrix
149  struct Resize {
151  using Other = HermitianMatrix< typename MT::template Resize<NewM,NewN>::Other >;
152  };
153  //**********************************************************************************************
154 
155  //**Iterator class definition*******************************************************************
158  class Iterator
159  {
160  public:
161  //**Type definitions*************************************************************************
162  using IteratorType = Iterator_<MT>;
163 
164  using IteratorCategory = std::forward_iterator_tag;
165  using ValueType = HermitianElement<MT>;
166  using PointerType = ValueType;
167  using ReferenceType = ValueType;
168  using DifferenceType = ptrdiff_t;
169 
170  // STL iterator requirements
171  using iterator_category = IteratorCategory;
172  using value_type = ValueType;
173  using pointer = PointerType;
174  using reference = ReferenceType;
175  using difference_type = DifferenceType;
176  //*******************************************************************************************
177 
178  //**Default constructor**********************************************************************
181  inline Iterator()
182  : pos_ () // Iterator to the current sparse Hermitian matrix element
183  , matrix_( nullptr ) // The sparse matrix containing the iterator
184  , index_ ( 0UL ) // The row/column index of the iterator
185  {}
186  //*******************************************************************************************
187 
188  //**Constructor******************************************************************************
195  inline Iterator( IteratorType pos, MT& matrix, size_t index )
196  : pos_ ( pos ) // Iterator to the current sparse Hermitian matrix element
197  , matrix_( &matrix ) // The sparse matrix containing the iterator
198  , index_ ( index ) // The row/column index of the iterator
199  {}
200  //*******************************************************************************************
201 
202  //**Prefix increment operator****************************************************************
207  inline Iterator& operator++() {
208  ++pos_;
209  return *this;
210  }
211  //*******************************************************************************************
212 
213  //**Postfix increment operator***************************************************************
218  inline const Iterator operator++( int ) {
219  const Iterator tmp( *this );
220  ++(*this);
221  return tmp;
222  }
223  //*******************************************************************************************
224 
225  //**Element access operator******************************************************************
230  inline ReferenceType operator*() const {
231  return ReferenceType( pos_, matrix_, index_ );
232  }
233  //*******************************************************************************************
234 
235  //**Element access operator******************************************************************
240  inline PointerType operator->() const {
241  return PointerType( pos_, matrix_, index_ );
242  }
243  //*******************************************************************************************
244 
245  //**Conversion operator**********************************************************************
250  inline operator ConstIterator() const {
251  return pos_;
252  }
253  //*******************************************************************************************
254 
255  //**Equality operator************************************************************************
261  inline bool operator==( const Iterator& rhs ) const {
262  return pos_ == rhs.pos_;
263  }
264  //*******************************************************************************************
265 
266  //**Inequality operator**********************************************************************
272  inline bool operator!=( const Iterator& rhs ) const {
273  return !( *this == rhs );
274  }
275  //*******************************************************************************************
276 
277  //**Subtraction operator*********************************************************************
283  inline DifferenceType operator-( const Iterator& rhs ) const {
284  return pos_ - rhs.pos_;
285  }
286  //*******************************************************************************************
287 
288  //**Base function****************************************************************************
293  inline IteratorType base() const {
294  return pos_;
295  }
296  //*******************************************************************************************
297 
298  private:
299  //**Member variables*************************************************************************
300  IteratorType pos_;
301  MT* matrix_;
302  size_t index_;
303  //*******************************************************************************************
304  };
305  //**********************************************************************************************
306 
307  //**Compilation flags***************************************************************************
309  enum : bool { smpAssignable = false };
310  //**********************************************************************************************
311 
312  //**Constructors********************************************************************************
315  explicit inline HermitianMatrix();
316  explicit inline HermitianMatrix( size_t n );
317  explicit inline HermitianMatrix( size_t n, size_t nonzeros );
318  explicit inline HermitianMatrix( size_t n, const std::vector<size_t>& nonzeros );
319  explicit inline HermitianMatrix( initializer_list< initializer_list<ElementType> > list );
320 
321  inline HermitianMatrix( const HermitianMatrix& m );
322  inline HermitianMatrix( HermitianMatrix&& m ) noexcept;
323 
324  template< typename MT2, bool SO2 >
325  inline HermitianMatrix( const Matrix<MT2,SO2>& m );
327  //**********************************************************************************************
328 
329  //**Destructor**********************************************************************************
330  // No explicitly declared destructor.
331  //**********************************************************************************************
332 
333  //**Data access functions***********************************************************************
336  inline Reference operator()( size_t i, size_t j );
337  inline ConstReference operator()( size_t i, size_t j ) const;
338  inline Reference at( size_t i, size_t j );
339  inline ConstReference at( size_t i, size_t j ) const;
340  inline Iterator begin ( size_t i );
341  inline ConstIterator begin ( size_t i ) const;
342  inline ConstIterator cbegin( size_t i ) const;
343  inline Iterator end ( size_t i );
344  inline ConstIterator end ( size_t i ) const;
345  inline ConstIterator cend ( size_t i ) const;
347  //**********************************************************************************************
348 
349  //**Assignment operators************************************************************************
352  inline HermitianMatrix& operator=( initializer_list< initializer_list<ElementType> > list );
353 
354  inline HermitianMatrix& operator=( const HermitianMatrix& rhs );
355  inline HermitianMatrix& operator=( HermitianMatrix&& rhs ) noexcept;
356 
357  template< typename MT2, bool SO2 >
358  inline DisableIf_< IsComputation<MT2>, HermitianMatrix& > operator=( const Matrix<MT2,SO2>& rhs );
359 
360  template< typename MT2, bool SO2 >
361  inline EnableIf_< IsComputation<MT2>, HermitianMatrix& > operator=( const Matrix<MT2,SO2>& rhs );
362 
363  template< typename MT2 >
364  inline EnableIf_< IsBuiltin< ElementType_<MT2> >, HermitianMatrix& >
365  operator=( const Matrix<MT2,!SO>& rhs );
366 
367  template< typename MT2, bool SO2 >
368  inline DisableIf_< IsComputation<MT2>, HermitianMatrix& > operator+=( const Matrix<MT2,SO2>& rhs );
369 
370  template< typename MT2, bool SO2 >
371  inline EnableIf_< IsComputation<MT2>, HermitianMatrix& > operator+=( const Matrix<MT2,SO2>& rhs );
372 
373  template< typename MT2 >
374  inline EnableIf_< IsBuiltin< ElementType_<MT2> >, HermitianMatrix& >
375  operator+=( const Matrix<MT2,!SO>& rhs );
376 
377  template< typename MT2, bool SO2 >
378  inline DisableIf_< IsComputation<MT2>, HermitianMatrix& > operator-=( const Matrix<MT2,SO2>& rhs );
379 
380  template< typename MT2, bool SO2 >
381  inline EnableIf_< IsComputation<MT2>, HermitianMatrix& > operator-=( const Matrix<MT2,SO2>& rhs );
382 
383  template< typename MT2 >
384  inline EnableIf_< IsBuiltin< ElementType_<MT2> >, HermitianMatrix& >
385  operator-=( const Matrix<MT2,!SO>& rhs );
386 
387  template< typename MT2, bool SO2 >
388  inline DisableIf_< IsComputation<MT2>, HermitianMatrix& > operator%=( const Matrix<MT2,SO2>& rhs );
389 
390  template< typename MT2, bool SO2 >
391  inline EnableIf_< IsComputation<MT2>, HermitianMatrix& > operator%=( const Matrix<MT2,SO2>& rhs );
392 
393  template< typename MT2 >
394  inline EnableIf_< IsBuiltin< ElementType_<MT2> >, HermitianMatrix& >
395  operator%=( const Matrix<MT2,!SO>& rhs );
396 
397  template< typename ST >
398  inline EnableIf_< IsNumeric<ST>, HermitianMatrix >& operator*=( ST rhs );
399 
400  template< typename ST >
401  inline EnableIf_< IsNumeric<ST>, HermitianMatrix >& operator/=( ST rhs );
403  //**********************************************************************************************
404 
405  //**Utility functions***************************************************************************
408  inline size_t rows() const noexcept;
409  inline size_t columns() const noexcept;
410  inline size_t capacity() const noexcept;
411  inline size_t capacity( size_t i ) const noexcept;
412  inline size_t nonZeros() const;
413  inline size_t nonZeros( size_t i ) const;
414  inline void reset();
415  inline void reset( size_t i );
416  inline void clear();
417  inline void resize ( size_t n, bool preserve=true );
418  inline void reserve( size_t nonzeros );
419  inline void reserve( size_t i, size_t nonzeros );
420  inline void trim();
421  inline void trim( size_t i );
422  inline void shrinkToFit();
423  inline void swap( HermitianMatrix& m ) noexcept;
425  //**********************************************************************************************
426 
427  //**Insertion functions*************************************************************************
430  inline Iterator set ( size_t i, size_t j, const ElementType& value );
431  inline Iterator insert ( size_t i, size_t j, const ElementType& value );
432  inline void append ( size_t i, size_t j, const ElementType& value, bool check=false );
433  inline void finalize( size_t i );
435  //**********************************************************************************************
436 
437  //**Erase functions*****************************************************************************
440  inline void erase( size_t i, size_t j );
441  inline Iterator erase( size_t i, Iterator pos );
442  inline Iterator erase( size_t i, Iterator first, Iterator last );
443 
444  template< typename Pred >
445  inline void erase( Pred predicate );
446 
447  template< typename Pred >
448  inline void erase( size_t i, Iterator first, Iterator last, Pred predicate );
450  //**********************************************************************************************
451 
452  //**Lookup functions****************************************************************************
455  inline Iterator find ( size_t i, size_t j );
456  inline ConstIterator find ( size_t i, size_t j ) const;
457  inline Iterator lowerBound( size_t i, size_t j );
458  inline ConstIterator lowerBound( size_t i, size_t j ) const;
459  inline Iterator upperBound( size_t i, size_t j );
460  inline ConstIterator upperBound( size_t i, size_t j ) const;
462  //**********************************************************************************************
463 
464  //**Numeric functions***************************************************************************
467  inline HermitianMatrix& transpose();
468  inline HermitianMatrix& ctranspose();
469 
470  template< typename Other > inline HermitianMatrix& scale( const Other& scalar );
472  //**********************************************************************************************
473 
474  //**Debugging functions*************************************************************************
477  inline bool isIntact() const noexcept;
479  //**********************************************************************************************
480 
481  //**Expression template evaluation functions****************************************************
484  template< typename Other > inline bool canAlias ( const Other* alias ) const noexcept;
485  template< typename Other > inline bool isAliased( const Other* alias ) const noexcept;
486 
487  inline bool canSMPAssign() const noexcept;
489  //**********************************************************************************************
490 
491  private:
492  //**Construction functions**********************************************************************
495  template< typename MT2, bool SO2, typename T >
496  inline const MT2& construct( const Matrix<MT2,SO2>& m, T );
497 
498  template< typename MT2 >
499  inline TransExprTrait_<MT2> construct( const Matrix<MT2,!SO>& m, TrueType );
501  //**********************************************************************************************
502 
503  //**Member variables****************************************************************************
506  MT matrix_;
507 
508  //**********************************************************************************************
509 
510  //**Friend declarations*************************************************************************
511  template< bool RF, typename MT2, bool SO2, bool DF2 >
512  friend bool isDefault( const HermitianMatrix<MT2,SO2,DF2>& m );
513  //**********************************************************************************************
514 
515  //**Compile time checks*************************************************************************
529  BLAZE_STATIC_ASSERT( ( Size<MT,0UL>::value == Size<MT,1UL>::value ) );
530  //**********************************************************************************************
531 };
533 //*************************************************************************************************
534 
535 
536 
537 
538 //=================================================================================================
539 //
540 // CONSTRUCTORS
541 //
542 //=================================================================================================
543 
544 //*************************************************************************************************
548 template< typename MT // Type of the adapted sparse matrix
549  , bool SO > // Storage order of the adapted sparse matrix
550 inline HermitianMatrix<MT,SO,false>::HermitianMatrix()
551  : matrix_() // The adapted sparse matrix
552 {
553  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square Hermitian matrix detected" );
554 }
556 //*************************************************************************************************
557 
558 
559 //*************************************************************************************************
567 template< typename MT // Type of the adapted sparse matrix
568  , bool SO > // Storage order of the adapted sparse matrix
569 inline HermitianMatrix<MT,SO,false>::HermitianMatrix( size_t n )
570  : matrix_( n, n ) // The adapted sparse matrix
571 {
573 
574  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square Hermitian matrix detected" );
575 }
577 //*************************************************************************************************
578 
579 
580 //*************************************************************************************************
589 template< typename MT // Type of the adapted sparse matrix
590  , bool SO > // Storage order of the adapted sparse matrix
591 inline HermitianMatrix<MT,SO,false>::HermitianMatrix( size_t n, size_t nonzeros )
592  : matrix_( n, n, nonzeros ) // The adapted sparse matrix
593 {
595 
596  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square Hermitian matrix detected" );
597 }
599 //*************************************************************************************************
600 
601 
602 //*************************************************************************************************
613 template< typename MT // Type of the adapted sparse matrix
614  , bool SO > // Storage order of the adapted sparse matrix
615 inline HermitianMatrix<MT,SO,false>::HermitianMatrix( size_t n, const std::vector<size_t>& nonzeros )
616  : matrix_( n, n, nonzeros ) // The adapted sparse matrix
617 {
619 
620  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square Hermitian matrix detected" );
621 }
623 //*************************************************************************************************
624 
625 
626 //*************************************************************************************************
653 template< typename MT // Type of the adapted sparse matrix
654  , bool SO > // Storage order of the adapted sparse matrix
655 inline HermitianMatrix<MT,SO,false>::HermitianMatrix( initializer_list< initializer_list<ElementType> > list )
656  : matrix_( list ) // The adapted sparse matrix
657 {
658  if( !isHermitian( matrix_ ) ) {
659  BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of Hermitian matrix" );
660  }
661 
662  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
663 }
665 //*************************************************************************************************
666 
667 
668 //*************************************************************************************************
674 template< typename MT // Type of the adapted sparse matrix
675  , bool SO > // Storage order of the adapted sparse matrix
676 inline HermitianMatrix<MT,SO,false>::HermitianMatrix( const HermitianMatrix& m )
677  : matrix_( m.matrix_ ) // The adapted sparse matrix
678 {
679  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square Hermitian matrix detected" );
680  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
681 }
683 //*************************************************************************************************
684 
685 
686 //*************************************************************************************************
692 template< typename MT // Type of the adapted sparse matrix
693  , bool SO > // Storage order of the adapted sparse matrix
694 inline HermitianMatrix<MT,SO,false>::HermitianMatrix( HermitianMatrix&& m ) noexcept
695  : matrix_( std::move( m.matrix_ ) ) // The adapted sparse matrix
696 {
697  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square Hermitian matrix detected" );
698  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
699 }
701 //*************************************************************************************************
702 
703 
704 //*************************************************************************************************
714 template< typename MT // Type of the adapted sparse matrix
715  , bool SO > // Storage order of the adapted sparse matrix
716 template< typename MT2 // Type of the foreign matrix
717  , bool SO2 > // Storage order of the foreign matrix
718 inline HermitianMatrix<MT,SO,false>::HermitianMatrix( const Matrix<MT2,SO2>& m )
719  : matrix_( construct( m, typename IsBuiltin< ElementType_<MT2> >::Type() ) ) // The adapted sparse matrix
720 {
721  if( !IsHermitian<MT2>::value && !isHermitian( matrix_ ) ) {
722  BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of Hermitian matrix" );
723  }
724 }
726 //*************************************************************************************************
727 
728 
729 
730 
731 //=================================================================================================
732 //
733 // DATA ACCESS FUNCTIONS
734 //
735 //=================================================================================================
736 
737 //*************************************************************************************************
753 template< typename MT // Type of the adapted sparse matrix
754  , bool SO > // Storage order of the adapted sparse matrix
756  HermitianMatrix<MT,SO,false>::operator()( size_t i, size_t j )
757 {
758  BLAZE_USER_ASSERT( i<rows() , "Invalid row access index" );
759  BLAZE_USER_ASSERT( j<columns(), "Invalid column access index" );
760 
761  return Reference( matrix_, i, j );
762 }
764 //*************************************************************************************************
765 
766 
767 //*************************************************************************************************
783 template< typename MT // Type of the adapted sparse matrix
784  , bool SO > // Storage order of the adapted sparse matrix
786  HermitianMatrix<MT,SO,false>::operator()( size_t i, size_t j ) const
787 {
788  BLAZE_USER_ASSERT( i<rows() , "Invalid row access index" );
789  BLAZE_USER_ASSERT( j<columns(), "Invalid column access index" );
790 
791  return matrix_(i,j);
792 }
794 //*************************************************************************************************
795 
796 
797 //*************************************************************************************************
814 template< typename MT // Type of the adapted sparse matrix
815  , bool SO > // Storage order of the adapted sparse matrix
817  HermitianMatrix<MT,SO,false>::at( size_t i, size_t j )
818 {
819  if( i >= rows() ) {
820  BLAZE_THROW_OUT_OF_RANGE( "Invalid row access index" );
821  }
822  if( j >= columns() ) {
823  BLAZE_THROW_OUT_OF_RANGE( "Invalid column access index" );
824  }
825  return (*this)(i,j);
826 }
828 //*************************************************************************************************
829 
830 
831 //*************************************************************************************************
848 template< typename MT // Type of the adapted sparse matrix
849  , bool SO > // Storage order of the adapted sparse matrix
851  HermitianMatrix<MT,SO,false>::at( size_t i, size_t j ) const
852 {
853  if( i >= rows() ) {
854  BLAZE_THROW_OUT_OF_RANGE( "Invalid row access index" );
855  }
856  if( j >= columns() ) {
857  BLAZE_THROW_OUT_OF_RANGE( "Invalid column access index" );
858  }
859  return (*this)(i,j);
860 }
862 //*************************************************************************************************
863 
864 
865 //*************************************************************************************************
877 template< typename MT // Type of the adapted sparse matrix
878  , bool SO > // Storage order of the adapted sparse matrix
881 {
882  return Iterator( matrix_.begin(i), matrix_, i );
883 }
885 //*************************************************************************************************
886 
887 
888 //*************************************************************************************************
900 template< typename MT // Type of the adapted sparse matrix
901  , bool SO > // Storage order of the adapted sparse matrix
903  HermitianMatrix<MT,SO,false>::begin( size_t i ) const
904 {
905  return matrix_.begin(i);
906 }
908 //*************************************************************************************************
909 
910 
911 //*************************************************************************************************
923 template< typename MT // Type of the adapted sparse matrix
924  , bool SO > // Storage order of the adapted sparse matrix
926  HermitianMatrix<MT,SO,false>::cbegin( size_t i ) const
927 {
928  return matrix_.cbegin(i);
929 }
931 //*************************************************************************************************
932 
933 
934 //*************************************************************************************************
946 template< typename MT // Type of the adapted sparse matrix
947  , bool SO > // Storage order of the adapted sparse matrix
950 {
951  return Iterator( matrix_.end(i), matrix_, i );
952 }
954 //*************************************************************************************************
955 
956 
957 //*************************************************************************************************
969 template< typename MT // Type of the adapted sparse matrix
970  , bool SO > // Storage order of the adapted sparse matrix
972  HermitianMatrix<MT,SO,false>::end( size_t i ) const
973 {
974  return matrix_.end(i);
975 }
977 //*************************************************************************************************
978 
979 
980 //*************************************************************************************************
992 template< typename MT // Type of the adapted sparse matrix
993  , bool SO > // Storage order of the adapted sparse matrix
995  HermitianMatrix<MT,SO,false>::cend( size_t i ) const
996 {
997  return matrix_.cend(i);
998 }
1000 //*************************************************************************************************
1001 
1002 
1003 
1004 
1005 //=================================================================================================
1006 //
1007 // ASSIGNMENT OPERATORS
1008 //
1009 //=================================================================================================
1010 
1011 //*************************************************************************************************
1038 template< typename MT // Type of the adapted sparse matrix
1039  , bool SO > // Storage order of the adapted sparse matrix
1040 inline HermitianMatrix<MT,SO,false>&
1041  HermitianMatrix<MT,SO,false>::operator=( initializer_list< initializer_list<ElementType> > list )
1042 {
1043  const InitializerMatrix<ElementType> tmp( list, list.size() );
1044 
1045  if( !isHermitian( tmp ) ) {
1046  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to Hermitian matrix" );
1047  }
1048 
1049  matrix_ = list;
1050 
1051  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square Hermitian matrix detected" );
1052  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1053 
1054  return *this;
1055 }
1057 //*************************************************************************************************
1058 
1059 
1060 //*************************************************************************************************
1070 template< typename MT // Type of the adapted sparse matrix
1071  , bool SO > // Storage order of the adapted sparse matrix
1072 inline HermitianMatrix<MT,SO,false>&
1073  HermitianMatrix<MT,SO,false>::operator=( const HermitianMatrix& rhs )
1074 {
1075  matrix_ = rhs.matrix_;
1076 
1077  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square Hermitian matrix detected" );
1078  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1079 
1080  return *this;
1081 }
1083 //*************************************************************************************************
1084 
1085 
1086 //*************************************************************************************************
1093 template< typename MT // Type of the adapted sparse matrix
1094  , bool SO > // Storage order of the adapted sparse matrix
1095 inline HermitianMatrix<MT,SO,false>&
1096  HermitianMatrix<MT,SO,false>::operator=( HermitianMatrix&& rhs ) noexcept
1097 {
1098  matrix_ = std::move( rhs.matrix_ );
1099 
1100  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square Hermitian matrix detected" );
1101  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1102 
1103  return *this;
1104 }
1106 //*************************************************************************************************
1107 
1108 
1109 //*************************************************************************************************
1122 template< typename MT // Type of the adapted sparse matrix
1123  , bool SO > // Storage order of the adapted sparse matrix
1124 template< typename MT2 // Type of the right-hand side matrix
1125  , bool SO2 > // Storage order of the right-hand side matrix
1126 inline DisableIf_< IsComputation<MT2>, HermitianMatrix<MT,SO,false>& >
1127  HermitianMatrix<MT,SO,false>::operator=( const Matrix<MT2,SO2>& rhs )
1128 {
1129  if( !IsHermitian<MT2>::value && !isHermitian( ~rhs ) ) {
1130  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to Hermitian matrix" );
1131  }
1132 
1133  matrix_ = ~rhs;
1134 
1135  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square Hermitian matrix detected" );
1136  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1137 
1138  return *this;
1139 }
1141 //*************************************************************************************************
1142 
1143 
1144 //*************************************************************************************************
1157 template< typename MT // Type of the adapted sparse matrix
1158  , bool SO > // Storage order of the adapted sparse matrix
1159 template< typename MT2 // Type of the right-hand side matrix
1160  , bool SO2 > // Storage order of the right-hand side matrix
1161 inline EnableIf_< IsComputation<MT2>, HermitianMatrix<MT,SO,false>& >
1162  HermitianMatrix<MT,SO,false>::operator=( const Matrix<MT2,SO2>& rhs )
1163 {
1164  if( !IsSquare<MT2>::value && !isSquare( ~rhs ) ) {
1165  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to Hermitian matrix" );
1166  }
1167 
1168  if( IsHermitian<MT2>::value ) {
1169  matrix_ = ~rhs;
1170  }
1171  else {
1172  MT tmp( ~rhs );
1173 
1174  if( !isHermitian( tmp ) ) {
1175  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to Hermitian matrix" );
1176  }
1177 
1178  matrix_ = std::move( tmp );
1179  }
1180 
1181  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square Hermitian matrix detected" );
1182  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1183 
1184  return *this;
1185 }
1187 //*************************************************************************************************
1188 
1189 
1190 //*************************************************************************************************
1203 template< typename MT // Type of the adapted sparse matrix
1204  , bool SO > // Storage order of the adapted sparse matrix
1205 template< typename MT2 > // Type of the right-hand side matrix
1206 inline EnableIf_< IsBuiltin< ElementType_<MT2> >, HermitianMatrix<MT,SO,false>& >
1207  HermitianMatrix<MT,SO,false>::operator=( const Matrix<MT2,!SO>& rhs )
1208 {
1209  return this->operator=( trans( ~rhs ) );
1210 }
1212 //*************************************************************************************************
1213 
1214 
1215 //*************************************************************************************************
1228 template< typename MT // Type of the adapted sparse matrix
1229  , bool SO > // Storage order of the adapted sparse matrix
1230 template< typename MT2 // Type of the right-hand side matrix
1231  , bool SO2 > // Storage order of the right-hand side matrix
1232 inline DisableIf_< IsComputation<MT2>, HermitianMatrix<MT,SO,false>& >
1233  HermitianMatrix<MT,SO,false>::operator+=( const Matrix<MT2,SO2>& rhs )
1234 {
1235  if( !IsHermitian<MT2>::value && !isHermitian( ~rhs ) ) {
1236  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to Hermitian matrix" );
1237  }
1238 
1239  matrix_ += ~rhs;
1240 
1241  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square Hermitian matrix detected" );
1242  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1243 
1244  return *this;
1245 }
1247 //*************************************************************************************************
1248 
1249 
1250 //*************************************************************************************************
1263 template< typename MT // Type of the adapted sparse matrix
1264  , bool SO > // Storage order of the adapted sparse matrix
1265 template< typename MT2 // Type of the right-hand side matrix
1266  , bool SO2 > // Storage order of the right-hand side matrix
1267 inline EnableIf_< IsComputation<MT2>, HermitianMatrix<MT,SO,false>& >
1268  HermitianMatrix<MT,SO,false>::operator+=( const Matrix<MT2,SO2>& rhs )
1269 {
1270  if( !IsSquare<MT2>::value && !isSquare( ~rhs ) ) {
1271  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to Hermitian matrix" );
1272  }
1273 
1274  if( IsHermitian<MT2>::value ) {
1275  matrix_ += ~rhs;
1276  }
1277  else {
1278  const ResultType_<MT2> tmp( ~rhs );
1279 
1280  if( !isHermitian( tmp ) ) {
1281  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to Hermitian matrix" );
1282  }
1283 
1284  matrix_ += tmp;
1285  }
1286 
1287  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square Hermitian matrix detected" );
1288  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1289 
1290  return *this;
1291 }
1293 //*************************************************************************************************
1294 
1295 
1296 //*************************************************************************************************
1310 template< typename MT // Type of the adapted sparse matrix
1311  , bool SO > // Storage order of the adapted sparse matrix
1312 template< typename MT2 > // Type of the right-hand side matrix
1313 inline EnableIf_< IsBuiltin< ElementType_<MT2> >, HermitianMatrix<MT,SO,false>& >
1314  HermitianMatrix<MT,SO,false>::operator+=( const Matrix<MT2,!SO>& rhs )
1315 {
1316  return this->operator+=( trans( ~rhs ) );
1317 }
1319 //*************************************************************************************************
1320 
1321 
1322 //*************************************************************************************************
1335 template< typename MT // Type of the adapted sparse matrix
1336  , bool SO > // Storage order of the adapted sparse matrix
1337 template< typename MT2 // Type of the right-hand side matrix
1338  , bool SO2 > // Storage order of the right-hand side matrix
1339 inline DisableIf_< IsComputation<MT2>, HermitianMatrix<MT,SO,false>& >
1340  HermitianMatrix<MT,SO,false>::operator-=( const Matrix<MT2,SO2>& rhs )
1341 {
1342  if( !IsHermitian<MT2>::value && !isHermitian( ~rhs ) ) {
1343  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to Hermitian matrix" );
1344  }
1345 
1346  matrix_ -= ~rhs;
1347 
1348  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square Hermitian matrix detected" );
1349  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1350 
1351  return *this;
1352 }
1354 //*************************************************************************************************
1355 
1356 
1357 //*************************************************************************************************
1370 template< typename MT // Type of the adapted sparse matrix
1371  , bool SO > // Storage order of the adapted sparse matrix
1372 template< typename MT2 // Type of the right-hand side matrix
1373  , bool SO2 > // Storage order of the right-hand side matrix
1374 inline EnableIf_< IsComputation<MT2>, HermitianMatrix<MT,SO,false>& >
1375  HermitianMatrix<MT,SO,false>::operator-=( const Matrix<MT2,SO2>& rhs )
1376 {
1377  if( !IsSquare<MT2>::value && !isSquare( ~rhs ) ) {
1378  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to Hermitian matrix" );
1379  }
1380 
1381  if( IsHermitian<MT2>::value ) {
1382  matrix_ -= ~rhs;
1383  }
1384  else {
1385  const ResultType_<MT2> tmp( ~rhs );
1386 
1387  if( !isHermitian( tmp ) ) {
1388  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to Hermitian matrix" );
1389  }
1390 
1391  matrix_ -= tmp;
1392  }
1393 
1394  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square Hermitian matrix detected" );
1395  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1396 
1397  return *this;
1398 }
1400 //*************************************************************************************************
1401 
1402 
1403 //*************************************************************************************************
1417 template< typename MT // Type of the adapted sparse matrix
1418  , bool SO > // Storage order of the adapted sparse matrix
1419 template< typename MT2 > // Type of the right-hand side matrix
1420 inline EnableIf_< IsBuiltin< ElementType_<MT2> >, HermitianMatrix<MT,SO,false>& >
1421  HermitianMatrix<MT,SO,false>::operator-=( const Matrix<MT2,!SO>& rhs )
1422 {
1423  return this->operator-=( trans( ~rhs ) );
1424 }
1426 //*************************************************************************************************
1427 
1428 
1429 //*************************************************************************************************
1443 template< typename MT // Type of the adapted sparse matrix
1444  , bool SO > // Storage order of the adapted sparse matrix
1445 template< typename MT2 // Type of the right-hand side matrix
1446  , bool SO2 > // Storage order of the right-hand side matrix
1447 inline DisableIf_< IsComputation<MT2>, HermitianMatrix<MT,SO,false>& >
1448  HermitianMatrix<MT,SO,false>::operator%=( const Matrix<MT2,SO2>& rhs )
1449 {
1450  if( !IsHermitian<MT2>::value && !isHermitian( ~rhs ) ) {
1451  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to Hermitian matrix" );
1452  }
1453 
1454  matrix_ %= ~rhs;
1455 
1456  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square Hermitian matrix detected" );
1457  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1458 
1459  return *this;
1460 }
1462 //*************************************************************************************************
1463 
1464 
1465 //*************************************************************************************************
1479 template< typename MT // Type of the adapted sparse matrix
1480  , bool SO > // Storage order of the adapted sparse matrix
1481 template< typename MT2 // Type of the right-hand side matrix
1482  , bool SO2 > // Storage order of the right-hand side matrix
1483 inline EnableIf_< IsComputation<MT2>, HermitianMatrix<MT,SO,false>& >
1484  HermitianMatrix<MT,SO,false>::operator%=( const Matrix<MT2,SO2>& rhs )
1485 {
1486  if( !IsSquare<MT2>::value && !isSquare( ~rhs ) ) {
1487  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to Hermitian matrix" );
1488  }
1489 
1490  if( IsHermitian<MT2>::value ) {
1491  matrix_ %= ~rhs;
1492  }
1493  else {
1494  const ResultType_<MT2> tmp( ~rhs );
1495 
1496  if( !isHermitian( tmp ) ) {
1497  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to Hermitian matrix" );
1498  }
1499 
1500  matrix_ %= tmp;
1501  }
1502 
1503  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square Hermitian matrix detected" );
1504  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1505 
1506  return *this;
1507 }
1509 //*************************************************************************************************
1510 
1511 
1512 //*************************************************************************************************
1526 template< typename MT // Type of the adapted sparse matrix
1527  , bool SO > // Storage order of the adapted sparse matrix
1528 template< typename MT2 > // Type of the right-hand side matrix
1529 inline EnableIf_< IsBuiltin< ElementType_<MT2> >, HermitianMatrix<MT,SO,false>& >
1530  HermitianMatrix<MT,SO,false>::operator%=( const Matrix<MT2,!SO>& rhs )
1531 {
1532  return this->operator%=( trans( ~rhs ) );
1533 }
1535 //*************************************************************************************************
1536 
1537 
1538 //*************************************************************************************************
1546 template< typename MT // Type of the adapted sparse matrix
1547  , bool SO > // Storage order of the adapted sparse matrix
1548 template< typename ST > // Data type of the right-hand side scalar
1549 inline EnableIf_< IsNumeric<ST>, HermitianMatrix<MT,SO,false> >&
1551 {
1552  matrix_ *= rhs;
1553  return *this;
1554 }
1555 //*************************************************************************************************
1556 
1557 
1558 //*************************************************************************************************
1566 template< typename MT // Type of the adapted sparse matrix
1567  , bool SO > // Storage order of the adapted sparse matrix
1568 template< typename ST > // Data type of the right-hand side scalar
1569 inline EnableIf_< IsNumeric<ST>, HermitianMatrix<MT,SO,false> >&
1571 {
1572  BLAZE_USER_ASSERT( !isZero( rhs ), "Division by zero detected" );
1573 
1574  matrix_ /= rhs;
1575  return *this;
1576 }
1578 //*************************************************************************************************
1579 
1580 
1581 
1582 
1583 //=================================================================================================
1584 //
1585 // UTILITY FUNCTIONS
1586 //
1587 //=================================================================================================
1588 
1589 //*************************************************************************************************
1595 template< typename MT // Type of the adapted sparse matrix
1596  , bool SO > // Storage order of the adapted sparse matrix
1597 inline size_t HermitianMatrix<MT,SO,false>::rows() const noexcept
1598 {
1599  return matrix_.rows();
1600 }
1602 //*************************************************************************************************
1603 
1604 
1605 //*************************************************************************************************
1611 template< typename MT // Type of the adapted sparse matrix
1612  , bool SO > // Storage order of the adapted sparse matrix
1613 inline size_t HermitianMatrix<MT,SO,false>::columns() const noexcept
1614 {
1615  return matrix_.columns();
1616 }
1618 //*************************************************************************************************
1619 
1620 
1621 //*************************************************************************************************
1627 template< typename MT // Type of the adapted sparse matrix
1628  , bool SO > // Storage order of the adapted sparse matrix
1629 inline size_t HermitianMatrix<MT,SO,false>::capacity() const noexcept
1630 {
1631  return matrix_.capacity();
1632 }
1634 //*************************************************************************************************
1635 
1636 
1637 //*************************************************************************************************
1648 template< typename MT // Type of the adapted sparse matrix
1649  , bool SO > // Storage order of the adapted sparse matrix
1650 inline size_t HermitianMatrix<MT,SO,false>::capacity( size_t i ) const noexcept
1651 {
1652  return matrix_.capacity(i);
1653 }
1655 //*************************************************************************************************
1656 
1657 
1658 //*************************************************************************************************
1664 template< typename MT // Type of the adapted sparse matrix
1665  , bool SO > // Storage order of the adapted sparse matrix
1666 inline size_t HermitianMatrix<MT,SO,false>::nonZeros() const
1667 {
1668  return matrix_.nonZeros();
1669 }
1671 //*************************************************************************************************
1672 
1673 
1674 //*************************************************************************************************
1686 template< typename MT // Type of the adapted sparse matrix
1687  , bool SO > // Storage order of the adapted sparse matrix
1688 inline size_t HermitianMatrix<MT,SO,false>::nonZeros( size_t i ) const
1689 {
1690  return matrix_.nonZeros(i);
1691 }
1693 //*************************************************************************************************
1694 
1695 
1696 //*************************************************************************************************
1702 template< typename MT // Type of the adapted sparse matrix
1703  , bool SO > // Storage order of the adapted sparse matrix
1705 {
1706  matrix_.reset();
1707 }
1709 //*************************************************************************************************
1710 
1711 
1712 //*************************************************************************************************
1748 template< typename MT // Type of the adapted sparse matrix
1749  , bool SO > // Storage order of the adapted sparse matrix
1750 inline void HermitianMatrix<MT,SO,false>::reset( size_t i )
1751 {
1752  for( Iterator_<MT> it=matrix_.begin(i); it!=matrix_.end(i); ++it )
1753  {
1754  const size_t j( it->index() );
1755 
1756  if( i == j )
1757  continue;
1758 
1759  if( SO ) {
1760  const Iterator_<MT> pos( matrix_.find( i, j ) );
1761  BLAZE_INTERNAL_ASSERT( pos != matrix_.end( j ), "Missing element detected" );
1762  matrix_.erase( j, pos );
1763  }
1764  else {
1765  const Iterator_<MT> pos( matrix_.find( j, i ) );
1766  BLAZE_INTERNAL_ASSERT( pos != matrix_.end( j ), "Missing element detected" );
1767  matrix_.erase( j, pos );
1768  }
1769  }
1770 
1771  matrix_.reset( i );
1772 }
1774 //*************************************************************************************************
1775 
1776 
1777 //*************************************************************************************************
1785 template< typename MT // Type of the adapted sparse matrix
1786  , bool SO > // Storage order of the adapted sparse matrix
1788 {
1789  using blaze::clear;
1790 
1791  clear( matrix_ );
1792 }
1794 //*************************************************************************************************
1795 
1796 
1797 //*************************************************************************************************
1812 template< typename MT // Type of the adapted sparse matrix
1813  , bool SO > // Storage order of the adapted sparse matrix
1814 void HermitianMatrix<MT,SO,false>::resize( size_t n, bool preserve )
1815 {
1817 
1818  UNUSED_PARAMETER( preserve );
1819 
1820  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square Hermitian matrix detected" );
1821 
1822  matrix_.resize( n, n, true );
1823 }
1825 //*************************************************************************************************
1826 
1827 
1828 //*************************************************************************************************
1839 template< typename MT // Type of the adapted sparse matrix
1840  , bool SO > // Storage order of the adapted sparse matrix
1841 inline void HermitianMatrix<MT,SO,false>::reserve( size_t nonzeros )
1842 {
1843  matrix_.reserve( nonzeros );
1844 }
1846 //*************************************************************************************************
1847 
1848 
1849 //*************************************************************************************************
1863 template< typename MT // Type of the adapted sparse matrix
1864  , bool SO > // Storage order of the adapted sparse matrix
1865 inline void HermitianMatrix<MT,SO,false>::reserve( size_t i, size_t nonzeros )
1866 {
1867  matrix_.reserve( i, nonzeros );
1868 }
1870 //*************************************************************************************************
1871 
1872 
1873 //*************************************************************************************************
1884 template< typename MT // Type of the adapted sparse matrix
1885  , bool SO > // Storage order of the adapted sparse matrix
1886 inline void HermitianMatrix<MT,SO,false>::trim()
1887 {
1888  matrix_.trim();
1889 }
1891 //*************************************************************************************************
1892 
1893 
1894 //*************************************************************************************************
1906 template< typename MT // Type of the adapted sparse matrix
1907  , bool SO > // Storage order of the adapted sparse matrix
1908 inline void HermitianMatrix<MT,SO,false>::trim( size_t i )
1909 {
1910  matrix_.trim( i );
1911 }
1913 //*************************************************************************************************
1914 
1915 
1916 //*************************************************************************************************
1926 template< typename MT // Type of the adapted sparse matrix
1927  , bool SO > // Storage order of the adapted sparse matrix
1929 {
1930  matrix_.shrinkToFit();
1931 }
1933 //*************************************************************************************************
1934 
1935 
1936 //*************************************************************************************************
1943 template< typename MT // Type of the adapted sparse matrix
1944  , bool SO > // Storage order of the adapted sparse matrix
1945 inline void HermitianMatrix<MT,SO,false>::swap( HermitianMatrix& m ) noexcept
1946 {
1947  using std::swap;
1948 
1949  swap( matrix_, m.matrix_ );
1950 }
1952 //*************************************************************************************************
1953 
1954 
1955 
1956 
1957 //=================================================================================================
1958 //
1959 // INSERTION FUNCTIONS
1960 //
1961 //=================================================================================================
1962 
1963 //*************************************************************************************************
1978 template< typename MT // Type of the adapted sparse matrix
1979  , bool SO > // Storage order of the adapted sparse matrix
1981  HermitianMatrix<MT,SO,false>::set( size_t i, size_t j, const ElementType& value )
1982 {
1983  const bool isDiagonal( i == j );
1984 
1985  if( IsComplex<ElementType>::value && isDiagonal && !isReal( value ) ) {
1986  BLAZE_THROW_INVALID_ARGUMENT( "Invalid access to diagonal matrix element" );
1987  }
1988 
1989  if( !isDiagonal )
1990  matrix_.set( j, i, conj( value ) );
1991  return Iterator( matrix_.set( i, j, value ), matrix_, ( SO ? j : i ) );
1992 }
1994 //*************************************************************************************************
1995 
1996 
1997 //*************************************************************************************************
2013 template< typename MT // Type of the adapted sparse matrix
2014  , bool SO > // Storage order of the adapted sparse matrix
2016  HermitianMatrix<MT,SO,false>::insert( size_t i, size_t j, const ElementType& value )
2017 {
2018  const bool isDiagonal( i == j );
2019 
2020  if( IsComplex<ElementType>::value && isDiagonal && !isReal( value ) ) {
2021  BLAZE_THROW_INVALID_ARGUMENT( "Invalid access to diagonal matrix element" );
2022  }
2023 
2024  if( !isDiagonal )
2025  matrix_.insert( j, i, conj( value ) );
2026  return Iterator( matrix_.insert( i, j, value ), matrix_, ( SO ? j : i ) );
2027 }
2029 //*************************************************************************************************
2030 
2031 
2032 //*************************************************************************************************
2091 template< typename MT // Type of the adapted sparse matrix
2092  , bool SO > // Storage order of the adapted sparse matrix
2093 inline void HermitianMatrix<MT,SO,false>::append( size_t i, size_t j, const ElementType& value, bool check )
2094 {
2095  const bool isDiagonal( i == j );
2096 
2097  if( IsComplex<ElementType>::value && isDiagonal && !isReal( value ) ) {
2098  BLAZE_THROW_INVALID_ARGUMENT( "Invalid access to diagonal matrix element" );
2099  }
2100 
2101  matrix_.append( i, j, value, check );
2102  if( !isDiagonal && ( !check || !isDefault<strict>( value ) ) )
2103  matrix_.insert( j, i, conj( value ) );
2104 }
2106 //*************************************************************************************************
2107 
2108 
2109 //*************************************************************************************************
2123 template< typename MT // Type of the adapted sparse matrix
2124  , bool SO > // Storage order of the adapted sparse matrix
2125 inline void HermitianMatrix<MT,SO,false>::finalize( size_t i )
2126 {
2127  matrix_.trim( i );
2128 }
2130 //*************************************************************************************************
2131 
2132 
2133 
2134 
2135 //=================================================================================================
2136 //
2137 // ERASE FUNCTIONS
2138 //
2139 //=================================================================================================
2140 
2141 //*************************************************************************************************
2151 template< typename MT // Type of the adapted sparse matrix
2152  , bool SO > // Storage order of the adapted sparse matrix
2153 inline void HermitianMatrix<MT,SO,false>::erase( size_t i, size_t j )
2154 {
2155  matrix_.erase( i, j );
2156  if( i != j )
2157  matrix_.erase( j, i );
2158 }
2160 //*************************************************************************************************
2161 
2162 
2163 //*************************************************************************************************
2175 template< typename MT // Type of the adapted sparse matrix
2176  , bool SO > // Storage order of the adapted sparse matrix
2178  HermitianMatrix<MT,SO,false>::erase( size_t i, Iterator pos )
2179 {
2180  const Iterator_<MT> base( pos.base() );
2181 
2182  if( base == matrix_.end( i ) )
2183  return pos;
2184 
2185  const size_t j( base->index() );
2186 
2187  if( i == j ) {
2188  BLAZE_INTERNAL_ASSERT( matrix_.find( i, i ) != matrix_.end( i ), "Missing element detected" );
2189  return Iterator( matrix_.erase( i, base ), matrix_, i );
2190  }
2191 
2192  if( SO ) {
2193  BLAZE_INTERNAL_ASSERT( matrix_.find( i, j ) != matrix_.end( j ), "Missing element detected" );
2194  matrix_.erase( j, matrix_.find( i, j ) );
2195  return Iterator( matrix_.erase( i, base ), matrix_, i );
2196  }
2197  else {
2198  BLAZE_INTERNAL_ASSERT( matrix_.find( j, i ) != matrix_.end( j ), "Missing element detected" );
2199  matrix_.erase( j, matrix_.find( j, i ) );
2200  return Iterator( matrix_.erase( i, base ), matrix_, i );
2201  }
2202 }
2204 //*************************************************************************************************
2205 
2206 
2207 //*************************************************************************************************
2221 template< typename MT // Type of the adapted sparse matrix
2222  , bool SO > // Storage order of the adapted sparse matrix
2224  HermitianMatrix<MT,SO,false>::erase( size_t i, Iterator first, Iterator last )
2225 {
2226  for( Iterator_<MT> it=first.base(); it!=last.base(); ++it )
2227  {
2228  const size_t j( it->index() );
2229 
2230  if( i == j )
2231  continue;
2232 
2233  if( SO ) {
2234  BLAZE_INTERNAL_ASSERT( matrix_.find( i, j ) != matrix_.end( j ), "Missing element detected" );
2235  matrix_.erase( i, j );
2236  }
2237  else {
2238  BLAZE_INTERNAL_ASSERT( matrix_.find( j, i ) != matrix_.end( j ), "Missing element detected" );
2239  matrix_.erase( j, i );
2240  }
2241  }
2242 
2243  return Iterator( matrix_.erase( i, first.base(), last.base() ), matrix_, i );
2244 }
2246 //*************************************************************************************************
2247 
2248 
2249 //*************************************************************************************************
2271 template< typename MT // Type of the adapted sparse matrix
2272  , bool SO > // Storage order of the adapted sparse matrix
2273 template< typename Pred > // Type of the unary predicate
2274 inline void HermitianMatrix<MT,SO,false>::erase( Pred predicate )
2275 {
2276  matrix_.erase( [predicate=predicate]( const ElementType& value ) {
2277  return predicate( value ) || predicate( conj( value ) );
2278  } );
2279 
2280  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
2281 }
2283 //*************************************************************************************************
2284 
2285 
2286 //*************************************************************************************************
2314 template< typename MT // Type of the adapted sparse matrix
2315  , bool SO > // Storage order of the adapted sparse matrix
2316 template< typename Pred > // Type of the unary predicate
2317 inline void
2318  HermitianMatrix<MT,SO,false>::erase( size_t i, Iterator first, Iterator last, Pred predicate )
2319 {
2320  for( Iterator it=first; it!=last; ++it ) {
2321  const size_t j( it->index() );
2322  if( i != j && predicate( it->value() ) ) {
2323  if( SO )
2324  matrix_.erase( i, j );
2325  else
2326  matrix_.erase( j, i );
2327  }
2328  }
2329 
2330  matrix_.erase( i, first.base(), last.base(), predicate );
2331 
2332  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
2333 }
2335 //*************************************************************************************************
2336 
2337 
2338 
2339 
2340 //=================================================================================================
2341 //
2342 // LOOKUP FUNCTIONS
2343 //
2344 //=================================================================================================
2345 
2346 //*************************************************************************************************
2362 template< typename MT // Type of the adapted sparse matrix
2363  , bool SO > // Storage order of the adapted sparse matrix
2365  HermitianMatrix<MT,SO,false>::find( size_t i, size_t j )
2366 {
2367  return Iterator( matrix_.find( i, j ), matrix_, ( SO ? j : i ) );
2368 }
2370 //*************************************************************************************************
2371 
2372 
2373 //*************************************************************************************************
2389 template< typename MT // Type of the adapted sparse matrix
2390  , bool SO > // Storage order of the adapted sparse matrix
2392  HermitianMatrix<MT,SO,false>::find( size_t i, size_t j ) const
2393 {
2394  return matrix_.find( i, j );
2395 }
2397 //*************************************************************************************************
2398 
2399 
2400 //*************************************************************************************************
2416 template< typename MT // Type of the adapted sparse matrix
2417  , bool SO > // Storage order of the adapted sparse matrix
2419  HermitianMatrix<MT,SO,false>::lowerBound( size_t i, size_t j )
2420 {
2421  return Iterator( matrix_.lowerBound( i, j ), matrix_, ( SO ? j : i ) );
2422 }
2424 //*************************************************************************************************
2425 
2426 
2427 //*************************************************************************************************
2443 template< typename MT // Type of the adapted sparse matrix
2444  , bool SO > // Storage order of the adapted sparse matrix
2446  HermitianMatrix<MT,SO,false>::lowerBound( size_t i, size_t j ) const
2447 {
2448  return matrix_.lowerBound( i, j );
2449 }
2451 //*************************************************************************************************
2452 
2453 
2454 //*************************************************************************************************
2470 template< typename MT // Type of the adapted sparse matrix
2471  , bool SO > // Storage order of the adapted sparse matrix
2473  HermitianMatrix<MT,SO,false>::upperBound( size_t i, size_t j )
2474 {
2475  return Iterator( matrix_.upperBound( i, j ), matrix_, ( SO ? j : i ) );
2476 }
2478 //*************************************************************************************************
2479 
2480 
2481 //*************************************************************************************************
2497 template< typename MT // Type of the adapted sparse matrix
2498  , bool SO > // Storage order of the adapted sparse matrix
2500  HermitianMatrix<MT,SO,false>::upperBound( size_t i, size_t j ) const
2501 {
2502  return matrix_.upperBound( i, j );
2503 }
2505 //*************************************************************************************************
2506 
2507 
2508 
2509 
2510 //=================================================================================================
2511 //
2512 // NUMERIC FUNCTIONS
2513 //
2514 //=================================================================================================
2515 
2516 //*************************************************************************************************
2522 template< typename MT // Type of the adapted sparse matrix
2523  , bool SO > // Storage order of the adapted sparse matrix
2524 inline HermitianMatrix<MT,SO,false>& HermitianMatrix<MT,SO,false>::transpose()
2525 {
2526  if( IsComplex<ElementType>::value )
2527  matrix_.transpose();
2528  return *this;
2529 }
2531 //*************************************************************************************************
2532 
2533 
2534 //*************************************************************************************************
2540 template< typename MT // Type of the adapted sparse matrix
2541  , bool SO > // Storage order of the adapted sparse matrix
2542 inline HermitianMatrix<MT,SO,false>& HermitianMatrix<MT,SO,false>::ctranspose()
2543 {
2544  return *this;
2545 }
2547 //*************************************************************************************************
2548 
2549 
2550 //*************************************************************************************************
2568 template< typename MT // Type of the adapted sparse matrix
2569  , bool SO > // Storage order of the adapted sparse matrix
2570 template< typename Other > // Data type of the scalar value
2571 inline HermitianMatrix<MT,SO,false>&
2572  HermitianMatrix<MT,SO,false>::scale( const Other& scalar )
2573 {
2574  matrix_.scale( scalar );
2575  return *this;
2576 }
2578 //*************************************************************************************************
2579 
2580 
2581 
2582 
2583 //=================================================================================================
2584 //
2585 // DEBUGGING FUNCTIONS
2586 //
2587 //=================================================================================================
2588 
2589 //*************************************************************************************************
2599 template< typename MT // Type of the adapted sparse matrix
2600  , bool SO > // Storage order of the adapted sparse matrix
2601 inline bool HermitianMatrix<MT,SO,false>::isIntact() const noexcept
2602 {
2603  using blaze::isIntact;
2604 
2605  return ( isIntact( matrix_ ) && isHermitian( matrix_ ) );
2606 }
2608 //*************************************************************************************************
2609 
2610 
2611 
2612 
2613 //=================================================================================================
2614 //
2615 // EXPRESSION TEMPLATE EVALUATION FUNCTIONS
2616 //
2617 //=================================================================================================
2618 
2619 //*************************************************************************************************
2630 template< typename MT // Type of the adapted sparse matrix
2631  , bool SO > // Storage order of the adapted sparse matrix
2632 template< typename Other > // Data type of the foreign expression
2633 inline bool HermitianMatrix<MT,SO,false>::canAlias( const Other* alias ) const noexcept
2634 {
2635  return matrix_.canAlias( alias );
2636 }
2638 //*************************************************************************************************
2639 
2640 
2641 //*************************************************************************************************
2652 template< typename MT // Type of the adapted sparse matrix
2653  , bool SO > // Storage order of the adapted sparse matrix
2654 template< typename Other > // Data type of the foreign expression
2655 inline bool HermitianMatrix<MT,SO,false>::isAliased( const Other* alias ) const noexcept
2656 {
2657  return matrix_.isAliased( alias );
2658 }
2660 //*************************************************************************************************
2661 
2662 
2663 //*************************************************************************************************
2674 template< typename MT // Type of the adapted sparse matrix
2675  , bool SO > // Storage order of the adapted sparse matrix
2676 inline bool HermitianMatrix<MT,SO,false>::canSMPAssign() const noexcept
2677 {
2678  return matrix_.canSMPAssign();
2679 }
2681 //*************************************************************************************************
2682 
2683 
2684 
2685 
2686 //=================================================================================================
2687 //
2688 // CONSTRUCTION FUNCTIONS
2689 //
2690 //=================================================================================================
2691 
2692 //*************************************************************************************************
2694 template< typename MT // Type of the adapted dense matrix
2695  , bool SO > // Storage order of the adapted dense matrix
2696 template< typename MT2 // Type of the foreign matrix
2697  , bool SO2 // Storage order of the foreign matrix
2698  , typename T > // Type of the third argument
2699 inline const MT2& HermitianMatrix<MT,SO,false>::construct( const Matrix<MT2,SO2>& m, T )
2700 {
2701  return ~m;
2702 }
2704 //*************************************************************************************************
2705 
2706 
2707 //*************************************************************************************************
2709 template< typename MT // Type of the adapted dense matrix
2710  , bool SO > // Storage order of the adapted dense matrix
2711 template< typename MT2 > // Type of the foreign matrix
2712 inline TransExprTrait_<MT2>
2713  HermitianMatrix<MT,SO,false>::construct( const Matrix<MT2,!SO>& m, TrueType )
2714 {
2715  return trans( ~m );
2716 }
2718 //*************************************************************************************************
2719 
2720 } // namespace blaze
2721 
2722 #endif
bool isReal(const DiagonalProxy< MT > &proxy)
Returns whether the matrix element represents a real number.
Definition: DiagonalProxy.h:650
#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.
Constraint on the data type.
CompressedMatrix< Type, false > OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: CompressedMatrix.h:3077
#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 UNUSED_PARAMETER function template.
BLAZE_ALWAYS_INLINE size_t capacity(const Matrix< MT, SO > &matrix) noexcept
Returns the maximum capacity of the matrix.
Definition: Matrix.h:522
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:3076
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:364
CompressedMatrix< Type, true > This
Type of this CompressedMatrix instance.
Definition: CompressedMatrix.h:3074
Constraint on the data type.
void reset(const DiagonalProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: DiagonalProxy.h:588
BLAZE_ALWAYS_INLINE void shrinkToFit(Matrix< MT, SO > &matrix)
Requesting the removal of unused capacity.
Definition: Matrix.h:775
void clear(CompressedMatrix< Type, SO > &m)
Clearing the given compressed matrix.
Definition: CompressedMatrix.h:5829
CompressedMatrix< Type, false > TransposeType
Transpose type for expression template evaluations.
Definition: CompressedMatrix.h:3078
BLAZE_ALWAYS_INLINE void ctranspose(Matrix< MT, SO > &matrix)
In-place conjugate transpose of the given matrix.
Definition: Matrix.h:827
const Type & ConstReference
Reference to a constant matrix value.
Definition: CompressedMatrix.h:3083
#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
bool isDiagonal(const DenseMatrix< MT, SO > &dm)
Checks if the give dense matrix is diagonal.
Definition: DenseMatrix.h:1725
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:560
const DenseIterator< Type, AF > operator-(const DenseIterator< Type, AF > &it, ptrdiff_t inc) noexcept
Subtraction between a DenseIterator and an integral value.
Definition: DenseIterator.h:733
BoolConstant< true > TrueType
Type traits base class.The TrueType class is used as base class for type traits and value traits that...
Definition: TrueType.h:61
Element * Iterator
Iterator over non-constant elements.
Definition: CompressedMatrix.h:3084
Header file for the extended initializer_list functionality.
Constraint on the data type.
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:474
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:408
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.
bool isZero(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is 0.
Definition: DiagonalProxy.h:670
Header file for the implementation of a matrix representation of an initializer list.
typename TransExprTrait< T >::Type TransExprTrait_
Auxiliary alias declaration for the TransExprTrait class template.The TransExprTrait_ alias declarati...
Definition: TransExprTrait.h:112
Header file for the DisableIf class template.
MatrixAccessProxy< This > Reference
Reference to a non-constant matrix value.
Definition: CompressedMatrix.h:3082
Header file for the clear shim.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58
void swap(CompressedMatrix< Type, SO > &a, CompressedMatrix< Type, SO > &b) noexcept
Swapping the contents of two compressed matrices.
Definition: CompressedMatrix.h:5908
Compile time assertion.
bool isIntact(const CompressedMatrix< Type, SO > &m)
Returns whether the invariants of the given compressed matrix are intact.
Definition: CompressedMatrix.h:5891
SparseMatrix< This, true > BaseType
Base type of this CompressedMatrix instance.
Definition: CompressedMatrix.h:3075
#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:3079
#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:3085
Header file for the isZero shim.
constexpr bool operator==(const NegativeAccuracy< A > &lhs, const T &rhs)
Equality comparison between a NegativeAccuracy object and a floating point value. ...
Definition: Accuracy.h:250
typename T::ElementType ElementType_
Alias declaration for nested ElementType type definitions.The ElementType_ alias declaration provides...
Definition: Aliases.h:163
Constraint on the data type.
BLAZE_ALWAYS_INLINE size_t columns(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of columns of the matrix.
Definition: Matrix.h:506
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
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:714
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:430
decltype(auto) operator*(const DenseMatrix< MT1, false > &lhs, const DenseMatrix< MT2, false > &rhs)
Multiplication operator for the multiplication of two row-major dense matrices ( ).
Definition: DMatDMatMultExpr.h:8893
constexpr bool operator!=(const NegativeAccuracy< A > &lhs, const T &rhs)
Inequality comparison between a NegativeAccuracy object and a floating point value.
Definition: Accuracy.h:290
Header file for the implementation of the base template of the HeritianMatrix.
Header file for all forward declarations for expression class templates.
Header file for the HermitianElement class.
Header file for the EnableIf class template.
void clear(const DiagonalProxy< MT > &proxy)
Clearing the represented element.
Definition: DiagonalProxy.h:608
Header file for the conjugate shim.
Header file for the IsNumeric type trait.
BLAZE_ALWAYS_INLINE const EnableIf_< And< IsIntegral< T >, HasSize< T, 1UL > >, If_< IsSigned< T >, SIMDint8, SIMDuint8 > > set(T value) noexcept
Sets all values in the vector to the given 1-byte integral value.
Definition: Set.h:76
#define BLAZE_CONSTRAINT_MUST_NOT_BE_SYMMETRIC_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is a symmetric matrix type, a compilation error is created.
Definition: Symmetric.h:79
BLAZE_ALWAYS_INLINE T1 & operator+=(SIMDPack< T1 > &lhs, const SIMDPack< T2 > &rhs)
Addition assignment operator for the addition of two SIMD packs.
Definition: BasicTypes.h:1357
Header file for run time assertion macros.
Constraint on the data type.
Constraint on the data type.
#define BLAZE_CONSTRAINT_MUST_BE_NUMERIC_TYPE(T)
Constraint on the data type.In case the given data type T is not a numeric (integral or floating poin...
Definition: Numeric.h:61
#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
bool isHermitian(const DenseMatrix< MT, SO > &dm)
Checks if the given dense matrix is Hermitian.
Definition: DenseMatrix.h:919
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:272
Header file for the TransExprTrait class template.
Constraint on the data type.
Constraint on the data type.
BLAZE_ALWAYS_INLINE size_t rows(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of rows of the matrix.
Definition: Matrix.h:490
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:3080
decltype(auto) trans(const DenseMatrix< MT, SO > &dm)
Calculation of the transpose of the given dense matrix.
Definition: DMatTransExpr.h:789
EnableIf_< IsNumeric< ST >, MT &> operator/=(DenseMatrix< MT, SO > &mat, ST scalar)
Division assignment operator for the division of a dense matrix by a scalar value ( )...
Definition: DenseMatrix.h:655
#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.
Header file for the IsBuiltin type trait.
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:3081
#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
Header file for the HermitianProxy class.
bool isIntact(const DiagonalMatrix< MT, SO, DF > &m)
Returns whether the invariants of the given diagonal matrix are intact.
Definition: DiagonalMatrix.h:254
Header file for the IsComplex type trait.
bool isDefault(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: DiagonalProxy.h:628
#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
void UNUSED_PARAMETER(const Args &...)
Suppression of unused parameter warnings.
Definition: Unused.h:81
decltype(auto) conj(const DenseMatrix< MT, SO > &dm)
Returns a matrix containing the complex conjugate of each single element of dm.
Definition: DMatMapExpr.h:1321
#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
EnableIf_< IsNumeric< ST >, MT &> operator*=(DenseMatrix< MT, SO > &mat, ST scalar)
Multiplication assignment operator for the multiplication of a dense matrix and a scalar value ( )...
Definition: DenseMatrix.h:593
Header file for the IsHermitian type trait.
BLAZE_ALWAYS_INLINE bool isSquare(const Matrix< MT, SO > &matrix) noexcept
Checks if the given matrix is a square matrix.
Definition: Matrix.h:908
Header file for the Size type trait.
Header file for the isReal shim.
#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
Header file for the TrueType type/value trait base class.
BLAZE_ALWAYS_INLINE void transpose(Matrix< MT, SO > &matrix)
In-place transpose of the given matrix.
Definition: Matrix.h:801