Dense.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_ADAPTORS_UNIUPPERMATRIX_DENSE_H_
36 #define _BLAZE_MATH_ADAPTORS_UNIUPPERMATRIX_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>
75 #include <blaze/system/Inline.h>
76 #include <blaze/util/Assert.h>
83 #include <blaze/util/DisableIf.h>
84 #include <blaze/util/EnableIf.h>
85 #include <blaze/util/FalseType.h>
87 #include <blaze/util/TrueType.h>
88 #include <blaze/util/Types.h>
89 #include <blaze/util/Unused.h>
90 
91 
92 namespace blaze {
93 
94 //=================================================================================================
95 //
96 // CLASS TEMPLATE SPECIALIZATION FOR DENSE MATRICES
97 //
98 //=================================================================================================
99 
100 //*************************************************************************************************
108 template< typename MT // Type of the adapted dense matrix
109  , bool SO > // Storage order of the adapted dense matrix
110 class UniUpperMatrix<MT,SO,true>
111  : public DenseMatrix< UniUpperMatrix<MT,SO,true>, SO >
112 {
113  private:
114  //**Type definitions****************************************************************************
115  typedef OppositeType_<MT> OT;
116  typedef TransposeType_<MT> TT;
117  typedef ElementType_<MT> ET;
118  //**********************************************************************************************
119 
120  public:
121  //**Type definitions****************************************************************************
122  typedef UniUpperMatrix<MT,SO,true> This;
123  typedef DenseMatrix<This,SO> BaseType;
124  typedef This ResultType;
125  typedef UniUpperMatrix<OT,!SO,true> OppositeType;
126  typedef UniLowerMatrix<TT,!SO,true> TransposeType;
127  typedef ET ElementType;
128  typedef SIMDType_<MT> SIMDType;
129  typedef ReturnType_<MT> ReturnType;
130  typedef const This& CompositeType;
131  typedef UniUpperProxy<MT> Reference;
132  typedef ConstReference_<MT> ConstReference;
133  typedef Pointer_<MT> Pointer;
134  typedef ConstPointer_<MT> ConstPointer;
135  typedef ConstIterator_<MT> ConstIterator;
136  //**********************************************************************************************
137 
138  //**Rebind struct definition********************************************************************
141  template< typename NewType > // Data type of the other matrix
142  struct Rebind {
144  typedef UniUpperMatrix< typename MT::template Rebind<NewType>::Other > Other;
145  };
146  //**********************************************************************************************
147 
148  //**Resize struct definition********************************************************************
151  template< size_t NewM // Number of rows of the other matrix
152  , size_t NewN > // Number of columns of the other matrix
153  struct Resize {
155  typedef UniUpperMatrix< typename MT::template Resize<NewM,NewN>::Other > Other;
156  };
157  //**********************************************************************************************
158 
159  //**Iterator class definition*******************************************************************
162  class Iterator
163  {
164  public:
165  //**Type definitions*************************************************************************
166  typedef std::random_access_iterator_tag IteratorCategory;
167  typedef ElementType_<MT> ValueType;
168  typedef UniUpperProxy<MT> PointerType;
169  typedef UniUpperProxy<MT> ReferenceType;
170  typedef ptrdiff_t DifferenceType;
171 
172  // STL iterator requirements
173  typedef IteratorCategory iterator_category;
174  typedef ValueType value_type;
175  typedef PointerType pointer;
176  typedef ReferenceType reference;
177  typedef DifferenceType difference_type;
178  //*******************************************************************************************
179 
180  //**Constructor******************************************************************************
183  inline Iterator() noexcept
184  : matrix_( nullptr ) // Reference to the adapted dense matrix
185  , row_ ( 0UL ) // The current row index of the iterator
186  , column_( 0UL ) // The current column index of the iterator
187  {}
188  //*******************************************************************************************
189 
190  //**Constructor******************************************************************************
197  inline Iterator( MT& matrix, size_t row, size_t column ) noexcept
198  : matrix_( &matrix ) // Reference to the adapted dense matrix
199  , row_ ( row ) // The current row-index of the iterator
200  , column_( column ) // The current column-index of the iterator
201  {}
202  //*******************************************************************************************
203 
204  //**Addition assignment operator*************************************************************
210  inline Iterator& operator+=( size_t inc ) noexcept {
211  ( SO )?( row_ += inc ):( column_ += inc );
212  return *this;
213  }
214  //*******************************************************************************************
215 
216  //**Subtraction assignment operator**********************************************************
222  inline Iterator& operator-=( size_t dec ) noexcept {
223  ( SO )?( row_ -= dec ):( column_ -= dec );
224  return *this;
225  }
226  //*******************************************************************************************
227 
228  //**Prefix increment operator****************************************************************
233  inline Iterator& operator++() noexcept {
234  ( SO )?( ++row_ ):( ++column_ );
235  return *this;
236  }
237  //*******************************************************************************************
238 
239  //**Postfix increment operator***************************************************************
244  inline const Iterator operator++( int ) noexcept {
245  const Iterator tmp( *this );
246  ++(*this);
247  return tmp;
248  }
249  //*******************************************************************************************
250 
251  //**Prefix decrement operator****************************************************************
256  inline Iterator& operator--() noexcept {
257  ( SO )?( --row_ ):( --column_ );
258  return *this;
259  }
260  //*******************************************************************************************
261 
262  //**Postfix decrement operator***************************************************************
267  inline const Iterator operator--( int ) {
268  const Iterator tmp( *this );
269  --(*this);
270  return tmp;
271  }
272  //*******************************************************************************************
273 
274  //**Element access operator******************************************************************
279  inline ReferenceType operator*() const {
280  return ReferenceType( *matrix_, row_, column_ );
281  }
282  //*******************************************************************************************
283 
284  //**Element access operator******************************************************************
289  inline PointerType operator->() const {
290  return PointerType( *matrix_, row_, column_ );
291  }
292  //*******************************************************************************************
293 
294  //**Load function****************************************************************************
304  inline SIMDType load() const {
305  return (*matrix_).load(row_,column_);
306  }
307  //*******************************************************************************************
308 
309  //**Loada function***************************************************************************
319  inline SIMDType loada() const {
320  return (*matrix_).loada(row_,column_);
321  }
322  //*******************************************************************************************
323 
324  //**Loadu function***************************************************************************
334  inline SIMDType loadu() const {
335  return (*matrix_).loadu(row_,column_);
336  }
337  //*******************************************************************************************
338 
339  //**Conversion operator**********************************************************************
344  inline operator ConstIterator() const {
345  if( SO )
346  return matrix_->begin( column_ ) + row_;
347  else
348  return matrix_->begin( row_ ) + column_;
349  }
350  //*******************************************************************************************
351 
352  //**Equality operator************************************************************************
359  friend inline bool operator==( const Iterator& lhs, const Iterator& rhs ) noexcept {
360  return ( SO )?( lhs.row_ == rhs.row_ ):( lhs.column_ == rhs.column_ );
361  }
362  //*******************************************************************************************
363 
364  //**Equality operator************************************************************************
371  friend inline bool operator==( const Iterator& lhs, const ConstIterator& rhs ) {
372  return ( ConstIterator( lhs ) == rhs );
373  }
374  //*******************************************************************************************
375 
376  //**Equality operator************************************************************************
383  friend inline bool operator==( const ConstIterator& lhs, const Iterator& rhs ) {
384  return ( lhs == ConstIterator( rhs ) );
385  }
386  //*******************************************************************************************
387 
388  //**Inequality operator**********************************************************************
395  friend inline bool operator!=( const Iterator& lhs, const Iterator& rhs ) noexcept {
396  return ( SO )?( lhs.row_ != rhs.row_ ):( lhs.column_ != rhs.column_ );
397  }
398  //*******************************************************************************************
399 
400  //**Inequality operator**********************************************************************
407  friend inline bool operator!=( const Iterator& lhs, const ConstIterator& rhs ) {
408  return ( ConstIterator( lhs ) != rhs );
409  }
410  //*******************************************************************************************
411 
412  //**Inequality operator**********************************************************************
419  friend inline bool operator!=( const ConstIterator& lhs, const Iterator& rhs ) {
420  return ( lhs != ConstIterator( rhs ) );
421  }
422  //*******************************************************************************************
423 
424  //**Less-than operator***********************************************************************
431  friend inline bool operator<( const Iterator& lhs, const Iterator& rhs ) noexcept {
432  return ( SO )?( lhs.row_ < rhs.row_ ):( lhs.column_ < rhs.column_ );
433  }
434  //*******************************************************************************************
435 
436  //**Less-than operator***********************************************************************
443  friend inline bool operator<( const Iterator& lhs, const ConstIterator& rhs ) {
444  return ( ConstIterator( lhs ) < rhs );
445  }
446  //*******************************************************************************************
447 
448  //**Less-than operator***********************************************************************
455  friend inline bool operator<( const ConstIterator& lhs, const Iterator& rhs ) {
456  return ( lhs < ConstIterator( rhs ) );
457  }
458  //*******************************************************************************************
459 
460  //**Greater-than operator********************************************************************
467  friend inline bool operator>( const Iterator& lhs, const Iterator& rhs ) noexcept {
468  return ( SO )?( lhs.row_ > rhs.row_ ):( lhs.column_ > rhs.column_ );
469  }
470  //*******************************************************************************************
471 
472  //**Greater-than operator********************************************************************
479  friend inline bool operator>( const Iterator& lhs, const ConstIterator& rhs ) {
480  return ( ConstIterator( lhs ) > rhs );
481  }
482  //*******************************************************************************************
483 
484  //**Greater-than operator********************************************************************
491  friend inline bool operator>( const ConstIterator& lhs, const Iterator& rhs ) {
492  return ( lhs > ConstIterator( rhs ) );
493  }
494  //*******************************************************************************************
495 
496  //**Less-or-equal-than operator**************************************************************
503  friend inline bool operator<=( const Iterator& lhs, const Iterator& rhs ) noexcept {
504  return ( SO )?( lhs.row_ <= rhs.row_ ):( lhs.column_ <= rhs.column_ );
505  }
506  //*******************************************************************************************
507 
508  //**Less-or-equal-than operator**************************************************************
515  friend inline bool operator<=( const Iterator& lhs, const ConstIterator& rhs ) {
516  return ( ConstIterator( lhs ) <= rhs );
517  }
518  //*******************************************************************************************
519 
520  //**Less-or-equal-than operator**************************************************************
527  friend inline bool operator<=( const ConstIterator& lhs, const Iterator& rhs ) {
528  return ( lhs <= ConstIterator( rhs ) );
529  }
530  //*******************************************************************************************
531 
532  //**Greater-or-equal-than operator***********************************************************
539  friend inline bool operator>=( const Iterator& lhs, const Iterator& rhs ) noexcept {
540  return ( SO )?( lhs.row_ >= rhs.row_ ):( lhs.column_ >= rhs.column_ );
541  }
542  //*******************************************************************************************
543 
544  //**Greater-or-equal-than operator***********************************************************
551  friend inline bool operator>=( const Iterator& lhs, const ConstIterator& rhs ) {
552  return ( ConstIterator( lhs ) >= rhs );
553  }
554  //*******************************************************************************************
555 
556  //**Greater-or-equal-than operator***********************************************************
563  friend inline bool operator>=( const ConstIterator& lhs, const Iterator& rhs ) {
564  return ( lhs >= ConstIterator( rhs ) );
565  }
566  //*******************************************************************************************
567 
568  //**Subtraction operator*********************************************************************
574  inline DifferenceType operator-( const Iterator& rhs ) const noexcept {
575  return ( SO )?( row_ - rhs.row_ ):( column_ - rhs.column_ );
576  }
577  //*******************************************************************************************
578 
579  //**Addition operator************************************************************************
586  friend inline const Iterator operator+( const Iterator& it, size_t inc ) noexcept {
587  if( SO )
588  return Iterator( *it.matrix_, it.row_ + inc, it.column_ );
589  else
590  return Iterator( *it.matrix_, it.row_, it.column_ + inc );
591  }
592  //*******************************************************************************************
593 
594  //**Addition operator************************************************************************
601  friend inline const Iterator operator+( size_t inc, const Iterator& it ) noexcept {
602  if( SO )
603  return Iterator( *it.matrix_, it.row_ + inc, it.column_ );
604  else
605  return Iterator( *it.matrix_, it.row_, it.column_ + inc );
606  }
607  //*******************************************************************************************
608 
609  //**Subtraction operator*********************************************************************
616  friend inline const Iterator operator-( const Iterator& it, size_t dec ) noexcept {
617  if( SO )
618  return Iterator( *it.matrix_, it.row_ - dec, it.column_ );
619  else
620  return Iterator( *it.matrix_, it.row_, it.column_ - dec );
621  }
622  //*******************************************************************************************
623 
624  private:
625  //**Member variables*************************************************************************
626  MT* matrix_;
627  size_t row_;
628  size_t column_;
629  //*******************************************************************************************
630  };
631  //**********************************************************************************************
632 
633  //**Compilation flags***************************************************************************
635  enum : bool { simdEnabled = MT::simdEnabled };
636 
638  enum : bool { smpAssignable = MT::smpAssignable };
639  //**********************************************************************************************
640 
641  //**Constructors********************************************************************************
644  explicit inline UniUpperMatrix();
645  template< typename A1 > explicit inline UniUpperMatrix( const A1& a1 );
646  explicit inline UniUpperMatrix( size_t n, const ElementType& init );
647 
648  explicit inline UniUpperMatrix( initializer_list< initializer_list<ElementType> > list );
649 
650  template< typename Other >
651  explicit inline UniUpperMatrix( size_t n, const Other* array );
652 
653  template< typename Other, size_t N >
654  explicit inline UniUpperMatrix( const Other (&array)[N][N] );
655 
656  explicit inline UniUpperMatrix( ElementType* ptr, size_t n );
657  explicit inline UniUpperMatrix( ElementType* ptr, size_t n, size_t nn );
658 
659  template< typename Deleter >
660  explicit inline UniUpperMatrix( ElementType* ptr, size_t n, Deleter d );
661 
662  template< typename Deleter >
663  explicit inline UniUpperMatrix( ElementType* ptr, size_t n, size_t nn, Deleter d );
664 
665  inline UniUpperMatrix( const UniUpperMatrix& m );
666  inline UniUpperMatrix( UniUpperMatrix&& m ) noexcept;
668  //**********************************************************************************************
669 
670  //**Destructor**********************************************************************************
671  // No explicitly declared destructor.
672  //**********************************************************************************************
673 
674  //**Data access functions***********************************************************************
677  inline Reference operator()( size_t i, size_t j );
678  inline ConstReference operator()( size_t i, size_t j ) const;
679  inline Reference at( size_t i, size_t j );
680  inline ConstReference at( size_t i, size_t j ) const;
681  inline ConstPointer data () const noexcept;
682  inline ConstPointer data ( size_t i ) const noexcept;
683  inline Iterator begin ( size_t i );
684  inline ConstIterator begin ( size_t i ) const;
685  inline ConstIterator cbegin( size_t i ) const;
686  inline Iterator end ( size_t i );
687  inline ConstIterator end ( size_t i ) const;
688  inline ConstIterator cend ( size_t i ) const;
690  //**********************************************************************************************
691 
692  //**Assignment operators************************************************************************
695  inline UniUpperMatrix& operator=( const ElementType& rhs );
696  inline UniUpperMatrix& operator=( initializer_list< initializer_list<ElementType> > list );
697 
698  template< typename Other, size_t N >
699  inline UniUpperMatrix& operator=( const Other (&array)[N][N] );
700 
701  inline UniUpperMatrix& operator=( const UniUpperMatrix& rhs );
702  inline UniUpperMatrix& operator=( UniUpperMatrix&& rhs ) noexcept;
703 
704  template< typename MT2, bool SO2 >
705  inline DisableIf_< IsComputation<MT2>, UniUpperMatrix& > operator=( const Matrix<MT2,SO2>& rhs );
706 
707  template< typename MT2, bool SO2 >
708  inline EnableIf_< IsComputation<MT2>, UniUpperMatrix& > operator=( const Matrix<MT2,SO2>& rhs );
709 
710  template< typename MT2, bool SO2 >
711  inline DisableIf_< IsComputation<MT2>, UniUpperMatrix& > operator+=( const Matrix<MT2,SO2>& rhs );
712 
713  template< typename MT2, bool SO2 >
714  inline EnableIf_< IsComputation<MT2>, UniUpperMatrix& > operator+=( const Matrix<MT2,SO2>& rhs );
715 
716  template< typename MT2, bool SO2 >
717  inline DisableIf_< IsComputation<MT2>, UniUpperMatrix& > operator-=( const Matrix<MT2,SO2>& rhs );
718 
719  template< typename MT2, bool SO2 >
720  inline EnableIf_< IsComputation<MT2>, UniUpperMatrix& > operator-=( const Matrix<MT2,SO2>& rhs );
721 
722  template< typename MT2, bool SO2 >
723  inline UniUpperMatrix& operator*=( const Matrix<MT2,SO2>& rhs );
725  //**********************************************************************************************
726 
727  //**Utility functions***************************************************************************
730  inline size_t rows() const noexcept;
731  inline size_t columns() const noexcept;
732  inline size_t spacing() const noexcept;
733  inline size_t capacity() const noexcept;
734  inline size_t capacity( size_t i ) const noexcept;
735  inline size_t nonZeros() const;
736  inline size_t nonZeros( size_t i ) const;
737  inline void reset();
738  inline void reset( size_t i );
739  inline void clear();
740  void resize ( size_t n, bool preserve=true );
741  inline void extend ( size_t n, bool preserve=true );
742  inline void reserve( size_t elements );
743  inline void swap( UniUpperMatrix& m ) noexcept;
744 
745  static inline constexpr size_t maxNonZeros() noexcept;
746  static inline constexpr size_t maxNonZeros( size_t n ) noexcept;
748  //**********************************************************************************************
749 
750  //**Debugging functions*************************************************************************
753  inline bool isIntact() const noexcept;
755  //**********************************************************************************************
756 
757  //**Expression template evaluation functions****************************************************
760  template< typename Other > inline bool canAlias ( const Other* alias ) const noexcept;
761  template< typename Other > inline bool isAliased( const Other* alias ) const noexcept;
762 
763  inline bool isAligned () const noexcept;
764  inline bool canSMPAssign() const noexcept;
765 
766  BLAZE_ALWAYS_INLINE SIMDType load ( size_t i, size_t j ) const noexcept;
767  BLAZE_ALWAYS_INLINE SIMDType loada( size_t i, size_t j ) const noexcept;
768  BLAZE_ALWAYS_INLINE SIMDType loadu( size_t i, size_t j ) const noexcept;
770  //**********************************************************************************************
771 
772  private:
773  //**Construction functions**********************************************************************
776  inline const MT construct( size_t n , TrueType );
777  inline const MT construct( const ElementType& value, FalseType );
778 
779  template< typename MT2, bool SO2, typename T >
780  inline const MT construct( const Matrix<MT2,SO2>& m, T );
782  //**********************************************************************************************
783 
784  //**Member variables****************************************************************************
787  MT matrix_;
788 
789  //**********************************************************************************************
790 
791  //**Friend declarations*************************************************************************
792  template< typename MT2, bool SO2, bool DF2 >
793  friend MT2& derestrict( UniUpperMatrix<MT2,SO2,DF2>& m );
794  //**********************************************************************************************
795 
796  //**Compile time checks*************************************************************************
810  BLAZE_STATIC_ASSERT( Rows<MT>::value == Columns<MT>::value );
811  //**********************************************************************************************
812 };
814 //*************************************************************************************************
815 
816 
817 
818 
819 //=================================================================================================
820 //
821 // CONSTRUCTORS
822 //
823 //=================================================================================================
824 
825 //*************************************************************************************************
829 template< typename MT // Type of the adapted dense matrix
830  , bool SO > // Storage order of the adapted dense matrix
831 inline UniUpperMatrix<MT,SO,true>::UniUpperMatrix()
832  : matrix_() // The adapted dense matrix
833 {
834  for( size_t i=0UL; i<Rows<MT>::value; ++i )
835  matrix_(i,i) = ElementType(1);
836 
837  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square uniupper matrix detected" );
838  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
839 }
841 //*************************************************************************************************
842 
843 
844 //*************************************************************************************************
862 template< typename MT // Type of the adapted dense matrix
863  , bool SO > // Storage order of the adapted dense matrix
864 template< typename A1 > // Type of the constructor argument
865 inline UniUpperMatrix<MT,SO,true>::UniUpperMatrix( const A1& a1 )
866  : matrix_( construct( a1, typename IsResizable<MT>::Type() ) ) // The adapted dense matrix
867 {
868  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square uniupper matrix detected" );
869  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
870 }
872 //*************************************************************************************************
873 
874 
875 //*************************************************************************************************
882 template< typename MT // Type of the adapted dense matrix
883  , bool SO > // Storage order of the adapted dense matrix
884 inline UniUpperMatrix<MT,SO,true>::UniUpperMatrix( size_t n, const ElementType& init )
885  : matrix_( n, n, ElementType() ) // The adapted dense matrix
886 {
888 
889  if( SO ) {
890  for( size_t j=0UL; j<columns(); ++j ) {
891  for( size_t i=0UL; i<j; ++i )
892  matrix_(i,j) = init;
893  matrix_(j,j) = ElementType(1);
894  }
895  }
896  else {
897  for( size_t i=0UL; i<rows(); ++i ) {
898  matrix_(i,i) = ElementType(1);
899  for( size_t j=i+1UL; j<columns(); ++j )
900  matrix_(i,j) = init;
901  }
902  }
903 
904  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square uniupper matrix detected" );
905  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
906 }
908 //*************************************************************************************************
909 
910 
911 //*************************************************************************************************
934 template< typename MT // Type of the adapted dense matrix
935  , bool SO > // Storage order of the adapted dense matrix
936 inline UniUpperMatrix<MT,SO,true>::UniUpperMatrix( initializer_list< initializer_list<ElementType> > list )
937  : matrix_( list ) // The adapted dense matrix
938 {
939  if( !isUniUpper( matrix_ ) ) {
940  BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of uniupper matrix" );
941  }
942 
943  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
944 }
946 //*************************************************************************************************
947 
948 
949 //*************************************************************************************************
975 template< typename MT // Type of the adapted dense matrix
976  , bool SO > // Storage order of the adapted dense matrix
977 template< typename Other > // Data type of the initialization array
978 inline UniUpperMatrix<MT,SO,true>::UniUpperMatrix( size_t n, const Other* array )
979  : matrix_( n, n, array ) // The adapted dense matrix
980 {
981  if( !isUniUpper( matrix_ ) ) {
982  BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of uniupper matrix" );
983  }
984 
985  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
986 }
988 //*************************************************************************************************
989 
990 
991 //*************************************************************************************************
1014 template< typename MT // Type of the adapted dense matrix
1015  , bool SO > // Storage order of the adapted dense matrix
1016 template< typename Other // Data type of the initialization array
1017  , size_t N > // Number of rows and columns of the initialization array
1018 inline UniUpperMatrix<MT,SO,true>::UniUpperMatrix( const Other (&array)[N][N] )
1019  : matrix_( array ) // The adapted dense matrix
1020 {
1021  if( !isUniUpper( matrix_ ) ) {
1022  BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of uniupper matrix" );
1023  }
1024 
1025  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1026 }
1028 //*************************************************************************************************
1029 
1030 
1031 //*************************************************************************************************
1052 template< typename MT // Type of the adapted dense matrix
1053  , bool SO > // Storage order of the adapted dense matrix
1054 inline UniUpperMatrix<MT,SO,true>::UniUpperMatrix( ElementType* ptr, size_t n )
1055  : matrix_( ptr, n, n ) // The adapted dense matrix
1056 {
1057  if( !isUniUpper( matrix_ ) ) {
1058  BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of uniupper matrix" );
1059  }
1060 
1061  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1062 }
1064 //*************************************************************************************************
1065 
1066 
1067 //*************************************************************************************************
1090 template< typename MT // Type of the adapted dense matrix
1091  , bool SO > // Storage order of the adapted dense matrix
1092 inline UniUpperMatrix<MT,SO,true>::UniUpperMatrix( ElementType* ptr, size_t n, size_t nn )
1093  : matrix_( ptr, n, n, nn ) // The adapted dense matrix
1094 {
1095  if( !isUniUpper( matrix_ ) ) {
1096  BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of uniupper matrix" );
1097  }
1098 
1099  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1100 }
1102 //*************************************************************************************************
1103 
1104 
1105 //*************************************************************************************************
1126 template< typename MT // Type of the adapted dense matrix
1127  , bool SO > // Storage order of the adapted dense matrix
1128 template< typename Deleter > // Type of the custom deleter
1129 inline UniUpperMatrix<MT,SO,true>::UniUpperMatrix( ElementType* ptr, size_t n, Deleter d )
1130  : matrix_( ptr, n, n, d ) // The adapted dense matrix
1131 {
1132  if( !isUniUpper( matrix_ ) ) {
1133  BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of uniupper matrix" );
1134  }
1135 
1136  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1137 }
1139 //*************************************************************************************************
1140 
1141 
1142 //*************************************************************************************************
1164 template< typename MT // Type of the adapted dense matrix
1165  , bool SO > // Storage order of the adapted dense matrix
1166 template< typename Deleter > // Type of the custom deleter
1167 inline UniUpperMatrix<MT,SO,true>::UniUpperMatrix( ElementType* ptr, size_t n, size_t nn, Deleter d )
1168  : matrix_( ptr, n, n, nn, d ) // The adapted dense matrix
1169 {
1170  if( !isUniUpper( matrix_ ) ) {
1171  BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of uniupper matrix" );
1172  }
1173 
1174  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1175 }
1177 //*************************************************************************************************
1178 
1179 
1180 //*************************************************************************************************
1186 template< typename MT // Type of the adapted dense matrix
1187  , bool SO > // Storage order of the adapted dense matrix
1188 inline UniUpperMatrix<MT,SO,true>::UniUpperMatrix( const UniUpperMatrix& m )
1189  : matrix_( m.matrix_ ) // The adapted dense matrix
1190 {
1191  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square uniupper matrix detected" );
1192  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1193 }
1195 //*************************************************************************************************
1196 
1197 
1198 //*************************************************************************************************
1204 template< typename MT // Type of the adapted dense matrix
1205  , bool SO > // Storage order of the adapted dense matrix
1206 inline UniUpperMatrix<MT,SO,true>::UniUpperMatrix( UniUpperMatrix&& m ) noexcept
1207  : matrix_( std::move( m.matrix_ ) ) // The adapted dense matrix
1208 {
1209  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square uniupper matrix detected" );
1210  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1211 }
1213 //*************************************************************************************************
1214 
1215 
1216 
1217 
1218 //=================================================================================================
1219 //
1220 // DATA ACCESS FUNCTIONS
1221 //
1222 //=================================================================================================
1223 
1224 //*************************************************************************************************
1240 template< typename MT // Type of the adapted dense matrix
1241  , bool SO > // Storage order of the adapted dense matrix
1243  UniUpperMatrix<MT,SO,true>::operator()( size_t i, size_t j )
1244 {
1245  BLAZE_USER_ASSERT( i<rows() , "Invalid row access index" );
1246  BLAZE_USER_ASSERT( j<columns(), "Invalid column access index" );
1247 
1248  return Reference( matrix_, i, j );
1249 }
1251 //*************************************************************************************************
1252 
1253 
1254 //*************************************************************************************************
1270 template< typename MT // Type of the adapted dense matrix
1271  , bool SO > // Storage order of the adapted dense matrix
1273  UniUpperMatrix<MT,SO,true>::operator()( size_t i, size_t j ) const
1274 {
1275  BLAZE_USER_ASSERT( i<rows() , "Invalid row access index" );
1276  BLAZE_USER_ASSERT( j<columns(), "Invalid column access index" );
1277 
1278  return matrix_(i,j);
1279 }
1281 //*************************************************************************************************
1282 
1283 
1284 //*************************************************************************************************
1301 template< typename MT // Type of the adapted dense matrix
1302  , bool SO > // Storage order of the adapted dense matrix
1304  UniUpperMatrix<MT,SO,true>::at( size_t i, size_t j )
1305 {
1306  if( i >= rows() ) {
1307  BLAZE_THROW_OUT_OF_RANGE( "Invalid row access index" );
1308  }
1309  if( j >= columns() ) {
1310  BLAZE_THROW_OUT_OF_RANGE( "Invalid column access index" );
1311  }
1312  return (*this)(i,j);
1313 }
1315 //*************************************************************************************************
1316 
1317 
1318 //*************************************************************************************************
1335 template< typename MT // Type of the adapted dense matrix
1336  , bool SO > // Storage order of the adapted dense matrix
1338  UniUpperMatrix<MT,SO,true>::at( size_t i, size_t j ) const
1339 {
1340  if( i >= rows() ) {
1341  BLAZE_THROW_OUT_OF_RANGE( "Invalid row access index" );
1342  }
1343  if( j >= columns() ) {
1344  BLAZE_THROW_OUT_OF_RANGE( "Invalid column access index" );
1345  }
1346  return (*this)(i,j);
1347 }
1349 //*************************************************************************************************
1350 
1351 
1352 //*************************************************************************************************
1365 template< typename MT // Type of the adapted dense matrix
1366  , bool SO > // Storage order of the adapted dense matrix
1367 inline typename UniUpperMatrix<MT,SO,true>::ConstPointer
1368  UniUpperMatrix<MT,SO,true>::data() const noexcept
1369 {
1370  return matrix_.data();
1371 }
1373 //*************************************************************************************************
1374 
1375 
1376 //*************************************************************************************************
1385 template< typename MT // Type of the adapted dense matrix
1386  , bool SO > // Storage order of the adapted dense matrix
1387 inline typename UniUpperMatrix<MT,SO,true>::ConstPointer
1388  UniUpperMatrix<MT,SO,true>::data( size_t i ) const noexcept
1389 {
1390  return matrix_.data(i);
1391 }
1393 //*************************************************************************************************
1394 
1395 
1396 //*************************************************************************************************
1408 template< typename MT // Type of the adapted dense matrix
1409  , bool SO > // Storage order of the adapted dense matrix
1412 {
1413  if( SO )
1414  return Iterator( matrix_, 0UL, i );
1415  else
1416  return Iterator( matrix_, i, 0UL );
1417 }
1419 //*************************************************************************************************
1420 
1421 
1422 //*************************************************************************************************
1434 template< typename MT // Type of the adapted dense matrix
1435  , bool SO > // Storage order of the adapted dense matrix
1437  UniUpperMatrix<MT,SO,true>::begin( size_t i ) const
1438 {
1439  return matrix_.begin(i);
1440 }
1442 //*************************************************************************************************
1443 
1444 
1445 //*************************************************************************************************
1457 template< typename MT // Type of the adapted dense matrix
1458  , bool SO > // Storage order of the adapted dense matrix
1460  UniUpperMatrix<MT,SO,true>::cbegin( size_t i ) const
1461 {
1462  return matrix_.cbegin(i);
1463 }
1465 //*************************************************************************************************
1466 
1467 
1468 //*************************************************************************************************
1480 template< typename MT // Type of the adapted dense matrix
1481  , bool SO > // Storage order of the adapted dense matrix
1484 {
1485  if( SO )
1486  return Iterator( matrix_, rows(), i );
1487  else
1488  return Iterator( matrix_, i, columns() );
1489 }
1491 //*************************************************************************************************
1492 
1493 
1494 //*************************************************************************************************
1506 template< typename MT // Type of the adapted dense matrix
1507  , bool SO > // Storage order of the adapted dense matrix
1509  UniUpperMatrix<MT,SO,true>::end( size_t i ) const
1510 {
1511  return matrix_.end(i);
1512 }
1514 //*************************************************************************************************
1515 
1516 
1517 //*************************************************************************************************
1529 template< typename MT // Type of the adapted dense matrix
1530  , bool SO > // Storage order of the adapted dense matrix
1532  UniUpperMatrix<MT,SO,true>::cend( size_t i ) const
1533 {
1534  return matrix_.cend(i);
1535 }
1537 //*************************************************************************************************
1538 
1539 
1540 
1541 
1542 //=================================================================================================
1543 //
1544 // ASSIGNMENT OPERATORS
1545 //
1546 //=================================================================================================
1547 
1548 //*************************************************************************************************
1555 template< typename MT // Type of the adapted dense matrix
1556  , bool SO > // Storage order of the adapted dense matrix
1557 inline UniUpperMatrix<MT,SO,true>&
1558  UniUpperMatrix<MT,SO,true>::operator=( const ElementType& rhs )
1559 {
1560  if( SO ) {
1561  for( size_t j=1UL; j<columns(); ++j )
1562  for( size_t i=0UL; i<j; ++i )
1563  matrix_(i,j) = rhs;
1564  }
1565  else {
1566  for( size_t i=0UL; i<rows(); ++i )
1567  for( size_t j=i+1UL; j<columns(); ++j )
1568  matrix_(i,j) = rhs;
1569  }
1570 
1571  return *this;
1572 }
1574 //*************************************************************************************************
1575 
1576 
1577 //*************************************************************************************************
1601 template< typename MT // Type of the adapted dense matrix
1602  , bool SO > // Storage order of the adapted dense matrix
1603 inline UniUpperMatrix<MT,SO,true>&
1604  UniUpperMatrix<MT,SO,true>::operator=( initializer_list< initializer_list<ElementType> > list )
1605 {
1606  MT tmp( list );
1607 
1608  if( !isUniUpper( tmp ) ) {
1609  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to uniupper matrix" );
1610  }
1611 
1612  matrix_ = std::move( tmp );
1613 
1614  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square uniupper matrix detected" );
1615  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1616 
1617  return *this;
1618 }
1620 //*************************************************************************************************
1621 
1622 
1623 //*************************************************************************************************
1647 template< typename MT // Type of the adapted dense matrix
1648  , bool SO > // Storage order of the adapted dense matrix
1649 template< typename Other // Data type of the initialization array
1650  , size_t N > // Number of rows and columns of the initialization array
1651 inline UniUpperMatrix<MT,SO,true>&
1652  UniUpperMatrix<MT,SO,true>::operator=( const Other (&array)[N][N] )
1653 {
1654  MT tmp( array );
1655 
1656  if( !isUniUpper( tmp ) ) {
1657  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to uniupper matrix" );
1658  }
1659 
1660  matrix_ = std::move( tmp );
1661 
1662  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square uniupper matrix detected" );
1663  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1664 
1665  return *this;
1666 }
1668 //*************************************************************************************************
1669 
1670 
1671 //*************************************************************************************************
1681 template< typename MT // Type of the adapted dense matrix
1682  , bool SO > // Storage order of the adapted dense matrix
1683 inline UniUpperMatrix<MT,SO,true>&
1684  UniUpperMatrix<MT,SO,true>::operator=( const UniUpperMatrix& rhs )
1685 {
1686  matrix_ = rhs.matrix_;
1687 
1688  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square uniupper matrix detected" );
1689  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1690 
1691  return *this;
1692 }
1694 //*************************************************************************************************
1695 
1696 
1697 //*************************************************************************************************
1704 template< typename MT // Type of the adapted dense matrix
1705  , bool SO > // Storage order of the adapted dense matrix
1706 inline UniUpperMatrix<MT,SO,true>&
1707  UniUpperMatrix<MT,SO,true>::operator=( UniUpperMatrix&& rhs ) noexcept
1708 {
1709  matrix_ = std::move( rhs.matrix_ );
1710 
1711  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square uniupper matrix detected" );
1712  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1713 
1714  return *this;
1715 }
1717 //*************************************************************************************************
1718 
1719 
1720 //*************************************************************************************************
1733 template< typename MT // Type of the adapted dense matrix
1734  , bool SO > // Storage order of the adapted dense matrix
1735 template< typename MT2 // Type of the right-hand side matrix
1736  , bool SO2 > // Storage order of the right-hand side matrix
1737 inline DisableIf_< IsComputation<MT2>, UniUpperMatrix<MT,SO,true>& >
1738  UniUpperMatrix<MT,SO,true>::operator=( const Matrix<MT2,SO2>& rhs )
1739 {
1740  if( IsStrictlyTriangular<MT2>::value || ( !IsUniUpper<MT2>::value && !isUniUpper( ~rhs ) ) ) {
1741  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to uniupper matrix" );
1742  }
1743 
1744  matrix_ = ~rhs;
1745 
1746  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square uniupper matrix detected" );
1747  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1748 
1749  return *this;
1750 }
1752 //*************************************************************************************************
1753 
1754 
1755 //*************************************************************************************************
1768 template< typename MT // Type of the adapted dense matrix
1769  , bool SO > // Storage order of the adapted dense matrix
1770 template< typename MT2 // Type of the right-hand side matrix
1771  , bool SO2 > // Storage order of the right-hand side matrix
1772 inline EnableIf_< IsComputation<MT2>, UniUpperMatrix<MT,SO,true>& >
1773  UniUpperMatrix<MT,SO,true>::operator=( const Matrix<MT2,SO2>& rhs )
1774 {
1775  if( IsStrictlyTriangular<MT2>::value || ( !IsSquare<MT2>::value && !isSquare( ~rhs ) ) ) {
1776  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to uniupper matrix" );
1777  }
1778 
1779  if( IsUniUpper<MT2>::value ) {
1780  matrix_ = ~rhs;
1781  }
1782  else {
1783  MT tmp( ~rhs );
1784 
1785  if( !isUniUpper( tmp ) ) {
1786  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to uniupper matrix" );
1787  }
1788 
1789  matrix_ = std::move( tmp );
1790  }
1791 
1792  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square uniupper matrix detected" );
1793  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1794 
1795  return *this;
1796 }
1798 //*************************************************************************************************
1799 
1800 
1801 //*************************************************************************************************
1814 template< typename MT // Type of the adapted dense matrix
1815  , bool SO > // Storage order of the adapted dense matrix
1816 template< typename MT2 // Type of the right-hand side matrix
1817  , bool SO2 > // Storage order of the right-hand side matrix
1818 inline DisableIf_< IsComputation<MT2>, UniUpperMatrix<MT,SO,true>& >
1819  UniUpperMatrix<MT,SO,true>::operator+=( const Matrix<MT2,SO2>& rhs )
1820 {
1821  if( IsLower<MT2>::value || IsUniTriangular<MT2>::value ||
1822  ( !IsStrictlyUpper<MT2>::value && !isStrictlyUpper( ~rhs ) ) ) {
1823  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to uniupper matrix" );
1824  }
1825 
1826  matrix_ += ~rhs;
1827 
1828  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square uniupper matrix detected" );
1829  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1830 
1831  return *this;
1832 }
1834 //*************************************************************************************************
1835 
1836 
1837 //*************************************************************************************************
1850 template< typename MT // Type of the adapted dense matrix
1851  , bool SO > // Storage order of the adapted dense matrix
1852 template< typename MT2 // Type of the right-hand side matrix
1853  , bool SO2 > // Storage order of the right-hand side matrix
1854 inline EnableIf_< IsComputation<MT2>, UniUpperMatrix<MT,SO,true>& >
1855  UniUpperMatrix<MT,SO,true>::operator+=( const Matrix<MT2,SO2>& rhs )
1856 {
1857  if( IsLower<MT2>::value || IsUniTriangular<MT2>::value ||
1858  ( !IsSquare<MT2>::value && !isSquare( ~rhs ) ) ) {
1859  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to uniupper matrix" );
1860  }
1861 
1862  if( IsStrictlyUpper<MT2>::value ) {
1863  matrix_ += ~rhs;
1864  }
1865  else {
1866  const ResultType_<MT2> tmp( ~rhs );
1867 
1868  if( !isStrictlyUpper( tmp ) ) {
1869  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to uniupper matrix" );
1870  }
1871 
1872  matrix_ += tmp;
1873  }
1874 
1875  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square uniupper matrix detected" );
1876  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1877 
1878  return *this;
1879 }
1881 //*************************************************************************************************
1882 
1883 
1884 //*************************************************************************************************
1897 template< typename MT // Type of the adapted dense matrix
1898  , bool SO > // Storage order of the adapted dense matrix
1899 template< typename MT2 // Type of the right-hand side matrix
1900  , bool SO2 > // Storage order of the right-hand side matrix
1901 inline DisableIf_< IsComputation<MT2>, UniUpperMatrix<MT,SO,true>& >
1902  UniUpperMatrix<MT,SO,true>::operator-=( const Matrix<MT2,SO2>& rhs )
1903 {
1904  if( IsLower<MT2>::value || IsUniTriangular<MT2>::value ||
1905  ( !IsStrictlyUpper<MT2>::value && !isStrictlyUpper( ~rhs ) ) ) {
1906  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to uniupper matrix" );
1907  }
1908 
1909  matrix_ -= ~rhs;
1910 
1911  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square uniupper matrix detected" );
1912  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1913 
1914  return *this;
1915 }
1917 //*************************************************************************************************
1918 
1919 
1920 //*************************************************************************************************
1933 template< typename MT // Type of the adapted dense matrix
1934  , bool SO > // Storage order of the adapted dense matrix
1935 template< typename MT2 // Type of the right-hand side matrix
1936  , bool SO2 > // Storage order of the right-hand side matrix
1937 inline EnableIf_< IsComputation<MT2>, UniUpperMatrix<MT,SO,true>& >
1938  UniUpperMatrix<MT,SO,true>::operator-=( const Matrix<MT2,SO2>& rhs )
1939 {
1940  if( IsLower<MT2>::value || IsUniTriangular<MT2>::value ||
1941  ( !IsSquare<MT2>::value && !isSquare( ~rhs ) ) ) {
1942  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to uniupper matrix" );
1943  }
1944 
1945  if( IsStrictlyUpper<MT2>::value ) {
1946  matrix_ -= ~rhs;
1947  }
1948  else {
1949  const ResultType_<MT2> tmp( ~rhs );
1950 
1951  if( !isStrictlyUpper( tmp ) ) {
1952  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to uniupper matrix" );
1953  }
1954 
1955  matrix_ -= tmp;
1956  }
1957 
1958  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square uniupper 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 UniUpperMatrix<MT,SO,true>&
1984  UniUpperMatrix<MT,SO,true>::operator*=( const Matrix<MT2,SO2>& rhs )
1985 {
1986  if( matrix_.rows() != (~rhs).columns() ) {
1987  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to uniupper matrix" );
1988  }
1989 
1990  MT tmp( matrix_ * ~rhs );
1991 
1992  if( !isUniUpper( tmp ) ) {
1993  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to uniupper matrix" );
1994  }
1995 
1996  matrix_ = std::move( tmp );
1997 
1998  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square uniupper matrix detected" );
1999  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
2000 
2001  return *this;
2002 }
2004 //*************************************************************************************************
2005 
2006 
2007 
2008 
2009 //=================================================================================================
2010 //
2011 // UTILITY FUNCTIONS
2012 //
2013 //=================================================================================================
2014 
2015 //*************************************************************************************************
2021 template< typename MT // Type of the adapted dense matrix
2022  , bool SO > // Storage order of the adapted dense matrix
2023 inline size_t UniUpperMatrix<MT,SO,true>::rows() const noexcept
2024 {
2025  return matrix_.rows();
2026 }
2028 //*************************************************************************************************
2029 
2030 
2031 //*************************************************************************************************
2037 template< typename MT // Type of the adapted dense matrix
2038  , bool SO > // Storage order of the adapted dense matrix
2039 inline size_t UniUpperMatrix<MT,SO,true>::columns() const noexcept
2040 {
2041  return matrix_.columns();
2042 }
2044 //*************************************************************************************************
2045 
2046 
2047 //*************************************************************************************************
2058 template< typename MT // Type of the adapted dense matrix
2059  , bool SO > // Storage order of the adapted dense matrix
2060 inline size_t UniUpperMatrix<MT,SO,true>::spacing() const noexcept
2061 {
2062  return matrix_.spacing();
2063 }
2065 //*************************************************************************************************
2066 
2067 
2068 //*************************************************************************************************
2074 template< typename MT // Type of the adapted dense matrix
2075  , bool SO > // Storage order of the adapted dense matrix
2076 inline size_t UniUpperMatrix<MT,SO,true>::capacity() const noexcept
2077 {
2078  return matrix_.capacity();
2079 }
2081 //*************************************************************************************************
2082 
2083 
2084 //*************************************************************************************************
2096 template< typename MT // Type of the adapted dense matrix
2097  , bool SO > // Storage order of the adapted dense matrix
2098 inline size_t UniUpperMatrix<MT,SO,true>::capacity( size_t i ) const noexcept
2099 {
2100  return matrix_.capacity(i);
2101 }
2103 //*************************************************************************************************
2104 
2105 
2106 //*************************************************************************************************
2112 template< typename MT // Type of the adapted dense matrix
2113  , bool SO > // Storage order of the adapted dense matrix
2114 inline size_t UniUpperMatrix<MT,SO,true>::nonZeros() const
2115 {
2116  return matrix_.nonZeros();
2117 }
2119 //*************************************************************************************************
2120 
2121 
2122 //*************************************************************************************************
2134 template< typename MT // Type of the adapted dense matrix
2135  , bool SO > // Storage order of the adapted dense matrix
2136 inline size_t UniUpperMatrix<MT,SO,true>::nonZeros( size_t i ) const
2137 {
2138  return matrix_.nonZeros(i);
2139 }
2141 //*************************************************************************************************
2142 
2143 
2144 //*************************************************************************************************
2150 template< typename MT // Type of the adapted dense matrix
2151  , bool SO > // Storage order of the adapted dense matrix
2153 {
2154  using blaze::clear;
2155 
2156  if( SO ) {
2157  for( size_t j=1UL; j<columns(); ++j )
2158  for( size_t i=0UL; i<j; ++i )
2159  clear( matrix_(i,j) );
2160  }
2161  else {
2162  for( size_t i=0UL; i<rows(); ++i )
2163  for( size_t j=i+1UL; j<columns(); ++j )
2164  clear( matrix_(i,j) );
2165  }
2166 }
2168 //*************************************************************************************************
2169 
2170 
2171 //*************************************************************************************************
2184 template< typename MT // Type of the adapted dense matrix
2185  , bool SO > // Storage order of the adapted dense matrix
2186 inline void UniUpperMatrix<MT,SO,true>::reset( size_t i )
2187 {
2188  using blaze::clear;
2189 
2190  if( SO ) {
2191  for( size_t j=0UL; j<i; ++j )
2192  clear( matrix_(j,i) );
2193  }
2194  else {
2195  for( size_t j=i+1UL; j<columns(); ++j )
2196  clear( matrix_(i,j) );
2197  }
2198 }
2200 //*************************************************************************************************
2201 
2202 
2203 //*************************************************************************************************
2215 template< typename MT // Type of the adapted dense matrix
2216  , bool SO > // Storage order of the adapted dense matrix
2218 {
2219  using blaze::clear;
2220 
2221  if( IsResizable<MT>::value ) {
2222  clear( matrix_ );
2223  }
2224  else {
2225  reset();
2226  }
2227 }
2229 //*************************************************************************************************
2230 
2231 
2232 //*************************************************************************************************
2268 template< typename MT // Type of the adapted dense matrix
2269  , bool SO > // Storage order of the adapted dense matrix
2270 void UniUpperMatrix<MT,SO,true>::resize( size_t n, bool preserve )
2271 {
2273 
2274  UNUSED_PARAMETER( preserve );
2275 
2276  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square uniupper matrix detected" );
2277 
2278  const size_t oldsize( matrix_.rows() );
2279 
2280  matrix_.resize( n, n, true );
2281 
2282  if( n > oldsize )
2283  {
2284  const size_t increment( n - oldsize );
2285  submatrix( matrix_, oldsize, 0UL, increment, n-1UL ).reset();
2286 
2287  for( size_t i=oldsize; i<n; ++i )
2288  matrix_(i,i) = ElementType(1);
2289  }
2290 }
2292 //*************************************************************************************************
2293 
2294 
2295 //*************************************************************************************************
2308 template< typename MT // Type of the adapted dense matrix
2309  , bool SO > // Storage order of the adapted dense matrix
2310 inline void UniUpperMatrix<MT,SO,true>::extend( size_t n, bool preserve )
2311 {
2313 
2314  UNUSED_PARAMETER( preserve );
2315 
2316  resize( rows() + n, true );
2317 }
2318 //*************************************************************************************************
2319 
2320 
2321 //*************************************************************************************************
2331 template< typename MT // Type of the adapted dense matrix
2332  , bool SO > // Storage order of the adapted dense matrix
2333 inline void UniUpperMatrix<MT,SO,true>::reserve( size_t elements )
2334 {
2335  matrix_.reserve( elements );
2336 }
2338 //*************************************************************************************************
2339 
2340 
2341 //*************************************************************************************************
2348 template< typename MT // Type of the adapted dense matrix
2349  , bool SO > // Storage order of the adapted dense matrix
2350 inline void UniUpperMatrix<MT,SO,true>::swap( UniUpperMatrix& m ) noexcept
2351 {
2352  using std::swap;
2353 
2354  swap( matrix_, m.matrix_ );
2355 }
2357 //*************************************************************************************************
2358 
2359 
2360 //*************************************************************************************************
2372 template< typename MT // Type of the adapted dense matrix
2373  , bool SO > // Storage order of the adapted dense matrix
2374 inline constexpr size_t UniUpperMatrix<MT,SO,true>::maxNonZeros() noexcept
2375 {
2377 
2378  return maxNonZeros( Rows<MT>::value );
2379 }
2381 //*************************************************************************************************
2382 
2383 
2384 //*************************************************************************************************
2394 template< typename MT // Type of the adapted dense matrix
2395  , bool SO > // Storage order of the adapted dense matrix
2396 inline constexpr size_t UniUpperMatrix<MT,SO,true>::maxNonZeros( size_t n ) noexcept
2397 {
2398  return ( ( n + 1UL ) * n ) / 2UL;
2399 }
2401 //*************************************************************************************************
2402 
2403 
2404 
2405 
2406 //=================================================================================================
2407 //
2408 // DEBUGGING FUNCTIONS
2409 //
2410 //=================================================================================================
2411 
2412 //*************************************************************************************************
2422 template< typename MT // Type of the adapted dense matrix
2423  , bool SO > // Storage order of the adapted dense matrix
2424 inline bool UniUpperMatrix<MT,SO,true>::isIntact() const noexcept
2425 {
2426  using blaze::isIntact;
2427 
2428  return ( isIntact( matrix_ ) && isUniUpper( matrix_ ) );
2429 }
2431 //*************************************************************************************************
2432 
2433 
2434 
2435 
2436 //=================================================================================================
2437 //
2438 // EXPRESSION TEMPLATE EVALUATION FUNCTIONS
2439 //
2440 //=================================================================================================
2441 
2442 //*************************************************************************************************
2453 template< typename MT // Type of the adapted dense matrix
2454  , bool SO > // Storage order of the adapted dense matrix
2455 template< typename Other > // Data type of the foreign expression
2456 inline bool UniUpperMatrix<MT,SO,true>::canAlias( const Other* alias ) const noexcept
2457 {
2458  return matrix_.canAlias( alias );
2459 }
2461 //*************************************************************************************************
2462 
2463 
2464 //*************************************************************************************************
2475 template< typename MT // Type of the adapted dense matrix
2476  , bool SO > // Storage order of the adapted dense matrix
2477 template< typename Other > // Data type of the foreign expression
2478 inline bool UniUpperMatrix<MT,SO,true>::isAliased( const Other* alias ) const noexcept
2479 {
2480  return matrix_.isAliased( alias );
2481 }
2483 //*************************************************************************************************
2484 
2485 
2486 //*************************************************************************************************
2496 template< typename MT // Type of the adapted dense matrix
2497  , bool SO > // Storage order of the adapted dense matrix
2498 inline bool UniUpperMatrix<MT,SO,true>::isAligned() const noexcept
2499 {
2500  return matrix_.isAligned();
2501 }
2503 //*************************************************************************************************
2504 
2505 
2506 //*************************************************************************************************
2517 template< typename MT // Type of the adapted dense matrix
2518  , bool SO > // Storage order of the adapted dense matrix
2519 inline bool UniUpperMatrix<MT,SO,true>::canSMPAssign() const noexcept
2520 {
2521  return matrix_.canSMPAssign();
2522 }
2524 //*************************************************************************************************
2525 
2526 
2527 //*************************************************************************************************
2543 template< typename MT // Type of the adapted dense matrix
2544  , bool SO > // Storage order of the adapted dense matrix
2545 BLAZE_ALWAYS_INLINE typename UniUpperMatrix<MT,SO,true>::SIMDType
2546  UniUpperMatrix<MT,SO,true>::load( size_t i, size_t j ) const noexcept
2547 {
2548  return matrix_.load( i, j );
2549 }
2551 //*************************************************************************************************
2552 
2553 
2554 //*************************************************************************************************
2570 template< typename MT // Type of the adapted dense matrix
2571  , bool SO > // Storage order of the adapted dense matrix
2572 BLAZE_ALWAYS_INLINE typename UniUpperMatrix<MT,SO,true>::SIMDType
2573  UniUpperMatrix<MT,SO,true>::loada( size_t i, size_t j ) const noexcept
2574 {
2575  return matrix_.loada( i, j );
2576 }
2578 //*************************************************************************************************
2579 
2580 
2581 //*************************************************************************************************
2597 template< typename MT // Type of the adapted dense matrix
2598  , bool SO > // Storage order of the adapted dense matrix
2599 BLAZE_ALWAYS_INLINE typename UniUpperMatrix<MT,SO,true>::SIMDType
2600  UniUpperMatrix<MT,SO,true>::loadu( size_t i, size_t j ) const noexcept
2601 {
2602  return matrix_.loadu( i, j );
2603 }
2605 //*************************************************************************************************
2606 
2607 
2608 
2609 
2610 //=================================================================================================
2611 //
2612 // CONSTRUCTION FUNCTIONS
2613 //
2614 //=================================================================================================
2615 
2616 //*************************************************************************************************
2623 template< typename MT // Type of the adapted dense matrix
2624  , bool SO > // Storage order of the adapted dense matrix
2625 inline const MT UniUpperMatrix<MT,SO,true>::construct( size_t n, TrueType )
2626 {
2628 
2629  MT tmp( n, n, ElementType() );
2630 
2631  for( size_t i=0UL; i<n; ++i )
2632  tmp(i,i) = ElementType(1);
2633 
2634  return tmp;
2635 }
2637 //*************************************************************************************************
2638 
2639 
2640 //*************************************************************************************************
2647 template< typename MT // Type of the adapted dense matrix
2648  , bool SO > // Storage order of the adapted dense matrix
2649 inline const MT UniUpperMatrix<MT,SO,true>::construct( const ElementType& init, FalseType )
2650 {
2653 
2654  MT tmp;
2655 
2656  if( SO ) {
2657  for( size_t j=0UL; j<columns(); ++j ) {
2658  for( size_t i=0UL; i<j; ++i )
2659  tmp(i,j) = init;
2660  tmp(j,j) = ElementType(1);
2661  }
2662  }
2663  else {
2664  for( size_t i=0UL; i<rows(); ++i ) {
2665  tmp(i,i) = ElementType(1);
2666  for( size_t j=i+1UL; j<columns(); ++j )
2667  tmp(i,j) = init;
2668  }
2669  }
2670 
2671  return tmp;
2672 }
2674 //*************************************************************************************************
2675 
2676 
2677 //*************************************************************************************************
2688 template< typename MT // Type of the adapted dense matrix
2689  , bool SO > // Storage order of the adapted dense matrix
2690 template< typename MT2 // Type of the foreign matrix
2691  , bool SO2 // Storage order of the foreign matrix
2692  , typename T > // Type of the third argument
2693 inline const MT UniUpperMatrix<MT,SO,true>::construct( const Matrix<MT2,SO2>& m, T )
2694 {
2695  const MT tmp( ~m );
2696 
2697  if( IsStrictlyTriangular<MT2>::value || ( !IsUniUpper<MT2>::value && !isUniUpper( tmp ) ) ) {
2698  BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of uniupper matrix" );
2699  }
2700 
2701  return tmp;
2702 }
2704 //*************************************************************************************************
2705 
2706 } // namespace blaze
2707 
2708 #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.
Constraint on the data type.
#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.
Header file for the IsUniUpper type trait.
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
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 IsStrictlyUpper type trait.
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.
Header file for the IsLower type trait.
Header file for the UniUpperProxy class.
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
Header file for the IsUniTriangular type trait.
Header file for the IsStrictlyTriangular type trait.
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
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 all adaptor forward declarations.
#define BLAZE_CONSTRAINT_MUST_NOT_BE_SYMMETRIC_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is a symmetric matrix type, a compilation error is created.
Definition: Symmetric.h:79
bool isStrictlyUpper(const DenseMatrix< MT, SO > &dm)
Checks if the given dense matrix is a strictly upper triangular matrix.
Definition: DenseMatrix.h:1493
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_BE_NUMERIC_TYPE(T)
Constraint on the data type.In case the given data type T is not a numeric (integral or floating poin...
Definition: Numeric.h:61
#define BLAZE_CONSTRAINT_MUST_NOT_BE_LOWER_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is a lower triangular matrix type...
Definition: Lower.h:81
#define BLAZE_CONSTRAINT_MUST_NOT_BE_REFERENCE_TYPE(T)
Constraint on the data type.In case the given data type T is not a reference type, a compilation error is created.
Definition: Reference.h:79
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 isUniUpper(const DenseMatrix< MT, SO > &dm)
Checks if the given dense matrix is an upper unitriangular matrix.
Definition: DenseMatrix.h:1406
bool isIntact(const DiagonalMatrix< MT, SO, DF > &m)
Returns whether the invariants of the given diagonal matrix are intact.
Definition: DiagonalMatrix.h:249
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
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
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 implementation of the base template of the UniUpperMatrix.
Header file for the TrueType type/value trait base class.