Dense.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_ADAPTORS_UPPERMATRIX_DENSE_H_
36 #define _BLAZE_MATH_ADAPTORS_UPPERMATRIX_DENSE_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
43 #include <iterator>
44 #include <utility>
48 #include <blaze/math/Aliases.h>
59 #include <blaze/math/Exception.h>
62 #include <blaze/math/shims/Clear.h>
71 #include <blaze/system/Inline.h>
72 #include <blaze/util/Assert.h>
78 #include <blaze/util/DisableIf.h>
79 #include <blaze/util/EnableIf.h>
80 #include <blaze/util/FalseType.h>
82 #include <blaze/util/TrueType.h>
83 #include <blaze/util/Types.h>
85 #include <blaze/util/Unused.h>
86 
87 
88 namespace blaze {
89 
90 //=================================================================================================
91 //
92 // CLASS TEMPLATE SPECIALIZATION FOR DENSE MATRICES
93 //
94 //=================================================================================================
95 
96 //*************************************************************************************************
104 template< typename MT // Type of the adapted dense matrix
105  , bool SO > // Storage order of the adapted dense matrix
106 class UpperMatrix<MT,SO,true>
107  : public DenseMatrix< UpperMatrix<MT,SO,true>, SO >
108 {
109  private:
110  //**Type definitions****************************************************************************
111  typedef OppositeType_<MT> OT;
112  typedef TransposeType_<MT> TT;
113  typedef ElementType_<MT> ET;
114  //**********************************************************************************************
115 
116  public:
117  //**Type definitions****************************************************************************
118  typedef UpperMatrix<MT,SO,true> This;
119  typedef DenseMatrix<This,SO> BaseType;
120  typedef This ResultType;
121  typedef UpperMatrix<OT,!SO,true> OppositeType;
122  typedef LowerMatrix<TT,!SO,true> TransposeType;
123  typedef ET ElementType;
124  typedef SIMDType_<MT> SIMDType;
125  typedef ReturnType_<MT> ReturnType;
126  typedef const This& CompositeType;
127  typedef UpperProxy<MT> Reference;
128  typedef ConstReference_<MT> ConstReference;
129  typedef Pointer_<MT> Pointer;
130  typedef ConstPointer_<MT> ConstPointer;
131  typedef ConstIterator_<MT> ConstIterator;
132  //**********************************************************************************************
133 
134  //**Rebind struct definition********************************************************************
137  template< typename NewType > // Data type of the other matrix
138  struct Rebind {
140  typedef UpperMatrix< typename MT::template Rebind<NewType>::Other > 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  typedef UpperMatrix< typename MT::template Resize<NewM,NewN>::Other > Other;
152  };
153  //**********************************************************************************************
154 
155  //**Iterator class definition*******************************************************************
158  class Iterator
159  {
160  public:
161  //**Type definitions*************************************************************************
162  typedef std::random_access_iterator_tag IteratorCategory;
163  typedef ElementType_<MT> ValueType;
164  typedef UpperProxy<MT> PointerType;
165  typedef UpperProxy<MT> ReferenceType;
166  typedef ptrdiff_t DifferenceType;
167 
168  // STL iterator requirements
169  typedef IteratorCategory iterator_category;
170  typedef ValueType value_type;
171  typedef PointerType pointer;
172  typedef ReferenceType reference;
173  typedef DifferenceType difference_type;
174  //*******************************************************************************************
175 
176  //**Constructor******************************************************************************
179  inline Iterator() noexcept
180  : matrix_( nullptr ) // Reference to the adapted dense matrix
181  , row_ ( 0UL ) // The current row index of the iterator
182  , column_( 0UL ) // The current column index of the iterator
183  {}
184  //*******************************************************************************************
185 
186  //**Constructor******************************************************************************
193  inline Iterator( MT& matrix, size_t row, size_t column ) noexcept
194  : matrix_( &matrix ) // Reference to the adapted dense matrix
195  , row_ ( row ) // The current row-index of the iterator
196  , column_( column ) // The current column-index of the iterator
197  {}
198  //*******************************************************************************************
199 
200  //**Addition assignment operator*************************************************************
206  inline Iterator& operator+=( size_t inc ) noexcept {
207  ( SO )?( row_ += inc ):( column_ += inc );
208  return *this;
209  }
210  //*******************************************************************************************
211 
212  //**Subtraction assignment operator**********************************************************
218  inline Iterator& operator-=( size_t dec ) noexcept {
219  ( SO )?( row_ -= dec ):( column_ -= dec );
220  return *this;
221  }
222  //*******************************************************************************************
223 
224  //**Prefix increment operator****************************************************************
229  inline Iterator& operator++() noexcept {
230  ( SO )?( ++row_ ):( ++column_ );
231  return *this;
232  }
233  //*******************************************************************************************
234 
235  //**Postfix increment operator***************************************************************
240  inline const Iterator operator++( int ) noexcept {
241  const Iterator tmp( *this );
242  ++(*this);
243  return tmp;
244  }
245  //*******************************************************************************************
246 
247  //**Prefix decrement operator****************************************************************
252  inline Iterator& operator--() noexcept {
253  ( SO )?( --row_ ):( --column_ );
254  return *this;
255  }
256  //*******************************************************************************************
257 
258  //**Postfix decrement operator***************************************************************
263  inline const Iterator operator--( int ) noexcept {
264  const Iterator tmp( *this );
265  --(*this);
266  return tmp;
267  }
268  //*******************************************************************************************
269 
270  //**Element access operator******************************************************************
275  inline ReferenceType operator*() const {
276  return ReferenceType( *matrix_, row_, column_ );
277  }
278  //*******************************************************************************************
279 
280  //**Element access operator******************************************************************
285  inline PointerType operator->() const {
286  return PointerType( *matrix_, row_, column_ );
287  }
288  //*******************************************************************************************
289 
290  //**Load function****************************************************************************
300  inline SIMDType load() const {
301  return (*matrix_).load(row_,column_);
302  }
303  //*******************************************************************************************
304 
305  //**Loada function***************************************************************************
315  inline SIMDType loada() const {
316  return (*matrix_).loada(row_,column_);
317  }
318  //*******************************************************************************************
319 
320  //**Loadu function***************************************************************************
330  inline SIMDType loadu() const {
331  return (*matrix_).loadu(row_,column_);
332  }
333  //*******************************************************************************************
334 
335  //**Conversion operator**********************************************************************
340  inline operator ConstIterator() const {
341  if( SO )
342  return matrix_->begin( column_ ) + row_;
343  else
344  return matrix_->begin( row_ ) + column_;
345  }
346  //*******************************************************************************************
347 
348  //**Equality operator************************************************************************
355  friend inline bool operator==( const Iterator& lhs, const Iterator& rhs ) noexcept {
356  return ( SO )?( lhs.row_ == rhs.row_ ):( lhs.column_ == rhs.column_ );
357  }
358  //*******************************************************************************************
359 
360  //**Equality operator************************************************************************
367  friend inline bool operator==( const Iterator& lhs, const ConstIterator& rhs ) {
368  return ( ConstIterator( lhs ) == rhs );
369  }
370  //*******************************************************************************************
371 
372  //**Equality operator************************************************************************
379  friend inline bool operator==( const ConstIterator& lhs, const Iterator& rhs ) {
380  return ( lhs == ConstIterator( rhs ) );
381  }
382  //*******************************************************************************************
383 
384  //**Inequality operator**********************************************************************
391  friend inline bool operator!=( const Iterator& lhs, const Iterator& rhs ) noexcept {
392  return ( SO )?( lhs.row_ != rhs.row_ ):( lhs.column_ != rhs.column_ );
393  }
394  //*******************************************************************************************
395 
396  //**Inequality operator**********************************************************************
403  friend inline bool operator!=( const Iterator& lhs, const ConstIterator& rhs ) {
404  return ( ConstIterator( lhs ) != rhs );
405  }
406  //*******************************************************************************************
407 
408  //**Inequality operator**********************************************************************
415  friend inline bool operator!=( const ConstIterator& lhs, const Iterator& rhs ) {
416  return ( lhs != ConstIterator( rhs ) );
417  }
418  //*******************************************************************************************
419 
420  //**Less-than operator***********************************************************************
427  friend inline bool operator<( const Iterator& lhs, const Iterator& rhs ) noexcept {
428  return ( SO )?( lhs.row_ < rhs.row_ ):( lhs.column_ < rhs.column_ );
429  }
430  //*******************************************************************************************
431 
432  //**Less-than operator***********************************************************************
439  friend inline bool operator<( const Iterator& lhs, const ConstIterator& rhs ) {
440  return ( ConstIterator( lhs ) < rhs );
441  }
442  //*******************************************************************************************
443 
444  //**Less-than operator***********************************************************************
451  friend inline bool operator<( const ConstIterator& lhs, const Iterator& rhs ) {
452  return ( lhs < ConstIterator( rhs ) );
453  }
454  //*******************************************************************************************
455 
456  //**Greater-than operator********************************************************************
463  friend inline bool operator>( const Iterator& lhs, const Iterator& rhs ) noexcept {
464  return ( SO )?( lhs.row_ > rhs.row_ ):( lhs.column_ > rhs.column_ );
465  }
466  //*******************************************************************************************
467 
468  //**Greater-than operator********************************************************************
475  friend inline bool operator>( const Iterator& lhs, const ConstIterator& rhs ) {
476  return ( ConstIterator( lhs ) > rhs );
477  }
478  //*******************************************************************************************
479 
480  //**Greater-than operator********************************************************************
487  friend inline bool operator>( const ConstIterator& lhs, const Iterator& rhs ) {
488  return ( lhs > ConstIterator( rhs ) );
489  }
490  //*******************************************************************************************
491 
492  //**Less-or-equal-than operator**************************************************************
499  friend inline bool operator<=( const Iterator& lhs, const Iterator& rhs ) noexcept {
500  return ( SO )?( lhs.row_ <= rhs.row_ ):( lhs.column_ <= rhs.column_ );
501  }
502  //*******************************************************************************************
503 
504  //**Less-or-equal-than operator**************************************************************
511  friend inline bool operator<=( const Iterator& lhs, const ConstIterator& rhs ) {
512  return ( ConstIterator( lhs ) <= rhs );
513  }
514  //*******************************************************************************************
515 
516  //**Less-or-equal-than operator**************************************************************
523  friend inline bool operator<=( const ConstIterator& lhs, const Iterator& rhs ) {
524  return ( lhs <= ConstIterator( rhs ) );
525  }
526  //*******************************************************************************************
527 
528  //**Greater-or-equal-than operator***********************************************************
535  friend inline bool operator>=( const Iterator& lhs, const Iterator& rhs ) noexcept {
536  return ( SO )?( lhs.row_ >= rhs.row_ ):( lhs.column_ >= rhs.column_ );
537  }
538  //*******************************************************************************************
539 
540  //**Greater-or-equal-than operator***********************************************************
547  friend inline bool operator>=( const Iterator& lhs, const ConstIterator& rhs ) {
548  return ( ConstIterator( lhs ) >= rhs );
549  }
550  //*******************************************************************************************
551 
552  //**Greater-or-equal-than operator***********************************************************
559  friend inline bool operator>=( const ConstIterator& lhs, const Iterator& rhs ) {
560  return ( lhs >= ConstIterator( rhs ) );
561  }
562  //*******************************************************************************************
563 
564  //**Subtraction operator*********************************************************************
570  inline DifferenceType operator-( const Iterator& rhs ) const noexcept {
571  return ( SO )?( row_ - rhs.row_ ):( column_ - rhs.column_ );
572  }
573  //*******************************************************************************************
574 
575  //**Addition operator************************************************************************
582  friend inline const Iterator operator+( const Iterator& it, size_t inc ) noexcept {
583  if( SO )
584  return Iterator( *it.matrix_, it.row_ + inc, it.column_ );
585  else
586  return Iterator( *it.matrix_, it.row_, it.column_ + inc );
587  }
588  //*******************************************************************************************
589 
590  //**Addition operator************************************************************************
597  friend inline const Iterator operator+( size_t inc, const Iterator& it ) noexcept {
598  if( SO )
599  return Iterator( *it.matrix_, it.row_ + inc, it.column_ );
600  else
601  return Iterator( *it.matrix_, it.row_, it.column_ + inc );
602  }
603  //*******************************************************************************************
604 
605  //**Subtraction operator*********************************************************************
612  friend inline const Iterator operator-( const Iterator& it, size_t dec ) noexcept {
613  if( SO )
614  return Iterator( *it.matrix_, it.row_ - dec, it.column_ );
615  else
616  return Iterator( *it.matrix_, it.row_, it.column_ - dec );
617  }
618  //*******************************************************************************************
619 
620  private:
621  //**Member variables*************************************************************************
622  MT* matrix_;
623  size_t row_;
624  size_t column_;
625  //*******************************************************************************************
626  };
627  //**********************************************************************************************
628 
629  //**Compilation flags***************************************************************************
631  enum : bool { simdEnabled = MT::simdEnabled };
632 
634  enum : bool { smpAssignable = MT::smpAssignable };
635  //**********************************************************************************************
636 
637  //**Constructors********************************************************************************
640  explicit inline UpperMatrix();
641  template< typename A1 > explicit inline UpperMatrix( const A1& a1 );
642  explicit inline UpperMatrix( size_t n, const ElementType& init );
643 
644  explicit inline UpperMatrix( initializer_list< initializer_list<ElementType> > list );
645 
646  template< typename Other >
647  explicit inline UpperMatrix( size_t n, const Other* array );
648 
649  template< typename Other, size_t N >
650  explicit inline UpperMatrix( const Other (&array)[N][N] );
651 
652  explicit inline UpperMatrix( ElementType* ptr, size_t n );
653  explicit inline UpperMatrix( ElementType* ptr, size_t n, size_t nn );
654 
655  template< typename Deleter >
656  explicit inline UpperMatrix( ElementType* ptr, size_t n, Deleter d );
657 
658  template< typename Deleter >
659  explicit inline UpperMatrix( ElementType* ptr, size_t n, size_t nn, Deleter d );
660 
661  inline UpperMatrix( const UpperMatrix& m );
662  inline UpperMatrix( UpperMatrix&& m ) noexcept;
664  //**********************************************************************************************
665 
666  //**Destructor**********************************************************************************
667  // No explicitly declared destructor.
668  //**********************************************************************************************
669 
670  //**Data access functions***********************************************************************
673  inline Reference operator()( size_t i, size_t j );
674  inline ConstReference operator()( size_t i, size_t j ) const;
675  inline Reference at( size_t i, size_t j );
676  inline ConstReference at( size_t i, size_t j ) const;
677  inline ConstPointer data () const noexcept;
678  inline ConstPointer data ( size_t i ) const noexcept;
679  inline Iterator begin ( size_t i );
680  inline ConstIterator begin ( size_t i ) const;
681  inline ConstIterator cbegin( size_t i ) const;
682  inline Iterator end ( size_t i );
683  inline ConstIterator end ( size_t i ) const;
684  inline ConstIterator cend ( size_t i ) const;
686  //**********************************************************************************************
687 
688  //**Assignment operators************************************************************************
691  inline UpperMatrix& operator=( const ElementType& rhs );
692  inline UpperMatrix& operator=( initializer_list< initializer_list<ElementType> > list );
693 
694  template< typename Other, size_t N >
695  inline UpperMatrix& operator=( const Other (&array)[N][N] );
696 
697  inline UpperMatrix& operator=( const UpperMatrix& rhs );
698  inline UpperMatrix& operator=( UpperMatrix&& rhs ) noexcept;
699 
700  template< typename MT2, bool SO2 >
701  inline DisableIf_< IsComputation<MT2>, UpperMatrix& > operator=( const Matrix<MT2,SO2>& rhs );
702 
703  template< typename MT2, bool SO2 >
704  inline EnableIf_< IsComputation<MT2>, UpperMatrix& > operator=( const Matrix<MT2,SO2>& rhs );
705 
706  template< typename MT2, bool SO2 >
707  inline DisableIf_< IsComputation<MT2>, UpperMatrix& > operator+=( const Matrix<MT2,SO2>& rhs );
708 
709  template< typename MT2, bool SO2 >
710  inline EnableIf_< IsComputation<MT2>, UpperMatrix& > operator+=( const Matrix<MT2,SO2>& rhs );
711 
712  template< typename MT2, bool SO2 >
713  inline DisableIf_< IsComputation<MT2>, UpperMatrix& > operator-=( const Matrix<MT2,SO2>& rhs );
714 
715  template< typename MT2, bool SO2 >
716  inline EnableIf_< IsComputation<MT2>, UpperMatrix& > operator-=( const Matrix<MT2,SO2>& rhs );
717 
718  template< typename MT2, bool SO2 >
719  inline UpperMatrix& operator*=( const Matrix<MT2,SO2>& rhs );
720 
721  template< typename Other >
722  inline EnableIf_< IsNumeric<Other>, UpperMatrix >& operator*=( Other rhs );
723 
724  template< typename Other >
725  inline EnableIf_< IsNumeric<Other>, UpperMatrix >& operator/=( Other rhs );
727  //**********************************************************************************************
728 
729  //**Utility functions***************************************************************************
732  inline size_t rows() const noexcept;
733  inline size_t columns() const noexcept;
734  inline size_t spacing() const noexcept;
735  inline size_t capacity() const noexcept;
736  inline size_t capacity( size_t i ) const noexcept;
737  inline size_t nonZeros() const;
738  inline size_t nonZeros( size_t i ) const;
739  inline void reset();
740  inline void reset( size_t i );
741  inline void clear();
742  void resize ( size_t n, bool preserve=true );
743  inline void extend ( size_t n, bool preserve=true );
744  inline void reserve( size_t elements );
745  inline void swap( UpperMatrix& m ) noexcept;
746 
747  static inline constexpr size_t maxNonZeros() noexcept;
748  static inline constexpr size_t maxNonZeros( size_t n ) noexcept;
750  //**********************************************************************************************
751 
752  //**Numeric functions***************************************************************************
755  template< typename Other > inline UpperMatrix& scale( const Other& scalar );
757  //**********************************************************************************************
758 
759  //**Debugging functions*************************************************************************
762  inline bool isIntact() const noexcept;
764  //**********************************************************************************************
765 
766  //**Expression template evaluation functions****************************************************
769  template< typename Other > inline bool canAlias ( const Other* alias ) const noexcept;
770  template< typename Other > inline bool isAliased( const Other* alias ) const noexcept;
771 
772  inline bool isAligned () const noexcept;
773  inline bool canSMPAssign() const noexcept;
774 
775  BLAZE_ALWAYS_INLINE SIMDType load ( size_t i, size_t j ) const noexcept;
776  BLAZE_ALWAYS_INLINE SIMDType loada( size_t i, size_t j ) const noexcept;
777  BLAZE_ALWAYS_INLINE SIMDType loadu( size_t i, size_t j ) const noexcept;
779  //**********************************************************************************************
780 
781  private:
782  //**Construction functions**********************************************************************
785  inline const MT construct( size_t n , TrueType );
786  inline const MT construct( const ElementType& value, FalseType );
787 
788  template< typename MT2, bool SO2, typename T >
789  inline const MT construct( const Matrix<MT2,SO2>& m, T );
791  //**********************************************************************************************
792 
793  //**Member variables****************************************************************************
796  MT matrix_;
797 
798  //**********************************************************************************************
799 
800  //**Friend declarations*************************************************************************
801  template< bool RF, typename MT2, bool SO2, bool DF2 >
802  friend bool isDefault( const UpperMatrix<MT2,SO2,DF2>& m );
803 
804  template< typename MT2, bool SO2, bool DF2 >
805  friend MT2& derestrict( UpperMatrix<MT2,SO2,DF2>& m );
806  //**********************************************************************************************
807 
808  //**Compile time checks*************************************************************************
821  BLAZE_STATIC_ASSERT( Rows<MT>::value == Columns<MT>::value );
822  //**********************************************************************************************
823 };
825 //*************************************************************************************************
826 
827 
828 
829 
830 //=================================================================================================
831 //
832 // CONSTRUCTORS
833 //
834 //=================================================================================================
835 
836 //*************************************************************************************************
840 template< typename MT // Type of the adapted dense matrix
841  , bool SO > // Storage order of the adapted dense matrix
842 inline UpperMatrix<MT,SO,true>::UpperMatrix()
843  : matrix_() // The adapted dense matrix
844 {
845  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square upper matrix detected" );
846  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
847 }
849 //*************************************************************************************************
850 
851 
852 //*************************************************************************************************
870 template< typename MT // Type of the adapted dense matrix
871  , bool SO > // Storage order of the adapted dense matrix
872 template< typename A1 > // Type of the constructor argument
873 inline UpperMatrix<MT,SO,true>::UpperMatrix( const A1& a1 )
874  : matrix_( construct( a1, typename IsResizable<MT>::Type() ) ) // The adapted dense matrix
875 {
876  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square upper matrix detected" );
877  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
878 }
880 //*************************************************************************************************
881 
882 
883 //*************************************************************************************************
890 template< typename MT // Type of the adapted dense matrix
891  , bool SO > // Storage order of the adapted dense matrix
892 inline UpperMatrix<MT,SO,true>::UpperMatrix( size_t n, const ElementType& init )
893  : matrix_( n, n, ElementType() ) // The adapted dense matrix
894 {
896 
897  if( SO ) {
898  for( size_t j=0UL; j<columns(); ++j )
899  for( size_t i=0UL; i<=j; ++i )
900  matrix_(i,j) = init;
901  }
902  else {
903  for( size_t i=0UL; i<rows(); ++i )
904  for( size_t j=i; j<columns(); ++j )
905  matrix_(i,j) = init;
906  }
907 
908  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square upper matrix detected" );
909  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
910 }
912 //*************************************************************************************************
913 
914 
915 //*************************************************************************************************
938 template< typename MT // Type of the adapted dense matrix
939  , bool SO > // Storage order of the adapted dense matrix
940 inline UpperMatrix<MT,SO,true>::UpperMatrix( initializer_list< initializer_list<ElementType> > list )
941  : matrix_( list ) // The adapted dense matrix
942 {
943  if( !isUpper( matrix_ ) ) {
944  BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of upper matrix" );
945  }
946 
947  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
948 }
950 //*************************************************************************************************
951 
952 
953 //*************************************************************************************************
979 template< typename MT // Type of the adapted dense matrix
980  , bool SO > // Storage order of the adapted dense matrix
981 template< typename Other > // Data type of the initialization array
982 inline UpperMatrix<MT,SO,true>::UpperMatrix( size_t n, const Other* array )
983  : matrix_( n, n, array ) // The adapted dense matrix
984 {
985  if( !isUpper( matrix_ ) ) {
986  BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of upper matrix" );
987  }
988 
989  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
990 }
992 //*************************************************************************************************
993 
994 
995 //*************************************************************************************************
1018 template< typename MT // Type of the adapted dense matrix
1019  , bool SO > // Storage order of the adapted dense matrix
1020 template< typename Other // Data type of the initialization array
1021  , size_t N > // Number of rows and columns of the initialization array
1022 inline UpperMatrix<MT,SO,true>::UpperMatrix( const Other (&array)[N][N] )
1023  : matrix_( array ) // The adapted dense matrix
1024 {
1025  if( !isUpper( matrix_ ) ) {
1026  BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of upper matrix" );
1027  }
1028 
1029  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1030 }
1032 //*************************************************************************************************
1033 
1034 
1035 //*************************************************************************************************
1056 template< typename MT // Type of the adapted dense matrix
1057  , bool SO > // Storage order of the adapted dense matrix
1058 inline UpperMatrix<MT,SO,true>::UpperMatrix( ElementType* ptr, size_t n )
1059  : matrix_( ptr, n, n ) // The adapted dense matrix
1060 {
1061  if( !isUpper( matrix_ ) ) {
1062  BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of upper matrix" );
1063  }
1064 
1065  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1066 }
1068 //*************************************************************************************************
1069 
1070 
1071 //*************************************************************************************************
1094 template< typename MT // Type of the adapted dense matrix
1095  , bool SO > // Storage order of the adapted dense matrix
1096 inline UpperMatrix<MT,SO,true>::UpperMatrix( ElementType* ptr, size_t n, size_t nn )
1097  : matrix_( ptr, n, n, nn ) // The adapted dense matrix
1098 {
1099  if( !isUpper( matrix_ ) ) {
1100  BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of upper matrix" );
1101  }
1102 
1103  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1104 }
1106 //*************************************************************************************************
1107 
1108 
1109 //*************************************************************************************************
1130 template< typename MT // Type of the adapted dense matrix
1131  , bool SO > // Storage order of the adapted dense matrix
1132 template< typename Deleter > // Type of the custom deleter
1133 inline UpperMatrix<MT,SO,true>::UpperMatrix( ElementType* ptr, size_t n, Deleter d )
1134  : matrix_( ptr, n, n, d ) // The adapted dense matrix
1135 {
1136  if( !isUpper( matrix_ ) ) {
1137  BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of upper matrix" );
1138  }
1139 
1140  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1141 }
1143 //*************************************************************************************************
1144 
1145 
1146 //*************************************************************************************************
1168 template< typename MT // Type of the adapted dense matrix
1169  , bool SO > // Storage order of the adapted dense matrix
1170 template< typename Deleter > // Type of the custom deleter
1171 inline UpperMatrix<MT,SO,true>::UpperMatrix( ElementType* ptr, size_t n, size_t nn, Deleter d )
1172  : matrix_( ptr, n, n, nn, d ) // The adapted dense matrix
1173 {
1174  if( !isUpper( matrix_ ) ) {
1175  BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of upper matrix" );
1176  }
1177 
1178  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1179 }
1181 //*************************************************************************************************
1182 
1183 
1184 //*************************************************************************************************
1190 template< typename MT // Type of the adapted dense matrix
1191  , bool SO > // Storage order of the adapted dense matrix
1192 inline UpperMatrix<MT,SO,true>::UpperMatrix( const UpperMatrix& m )
1193  : matrix_( m.matrix_ ) // The adapted dense matrix
1194 {
1195  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square upper matrix detected" );
1196  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1197 }
1199 //*************************************************************************************************
1200 
1201 
1202 //*************************************************************************************************
1208 template< typename MT // Type of the adapted dense matrix
1209  , bool SO > // Storage order of the adapted dense matrix
1210 inline UpperMatrix<MT,SO,true>::UpperMatrix( UpperMatrix&& m ) noexcept
1211  : matrix_( std::move( m.matrix_ ) ) // The adapted dense matrix
1212 {
1213  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square upper matrix detected" );
1214  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1215 }
1217 //*************************************************************************************************
1218 
1219 
1220 
1221 
1222 //=================================================================================================
1223 //
1224 // DATA ACCESS FUNCTIONS
1225 //
1226 //=================================================================================================
1227 
1228 //*************************************************************************************************
1244 template< typename MT // Type of the adapted dense matrix
1245  , bool SO > // Storage order of the adapted dense matrix
1246 inline typename UpperMatrix<MT,SO,true>::Reference
1247  UpperMatrix<MT,SO,true>::operator()( size_t i, size_t j )
1248 {
1249  BLAZE_USER_ASSERT( i<rows() , "Invalid row access index" );
1250  BLAZE_USER_ASSERT( j<columns(), "Invalid column access index" );
1251 
1252  return Reference( matrix_, i, j );
1253 }
1255 //*************************************************************************************************
1256 
1257 
1258 //*************************************************************************************************
1274 template< typename MT // Type of the adapted dense matrix
1275  , bool SO > // Storage order of the adapted dense matrix
1277  UpperMatrix<MT,SO,true>::operator()( size_t i, size_t j ) const
1278 {
1279  BLAZE_USER_ASSERT( i<rows() , "Invalid row access index" );
1280  BLAZE_USER_ASSERT( j<columns(), "Invalid column access index" );
1281 
1282  return matrix_(i,j);
1283 }
1285 //*************************************************************************************************
1286 
1287 
1288 //*************************************************************************************************
1305 template< typename MT // Type of the adapted dense matrix
1306  , bool SO > // Storage order of the adapted dense matrix
1307 inline typename UpperMatrix<MT,SO,true>::Reference
1308  UpperMatrix<MT,SO,true>::at( size_t i, size_t j )
1309 {
1310  if( i >= rows() ) {
1311  BLAZE_THROW_OUT_OF_RANGE( "Invalid row access index" );
1312  }
1313  if( j >= columns() ) {
1314  BLAZE_THROW_OUT_OF_RANGE( "Invalid column access index" );
1315  }
1316  return (*this)(i,j);
1317 }
1319 //*************************************************************************************************
1320 
1321 
1322 //*************************************************************************************************
1339 template< typename MT // Type of the adapted dense matrix
1340  , bool SO > // Storage order of the adapted dense matrix
1342  UpperMatrix<MT,SO,true>::at( size_t i, size_t j ) const
1343 {
1344  if( i >= rows() ) {
1345  BLAZE_THROW_OUT_OF_RANGE( "Invalid row access index" );
1346  }
1347  if( j >= columns() ) {
1348  BLAZE_THROW_OUT_OF_RANGE( "Invalid column access index" );
1349  }
1350  return (*this)(i,j);
1351 }
1353 //*************************************************************************************************
1354 
1355 
1356 //*************************************************************************************************
1369 template< typename MT // Type of the adapted dense matrix
1370  , bool SO > // Storage order of the adapted dense matrix
1371 inline typename UpperMatrix<MT,SO,true>::ConstPointer
1372  UpperMatrix<MT,SO,true>::data() const noexcept
1373 {
1374  return matrix_.data();
1375 }
1377 //*************************************************************************************************
1378 
1379 
1380 //*************************************************************************************************
1389 template< typename MT // Type of the adapted dense matrix
1390  , bool SO > // Storage order of the adapted dense matrix
1391 inline typename UpperMatrix<MT,SO,true>::ConstPointer
1392  UpperMatrix<MT,SO,true>::data( size_t i ) const noexcept
1393 {
1394  return matrix_.data(i);
1395 }
1397 //*************************************************************************************************
1398 
1399 
1400 //*************************************************************************************************
1412 template< typename MT // Type of the adapted dense matrix
1413  , bool SO > // Storage order of the adapted dense matrix
1414 inline typename UpperMatrix<MT,SO,true>::Iterator
1415  UpperMatrix<MT,SO,true>::begin( size_t i )
1416 {
1417  if( SO )
1418  return Iterator( matrix_, 0UL, i );
1419  else
1420  return Iterator( matrix_, i, 0UL );
1421 }
1423 //*************************************************************************************************
1424 
1425 
1426 //*************************************************************************************************
1438 template< typename MT // Type of the adapted dense matrix
1439  , bool SO > // Storage order of the adapted dense matrix
1441  UpperMatrix<MT,SO,true>::begin( size_t i ) const
1442 {
1443  return matrix_.begin(i);
1444 }
1446 //*************************************************************************************************
1447 
1448 
1449 //*************************************************************************************************
1461 template< typename MT // Type of the adapted dense matrix
1462  , bool SO > // Storage order of the adapted dense matrix
1464  UpperMatrix<MT,SO,true>::cbegin( size_t i ) const
1465 {
1466  return matrix_.cbegin(i);
1467 }
1469 //*************************************************************************************************
1470 
1471 
1472 //*************************************************************************************************
1484 template< typename MT // Type of the adapted dense matrix
1485  , bool SO > // Storage order of the adapted dense matrix
1486 inline typename UpperMatrix<MT,SO,true>::Iterator
1487  UpperMatrix<MT,SO,true>::end( size_t i )
1488 {
1489  if( SO )
1490  return Iterator( matrix_, rows(), i );
1491  else
1492  return Iterator( matrix_, i, columns() );
1493 }
1495 //*************************************************************************************************
1496 
1497 
1498 //*************************************************************************************************
1510 template< typename MT // Type of the adapted dense matrix
1511  , bool SO > // Storage order of the adapted dense matrix
1513  UpperMatrix<MT,SO,true>::end( size_t i ) const
1514 {
1515  return matrix_.end(i);
1516 }
1518 //*************************************************************************************************
1519 
1520 
1521 //*************************************************************************************************
1533 template< typename MT // Type of the adapted dense matrix
1534  , bool SO > // Storage order of the adapted dense matrix
1536  UpperMatrix<MT,SO,true>::cend( size_t i ) const
1537 {
1538  return matrix_.cend(i);
1539 }
1541 //*************************************************************************************************
1542 
1543 
1544 
1545 
1546 //=================================================================================================
1547 //
1548 // ASSIGNMENT OPERATORS
1549 //
1550 //=================================================================================================
1551 
1552 //*************************************************************************************************
1559 template< typename MT // Type of the adapted dense matrix
1560  , bool SO > // Storage order of the adapted dense matrix
1561 inline UpperMatrix<MT,SO,true>&
1562  UpperMatrix<MT,SO,true>::operator=( const ElementType& rhs )
1563 {
1564  if( SO ) {
1565  for( size_t j=0UL; j<columns(); ++j )
1566  for( size_t i=0UL; i<=j; ++i )
1567  matrix_(i,j) = rhs;
1568  }
1569  else {
1570  for( size_t i=0UL; i<rows(); ++i )
1571  for( size_t j=i; j<columns(); ++j )
1572  matrix_(i,j) = rhs;
1573  }
1574 
1575  return *this;
1576 }
1578 //*************************************************************************************************
1579 
1580 
1581 //*************************************************************************************************
1605 template< typename MT // Type of the adapted dense matrix
1606  , bool SO > // Storage order of the adapted dense matrix
1607 inline UpperMatrix<MT,SO,true>&
1608  UpperMatrix<MT,SO,true>::operator=( initializer_list< initializer_list<ElementType> > list )
1609 {
1610  MT tmp( list );
1611 
1612  if( !isUpper( tmp ) ) {
1613  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to upper matrix" );
1614  }
1615 
1616  matrix_ = std::move( tmp );
1617 
1618  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square upper matrix detected" );
1619  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1620 
1621  return *this;
1622 }
1624 //*************************************************************************************************
1625 
1626 
1627 //*************************************************************************************************
1651 template< typename MT // Type of the adapted dense matrix
1652  , bool SO > // Storage order of the adapted dense matrix
1653 template< typename Other // Data type of the initialization array
1654  , size_t N > // Number of rows and columns of the initialization array
1655 inline UpperMatrix<MT,SO,true>&
1656  UpperMatrix<MT,SO,true>::operator=( const Other (&array)[N][N] )
1657 {
1658  MT tmp( array );
1659 
1660  if( !isUpper( tmp ) ) {
1661  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to upper matrix" );
1662  }
1663 
1664  matrix_ = std::move( tmp );
1665 
1666  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square upper matrix detected" );
1667  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1668 
1669  return *this;
1670 }
1672 //*************************************************************************************************
1673 
1674 
1675 //*************************************************************************************************
1685 template< typename MT // Type of the adapted dense matrix
1686  , bool SO > // Storage order of the adapted dense matrix
1687 inline UpperMatrix<MT,SO,true>&
1688  UpperMatrix<MT,SO,true>::operator=( const UpperMatrix& rhs )
1689 {
1690  matrix_ = rhs.matrix_;
1691 
1692  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square upper matrix detected" );
1693  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1694 
1695  return *this;
1696 }
1698 //*************************************************************************************************
1699 
1700 
1701 //*************************************************************************************************
1708 template< typename MT // Type of the adapted dense matrix
1709  , bool SO > // Storage order of the adapted dense matrix
1710 inline UpperMatrix<MT,SO,true>&
1711  UpperMatrix<MT,SO,true>::operator=( UpperMatrix&& rhs ) noexcept
1712 {
1713  matrix_ = std::move( rhs.matrix_ );
1714 
1715  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square upper matrix detected" );
1716  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1717 
1718  return *this;
1719 }
1721 //*************************************************************************************************
1722 
1723 
1724 //*************************************************************************************************
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 DisableIf_< IsComputation<MT2>, UpperMatrix<MT,SO,true>& >
1742  UpperMatrix<MT,SO,true>::operator=( const Matrix<MT2,SO2>& rhs )
1743 {
1744  if( !IsUpper<MT2>::value && !isUpper( ~rhs ) ) {
1745  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to upper matrix" );
1746  }
1747 
1748  matrix_ = ~rhs;
1749 
1750  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square upper matrix detected" );
1751  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1752 
1753  return *this;
1754 }
1756 //*************************************************************************************************
1757 
1758 
1759 //*************************************************************************************************
1772 template< typename MT // Type of the adapted dense matrix
1773  , bool SO > // Storage order of the adapted dense matrix
1774 template< typename MT2 // Type of the right-hand side matrix
1775  , bool SO2 > // Storage order of the right-hand side matrix
1776 inline EnableIf_< IsComputation<MT2>, UpperMatrix<MT,SO,true>& >
1777  UpperMatrix<MT,SO,true>::operator=( const Matrix<MT2,SO2>& rhs )
1778 {
1779  if( !IsSquare<MT2>::value && !isSquare( ~rhs ) ) {
1780  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to upper matrix" );
1781  }
1782 
1783  if( IsUpper<MT2>::value ) {
1784  matrix_ = ~rhs;
1785  }
1786  else {
1787  MT tmp( ~rhs );
1788 
1789  if( !isUpper( tmp ) ) {
1790  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to upper matrix" );
1791  }
1792 
1793  matrix_ = std::move( tmp );
1794  }
1795 
1796  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square upper matrix detected" );
1797  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1798 
1799  return *this;
1800 }
1802 //*************************************************************************************************
1803 
1804 
1805 //*************************************************************************************************
1818 template< typename MT // Type of the adapted dense matrix
1819  , bool SO > // Storage order of the adapted dense matrix
1820 template< typename MT2 // Type of the right-hand side matrix
1821  , bool SO2 > // Storage order of the right-hand side matrix
1822 inline DisableIf_< IsComputation<MT2>, UpperMatrix<MT,SO,true>& >
1823  UpperMatrix<MT,SO,true>::operator+=( const Matrix<MT2,SO2>& rhs )
1824 {
1825  if( !IsUpper<MT2>::value && !isUpper( ~rhs ) ) {
1826  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to upper matrix" );
1827  }
1828 
1829  matrix_ += ~rhs;
1830 
1831  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square upper matrix detected" );
1832  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1833 
1834  return *this;
1835 }
1837 //*************************************************************************************************
1838 
1839 
1840 //*************************************************************************************************
1853 template< typename MT // Type of the adapted dense matrix
1854  , bool SO > // Storage order of the adapted dense matrix
1855 template< typename MT2 // Type of the right-hand side matrix
1856  , bool SO2 > // Storage order of the right-hand side matrix
1857 inline EnableIf_< IsComputation<MT2>, UpperMatrix<MT,SO,true>& >
1858  UpperMatrix<MT,SO,true>::operator+=( const Matrix<MT2,SO2>& rhs )
1859 {
1860  if( !IsSquare<MT2>::value && !isSquare( ~rhs ) ) {
1861  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to upper matrix" );
1862  }
1863 
1864  if( IsUpper<MT2>::value ) {
1865  matrix_ += ~rhs;
1866  }
1867  else {
1868  const ResultType_<MT2> tmp( ~rhs );
1869 
1870  if( !isUpper( tmp ) ) {
1871  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to upper matrix" );
1872  }
1873 
1874  matrix_ += tmp;
1875  }
1876 
1877  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square upper matrix detected" );
1878  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1879 
1880  return *this;
1881 }
1883 //*************************************************************************************************
1884 
1885 
1886 //*************************************************************************************************
1899 template< typename MT // Type of the adapted dense matrix
1900  , bool SO > // Storage order of the adapted dense matrix
1901 template< typename MT2 // Type of the right-hand side matrix
1902  , bool SO2 > // Storage order of the right-hand side matrix
1903 inline DisableIf_< IsComputation<MT2>, UpperMatrix<MT,SO,true>& >
1904  UpperMatrix<MT,SO,true>::operator-=( const Matrix<MT2,SO2>& rhs )
1905 {
1906  if( !IsUpper<MT2>::value && !isUpper( ~rhs ) ) {
1907  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to upper matrix" );
1908  }
1909 
1910  matrix_ -= ~rhs;
1911 
1912  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square upper matrix detected" );
1913  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1914 
1915  return *this;
1916 }
1918 //*************************************************************************************************
1919 
1920 
1921 //*************************************************************************************************
1934 template< typename MT // Type of the adapted dense matrix
1935  , bool SO > // Storage order of the adapted dense matrix
1936 template< typename MT2 // Type of the right-hand side matrix
1937  , bool SO2 > // Storage order of the right-hand side matrix
1938 inline EnableIf_< IsComputation<MT2>, UpperMatrix<MT,SO,true>& >
1939  UpperMatrix<MT,SO,true>::operator-=( const Matrix<MT2,SO2>& rhs )
1940 {
1941  if( !IsSquare<MT2>::value && !isSquare( ~rhs ) ) {
1942  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to upper matrix" );
1943  }
1944 
1945  if( IsUpper<MT2>::value ) {
1946  matrix_ -= ~rhs;
1947  }
1948  else {
1949  const ResultType_<MT2> tmp( ~rhs );
1950 
1951  if( !isUpper( tmp ) ) {
1952  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to upper matrix" );
1953  }
1954 
1955  matrix_ -= tmp;
1956  }
1957 
1958  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square upper matrix detected" );
1959  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1960 
1961  return *this;
1962 }
1964 //*************************************************************************************************
1965 
1966 
1967 //*************************************************************************************************
1979 template< typename MT // Type of the adapted dense matrix
1980  , bool SO > // Storage order of the adapted dense matrix
1981 template< typename MT2 // Type of the right-hand side matrix
1982  , bool SO2 > // Storage order of the right-hand side matrix
1983 inline UpperMatrix<MT,SO,true>&
1984  UpperMatrix<MT,SO,true>::operator*=( const Matrix<MT2,SO2>& rhs )
1985 {
1986  if( matrix_.rows() != (~rhs).columns() ) {
1987  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to upper matrix" );
1988  }
1989 
1990  MT tmp( matrix_ * ~rhs );
1991 
1992  if( !isUpper( tmp ) ) {
1993  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to upper matrix" );
1994  }
1995 
1996  matrix_ = std::move( tmp );
1997 
1998  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square upper matrix detected" );
1999  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
2000 
2001  return *this;
2002 }
2004 //*************************************************************************************************
2005 
2006 
2007 //*************************************************************************************************
2015 template< typename MT // Type of the adapted dense matrix
2016  , bool SO > // Storage order of the adapted dense matrix
2017 template< typename Other > // Data type of the right-hand side scalar
2018 inline EnableIf_< IsNumeric<Other>, UpperMatrix<MT,SO,true> >&
2020 {
2021  matrix_ *= rhs;
2022  return *this;
2023 }
2024 //*************************************************************************************************
2025 
2026 
2027 //*************************************************************************************************
2035 template< typename MT // Type of the adapted dense matrix
2036  , bool SO > // Storage order of the adapted dense matrix
2037 template< typename Other > // Data type of the right-hand side scalar
2038 inline EnableIf_< IsNumeric<Other>, UpperMatrix<MT,SO,true> >&
2040 {
2041  BLAZE_USER_ASSERT( rhs != Other(0), "Division by zero detected" );
2042 
2043  matrix_ /= rhs;
2044  return *this;
2045 }
2047 //*************************************************************************************************
2048 
2049 
2050 
2051 
2052 //=================================================================================================
2053 //
2054 // UTILITY FUNCTIONS
2055 //
2056 //=================================================================================================
2057 
2058 //*************************************************************************************************
2064 template< typename MT // Type of the adapted dense matrix
2065  , bool SO > // Storage order of the adapted dense matrix
2066 inline size_t UpperMatrix<MT,SO,true>::rows() const noexcept
2067 {
2068  return matrix_.rows();
2069 }
2071 //*************************************************************************************************
2072 
2073 
2074 //*************************************************************************************************
2080 template< typename MT // Type of the adapted dense matrix
2081  , bool SO > // Storage order of the adapted dense matrix
2082 inline size_t UpperMatrix<MT,SO,true>::columns() const noexcept
2083 {
2084  return matrix_.columns();
2085 }
2087 //*************************************************************************************************
2088 
2089 
2090 //*************************************************************************************************
2101 template< typename MT // Type of the adapted dense matrix
2102  , bool SO > // Storage order of the adapted dense matrix
2103 inline size_t UpperMatrix<MT,SO,true>::spacing() const noexcept
2104 {
2105  return matrix_.spacing();
2106 }
2108 //*************************************************************************************************
2109 
2110 
2111 //*************************************************************************************************
2117 template< typename MT // Type of the adapted dense matrix
2118  , bool SO > // Storage order of the adapted dense matrix
2119 inline size_t UpperMatrix<MT,SO,true>::capacity() const noexcept
2120 {
2121  return matrix_.capacity();
2122 }
2124 //*************************************************************************************************
2125 
2126 
2127 //*************************************************************************************************
2139 template< typename MT // Type of the adapted dense matrix
2140  , bool SO > // Storage order of the adapted dense matrix
2141 inline size_t UpperMatrix<MT,SO,true>::capacity( size_t i ) const noexcept
2142 {
2143  return matrix_.capacity(i);
2144 }
2146 //*************************************************************************************************
2147 
2148 
2149 //*************************************************************************************************
2155 template< typename MT // Type of the adapted dense matrix
2156  , bool SO > // Storage order of the adapted dense matrix
2157 inline size_t UpperMatrix<MT,SO,true>::nonZeros() const
2158 {
2159  return matrix_.nonZeros();
2160 }
2162 //*************************************************************************************************
2163 
2164 
2165 //*************************************************************************************************
2177 template< typename MT // Type of the adapted dense matrix
2178  , bool SO > // Storage order of the adapted dense matrix
2179 inline size_t UpperMatrix<MT,SO,true>::nonZeros( size_t i ) const
2180 {
2181  return matrix_.nonZeros(i);
2182 }
2184 //*************************************************************************************************
2185 
2186 
2187 //*************************************************************************************************
2193 template< typename MT // Type of the adapted dense matrix
2194  , bool SO > // Storage order of the adapted dense matrix
2195 inline void UpperMatrix<MT,SO,true>::reset()
2196 {
2197  using blaze::clear;
2198 
2199  if( SO ) {
2200  for( size_t j=0UL; j<columns(); ++j )
2201  for( size_t i=0UL; i<=j; ++i )
2202  clear( matrix_(i,j) );
2203  }
2204  else {
2205  for( size_t i=0UL; i<rows(); ++i )
2206  for( size_t j=i; j<columns(); ++j )
2207  clear( matrix_(i,j) );
2208  }
2209 }
2211 //*************************************************************************************************
2212 
2213 
2214 //*************************************************************************************************
2227 template< typename MT // Type of the adapted dense matrix
2228  , bool SO > // Storage order of the adapted dense matrix
2229 inline void UpperMatrix<MT,SO,true>::reset( size_t i )
2230 {
2231  using blaze::clear;
2232 
2233  if( SO ) {
2234  for( size_t j=0UL; j<=i; ++j )
2235  clear( matrix_(j,i) );
2236  }
2237  else {
2238  for( size_t j=i; j<columns(); ++j )
2239  clear( matrix_(i,j) );
2240  }
2241 }
2243 //*************************************************************************************************
2244 
2245 
2246 //*************************************************************************************************
2258 template< typename MT // Type of the adapted dense matrix
2259  , bool SO > // Storage order of the adapted dense matrix
2260 inline void UpperMatrix<MT,SO,true>::clear()
2261 {
2262  using blaze::clear;
2263 
2264  if( IsResizable<MT>::value ) {
2265  clear( matrix_ );
2266  }
2267  else {
2268  reset();
2269  }
2270 }
2272 //*************************************************************************************************
2273 
2274 
2275 //*************************************************************************************************
2311 template< typename MT // Type of the adapted dense matrix
2312  , bool SO > // Storage order of the adapted dense matrix
2313 void UpperMatrix<MT,SO,true>::resize( size_t n, bool preserve )
2314 {
2316 
2317  UNUSED_PARAMETER( preserve );
2318 
2319  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square upper matrix detected" );
2320 
2321  const size_t oldsize( matrix_.rows() );
2322 
2323  matrix_.resize( n, n, true );
2324 
2325  if( n > oldsize ) {
2326  const size_t increment( n - oldsize );
2327  submatrix( matrix_, oldsize, 0UL, increment, n-1 ).reset();
2328  }
2329 }
2331 //*************************************************************************************************
2332 
2333 
2334 //*************************************************************************************************
2347 template< typename MT // Type of the adapted dense matrix
2348  , bool SO > // Storage order of the adapted dense matrix
2349 inline void UpperMatrix<MT,SO,true>::extend( size_t n, bool preserve )
2350 {
2352 
2353  UNUSED_PARAMETER( preserve );
2354 
2355  resize( rows() + n, true );
2356 }
2357 //*************************************************************************************************
2358 
2359 
2360 //*************************************************************************************************
2370 template< typename MT // Type of the adapted dense matrix
2371  , bool SO > // Storage order of the adapted dense matrix
2372 inline void UpperMatrix<MT,SO,true>::reserve( size_t elements )
2373 {
2374  matrix_.reserve( elements );
2375 }
2377 //*************************************************************************************************
2378 
2379 
2380 //*************************************************************************************************
2387 template< typename MT // Type of the adapted dense matrix
2388  , bool SO > // Storage order of the adapted dense matrix
2389 inline void UpperMatrix<MT,SO,true>::swap( UpperMatrix& m ) noexcept
2390 {
2391  using std::swap;
2392 
2393  swap( matrix_, m.matrix_ );
2394 }
2396 //*************************************************************************************************
2397 
2398 
2399 //*************************************************************************************************
2411 template< typename MT // Type of the adapted dense matrix
2412  , bool SO > // Storage order of the adapted dense matrix
2413 inline constexpr size_t UpperMatrix<MT,SO,true>::maxNonZeros() noexcept
2414 {
2416 
2417  return maxNonZeros( Rows<MT>::value );
2418 }
2420 //*************************************************************************************************
2421 
2422 
2423 //*************************************************************************************************
2433 template< typename MT // Type of the adapted dense matrix
2434  , bool SO > // Storage order of the adapted dense matrix
2435 inline constexpr size_t UpperMatrix<MT,SO,true>::maxNonZeros( size_t n ) noexcept
2436 {
2437  return ( ( n + 1UL ) * n ) / 2UL;
2438 }
2440 //*************************************************************************************************
2441 
2442 
2443 
2444 
2445 //=================================================================================================
2446 //
2447 // NUMERIC FUNCTIONS
2448 //
2449 //=================================================================================================
2450 
2451 //*************************************************************************************************
2458 template< typename MT // Type of the adapted dense matrix
2459  , bool SO > // Storage order of the adapted dense matrix
2460 template< typename Other > // Data type of the scalar value
2461 inline UpperMatrix<MT,SO,true>& UpperMatrix<MT,SO,true>::scale( const Other& scalar )
2462 {
2463  matrix_.scale( scalar );
2464  return *this;
2465 }
2467 //*************************************************************************************************
2468 
2469 
2470 
2471 
2472 //=================================================================================================
2473 //
2474 // DEBUGGING FUNCTIONS
2475 //
2476 //=================================================================================================
2477 
2478 //*************************************************************************************************
2488 template< typename MT // Type of the adapted dense matrix
2489  , bool SO > // Storage order of the adapted dense matrix
2490 inline bool UpperMatrix<MT,SO,true>::isIntact() const noexcept
2491 {
2492  using blaze::isIntact;
2493 
2494  return ( isIntact( matrix_ ) && isUpper( matrix_ ) );
2495 }
2497 //*************************************************************************************************
2498 
2499 
2500 
2501 
2502 //=================================================================================================
2503 //
2504 // EXPRESSION TEMPLATE EVALUATION FUNCTIONS
2505 //
2506 //=================================================================================================
2507 
2508 //*************************************************************************************************
2519 template< typename MT // Type of the adapted dense matrix
2520  , bool SO > // Storage order of the adapted dense matrix
2521 template< typename Other > // Data type of the foreign expression
2522 inline bool UpperMatrix<MT,SO,true>::canAlias( const Other* alias ) const noexcept
2523 {
2524  return matrix_.canAlias( alias );
2525 }
2527 //*************************************************************************************************
2528 
2529 
2530 //*************************************************************************************************
2541 template< typename MT // Type of the adapted dense matrix
2542  , bool SO > // Storage order of the adapted dense matrix
2543 template< typename Other > // Data type of the foreign expression
2544 inline bool UpperMatrix<MT,SO,true>::isAliased( const Other* alias ) const noexcept
2545 {
2546  return matrix_.isAliased( alias );
2547 }
2549 //*************************************************************************************************
2550 
2551 
2552 //*************************************************************************************************
2562 template< typename MT // Type of the adapted dense matrix
2563  , bool SO > // Storage order of the adapted dense matrix
2564 inline bool UpperMatrix<MT,SO,true>::isAligned() const noexcept
2565 {
2566  return matrix_.isAligned();
2567 }
2569 //*************************************************************************************************
2570 
2571 
2572 //*************************************************************************************************
2583 template< typename MT // Type of the adapted dense matrix
2584  , bool SO > // Storage order of the adapted dense matrix
2585 inline bool UpperMatrix<MT,SO,true>::canSMPAssign() const noexcept
2586 {
2587  return matrix_.canSMPAssign();
2588 }
2590 //*************************************************************************************************
2591 
2592 
2593 //*************************************************************************************************
2609 template< typename MT // Type of the adapted dense matrix
2610  , bool SO > // Storage order of the adapted dense matrix
2611 BLAZE_ALWAYS_INLINE typename UpperMatrix<MT,SO,true>::SIMDType
2612  UpperMatrix<MT,SO,true>::load( size_t i, size_t j ) const noexcept
2613 {
2614  return matrix_.load( i, j );
2615 }
2617 //*************************************************************************************************
2618 
2619 
2620 //*************************************************************************************************
2636 template< typename MT // Type of the adapted dense matrix
2637  , bool SO > // Storage order of the adapted dense matrix
2638 BLAZE_ALWAYS_INLINE typename UpperMatrix<MT,SO,true>::SIMDType
2639  UpperMatrix<MT,SO,true>::loada( size_t i, size_t j ) const noexcept
2640 {
2641  return matrix_.loada( i, j );
2642 }
2644 //*************************************************************************************************
2645 
2646 
2647 //*************************************************************************************************
2663 template< typename MT // Type of the adapted dense matrix
2664  , bool SO > // Storage order of the adapted dense matrix
2665 BLAZE_ALWAYS_INLINE typename UpperMatrix<MT,SO,true>::SIMDType
2666  UpperMatrix<MT,SO,true>::loadu( size_t i, size_t j ) const noexcept
2667 {
2668  return matrix_.loadu( i, j );
2669 }
2671 //*************************************************************************************************
2672 
2673 
2674 
2675 
2676 //=================================================================================================
2677 //
2678 // CONSTRUCTION FUNCTIONS
2679 //
2680 //=================================================================================================
2681 
2682 //*************************************************************************************************
2689 template< typename MT // Type of the adapted dense matrix
2690  , bool SO > // Storage order of the adapted dense matrix
2691 inline const MT UpperMatrix<MT,SO,true>::construct( size_t n, TrueType )
2692 {
2694 
2695  return MT( n, n, ElementType() );
2696 }
2698 //*************************************************************************************************
2699 
2700 
2701 //*************************************************************************************************
2708 template< typename MT // Type of the adapted dense matrix
2709  , bool SO > // Storage order of the adapted dense matrix
2710 inline const MT UpperMatrix<MT,SO,true>::construct( const ElementType& init, FalseType )
2711 {
2714 
2715  MT tmp;
2716 
2717  if( SO ) {
2718  for( size_t j=0UL; j<columns(); ++j )
2719  for( size_t i=0UL; i<=j; ++i )
2720  tmp(i,j) = init;
2721  }
2722  else {
2723  for( size_t i=0UL; i<rows(); ++i )
2724  for( size_t j=i; j<columns(); ++j )
2725  tmp(i,j) = init;
2726  }
2727 
2728  return tmp;
2729 }
2731 //*************************************************************************************************
2732 
2733 
2734 //*************************************************************************************************
2745 template< typename MT // Type of the adapted dense matrix
2746  , bool SO > // Storage order of the adapted dense matrix
2747 template< typename MT2 // Type of the foreign matrix
2748  , bool SO2 // Storage order of the foreign matrix
2749  , typename T > // Type of the third argument
2750 inline const MT UpperMatrix<MT,SO,true>::construct( const Matrix<MT2,SO2>& m, T )
2751 {
2752  const MT tmp( ~m );
2753 
2754  if( !IsUpper<MT2>::value && !isUpper( tmp ) ) {
2755  BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of upper matrix" );
2756  }
2757 
2758  return tmp;
2759 }
2761 //*************************************************************************************************
2762 
2763 } // namespace blaze
2764 
2765 #endif
Constraint on the data type.
Header file for the implementation of the Submatrix view.
#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
BoolConstant< false > FalseType
Type/value traits base class.The FalseType class is used as base class for type traits and value trai...
Definition: FalseType.h:61
#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
BLAZE_ALWAYS_INLINE size_t spacing(const DenseMatrix< MT, SO > &dm) noexcept
Returns the spacing between the beginning of two rows/columns.
Definition: DenseMatrix.h:102
Header file for auxiliary alias declarations.
bool isUpper(const DenseMatrix< MT, SO > &dm)
Checks if the given dense matrix is an upper triangular matrix.
Definition: DenseMatrix.h:1321
#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.
BLAZE_ALWAYS_INLINE size_t capacity(const Matrix< MT, SO > &matrix) noexcept
Returns the maximum capacity of the matrix.
Definition: Matrix.h:352
Header file for basic type definitions.
Header file for the FalseType type/value trait base class.
#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
#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:61
constexpr bool operator<(const NegativeAccuracy< A > &lhs, const T &rhs)
Less-than comparison between a NegativeAccuracy object and a floating point value.
Definition: Accuracy.h:329
BLAZE_ALWAYS_INLINE T1 & operator/=(SIMDPack< T1 > &lhs, const SIMDPack< T2 > &rhs)
Division assignment operator for the division of two SIMD packs.
Definition: BasicTypes.h:1339
Constraint on the data type.
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:194
Constraint on the data type.
void reset(const DiagonalProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: DiagonalProxy.h:533
const DenseIterator< Type, AF > operator+(const DenseIterator< Type, AF > &it, ptrdiff_t inc) noexcept
Addition between a DenseIterator and an integral value.
Definition: DenseIterator.h:699
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:2935
typename DisableIf< Condition, T >::Type DisableIf_
Auxiliary type for the DisableIf class template.The DisableIf_ alias declaration provides a convenien...
Definition: DisableIf.h:223
void clear(CompressedMatrix< Type, SO > &m)
Clearing the given compressed matrix.
Definition: CompressedMatrix.h:5556
CompressedMatrix< Type, true > This
Type of this CompressedMatrix instance.
Definition: CompressedMatrix.h:2928
#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
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:390
#define BLAZE_CONSTRAINT_MUST_BE_SQUARE(T)
Constraint on the data type.In case the given data type T is not a square matrix type, a compilation error is created.
Definition: Square.h:60
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:731
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
BLAZE_ALWAYS_INLINE T1 & operator*=(SIMDPack< T1 > &lhs, const SIMDPack< T2 > &rhs)
Multiplication assignment operator for the multiplication of two SIMD packs.
Definition: BasicTypes.h:1321
Constraint on the data type.
BLAZE_ALWAYS_INLINE const EnableIf_< And< IsIntegral< T >, HasSize< T, 1UL > >, If_< IsSigned< T >, SIMDint8, SIMDuint8 > > loadu(const T *address) noexcept
Loads a vector of 1-byte integral values.
Definition: Loadu.h:77
CompressedMatrix< Type, false > OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: CompressedMatrix.h:2931
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:304
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:238
Constraint on the data type.
Constraint on the data type.
Header file for the std::initializer_list aliases.
Header file for the IsSquare type trait.
Constraint on the data type.
Constraint on the data type.
Header file for the DisableIf class template.
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
void swap(CompressedMatrix< Type, SO > &a, CompressedMatrix< Type, SO > &b) noexcept
Swapping the contents of two compressed matrices.
Definition: CompressedMatrix.h:5635
Compile time assertion.
bool isIntact(const CompressedMatrix< Type, SO > &m)
Returns whether the invariants of the given compressed matrix are intact.
Definition: CompressedMatrix.h:5618
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2939
#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
#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
Header file for the DenseMatrix base class.
Header file for the Columns type trait.
constexpr bool operator>(const NegativeAccuracy< A > &lhs, const T &rhs)
Greater-than comparison between a NegativeAccuracy object and a floating point value.
Definition: Accuracy.h:367
constexpr 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:443
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
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:336
BLAZE_ALWAYS_INLINE const EnableIf_< And< IsIntegral< T >, HasSize< T, 1UL > >, If_< IsSigned< T >, SIMDint8, SIMDuint8 > > loada(const T *address) noexcept
Loads a vector of 1-byte integral values.
Definition: Loada.h:80
DisableIf_< Or< IsComputation< MT >, IsTransExpr< MT >, IsDeclExpr< MT > >, RowExprTrait_< MT > > row(Matrix< MT, SO > &matrix, size_t index)
Creating a view on a specific row of the given matrix.
Definition: Row.h:128
CompressedMatrix< Type, false > TransposeType
Transpose type for expression template evaluations.
Definition: CompressedMatrix.h:2932
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:544
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:260
Type ElementType
Type of the compressed matrix elements.
Definition: CompressedMatrix.h:2933
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 UpperProxy class.
const Type & ConstReference
Reference to a constant matrix value.
Definition: CompressedMatrix.h:2937
DisableIf_< Or< IsComputation< MT >, IsTransExpr< MT >, IsDeclExpr< MT > >, ColumnExprTrait_< MT > > column(Matrix< MT, SO > &matrix, size_t index)
Creating a view on a specific column of the given matrix.
Definition: Column.h:128
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:553
Header file for the IsNumeric type trait.
Header file for all adaptor forward declarations.
#define BLAZE_CONSTRAINT_MUST_NOT_BE_SYMMETRIC_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is a symmetric matrix type, a compilation error is created.
Definition: Symmetric.h:79
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:2934
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:1285
Header file for run time assertion macros.
Constraint on the data type.
Constraint on the data type.
#define BLAZE_CONSTRAINT_MUST_NOT_BE_LOWER_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is a lower triangular matrix type...
Definition: Lower.h:81
#define BLAZE_CONSTRAINT_MUST_NOT_BE_REFERENCE_TYPE(T)
Constraint on the data type.In case the given data type T is not a reference type, a compilation error is created.
Definition: Reference.h:79
Element * Iterator
Iterator over non-constant elements.
Definition: CompressedMatrix.h:2938
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:267
Constraint on the data type.
Constraint on the data type.
constexpr 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:405
#define BLAZE_CONSTRAINT_MUST_NOT_BE_RESIZABLE(T)
Constraint on the data type.In case the given data type T is resizable, i.e. has a &#39;resize&#39; member fu...
Definition: Resizable.h:81
typename EnableIf< Condition, T >::Type EnableIf_
Auxiliary alias declaration for the EnableIf class template.The EnableIf_ alias declaration provides ...
Definition: EnableIf.h:223
BLAZE_ALWAYS_INLINE size_t rows(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of rows of the matrix.
Definition: Matrix.h:320
SparseMatrix< This, true > BaseType
Base type of this CompressedMatrix instance.
Definition: CompressedMatrix.h:2929
#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 &#39;res...
Definition: Resizable.h:61
Header file for the IsComputation type trait class.
#define BLAZE_CONSTRAINT_MUST_NOT_BE_EXPRESSION_TYPE(T)
Constraint on the data type.In case the given data type T is an expression (i.e. a type derived from ...
Definition: Expression.h:81
This ResultType
Result type for expression template evaluations.
Definition: CompressedMatrix.h:2930
bool isIntact(const DiagonalMatrix< MT, SO, DF > &m)
Returns whether the invariants of the given diagonal matrix are intact.
Definition: DiagonalMatrix.h:249
bool isDefault(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: DiagonalProxy.h:573
MatrixAccessProxy< This > Reference
Reference to a non-constant matrix value.
Definition: CompressedMatrix.h:2936
#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:1303
Header file for the IsUpper type trait.
void UNUSED_PARAMETER(const Args &...)
Suppression of unused parameter warnings.
Definition: Unused.h:81
#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
Header file for the implementation of the base template of the UpperMatrix.
SubmatrixExprTrait_< MT, unaligned > 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:168
BLAZE_ALWAYS_INLINE bool isSquare(const Matrix< MT, SO > &matrix) noexcept
Checks if the given matrix is a square matrix.
Definition: Matrix.h:677
Header file for the IsResizable type trait.
const DMatDMatMultExpr< T1, T2, false, false, false, false > 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:7505
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 the TrueType type/value trait base class.