Dense.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_ADAPTORS_HERMITIANMATRIX_DENSE_H_
36 #define _BLAZE_MATH_ADAPTORS_HERMITIANMATRIX_DENSE_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
43 #include <algorithm>
44 #include <iterator>
58 #include <blaze/math/Functions.h>
59 #include <blaze/math/Intrinsics.h>
60 #include <blaze/math/shims/Clear.h>
62 #include <blaze/math/shims/Move.h>
73 #include <blaze/math/views/Row.h>
75 #include <blaze/system/Inline.h>
76 #include <blaze/util/Assert.h>
82 #include <blaze/util/DisableIf.h>
83 #include <blaze/util/EnableIf.h>
84 #include <blaze/util/Exception.h>
85 #include <blaze/util/mpl/If.h>
87 #include <blaze/util/TrueType.h>
88 #include <blaze/util/Types.h>
92 #include <blaze/util/Unused.h>
93 
94 
95 namespace blaze {
96 
97 //=================================================================================================
98 //
99 // CLASS TEMPLATE SPECIALIZATION FOR DENSE MATRICES
100 //
101 //=================================================================================================
102 
103 //*************************************************************************************************
111 template< typename MT // Type of the adapted dense matrix
112  , bool SO > // Storage order of the adapted dense matrix
113 class HermitianMatrix<MT,SO,true>
114  : public DenseMatrix< HermitianMatrix<MT,SO,true>, SO >
115 {
116  private:
117  //**Type definitions****************************************************************************
118  typedef typename MT::OppositeType OT;
119  typedef typename MT::TransposeType TT;
120  typedef typename MT::ElementType ET;
121  typedef IntrinsicTrait<ET> IT;
122  //**********************************************************************************************
123 
124  public:
125  //**Type definitions****************************************************************************
126  typedef HermitianMatrix<MT,SO,true> This;
127  typedef This ResultType;
128  typedef HermitianMatrix<OT,!SO,true> OppositeType;
129  typedef HermitianMatrix<TT,!SO,true> TransposeType;
130  typedef ET ElementType;
131  typedef typename MT::IntrinsicType IntrinsicType;
132  typedef typename MT::ReturnType ReturnType;
133  typedef const This& CompositeType;
134  typedef HermitianProxy<MT> Reference;
135  typedef typename MT::ConstReference ConstReference;
136  typedef typename MT::Pointer Pointer;
137  typedef typename MT::ConstPointer ConstPointer;
138  typedef typename MT::ConstIterator ConstIterator;
139  //**********************************************************************************************
140 
141  //**Rebind struct definition********************************************************************
144  template< typename ET > // Data type of the other matrix
145  struct Rebind {
147  typedef HermitianMatrix< typename MT::template Rebind<ET>::Other > Other;
148  };
149  //**********************************************************************************************
150 
151  //**Iterator class definition*******************************************************************
154  class Iterator
155  {
156  public:
157  //**Type definitions*************************************************************************
158  typedef std::random_access_iterator_tag IteratorCategory;
159  typedef typename MT::ElementType ValueType;
160  typedef HermitianProxy<MT> PointerType;
161  typedef HermitianProxy<MT> ReferenceType;
162  typedef ptrdiff_t DifferenceType;
163 
164  // STL iterator requirements
165  typedef IteratorCategory iterator_category;
166  typedef ValueType value_type;
167  typedef PointerType pointer;
168  typedef ReferenceType reference;
169  typedef DifferenceType difference_type;
170  //*******************************************************************************************
171 
172  //**Constructor******************************************************************************
175  inline Iterator()
176  : matrix_( NULL ) // Reference to the adapted dense matrix
177  , row_ ( 0UL ) // The current row index of the iterator
178  , column_( 0UL ) // The current column index of the iterator
179  {}
180  //*******************************************************************************************
181 
182  //**Constructor******************************************************************************
189  inline Iterator( MT& matrix, size_t row, size_t column )
190  : matrix_( &matrix ) // Reference to the adapted dense matrix
191  , row_ ( row ) // The current row index of the iterator
192  , column_( column ) // The current column index of the iterator
193  {}
194  //*******************************************************************************************
195 
196  //**Addition assignment operator*************************************************************
202  inline Iterator& operator+=( size_t inc ) {
203  ( SO )?( row_ += inc ):( column_ += inc );
204  return *this;
205  }
206  //*******************************************************************************************
207 
208  //**Subtraction assignment operator**********************************************************
214  inline Iterator& operator-=( size_t dec ) {
215  ( SO )?( row_ -= dec ):( column_ -= dec );
216  return *this;
217  }
218  //*******************************************************************************************
219 
220  //**Prefix increment operator****************************************************************
225  inline Iterator& operator++() {
226  ( SO )?( ++row_ ):( ++column_ );
227  return *this;
228  }
229  //*******************************************************************************************
230 
231  //**Postfix increment operator***************************************************************
236  inline const Iterator operator++( int ) {
237  const Iterator tmp( *this );
238  ++(*this);
239  return tmp;
240  }
241  //*******************************************************************************************
242 
243  //**Prefix decrement operator****************************************************************
248  inline Iterator& operator--() {
249  ( SO )?( --row_ ):( --column_ );
250  return *this;
251  }
252  //*******************************************************************************************
253 
254  //**Postfix decrement operator***************************************************************
259  inline const Iterator operator--( int ) {
260  const Iterator tmp( *this );
261  --(*this);
262  return tmp;
263  }
264  //*******************************************************************************************
265 
266  //**Element access operator******************************************************************
271  inline ReferenceType operator*() const {
272  return ReferenceType( *matrix_, row_, column_ );
273  }
274  //*******************************************************************************************
275 
276  //**Element access operator******************************************************************
281  inline PointerType operator->() const {
282  return PointerType( *matrix_, row_, column_ );
283  }
284  //*******************************************************************************************
285 
286  //**Conversion operator**********************************************************************
291  inline operator ConstIterator() const {
292  if( SO )
293  return matrix_->begin( column_ ) + row_;
294  else
295  return matrix_->begin( row_ ) + column_;
296  }
297  //*******************************************************************************************
298 
299  //**Equality operator************************************************************************
306  friend inline bool operator==( const Iterator& lhs, const Iterator& rhs ) {
307  return ( SO )?( lhs.row_ == rhs.row_ ):( lhs.column_ == rhs.column_ );
308  }
309  //*******************************************************************************************
310 
311  //**Equality operator************************************************************************
318  friend inline bool operator==( const Iterator& lhs, const ConstIterator& rhs ) {
319  return ( ConstIterator( lhs ) == rhs );
320  }
321  //*******************************************************************************************
322 
323  //**Equality operator************************************************************************
330  friend inline bool operator==( const ConstIterator& lhs, const Iterator& rhs ) {
331  return ( lhs == ConstIterator( rhs ) );
332  }
333  //*******************************************************************************************
334 
335  //**Inequality operator**********************************************************************
342  friend inline bool operator!=( const Iterator& lhs, const Iterator& rhs ) {
343  return ( SO )?( lhs.row_ != rhs.row_ ):( lhs.column_ != rhs.column_ );
344  }
345  //*******************************************************************************************
346 
347  //**Inequality operator**********************************************************************
354  friend inline bool operator!=( const Iterator& lhs, const ConstIterator& rhs ) {
355  return ( ConstIterator( lhs ) != rhs );
356  }
357  //*******************************************************************************************
358 
359  //**Inequality operator**********************************************************************
366  friend inline bool operator!=( const ConstIterator& lhs, const Iterator& rhs ) {
367  return ( lhs != ConstIterator( rhs ) );
368  }
369  //*******************************************************************************************
370 
371  //**Less-than operator***********************************************************************
378  friend inline bool operator<( const Iterator& lhs, const Iterator& rhs ) {
379  return ( SO )?( lhs.row_ < rhs.row_ ):( lhs.column_ < rhs.column_ );
380  }
381  //*******************************************************************************************
382 
383  //**Less-than operator***********************************************************************
390  friend inline bool operator<( const Iterator& lhs, const ConstIterator& rhs ) {
391  return ( ConstIterator( lhs ) < rhs );
392  }
393  //*******************************************************************************************
394 
395  //**Less-than operator***********************************************************************
402  friend inline bool operator<( const ConstIterator& lhs, const Iterator& rhs ) {
403  return ( lhs < ConstIterator( rhs ) );
404  }
405  //*******************************************************************************************
406 
407  //**Greater-than operator********************************************************************
414  friend inline bool operator>( const Iterator& lhs, const Iterator& rhs ) {
415  return ( SO )?( lhs.row_ > rhs.row_ ):( lhs.column_ > rhs.column_ );
416  }
417  //*******************************************************************************************
418 
419  //**Greater-than operator********************************************************************
426  friend inline bool operator>( const Iterator& lhs, const ConstIterator& rhs ) {
427  return ( ConstIterator( lhs ) > rhs );
428  }
429  //*******************************************************************************************
430 
431  //**Greater-than operator********************************************************************
438  friend inline bool operator>( const ConstIterator& lhs, const Iterator& rhs ) {
439  return ( lhs > ConstIterator( rhs ) );
440  }
441  //*******************************************************************************************
442 
443  //**Less-or-equal-than operator**************************************************************
450  friend inline bool operator<=( const Iterator& lhs, const Iterator& rhs ) {
451  return ( SO )?( lhs.row_ <= rhs.row_ ):( lhs.column_ <= rhs.column_ );
452  }
453  //*******************************************************************************************
454 
455  //**Less-or-equal-than operator**************************************************************
462  friend inline bool operator<=( const Iterator& lhs, const ConstIterator& rhs ) {
463  return ( ConstIterator( lhs ) <= rhs );
464  }
465  //*******************************************************************************************
466 
467  //**Less-or-equal-than operator**************************************************************
474  friend inline bool operator<=( const ConstIterator& lhs, const Iterator& rhs ) {
475  return ( lhs <= ConstIterator( rhs ) );
476  }
477  //*******************************************************************************************
478 
479  //**Greater-or-equal-than operator***********************************************************
486  friend inline bool operator>=( const Iterator& lhs, const Iterator& rhs ) {
487  return ( SO )?( lhs.row_ >= rhs.row_ ):( lhs.column_ >= rhs.column_ );
488  }
489  //*******************************************************************************************
490 
491  //**Greater-or-equal-than operator***********************************************************
498  friend inline bool operator>=( const Iterator& lhs, const ConstIterator& rhs ) {
499  return ( ConstIterator( lhs ) >= rhs );
500  }
501  //*******************************************************************************************
502 
503  //**Greater-or-equal-than operator***********************************************************
510  friend inline bool operator>=( const ConstIterator& lhs, const Iterator& rhs ) {
511  return ( lhs >= ConstIterator( rhs ) );
512  }
513  //*******************************************************************************************
514 
515  //**Subtraction operator*********************************************************************
521  inline DifferenceType operator-( const Iterator& rhs ) const {
522  return ( SO )?( row_ - rhs.row_ ):( column_ - rhs.column_ );
523  }
524  //*******************************************************************************************
525 
526  //**Addition operator************************************************************************
533  friend inline const Iterator operator+( const Iterator& it, size_t inc ) {
534  if( SO )
535  return Iterator( *it.matrix_, it.row_ + inc, it.column_ );
536  else
537  return Iterator( *it.matrix_, it.row_, it.column_ + inc );
538  }
539  //*******************************************************************************************
540 
541  //**Addition operator************************************************************************
548  friend inline const Iterator operator+( size_t inc, const Iterator& it ) {
549  if( SO )
550  return Iterator( *it.matrix_, it.row_ + inc, it.column_ );
551  else
552  return Iterator( *it.matrix_, it.row_, it.column_ + inc );
553  }
554  //*******************************************************************************************
555 
556  //**Subtraction operator*********************************************************************
563  friend inline const Iterator operator-( const Iterator& it, size_t dec ) {
564  if( SO )
565  return Iterator( *it.matrix_, it.row_ - dec, it.column_ );
566  else
567  return Iterator( *it.matrix_, it.row_, it.column_ - dec );
568  }
569  //*******************************************************************************************
570 
571  private:
572  //**Member variables*************************************************************************
573  MT* matrix_;
574  size_t row_;
575  size_t column_;
576  //*******************************************************************************************
577  };
578  //**********************************************************************************************
579 
580  //**Compilation flags***************************************************************************
582  enum { vectorizable = MT::vectorizable };
583 
585  enum { smpAssignable = MT::smpAssignable };
586  //**********************************************************************************************
587 
588  //**Constructors********************************************************************************
591  explicit inline HermitianMatrix();
592  explicit inline HermitianMatrix( size_t n );
593 
594  explicit inline HermitianMatrix( ElementType* ptr, size_t n );
595  explicit inline HermitianMatrix( ElementType* ptr, size_t n, size_t nn );
596 
597  template< typename Deleter >
598  explicit inline HermitianMatrix( ElementType* ptr, size_t n, Deleter d );
599 
600  template< typename Deleter >
601  explicit inline HermitianMatrix( ElementType* ptr, size_t n, size_t nn, Deleter d );
602 
603  inline HermitianMatrix( const HermitianMatrix& m );
604  template< typename MT2, bool SO2 > inline HermitianMatrix( const Matrix<MT2,SO2>& m );
606  //**********************************************************************************************
607 
608  //**Destructor**********************************************************************************
609  // No explicitly declared destructor.
610  //**********************************************************************************************
611 
612  //**Data access functions***********************************************************************
615  inline Reference operator()( size_t i, size_t j );
616  inline ConstReference operator()( size_t i, size_t j ) const;
617  inline Reference at( size_t i, size_t j );
618  inline ConstReference at( size_t i, size_t j ) const;
619  inline ConstPointer data () const;
620  inline ConstPointer data ( size_t i ) const;
621  inline Iterator begin ( size_t i );
622  inline ConstIterator begin ( size_t i ) const;
623  inline ConstIterator cbegin( size_t i ) const;
624  inline Iterator end ( size_t i );
625  inline ConstIterator end ( size_t i ) const;
626  inline ConstIterator cend ( size_t i ) const;
628  //**********************************************************************************************
629 
630  //**Assignment operators************************************************************************
633  inline HermitianMatrix& operator=( const HermitianMatrix& rhs );
634 
635  template< typename MT2, bool SO2 >
636  inline typename DisableIf< IsComputation<MT2>, HermitianMatrix& >::Type
637  operator=( const Matrix<MT2,SO2>& rhs );
638 
639  template< typename MT2, bool SO2 >
640  inline typename EnableIf< IsComputation<MT2>, HermitianMatrix& >::Type
641  operator=( const Matrix<MT2,SO2>& rhs );
642 
643  template< typename MT2 >
644  inline typename EnableIf< IsBuiltin<typename MT2::ElementType>, HermitianMatrix& >::Type
645  operator=( const Matrix<MT2,!SO>& rhs );
646 
647  template< typename MT2, bool SO2 >
648  inline typename DisableIf< IsComputation<MT2>, HermitianMatrix& >::Type
649  operator+=( const Matrix<MT2,SO2>& rhs );
650 
651  template< typename MT2, bool SO2 >
652  inline typename EnableIf< IsComputation<MT2>, HermitianMatrix& >::Type
653  operator+=( const Matrix<MT2,SO2>& rhs );
654 
655  template< typename MT2 >
656  inline typename EnableIf< IsBuiltin<typename MT2::ElementType>, HermitianMatrix& >::Type
657  operator+=( const Matrix<MT2,!SO>& rhs );
658 
659  template< typename MT2, bool SO2 >
660  inline typename DisableIf< IsComputation<MT2>, HermitianMatrix& >::Type
661  operator-=( const Matrix<MT2,SO2>& rhs );
662 
663  template< typename MT2, bool SO2 >
664  inline typename EnableIf< IsComputation<MT2>, HermitianMatrix& >::Type
665  operator-=( const Matrix<MT2,SO2>& rhs );
666 
667  template< typename MT2 >
668  inline typename EnableIf< IsBuiltin<typename MT2::ElementType>, HermitianMatrix& >::Type
669  operator-=( const Matrix<MT2,!SO>& rhs );
670 
671  template< typename MT2, bool SO2 >
672  inline HermitianMatrix& operator*=( const Matrix<MT2,SO2>& rhs );
673 
674  template< typename Other >
675  inline typename EnableIf< IsNumeric<Other>, HermitianMatrix >::Type&
676  operator*=( Other rhs );
677 
678  template< typename Other >
679  inline typename EnableIf< IsNumeric<Other>, HermitianMatrix >::Type&
680  operator/=( Other rhs );
682  //**********************************************************************************************
683 
684  //**Utility functions***************************************************************************
687  inline size_t rows() const;
688  inline size_t columns() const;
689  inline size_t spacing() const;
690  inline size_t capacity() const;
691  inline size_t capacity( size_t i ) const;
692  inline size_t nonZeros() const;
693  inline size_t nonZeros( size_t i ) const;
694  inline void reset();
695  inline void reset( size_t i );
696  inline void clear();
697  void resize ( size_t n, bool preserve=true );
698  inline void extend ( size_t n, bool preserve=true );
699  inline void reserve( size_t elements );
700  inline HermitianMatrix& transpose();
701  inline HermitianMatrix& ctranspose();
702  template< typename Other > inline HermitianMatrix& scale( const Other& scalar );
703  inline void swap( HermitianMatrix& m ) /* throw() */;
705  //**********************************************************************************************
706 
707  //**Debugging functions*************************************************************************
710  inline bool isIntact() const;
712  //**********************************************************************************************
713 
714  //**Expression template evaluation functions****************************************************
717  template< typename Other > inline bool canAlias ( const Other* alias ) const;
718  template< typename Other > inline bool isAliased( const Other* alias ) const;
719 
720  inline bool isAligned () const;
721  inline bool canSMPAssign() const;
722 
723  BLAZE_ALWAYS_INLINE IntrinsicType load ( size_t i, size_t j ) const;
724  BLAZE_ALWAYS_INLINE IntrinsicType loada( size_t i, size_t j ) const;
725  BLAZE_ALWAYS_INLINE IntrinsicType loadu( size_t i, size_t j ) const;
726 
727  inline void store ( size_t i, size_t j, const IntrinsicType& value );
728  inline void storea( size_t i, size_t j, const IntrinsicType& value );
729  inline void storeu( size_t i, size_t j, const IntrinsicType& value );
730  inline void stream( size_t i, size_t j, const IntrinsicType& value );
732  //**********************************************************************************************
733 
734  private:
735  //**Construction functions**********************************************************************
738  template< typename MT2, bool SO2, typename T >
739  inline const MT2& construct( const Matrix<MT2,SO2>& m, T );
740 
741  template< typename MT2 >
742  inline typename TransExprTrait<MT2>::Type construct( const Matrix<MT2,!SO>& m, TrueType );
744  //**********************************************************************************************
745 
746  //**Member variables****************************************************************************
749  MT matrix_;
750 
751  //**********************************************************************************************
752 
753  //**Friend declarations*************************************************************************
754  template< typename MT2, bool SO2, bool DF2 >
755  friend bool isDefault( const HermitianMatrix<MT2,SO2,DF2>& m );
756 
757  template< typename MT2, bool SO2 >
758  friend void invert2x2( HermitianMatrix<MT2,SO2,true>& m );
759 
760  template< typename MT2, bool SO2 >
761  friend void invert3x3( HermitianMatrix<MT2,SO2,true>& m );
762 
763  template< typename MT2, bool SO2 >
764  friend void invert4x4( HermitianMatrix<MT2,SO2,true>& m );
765 
766  template< typename MT2, bool SO2 >
767  friend void invert5x5( HermitianMatrix<MT2,SO2,true>& m );
768 
769  template< typename MT2, bool SO2 >
770  friend void invert6x6( HermitianMatrix<MT2,SO2,true>& m );
771 
772  template< typename MT2, bool SO2 >
773  friend void invertByLU( HermitianMatrix<MT2,SO2,true>& m );
774 
775  template< typename MT2, bool SO2 >
776  friend void invertByLDLT( HermitianMatrix<MT2,SO2,true>& m );
777 
778  template< typename MT2, bool SO2 >
779  friend void invertByLDLH( HermitianMatrix<MT2,SO2,true>& m );
780 
781  template< typename MT2, bool SO2 >
782  friend void invertByLLH( HermitianMatrix<MT2,SO2,true>& m );
783  //**********************************************************************************************
784 
785  //**Compile time checks*************************************************************************
799  BLAZE_STATIC_ASSERT( Rows<MT>::value == Columns<MT>::value );
800  //**********************************************************************************************
801 };
803 //*************************************************************************************************
804 
805 
806 
807 
808 //=================================================================================================
809 //
810 // CONSTRUCTORS
811 //
812 //=================================================================================================
813 
814 //*************************************************************************************************
818 template< typename MT // Type of the adapted dense matrix
819  , bool SO > // Storage order of the adapted dense matrix
820 inline HermitianMatrix<MT,SO,true>::HermitianMatrix()
821  : matrix_() // The adapted dense matrix
822 {
823  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square Hermitian matrix detected" );
824  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
825 }
827 //*************************************************************************************************
828 
829 
830 //*************************************************************************************************
836 template< typename MT // Type of the adapted dense matrix
837  , bool SO > // Storage order of the adapted dense matrix
838 inline HermitianMatrix<MT,SO,true>::HermitianMatrix( size_t n )
839  : matrix_( n, n, ElementType() ) // The adapted dense matrix
840 {
842 
843  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square Hermitian matrix detected" );
844  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
845 }
847 //*************************************************************************************************
848 
849 
850 //*************************************************************************************************
871 template< typename MT // Type of the adapted dense matrix
872  , bool SO > // Storage order of the adapted dense matrix
873 inline HermitianMatrix<MT,SO,true>::HermitianMatrix( ElementType* ptr, size_t n )
874  : matrix_( ptr, n, n ) // The adapted dense matrix
875 {
876  if( !isHermitian( matrix_ ) ) {
877  BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of Hermitian matrix" );
878  }
879 
880  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
881 }
883 //*************************************************************************************************
884 
885 
886 //*************************************************************************************************
909 template< typename MT // Type of the adapted dense matrix
910  , bool SO > // Storage order of the adapted dense matrix
911 inline HermitianMatrix<MT,SO,true>::HermitianMatrix( ElementType* ptr, size_t n, size_t nn )
912  : matrix_( ptr, n, n, nn ) // The adapted dense matrix
913 {
914  if( !isHermitian( matrix_ ) ) {
915  BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of Hermitian matrix" );
916  }
917 
918  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
919 }
921 //*************************************************************************************************
922 
923 
924 //*************************************************************************************************
945 template< typename MT // Type of the adapted dense matrix
946  , bool SO > // Storage order of the adapted dense matrix
947 template< typename Deleter > // Type of the custom deleter
948 inline HermitianMatrix<MT,SO,true>::HermitianMatrix( ElementType* ptr, size_t n, Deleter d )
949  : matrix_( ptr, n, n, d ) // The adapted dense matrix
950 {
951  if( !isHermitian( matrix_ ) ) {
952  BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of Hermitian matrix" );
953  }
954 
955  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
956 }
958 //*************************************************************************************************
959 
960 
961 //*************************************************************************************************
983 template< typename MT // Type of the adapted dense matrix
984  , bool SO > // Storage order of the adapted dense matrix
985 template< typename Deleter > // Type of the custom deleter
986 inline HermitianMatrix<MT,SO,true>::HermitianMatrix( ElementType* ptr, size_t n, size_t nn, Deleter d )
987  : matrix_( ptr, n, n, nn, d ) // The adapted dense matrix
988 {
989  if( !isHermitian( matrix_ ) ) {
990  BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of Hermitian matrix" );
991  }
992 
993  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
994 }
996 //*************************************************************************************************
997 
998 
999 //*************************************************************************************************
1005 template< typename MT // Type of the adapted dense matrix
1006  , bool SO > // Storage order of the adapted dense matrix
1007 inline HermitianMatrix<MT,SO,true>::HermitianMatrix( const HermitianMatrix& m )
1008  : matrix_( m.matrix_ ) // The adapted dense matrix
1009 {
1010  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square Hermitian matrix detected" );
1011  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1012 }
1014 //*************************************************************************************************
1015 
1016 
1017 //*************************************************************************************************
1027 template< typename MT // Type of the adapted dense matrix
1028  , bool SO > // Storage order of the adapted dense matrix
1029 template< typename MT2 // Type of the foreign matrix
1030  , bool SO2 > // Storage order of the foreign matrix
1031 inline HermitianMatrix<MT,SO,true>::HermitianMatrix( const Matrix<MT2,SO2>& m )
1032  : matrix_( construct( m, typename IsBuiltin<typename MT2::ElementType>::Type() ) ) // The adapted dense matrix
1033 {
1034  if( !IsHermitian<MT2>::value && !isHermitian( matrix_ ) ) {
1035  BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of Hermitian matrix" );
1036  }
1037 
1038  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1039 }
1041 //*************************************************************************************************
1042 
1043 
1044 
1045 
1046 //=================================================================================================
1047 //
1048 // DATA ACCESS FUNCTIONS
1049 //
1050 //=================================================================================================
1051 
1052 //*************************************************************************************************
1068 template< typename MT // Type of the adapted dense matrix
1069  , bool SO > // Storage order of the adapted dense matrix
1071  HermitianMatrix<MT,SO,true>::operator()( size_t i, size_t j )
1072 {
1073  BLAZE_USER_ASSERT( i<rows() , "Invalid row access index" );
1074  BLAZE_USER_ASSERT( j<columns(), "Invalid column access index" );
1075 
1076  return Reference( matrix_, i, j );
1077 }
1079 //*************************************************************************************************
1080 
1081 
1082 //*************************************************************************************************
1098 template< typename MT // Type of the adapted dense matrix
1099  , bool SO > // Storage order of the adapted dense matrix
1101  HermitianMatrix<MT,SO,true>::operator()( size_t i, size_t j ) const
1102 {
1103  BLAZE_USER_ASSERT( i<rows() , "Invalid row access index" );
1104  BLAZE_USER_ASSERT( j<columns(), "Invalid column access index" );
1105 
1106  return matrix_(i,j);
1107 }
1109 //*************************************************************************************************
1110 
1111 
1112 //*************************************************************************************************
1129 template< typename MT // Type of the adapted dense matrix
1130  , bool SO > // Storage order of the adapted dense matrix
1132  HermitianMatrix<MT,SO,true>::at( size_t i, size_t j )
1133 {
1134  if( i >= rows() ) {
1135  BLAZE_THROW_OUT_OF_RANGE( "Invalid row access index" );
1136  }
1137  if( j >= columns() ) {
1138  BLAZE_THROW_OUT_OF_RANGE( "Invalid column access index" );
1139  }
1140  return (*this)(i,j);
1141 }
1143 //*************************************************************************************************
1144 
1145 
1146 //*************************************************************************************************
1163 template< typename MT // Type of the adapted dense matrix
1164  , bool SO > // Storage order of the adapted dense matrix
1166  HermitianMatrix<MT,SO,true>::at( size_t i, size_t j ) const
1167 {
1168  if( i >= rows() ) {
1169  BLAZE_THROW_OUT_OF_RANGE( "Invalid row access index" );
1170  }
1171  if( j >= columns() ) {
1172  BLAZE_THROW_OUT_OF_RANGE( "Invalid column access index" );
1173  }
1174  return (*this)(i,j);
1175 }
1177 //*************************************************************************************************
1178 
1179 
1180 //*************************************************************************************************
1194 template< typename MT // Type of the adapted dense matrix
1195  , bool SO > // Storage order of the adapted dense matrix
1196 inline typename HermitianMatrix<MT,SO,true>::ConstPointer
1197  HermitianMatrix<MT,SO,true>::data() const
1198 {
1199  return matrix_.data();
1200 }
1202 //*************************************************************************************************
1203 
1204 
1205 //*************************************************************************************************
1216 template< typename MT // Type of the adapted dense matrix
1217  , bool SO > // Storage order of the adapted dense matrix
1218 inline typename HermitianMatrix<MT,SO,true>::ConstPointer
1219  HermitianMatrix<MT,SO,true>::data( size_t i ) const
1220 {
1221  return matrix_.data(i);
1222 }
1224 //*************************************************************************************************
1225 
1226 
1227 //*************************************************************************************************
1239 template< typename MT // Type of the adapted dense matrix
1240  , bool SO > // Storage order of the adapted dense matrix
1243 {
1244  if( SO )
1245  return Iterator( matrix_, 0UL, i );
1246  else
1247  return Iterator( matrix_, i, 0UL );
1248 }
1250 //*************************************************************************************************
1251 
1252 
1253 //*************************************************************************************************
1265 template< typename MT // Type of the adapted dense matrix
1266  , bool SO > // Storage order of the adapted dense matrix
1268  HermitianMatrix<MT,SO,true>::begin( size_t i ) const
1269 {
1270  return matrix_.begin(i);
1271 }
1273 //*************************************************************************************************
1274 
1275 
1276 //*************************************************************************************************
1288 template< typename MT // Type of the adapted dense matrix
1289  , bool SO > // Storage order of the adapted dense matrix
1291  HermitianMatrix<MT,SO,true>::cbegin( size_t i ) const
1292 {
1293  return matrix_.cbegin(i);
1294 }
1296 //*************************************************************************************************
1297 
1298 
1299 //*************************************************************************************************
1311 template< typename MT // Type of the adapted dense matrix
1312  , bool SO > // Storage order of the adapted dense matrix
1315 {
1316  if( SO )
1317  return Iterator( matrix_, rows(), i );
1318  else
1319  return Iterator( matrix_, i, columns() );
1320 }
1322 //*************************************************************************************************
1323 
1324 
1325 //*************************************************************************************************
1337 template< typename MT // Type of the adapted dense matrix
1338  , bool SO > // Storage order of the adapted dense matrix
1340  HermitianMatrix<MT,SO,true>::end( size_t i ) const
1341 {
1342  return matrix_.end(i);
1343 }
1345 //*************************************************************************************************
1346 
1347 
1348 //*************************************************************************************************
1360 template< typename MT // Type of the adapted dense matrix
1361  , bool SO > // Storage order of the adapted dense matrix
1363  HermitianMatrix<MT,SO,true>::cend( size_t i ) const
1364 {
1365  return matrix_.cend(i);
1366 }
1368 //*************************************************************************************************
1369 
1370 
1371 
1372 
1373 //=================================================================================================
1374 //
1375 // ASSIGNMENT OPERATORS
1376 //
1377 //=================================================================================================
1378 
1379 //*************************************************************************************************
1389 template< typename MT // Type of the adapted dense matrix
1390  , bool SO > // Storage order of the adapted dense matrix
1391 inline HermitianMatrix<MT,SO,true>&
1392  HermitianMatrix<MT,SO,true>::operator=( const HermitianMatrix& rhs )
1393 {
1394  matrix_ = rhs.matrix_;
1395 
1396  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square Hermitian matrix detected" );
1397  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1398 
1399  return *this;
1400 }
1402 //*************************************************************************************************
1403 
1404 
1405 //*************************************************************************************************
1418 template< typename MT // Type of the adapted dense matrix
1419  , bool SO > // Storage order of the adapted dense matrix
1420 template< typename MT2 // Type of the right-hand side matrix
1421  , bool SO2 > // Storage order of the right-hand side matrix
1422 inline typename DisableIf< IsComputation<MT2>, HermitianMatrix<MT,SO,true>& >::Type
1423  HermitianMatrix<MT,SO,true>::operator=( const Matrix<MT2,SO2>& rhs )
1424 {
1425  if( !IsHermitian<MT2>::value && !isHermitian( ~rhs ) ) {
1426  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to Hermitian matrix" );
1427  }
1428 
1429  matrix_ = ~rhs;
1430 
1431  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square Hermitian matrix detected" );
1432  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1433 
1434  return *this;
1435 }
1437 //*************************************************************************************************
1438 
1439 
1440 //*************************************************************************************************
1453 template< typename MT // Type of the adapted dense matrix
1454  , bool SO > // Storage order of the adapted dense matrix
1455 template< typename MT2 // Type of the right-hand side matrix
1456  , bool SO2 > // Storage order of the right-hand side matrix
1457 inline typename EnableIf< IsComputation<MT2>, HermitianMatrix<MT,SO,true>& >::Type
1458  HermitianMatrix<MT,SO,true>::operator=( const Matrix<MT2,SO2>& rhs )
1459 {
1460  if( !IsSquare<MT2>::value && !isSquare( ~rhs ) ) {
1461  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to Hermitian matrix" );
1462  }
1463 
1464  if( IsHermitian<MT2>::value ) {
1465  matrix_ = ~rhs;
1466  }
1467  else {
1468  MT tmp( ~rhs );
1469 
1470  if( !isHermitian( tmp ) ) {
1471  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to Hermitian matrix" );
1472  }
1473 
1474  move( matrix_, tmp );
1475  }
1476 
1477  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square Hermitian matrix detected" );
1478  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1479 
1480  return *this;
1481 }
1483 //*************************************************************************************************
1484 
1485 
1486 //*************************************************************************************************
1499 template< typename MT // Type of the adapted dense matrix
1500  , bool SO > // Storage order of the adapted dense matrix
1501 template< typename MT2 > // Type of the right-hand side matrix
1502 inline typename EnableIf< IsBuiltin<typename MT2::ElementType>, HermitianMatrix<MT,SO,true>& >::Type
1503  HermitianMatrix<MT,SO,true>::operator=( const Matrix<MT2,!SO>& rhs )
1504 {
1505  return this->operator=( trans( ~rhs ) );
1506 }
1508 //*************************************************************************************************
1509 
1510 
1511 //*************************************************************************************************
1524 template< typename MT // Type of the adapted dense matrix
1525  , bool SO > // Storage order of the adapted dense matrix
1526 template< typename MT2 // Type of the right-hand side matrix
1527  , bool SO2 > // Storage order of the right-hand side matrix
1528 inline typename DisableIf< IsComputation<MT2>, HermitianMatrix<MT,SO,true>& >::Type
1529  HermitianMatrix<MT,SO,true>::operator+=( const Matrix<MT2,SO2>& rhs )
1530 {
1531  if( !IsHermitian<MT2>::value && !isHermitian( ~rhs ) ) {
1532  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to Hermitian matrix" );
1533  }
1534 
1535  matrix_ += ~rhs;
1536 
1537  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square Hermitian matrix detected" );
1538  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1539 
1540  return *this;
1541 }
1543 //*************************************************************************************************
1544 
1545 
1546 //*************************************************************************************************
1559 template< typename MT // Type of the adapted dense matrix
1560  , bool SO > // Storage order of the adapted dense matrix
1561 template< typename MT2 // Type of the right-hand side matrix
1562  , bool SO2 > // Storage order of the right-hand side matrix
1563 inline typename EnableIf< IsComputation<MT2>, HermitianMatrix<MT,SO,true>& >::Type
1564  HermitianMatrix<MT,SO,true>::operator+=( const Matrix<MT2,SO2>& rhs )
1565 {
1566  if( !IsSquare<MT2>::value && !isSquare( ~rhs ) ) {
1567  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to Hermitian matrix" );
1568  }
1569 
1570  if( IsHermitian<MT2>::value ) {
1571  matrix_ += ~rhs;
1572  }
1573  else {
1574  typename MT2::ResultType tmp( ~rhs );
1575 
1576  if( !isHermitian( tmp ) ) {
1577  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to Hermitian matrix" );
1578  }
1579 
1580  matrix_ += tmp;
1581  }
1582 
1583  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square Hermitian matrix detected" );
1584  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1585 
1586  return *this;
1587 }
1589 //*************************************************************************************************
1590 
1591 
1592 //*************************************************************************************************
1606 template< typename MT // Type of the adapted dense matrix
1607  , bool SO > // Storage order of the adapted dense matrix
1608 template< typename MT2 > // Type of the right-hand side matrix
1609 inline typename EnableIf< IsBuiltin<typename MT2::ElementType>, HermitianMatrix<MT,SO,true>& >::Type
1610  HermitianMatrix<MT,SO,true>::operator+=( const Matrix<MT2,!SO>& rhs )
1611 {
1612  return this->operator+=( trans( ~rhs ) );
1613 }
1615 //*************************************************************************************************
1616 
1617 
1618 //*************************************************************************************************
1631 template< typename MT // Type of the adapted dense matrix
1632  , bool SO > // Storage order of the adapted dense matrix
1633 template< typename MT2 // Type of the right-hand side matrix
1634  , bool SO2 > // Storage order of the right-hand side matrix
1635 inline typename DisableIf< IsComputation<MT2>, HermitianMatrix<MT,SO,true>& >::Type
1636  HermitianMatrix<MT,SO,true>::operator-=( const Matrix<MT2,SO2>& rhs )
1637 {
1638  if( !IsHermitian<MT2>::value && !isHermitian( ~rhs ) ) {
1639  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to Hermitian matrix" );
1640  }
1641 
1642  matrix_ -= ~rhs;
1643 
1644  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square Hermitian matrix detected" );
1645  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1646 
1647  return *this;
1648 }
1650 //*************************************************************************************************
1651 
1652 
1653 //*************************************************************************************************
1666 template< typename MT // Type of the adapted dense matrix
1667  , bool SO > // Storage order of the adapted dense matrix
1668 template< typename MT2 // Type of the right-hand side matrix
1669  , bool SO2 > // Storage order of the right-hand side matrix
1670 inline typename EnableIf< IsComputation<MT2>, HermitianMatrix<MT,SO,true>& >::Type
1671  HermitianMatrix<MT,SO,true>::operator-=( const Matrix<MT2,SO2>& rhs )
1672 {
1673  if( !IsSquare<MT2>::value && !isSquare( ~rhs ) ) {
1674  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to Hermitian matrix" );
1675  }
1676 
1677  if( IsHermitian<MT2>::value ) {
1678  matrix_ -= ~rhs;
1679  }
1680  else {
1681  typename MT2::ResultType tmp( ~rhs );
1682 
1683  if( !isHermitian( tmp ) ) {
1684  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to Hermitian matrix" );
1685  }
1686 
1687  matrix_ -= tmp;
1688  }
1689 
1690  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square Hermitian matrix detected" );
1691  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1692 
1693  return *this;
1694 }
1696 //*************************************************************************************************
1697 
1698 
1699 //*************************************************************************************************
1713 template< typename MT // Type of the adapted dense matrix
1714  , bool SO > // Storage order of the adapted dense matrix
1715 template< typename MT2 > // Type of the right-hand side matrix
1716 inline typename EnableIf< IsBuiltin<typename MT2::ElementType>, HermitianMatrix<MT,SO,true>& >::Type
1717  HermitianMatrix<MT,SO,true>::operator-=( const Matrix<MT2,!SO>& rhs )
1718 {
1719  return this->operator-=( trans( ~rhs ) );
1720 }
1722 //*************************************************************************************************
1723 
1724 
1725 //*************************************************************************************************
1737 template< typename MT // Type of the adapted dense matrix
1738  , bool SO > // Storage order of the adapted dense matrix
1739 template< typename MT2 // Type of the right-hand side matrix
1740  , bool SO2 > // Storage order of the right-hand side matrix
1741 inline HermitianMatrix<MT,SO,true>&
1742  HermitianMatrix<MT,SO,true>::operator*=( const Matrix<MT2,SO2>& rhs )
1743 {
1744  if( matrix_.rows() != (~rhs).columns() ) {
1745  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to Hermitian matrix" );
1746  }
1747 
1748  MT tmp( matrix_ * ~rhs );
1749 
1750  if( !isHermitian( tmp ) ) {
1751  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to Hermitian matrix" );
1752  }
1753 
1754  move( matrix_, tmp );
1755 
1756  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square Hermitian matrix detected" );
1757  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1758 
1759  return *this;
1760 }
1762 //*************************************************************************************************
1763 
1764 
1765 //*************************************************************************************************
1773 template< typename MT // Type of the adapted dense matrix
1774  , bool SO > // Storage order of the adapted dense matrix
1775 template< typename Other > // Data type of the right-hand side scalar
1776 inline typename EnableIf< IsNumeric<Other>, HermitianMatrix<MT,SO,true> >::Type&
1777  HermitianMatrix<MT,SO,true>::operator*=( Other rhs )
1778 {
1779  matrix_ *= rhs;
1780  return *this;
1781 }
1782 //*************************************************************************************************
1783 
1784 
1785 //*************************************************************************************************
1793 template< typename MT // Type of the adapted dense matrix
1794  , bool SO > // Storage order of the adapted dense matrix
1795 template< typename Other > // Data type of the right-hand side scalar
1796 inline typename EnableIf< IsNumeric<Other>, HermitianMatrix<MT,SO,true> >::Type&
1797  HermitianMatrix<MT,SO,true>::operator/=( Other rhs )
1798 {
1799  BLAZE_USER_ASSERT( rhs != Other(0), "Division by zero detected" );
1800 
1801  matrix_ /= rhs;
1802  return *this;
1803 }
1805 //*************************************************************************************************
1806 
1807 
1808 
1809 
1810 //=================================================================================================
1811 //
1812 // UTILITY FUNCTIONS
1813 //
1814 //=================================================================================================
1815 
1816 //*************************************************************************************************
1822 template< typename MT // Type of the adapted dense matrix
1823  , bool SO > // Storage order of the adapted dense matrix
1824 inline size_t HermitianMatrix<MT,SO,true>::rows() const
1825 {
1826  return matrix_.rows();
1827 }
1829 //*************************************************************************************************
1830 
1831 
1832 //*************************************************************************************************
1838 template< typename MT // Type of the adapted dense matrix
1839  , bool SO > // Storage order of the adapted dense matrix
1840 inline size_t HermitianMatrix<MT,SO,true>::columns() const
1841 {
1842  return matrix_.columns();
1843 }
1845 //*************************************************************************************************
1846 
1847 
1848 //*************************************************************************************************
1860 template< typename MT // Type of the adapted dense matrix
1861  , bool SO > // Storage order of the adapted dense matrix
1862 inline size_t HermitianMatrix<MT,SO,true>::spacing() const
1863 {
1864  return matrix_.spacing();
1865 }
1867 //*************************************************************************************************
1868 
1869 
1870 //*************************************************************************************************
1876 template< typename MT // Type of the adapted dense matrix
1877  , bool SO > // Storage order of the adapted dense matrix
1878 inline size_t HermitianMatrix<MT,SO,true>::capacity() const
1879 {
1880  return matrix_.capacity();
1881 }
1883 //*************************************************************************************************
1884 
1885 
1886 //*************************************************************************************************
1897 template< typename MT // Type of the adapted dense matrix
1898  , bool SO > // Storage order of the adapted dense matrix
1899 inline size_t HermitianMatrix<MT,SO,true>::capacity( size_t i ) const
1900 {
1901  return matrix_.capacity(i);
1902 }
1904 //*************************************************************************************************
1905 
1906 
1907 //*************************************************************************************************
1913 template< typename MT // Type of the adapted dense matrix
1914  , bool SO > // Storage order of the adapted dense matrix
1915 inline size_t HermitianMatrix<MT,SO,true>::nonZeros() const
1916 {
1917  return matrix_.nonZeros();
1918 }
1920 //*************************************************************************************************
1921 
1922 
1923 //*************************************************************************************************
1935 template< typename MT // Type of the adapted dense matrix
1936  , bool SO > // Storage order of the adapted dense matrix
1937 inline size_t HermitianMatrix<MT,SO,true>::nonZeros( size_t i ) const
1938 {
1939  return matrix_.nonZeros(i);
1940 }
1942 //*************************************************************************************************
1943 
1944 
1945 //*************************************************************************************************
1951 template< typename MT // Type of the adapted dense matrix
1952  , bool SO > // Storage order of the adapted dense matrix
1954 {
1955  matrix_.reset();
1956 }
1958 //*************************************************************************************************
1959 
1960 
1961 //*************************************************************************************************
1997 template< typename MT // Type of the adapted dense matrix
1998  , bool SO > // Storage order of the adapted dense matrix
1999 inline void HermitianMatrix<MT,SO,true>::reset( size_t i )
2000 {
2001  row ( matrix_, i ).reset();
2002  column( matrix_, i ).reset();
2003 }
2005 //*************************************************************************************************
2006 
2007 
2008 //*************************************************************************************************
2020 template< typename MT // Type of the adapted dense matrix
2021  , bool SO > // Storage order of the adapted dense matrix
2023 {
2024  using blaze::clear;
2025 
2026  clear( matrix_ );
2027 }
2029 //*************************************************************************************************
2030 
2031 
2032 //*************************************************************************************************
2067 template< typename MT // Type of the adapted dense matrix
2068  , bool SO > // Storage order of the adapted dense matrix
2069 void HermitianMatrix<MT,SO,true>::resize( size_t n, bool preserve )
2070 {
2072 
2073  UNUSED_PARAMETER( preserve );
2074 
2075  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square Hermitian matrix detected" );
2076 
2077  const size_t oldsize( matrix_.rows() );
2078 
2079  matrix_.resize( n, n, true );
2080 
2081  if( n > oldsize ) {
2082  const size_t increment( n - oldsize );
2083  submatrix( matrix_, 0UL, oldsize, oldsize, increment ).reset();
2084  submatrix( matrix_, oldsize, 0UL, increment, n ).reset();
2085  }
2086 }
2088 //*************************************************************************************************
2089 
2090 
2091 //*************************************************************************************************
2104 template< typename MT // Type of the adapted dense matrix
2105  , bool SO > // Storage order of the adapted dense matrix
2106 inline void HermitianMatrix<MT,SO,true>::extend( size_t n, bool preserve )
2107 {
2109 
2110  UNUSED_PARAMETER( preserve );
2111 
2112  resize( rows() + n, true );
2113 }
2114 //*************************************************************************************************
2115 
2116 
2117 //*************************************************************************************************
2127 template< typename MT // Type of the adapted dense matrix
2128  , bool SO > // Storage order of the adapted dense matrix
2129 inline void HermitianMatrix<MT,SO,true>::reserve( size_t elements )
2130 {
2131  matrix_.reserve( elements );
2132 }
2134 //*************************************************************************************************
2135 
2136 
2137 //*************************************************************************************************
2143 template< typename MT // Type of the adapted dense matrix
2144  , bool SO > // Storage order of the adapted dense matrix
2145 inline HermitianMatrix<MT,SO,true>& HermitianMatrix<MT,SO,true>::transpose()
2146 {
2147  if( IsComplex<ElementType>::value )
2148  matrix_.transpose();
2149  return *this;
2150 }
2152 //*************************************************************************************************
2153 
2154 
2155 //*************************************************************************************************
2161 template< typename MT // Type of the adapted dense matrix
2162  , bool SO > // Storage order of the adapted dense matrix
2163 inline HermitianMatrix<MT,SO,true>& HermitianMatrix<MT,SO,true>::ctranspose()
2164 {
2165  return *this;
2166 }
2168 //*************************************************************************************************
2169 
2170 
2171 //*************************************************************************************************
2178 template< typename MT // Type of the adapted dense matrix
2179  , bool SO > // Storage order of the adapted dense matrix
2180 template< typename Other > // Data type of the scalar value
2181 inline HermitianMatrix<MT,SO,true>&
2182  HermitianMatrix<MT,SO,true>::scale( const Other& scalar )
2183 {
2184  matrix_.scale( scalar );
2185  return *this;
2186 }
2188 //*************************************************************************************************
2189 
2190 
2191 //*************************************************************************************************
2199 template< typename MT // Type of the adapted dense matrix
2200  , bool SO > // Storage order of the adapted dense matrix
2201 inline void HermitianMatrix<MT,SO,true>::swap( HermitianMatrix& m ) /* throw() */
2202 {
2203  using std::swap;
2204 
2205  swap( matrix_, m.matrix_ );
2206 }
2208 //*************************************************************************************************
2209 
2210 
2211 
2212 
2213 //=================================================================================================
2214 //
2215 // DEBUGGING FUNCTIONS
2216 //
2217 //=================================================================================================
2218 
2219 //*************************************************************************************************
2229 template< typename MT // Type of the adapted dense matrix
2230  , bool SO > // Storage order of the adapted dense matrix
2231 inline bool HermitianMatrix<MT,SO,true>::isIntact() const
2232 {
2233  using blaze::isIntact;
2234 
2235  return ( isIntact( matrix_ ) && isHermitian( matrix_ ) );
2236 }
2238 //*************************************************************************************************
2239 
2240 
2241 
2242 
2243 //=================================================================================================
2244 //
2245 // EXPRESSION TEMPLATE EVALUATION FUNCTIONS
2246 //
2247 //=================================================================================================
2248 
2249 //*************************************************************************************************
2260 template< typename MT // Type of the adapted dense matrix
2261  , bool SO > // Storage order of the adapted dense matrix
2262 template< typename Other > // Data type of the foreign expression
2263 inline bool HermitianMatrix<MT,SO,true>::canAlias( const Other* alias ) const
2264 {
2265  return matrix_.canAlias( alias );
2266 }
2268 //*************************************************************************************************
2269 
2270 
2271 //*************************************************************************************************
2282 template< typename MT // Type of the adapted dense matrix
2283  , bool SO > // Storage order of the adapted dense matrix
2284 template< typename Other > // Data type of the foreign expression
2285 inline bool HermitianMatrix<MT,SO,true>::isAliased( const Other* alias ) const
2286 {
2287  return matrix_.isAliased( alias );
2288 }
2290 //*************************************************************************************************
2291 
2292 
2293 //*************************************************************************************************
2303 template< typename MT // Type of the adapted dense matrix
2304  , bool SO > // Storage order of the adapted dense matrix
2305 inline bool HermitianMatrix<MT,SO,true>::isAligned() const
2306 {
2307  return matrix_.isAligned();
2308 }
2310 //*************************************************************************************************
2311 
2312 
2313 //*************************************************************************************************
2324 template< typename MT // Type of the adapted dense matrix
2325  , bool SO > // Storage order of the adapted dense matrix
2326 inline bool HermitianMatrix<MT,SO,true>::canSMPAssign() const
2327 {
2328  return matrix_.canSMPAssign();
2329 }
2331 //*************************************************************************************************
2332 
2333 
2334 //*************************************************************************************************
2350 template< typename MT // Type of the adapted dense matrix
2351  , bool SO > // Storage order of the adapted dense matrix
2352 BLAZE_ALWAYS_INLINE typename HermitianMatrix<MT,SO,true>::IntrinsicType
2353  HermitianMatrix<MT,SO,true>::load( size_t i, size_t j ) const
2354 {
2355  return matrix_.load( i, j );
2356 }
2358 //*************************************************************************************************
2359 
2360 
2361 //*************************************************************************************************
2377 template< typename MT // Type of the adapted dense matrix
2378  , bool SO > // Storage order of the adapted dense matrix
2379 BLAZE_ALWAYS_INLINE typename HermitianMatrix<MT,SO,true>::IntrinsicType
2380  HermitianMatrix<MT,SO,true>::loada( size_t i, size_t j ) const
2381 {
2382  return matrix_.loada( i, j );
2383 }
2385 //*************************************************************************************************
2386 
2387 
2388 //*************************************************************************************************
2404 template< typename MT // Type of the adapted dense matrix
2405  , bool SO > // Storage order of the adapted dense matrix
2406 BLAZE_ALWAYS_INLINE typename HermitianMatrix<MT,SO,true>::IntrinsicType
2407  HermitianMatrix<MT,SO,true>::loadu( size_t i, size_t j ) const
2408 {
2409  return matrix_.loadu( i, j );
2410 }
2412 //*************************************************************************************************
2413 
2414 
2415 //*************************************************************************************************
2432 template< typename MT // Type of the adapted dense matrix
2433  , bool SO > // Storage order of the adapted dense matrix
2434 inline void HermitianMatrix<MT,SO,true>::store( size_t i, size_t j, const IntrinsicType& value )
2435 {
2436  matrix_.store( i, j, value );
2437 
2438  if( SO ) {
2439  const size_t kend( min( i+IT::size, rows() ) );
2440  for( size_t k=i; k<kend; ++k )
2441  matrix_(j,k) = conj( matrix_(k,j) );
2442  }
2443  else {
2444  const size_t kend( min( j+IT::size, columns() ) );
2445  for( size_t k=j; k<kend; ++k )
2446  matrix_(k,i) = conj( matrix_(i,k) );
2447  }
2448 }
2450 //*************************************************************************************************
2451 
2452 
2453 //*************************************************************************************************
2470 template< typename MT // Type of the adapted dense matrix
2471  , bool SO > // Storage order of the adapted dense matrix
2472 inline void HermitianMatrix<MT,SO,true>::storea( size_t i, size_t j, const IntrinsicType& value )
2473 {
2474  matrix_.storea( i, j, value );
2475 
2476  if( SO ) {
2477  const size_t kend( min( i+IT::size, rows() ) );
2478  for( size_t k=i; k<kend; ++k )
2479  matrix_(j,k) = conj( matrix_(k,j) );
2480  }
2481  else {
2482  const size_t kend( min( j+IT::size, columns() ) );
2483  for( size_t k=j; k<kend; ++k )
2484  matrix_(k,i) = conj( matrix_(i,k) );
2485  }
2486 }
2488 //*************************************************************************************************
2489 
2490 
2491 //*************************************************************************************************
2508 template< typename MT // Type of the adapted dense matrix
2509  , bool SO > // Storage order of the adapted dense matrix
2510 inline void HermitianMatrix<MT,SO,true>::storeu( size_t i, size_t j, const IntrinsicType& value )
2511 {
2512  matrix_.storeu( i, j, value );
2513 
2514  if( SO ) {
2515  const size_t kend( min( i+IT::size, rows() ) );
2516  for( size_t k=i; k<kend; ++k )
2517  matrix_(j,k) = conj( matrix_(k,j) );
2518  }
2519  else {
2520  const size_t kend( min( j+IT::size, columns() ) );
2521  for( size_t k=j; k<kend; ++k )
2522  matrix_(k,i) = conj( matrix_(i,k) );
2523  }
2524 }
2526 //*************************************************************************************************
2527 
2528 
2529 //*************************************************************************************************
2546 template< typename MT // Type of the adapted dense matrix
2547  , bool SO > // Storage order of the adapted dense matrix
2548 inline void HermitianMatrix<MT,SO,true>::stream( size_t i, size_t j, const IntrinsicType& value )
2549 {
2550  matrix_.stream( i, j, value );
2551 
2552  if( SO ) {
2553  const size_t kend( min( i+IT::size, rows() ) );
2554  for( size_t k=i; k<kend; ++k )
2555  matrix_(j,k) = conj( matrix_(k,j) );
2556  }
2557  else {
2558  const size_t kend( min( j+IT::size, columns() ) );
2559  for( size_t k=j; k<kend; ++k )
2560  matrix_(k,i) = conj( matrix_(i,k) );
2561  }
2562 }
2564 //*************************************************************************************************
2565 
2566 
2567 
2568 
2569 //=================================================================================================
2570 //
2571 // CONSTRUCTION FUNCTIONS
2572 //
2573 //=================================================================================================
2574 
2575 //*************************************************************************************************
2577 template< typename MT // Type of the adapted dense matrix
2578  , bool SO > // Storage order of the adapted dense matrix
2579 template< typename MT2 // Type of the foreign matrix
2580  , bool SO2 // Storage order of the foreign matrix
2581  , typename T > // Type of the third argument
2582 inline const MT2& HermitianMatrix<MT,SO,true>::construct( const Matrix<MT2,SO2>& m, T )
2583 {
2584  return ~m;
2585 }
2587 //*************************************************************************************************
2588 
2589 
2590 //*************************************************************************************************
2592 template< typename MT // Type of the adapted dense matrix
2593  , bool SO > // Storage order of the adapted dense matrix
2594 template< typename MT2 > // Type of the foreign matrix
2595 inline typename TransExprTrait<MT2>::Type
2596  HermitianMatrix<MT,SO,true>::construct( const Matrix<MT2,!SO>& m, TrueType )
2597 {
2598  return trans( ~m );
2599 }
2601 //*************************************************************************************************
2602 
2603 } // namespace blaze
2604 
2605 #endif
Header file for all restructuring submatrix functions.
#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
#define BLAZE_THROW_INVALID_ARGUMENT(MESSAGE)
Macro for the emission of a std::invalid_argument exceptionThis macro encapsulates the default way of...
Definition: Exception.h:187
Constraint on the data type.
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 the UNUSED_PARAMETER function template.
const DMatDMatMultExpr< T1, T2 > operator*(const DenseMatrix< T1, false > &lhs, const DenseMatrix< T2, false > &rhs)
Multiplication operator for the multiplication of two row-major dense matrices ( ).
Definition: DMatDMatMultExpr.h:7820
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:603
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:229
BLAZE_ALWAYS_INLINE size_t size(const Vector< VT, TF > &vector)
Returns the current size/dimension of the vector.
Definition: Vector.h:252
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:292
bool operator<=(const NegativeAccuracy< A > &, const T &rhs)
Less-or-equal-than comparison between a NegativeAccuracy object and a floating point value...
Definition: Accuracy.h:404
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:250
#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:81
#define BLAZE_CONSTRAINT_MUST_BE_DENSE_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is not a dense, N-dimensional matrix type...
Definition: DenseMatrix.h:79
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:507
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:2588
BLAZE_ALWAYS_INLINE size_t capacity(const Matrix< MT, SO > &matrix)
Returns the maximum capacity of the matrix.
Definition: Matrix.h:340
BLAZE_ALWAYS_INLINE size_t rows(const Matrix< MT, SO > &matrix)
Returns the current number of rows of the matrix.
Definition: Matrix.h:308
void clear(CompressedMatrix< Type, SO > &m)
Clearing the given compressed matrix.
Definition: CompressedMatrix.h:4926
DisableIf< Or< IsComputation< MT >, IsTransExpr< MT > >, typename ColumnExprTrait< MT >::Type >::Type column(Matrix< MT, SO > &matrix, size_t index)
Creating a view on a specific column of the given matrix.
Definition: Column.h:107
void UNUSED_PARAMETER(const T1 &)
Suppression of unused parameter warnings.
Definition: Unused.h:81
bool operator>(const NegativeAccuracy< A > &lhs, const T &rhs)
Greater-than comparison between a NegativeAccuracy object and a floating point value.
Definition: Accuracy.h:366
BLAZE_ALWAYS_INLINE void ctranspose(Matrix< MT, SO > &matrix)
In-place conjugate transpose of the given matrix.
Definition: Matrix.h:584
CompressedMatrix< Type, true > This
Type of this CompressedMatrix instance.
Definition: CompressedMatrix.h:2582
bool operator>=(const NegativeAccuracy< A > &, const T &rhs)
Greater-or-equal-than comparison between a NegativeAccuracy object and a floating point value...
Definition: Accuracy.h:442
#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:378
void move(CustomMatrix< Type, AF, PF, SO > &dst, CustomMatrix< Type, AF, PF, SO > &src)
Moving the contents of one custom matrix to another.
Definition: CustomMatrix.h:6085
Constraint on the data type.
CompressedMatrix< Type, false > OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: CompressedMatrix.h:2584
bool isDefault(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: DiagonalProxy.h:547
Constraint on the data type.
Header file for the DenseColumn class template.
Constraint on the data type.
ConjExprTrait< typename DiagonalProxy< MT >::RepresentedType >::Type conj(const DiagonalProxy< MT > &proxy)
Computing the complex conjugate of the represented element.
Definition: DiagonalProxy.h:487
Header file for the IsSquare type trait.
Constraint on the data type.
Header file for the DenseSubmatrix class template.
Header file for the DisableIf class template.
BLAZE_ALWAYS_INLINE EnableIf< And< IsIntegral< T >, HasSize< T, 2UL > >, simd_int16_t >::Type loadu(const T *address)
Loads a vector of 2-byte integral values.
Definition: Loadu.h:74
Header file for the clear shim.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
#define BLAZE_ALWAYS_INLINE
Platform dependent setup of an enforced inline keyword.
Definition: Inline.h:85
Header file for the If class template.
Compile time assertion.
void swap(CompressedMatrix< Type, SO > &a, CompressedMatrix< Type, SO > &b)
Swapping the contents of two compressed matrices.
Definition: CompressedMatrix.h:4998
bool isIntact(const CompressedMatrix< Type, SO > &m)
Returns whether the invariants of the given compressed matrix are intact.
Definition: CompressedMatrix.h:4980
BLAZE_ALWAYS_INLINE EnableIf< And< IsIntegral< T >, HasSize< T, 2UL > > >::Type storeu(T *address, const simd_int16_t &value)
Unaligned store of a vector of 2-byte integral values.
Definition: Storeu.h:75
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2592
#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
#define BLAZE_THROW_OUT_OF_RANGE(MESSAGE)
Macro for the emission of a std::out_of_range exceptionThis macro encapsulates the default way of Bla...
Definition: Exception.h:331
const DenseIterator< Type, AF > operator+(const DenseIterator< Type, AF > &it, ptrdiff_t inc)
Addition between a DenseIterator and an integral value.
Definition: DenseIterator.h:610
const MT::ElementType min(const DenseMatrix< MT, SO > &dm)
Returns the smallest element of the dense matrix.
Definition: DenseMatrix.h:1682
Header file for the DenseMatrix base class.
Header file for the Columns type trait.
Constraint on the data type.
const DenseIterator< Type, AF > operator-(const DenseIterator< Type, AF > &it, ptrdiff_t inc)
Subtraction between a DenseIterator and an integral value.
Definition: DenseIterator.h:642
CompressedMatrix< Type, false > TransposeType
Transpose type for expression template evaluations.
Definition: CompressedMatrix.h:2585
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:187
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:532
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:2586
Header file for all forward declarations for expression class templates.
const Type & ConstReference
Reference to a constant matrix value.
Definition: CompressedMatrix.h:2590
Header file for the EnableIf class template.
Header file for utility functions for dense matrices.
void clear(const DiagonalProxy< MT > &proxy)
Clearing the represented element.
Definition: DiagonalProxy.h:527
Header file for all restructuring column functions.
Header file for the conjugate shim.
Header file for the IsNumeric type trait.
const bool spacing
Adding an additional spacing line between two log messages.This setting gives the opportunity to add ...
Definition: Logging.h:70
Header file for the implementation of the base template of the HeritianMatrix.
DisableIf< Or< IsComputation< MT >, IsTransExpr< MT > >, typename RowExprTrait< MT >::Type >::Type row(Matrix< MT, SO > &matrix, size_t index)
Creating a view on a specific row of the given matrix.
Definition: Row.h:107
BLAZE_ALWAYS_INLINE EnableIf< And< IsIntegral< T >, HasSize< T, 2UL > >, simd_int16_t >::Type loada(const T *address)
Loads a vector of 2-byte integral values.
Definition: Loada.h:77
#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:2587
Header file for run time assertion macros.
Header file for the DenseRow class template.
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:79
#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:2591
Header file for the TransExprTrait class template.
Constraint on the data type.
Constraint on the data type.
void swap(DiagonalMatrix< MT, SO, DF > &a, DiagonalMatrix< MT, SO, DF > &b)
Swapping the contents of two matrices.
Definition: DiagonalMatrix.h:256
Header file for all intrinsic functionality.
Header file for the move shim.
SubmatrixExprTrait< MT, unaligned >::Type submatrix(Matrix< MT, SO > &matrix, size_t row, size_t column, size_t m, size_t n)
Creating a view on a specific submatrix of the given matrix.
Definition: Submatrix.h:146
bool operator<(const NegativeAccuracy< A > &lhs, const T &rhs)
Less-than comparison between a NegativeAccuracy object and a floating point value.
Definition: Accuracy.h:328
#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
const DMatTransExpr< MT,!SO > trans(const DenseMatrix< MT, SO > &dm)
Calculation of the transpose of the given dense matrix.
Definition: DMatTransExpr.h:944
Header file for the IsComputation type trait class.
Header file for the IsBuiltin type trait.
bool isHermitian(const DenseMatrix< MT, SO > &dm)
Checks if the given dense matrix is Hermitian.
Definition: DenseMatrix.h:767
#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
Header file for the HermitianProxy class.
bool operator==(const NegativeAccuracy< A > &lhs, const T &rhs)
Equality comparison between a NegativeAccuracy object and a floating point value. ...
Definition: Accuracy.h:249
This ResultType
Result type for expression template evaluations.
Definition: CompressedMatrix.h:2583
BLAZE_ALWAYS_INLINE EnableIf< And< IsIntegral< T >, HasSize< T, 2UL > > >::Type stream(T *address, const simd_int16_t &value)
Aligned, non-temporal store of a vector of 2-byte integral values.
Definition: Stream.h:74
BLAZE_ALWAYS_INLINE size_t columns(const Matrix< MT, SO > &matrix)
Returns the current number of columns of the matrix.
Definition: Matrix.h:324
bool operator!=(const NegativeAccuracy< A > &lhs, const T &rhs)
Inequality comparison between a NegativeAccuracy object and a floating point value.
Definition: Accuracy.h:289
bool isIntact(const DiagonalMatrix< MT, SO, DF > &m)
Returns whether the invariants of the given diagonal matrix are intact.
Definition: DiagonalMatrix.h:237
Header file for the IsComplex type trait.
MatrixAccessProxy< This > Reference
Reference to a non-constant matrix value.
Definition: CompressedMatrix.h:2589
#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:116
Header file for exception macros.
boost::true_type TrueType
Type traits base class.The TrueType class is used as base class for type traits and value traits that...
Definition: TrueType.h:61
#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 IsHermitian type trait.
System settings for the inline keywords.
#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
Header file for all restructuring row functions.
BLAZE_ALWAYS_INLINE EnableIf< And< IsIntegral< T >, HasSize< T, 2UL > > >::Type storea(T *address, const simd_int16_t &value)
Aligned store of a vector of 2-byte integral values.
Definition: Storea.h:78
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:558