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>
61 #include <blaze/math/Exception.h>
64 #include <blaze/math/shims/Clear.h>
66 #include <blaze/math/shims/IsOne.h>
77 #include <blaze/system/Inline.h>
78 #include <blaze/util/Assert.h>
85 #include <blaze/util/DisableIf.h>
86 #include <blaze/util/EnableIf.h>
87 #include <blaze/util/FalseType.h>
89 #include <blaze/util/TrueType.h>
90 #include <blaze/util/Types.h>
91 #include <blaze/util/Unused.h>
92 
93 
94 namespace blaze {
95 
96 //=================================================================================================
97 //
98 // CLASS TEMPLATE SPECIALIZATION FOR DENSE MATRICES
99 //
100 //=================================================================================================
101 
102 //*************************************************************************************************
110 template< typename MT // Type of the adapted dense matrix
111  , bool SO > // Storage order of the adapted dense matrix
112 class UniUpperMatrix<MT,SO,true>
113  : public DenseMatrix< UniUpperMatrix<MT,SO,true>, SO >
114 {
115  private:
116  //**Type definitions****************************************************************************
117  using OT = OppositeType_<MT>;
118  using TT = TransposeType_<MT>;
119  using ET = ElementType_<MT>;
120  //**********************************************************************************************
121 
122  public:
123  //**Type definitions****************************************************************************
124  using This = UniUpperMatrix<MT,SO,true>;
125  using BaseType = DenseMatrix<This,SO>;
126  using ResultType = This;
127  using OppositeType = UniUpperMatrix<OT,!SO,true>;
128  using TransposeType = UniLowerMatrix<TT,!SO,true>;
129  using ElementType = ET;
130  using SIMDType = SIMDType_<MT>;
131  using ReturnType = ReturnType_<MT>;
132  using CompositeType = const This&;
133  using Reference = UniUpperProxy<MT>;
134  using ConstReference = ConstReference_<MT>;
135  using Pointer = Pointer_<MT>;
136  using ConstPointer = ConstPointer_<MT>;
137  using ConstIterator = ConstIterator_<MT>;
138  //**********************************************************************************************
139 
140  //**Rebind struct definition********************************************************************
143  template< typename NewType > // Data type of the other matrix
144  struct Rebind {
146  using Other = UniUpperMatrix< typename MT::template Rebind<NewType>::Other >;
147  };
148  //**********************************************************************************************
149 
150  //**Resize struct definition********************************************************************
153  template< size_t NewM // Number of rows of the other matrix
154  , size_t NewN > // Number of columns of the other matrix
155  struct Resize {
157  using Other = UniUpperMatrix< typename MT::template Resize<NewM,NewN>::Other >;
158  };
159  //**********************************************************************************************
160 
161  //**Iterator class definition*******************************************************************
164  class Iterator
165  {
166  public:
167  //**Type definitions*************************************************************************
168  using IteratorCategory = std::random_access_iterator_tag;
169  using ValueType = ElementType_<MT>;
170  using PointerType = UniUpperProxy<MT>;
171  using ReferenceType = UniUpperProxy<MT>;
172  using DifferenceType = ptrdiff_t;
173 
174  // STL iterator requirements
175  using iterator_category = IteratorCategory;
176  using value_type = ValueType;
177  using pointer = PointerType;
178  using reference = ReferenceType;
179  using difference_type = DifferenceType;
180  //*******************************************************************************************
181 
182  //**Constructor******************************************************************************
185  inline Iterator() noexcept
186  : matrix_( nullptr ) // Reference to the adapted dense matrix
187  , row_ ( 0UL ) // The current row index of the iterator
188  , column_( 0UL ) // The current column index of the iterator
189  {}
190  //*******************************************************************************************
191 
192  //**Constructor******************************************************************************
199  inline Iterator( MT& matrix, size_t row, size_t column ) noexcept
200  : matrix_( &matrix ) // Reference to the adapted dense matrix
201  , row_ ( row ) // The current row-index of the iterator
202  , column_( column ) // The current column-index of the iterator
203  {}
204  //*******************************************************************************************
205 
206  //**Addition assignment operator*************************************************************
212  inline Iterator& operator+=( size_t inc ) noexcept {
213  ( SO )?( row_ += inc ):( column_ += inc );
214  return *this;
215  }
216  //*******************************************************************************************
217 
218  //**Subtraction assignment operator**********************************************************
224  inline Iterator& operator-=( size_t dec ) noexcept {
225  ( SO )?( row_ -= dec ):( column_ -= dec );
226  return *this;
227  }
228  //*******************************************************************************************
229 
230  //**Prefix increment operator****************************************************************
235  inline Iterator& operator++() noexcept {
236  ( SO )?( ++row_ ):( ++column_ );
237  return *this;
238  }
239  //*******************************************************************************************
240 
241  //**Postfix increment operator***************************************************************
246  inline const Iterator operator++( int ) noexcept {
247  const Iterator tmp( *this );
248  ++(*this);
249  return tmp;
250  }
251  //*******************************************************************************************
252 
253  //**Prefix decrement operator****************************************************************
258  inline Iterator& operator--() noexcept {
259  ( SO )?( --row_ ):( --column_ );
260  return *this;
261  }
262  //*******************************************************************************************
263 
264  //**Postfix decrement operator***************************************************************
269  inline const Iterator operator--( int ) {
270  const Iterator tmp( *this );
271  --(*this);
272  return tmp;
273  }
274  //*******************************************************************************************
275 
276  //**Element access operator******************************************************************
281  inline ReferenceType operator*() const {
282  return ReferenceType( *matrix_, row_, column_ );
283  }
284  //*******************************************************************************************
285 
286  //**Element access operator******************************************************************
291  inline PointerType operator->() const {
292  return PointerType( *matrix_, row_, column_ );
293  }
294  //*******************************************************************************************
295 
296  //**Load function****************************************************************************
306  inline SIMDType load() const {
307  return (*matrix_).load(row_,column_);
308  }
309  //*******************************************************************************************
310 
311  //**Loada function***************************************************************************
321  inline SIMDType loada() const {
322  return (*matrix_).loada(row_,column_);
323  }
324  //*******************************************************************************************
325 
326  //**Loadu function***************************************************************************
336  inline SIMDType loadu() const {
337  return (*matrix_).loadu(row_,column_);
338  }
339  //*******************************************************************************************
340 
341  //**Conversion operator**********************************************************************
346  inline operator ConstIterator() const {
347  if( SO )
348  return matrix_->begin( column_ ) + row_;
349  else
350  return matrix_->begin( row_ ) + column_;
351  }
352  //*******************************************************************************************
353 
354  //**Equality operator************************************************************************
361  friend inline bool operator==( const Iterator& lhs, const Iterator& rhs ) noexcept {
362  return ( SO )?( lhs.row_ == rhs.row_ ):( lhs.column_ == rhs.column_ );
363  }
364  //*******************************************************************************************
365 
366  //**Equality operator************************************************************************
373  friend inline bool operator==( const Iterator& lhs, const ConstIterator& rhs ) {
374  return ( ConstIterator( lhs ) == rhs );
375  }
376  //*******************************************************************************************
377 
378  //**Equality operator************************************************************************
385  friend inline bool operator==( const ConstIterator& lhs, const Iterator& rhs ) {
386  return ( lhs == ConstIterator( rhs ) );
387  }
388  //*******************************************************************************************
389 
390  //**Inequality operator**********************************************************************
397  friend inline bool operator!=( const Iterator& lhs, const Iterator& rhs ) noexcept {
398  return ( SO )?( lhs.row_ != rhs.row_ ):( lhs.column_ != rhs.column_ );
399  }
400  //*******************************************************************************************
401 
402  //**Inequality operator**********************************************************************
409  friend inline bool operator!=( const Iterator& lhs, const ConstIterator& rhs ) {
410  return ( ConstIterator( lhs ) != rhs );
411  }
412  //*******************************************************************************************
413 
414  //**Inequality operator**********************************************************************
421  friend inline bool operator!=( const ConstIterator& lhs, const Iterator& rhs ) {
422  return ( lhs != ConstIterator( rhs ) );
423  }
424  //*******************************************************************************************
425 
426  //**Less-than operator***********************************************************************
433  friend inline bool operator<( const Iterator& lhs, const Iterator& rhs ) noexcept {
434  return ( SO )?( lhs.row_ < rhs.row_ ):( lhs.column_ < rhs.column_ );
435  }
436  //*******************************************************************************************
437 
438  //**Less-than operator***********************************************************************
445  friend inline bool operator<( const Iterator& lhs, const ConstIterator& rhs ) {
446  return ( ConstIterator( lhs ) < rhs );
447  }
448  //*******************************************************************************************
449 
450  //**Less-than operator***********************************************************************
457  friend inline bool operator<( const ConstIterator& lhs, const Iterator& rhs ) {
458  return ( lhs < ConstIterator( rhs ) );
459  }
460  //*******************************************************************************************
461 
462  //**Greater-than operator********************************************************************
469  friend inline bool operator>( const Iterator& lhs, const Iterator& rhs ) noexcept {
470  return ( SO )?( lhs.row_ > rhs.row_ ):( lhs.column_ > rhs.column_ );
471  }
472  //*******************************************************************************************
473 
474  //**Greater-than operator********************************************************************
481  friend inline bool operator>( const Iterator& lhs, const ConstIterator& rhs ) {
482  return ( ConstIterator( lhs ) > rhs );
483  }
484  //*******************************************************************************************
485 
486  //**Greater-than operator********************************************************************
493  friend inline bool operator>( const ConstIterator& lhs, const Iterator& rhs ) {
494  return ( lhs > ConstIterator( rhs ) );
495  }
496  //*******************************************************************************************
497 
498  //**Less-or-equal-than operator**************************************************************
505  friend inline bool operator<=( const Iterator& lhs, const Iterator& rhs ) noexcept {
506  return ( SO )?( lhs.row_ <= rhs.row_ ):( lhs.column_ <= rhs.column_ );
507  }
508  //*******************************************************************************************
509 
510  //**Less-or-equal-than operator**************************************************************
517  friend inline bool operator<=( const Iterator& lhs, const ConstIterator& rhs ) {
518  return ( ConstIterator( lhs ) <= rhs );
519  }
520  //*******************************************************************************************
521 
522  //**Less-or-equal-than operator**************************************************************
529  friend inline bool operator<=( const ConstIterator& lhs, const Iterator& rhs ) {
530  return ( lhs <= ConstIterator( rhs ) );
531  }
532  //*******************************************************************************************
533 
534  //**Greater-or-equal-than operator***********************************************************
541  friend inline bool operator>=( const Iterator& lhs, const Iterator& rhs ) noexcept {
542  return ( SO )?( lhs.row_ >= rhs.row_ ):( lhs.column_ >= rhs.column_ );
543  }
544  //*******************************************************************************************
545 
546  //**Greater-or-equal-than operator***********************************************************
553  friend inline bool operator>=( const Iterator& lhs, const ConstIterator& rhs ) {
554  return ( ConstIterator( lhs ) >= rhs );
555  }
556  //*******************************************************************************************
557 
558  //**Greater-or-equal-than operator***********************************************************
565  friend inline bool operator>=( const ConstIterator& lhs, const Iterator& rhs ) {
566  return ( lhs >= ConstIterator( rhs ) );
567  }
568  //*******************************************************************************************
569 
570  //**Subtraction operator*********************************************************************
576  inline DifferenceType operator-( const Iterator& rhs ) const noexcept {
577  return ( SO )?( row_ - rhs.row_ ):( column_ - rhs.column_ );
578  }
579  //*******************************************************************************************
580 
581  //**Addition operator************************************************************************
588  friend inline const Iterator operator+( const Iterator& it, size_t inc ) noexcept {
589  if( SO )
590  return Iterator( *it.matrix_, it.row_ + inc, it.column_ );
591  else
592  return Iterator( *it.matrix_, it.row_, it.column_ + inc );
593  }
594  //*******************************************************************************************
595 
596  //**Addition operator************************************************************************
603  friend inline const Iterator operator+( size_t inc, const Iterator& it ) noexcept {
604  if( SO )
605  return Iterator( *it.matrix_, it.row_ + inc, it.column_ );
606  else
607  return Iterator( *it.matrix_, it.row_, it.column_ + inc );
608  }
609  //*******************************************************************************************
610 
611  //**Subtraction operator*********************************************************************
618  friend inline const Iterator operator-( const Iterator& it, size_t dec ) noexcept {
619  if( SO )
620  return Iterator( *it.matrix_, it.row_ - dec, it.column_ );
621  else
622  return Iterator( *it.matrix_, it.row_, it.column_ - dec );
623  }
624  //*******************************************************************************************
625 
626  private:
627  //**Member variables*************************************************************************
628  MT* matrix_;
629  size_t row_;
630  size_t column_;
631  //*******************************************************************************************
632  };
633  //**********************************************************************************************
634 
635  //**Compilation flags***************************************************************************
637  enum : bool { simdEnabled = MT::simdEnabled };
638 
640  enum : bool { smpAssignable = MT::smpAssignable };
641  //**********************************************************************************************
642 
643  //**Constructors********************************************************************************
646  explicit inline UniUpperMatrix();
647  template< typename A1 > explicit inline UniUpperMatrix( const A1& a1 );
648  explicit inline UniUpperMatrix( size_t n, const ElementType& init );
649 
650  explicit inline UniUpperMatrix( initializer_list< initializer_list<ElementType> > list );
651 
652  template< typename Other >
653  explicit inline UniUpperMatrix( size_t n, const Other* array );
654 
655  template< typename Other, size_t N >
656  explicit inline UniUpperMatrix( const Other (&array)[N][N] );
657 
658  explicit inline UniUpperMatrix( ElementType* ptr, size_t n );
659  explicit inline UniUpperMatrix( ElementType* ptr, size_t n, size_t nn );
660 
661  inline UniUpperMatrix( const UniUpperMatrix& m );
662  inline UniUpperMatrix( UniUpperMatrix&& 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 UniUpperMatrix& operator=( const ElementType& rhs );
692  inline UniUpperMatrix& operator=( initializer_list< initializer_list<ElementType> > list );
693 
694  template< typename Other, size_t N >
695  inline UniUpperMatrix& operator=( const Other (&array)[N][N] );
696 
697  inline UniUpperMatrix& operator=( const UniUpperMatrix& rhs );
698  inline UniUpperMatrix& operator=( UniUpperMatrix&& rhs ) noexcept;
699 
700  template< typename MT2, bool SO2 >
701  inline DisableIf_< IsComputation<MT2>, UniUpperMatrix& > operator=( const Matrix<MT2,SO2>& rhs );
702 
703  template< typename MT2, bool SO2 >
704  inline EnableIf_< IsComputation<MT2>, UniUpperMatrix& > operator=( const Matrix<MT2,SO2>& rhs );
705 
706  template< typename MT2, bool SO2 >
707  inline DisableIf_< IsComputation<MT2>, UniUpperMatrix& > operator+=( const Matrix<MT2,SO2>& rhs );
708 
709  template< typename MT2, bool SO2 >
710  inline EnableIf_< IsComputation<MT2>, UniUpperMatrix& > operator+=( const Matrix<MT2,SO2>& rhs );
711 
712  template< typename MT2, bool SO2 >
713  inline DisableIf_< IsComputation<MT2>, UniUpperMatrix& > operator-=( const Matrix<MT2,SO2>& rhs );
714 
715  template< typename MT2, bool SO2 >
716  inline EnableIf_< IsComputation<MT2>, UniUpperMatrix& > operator-=( const Matrix<MT2,SO2>& rhs );
717 
718  template< typename MT2, bool SO2 >
719  inline UniUpperMatrix& operator%=( const Matrix<MT2,SO2>& rhs );
721  //**********************************************************************************************
722 
723  //**Utility functions***************************************************************************
726  inline size_t rows() const noexcept;
727  inline size_t columns() const noexcept;
728  inline size_t spacing() const noexcept;
729  inline size_t capacity() const noexcept;
730  inline size_t capacity( size_t i ) const noexcept;
731  inline size_t nonZeros() const;
732  inline size_t nonZeros( size_t i ) const;
733  inline void reset();
734  inline void reset( size_t i );
735  inline void clear();
736  void resize ( size_t n, bool preserve=true );
737  inline void extend ( size_t n, bool preserve=true );
738  inline void reserve( size_t elements );
739  inline void shrinkToFit();
740  inline void swap( UniUpperMatrix& m ) noexcept;
741 
742  static inline constexpr size_t maxNonZeros() noexcept;
743  static inline constexpr size_t maxNonZeros( size_t n ) noexcept;
745  //**********************************************************************************************
746 
747  //**Debugging functions*************************************************************************
750  inline bool isIntact() const noexcept;
752  //**********************************************************************************************
753 
754  //**Expression template evaluation functions****************************************************
757  template< typename Other > inline bool canAlias ( const Other* alias ) const noexcept;
758  template< typename Other > inline bool isAliased( const Other* alias ) const noexcept;
759 
760  inline bool isAligned () const noexcept;
761  inline bool canSMPAssign() const noexcept;
762 
763  BLAZE_ALWAYS_INLINE SIMDType load ( size_t i, size_t j ) const noexcept;
764  BLAZE_ALWAYS_INLINE SIMDType loada( size_t i, size_t j ) const noexcept;
765  BLAZE_ALWAYS_INLINE SIMDType loadu( size_t i, size_t j ) const noexcept;
767  //**********************************************************************************************
768 
769  private:
770  //**Construction functions**********************************************************************
773  inline const MT construct( size_t n , TrueType );
774  inline const MT construct( const ElementType& value, FalseType );
775 
776  template< typename MT2, bool SO2, typename T >
777  inline const MT construct( const Matrix<MT2,SO2>& m, T );
779  //**********************************************************************************************
780 
781  //**Member variables****************************************************************************
784  MT matrix_;
785 
786  //**********************************************************************************************
787 
788  //**Friend declarations*************************************************************************
789  template< typename MT2, bool SO2, bool DF2 >
790  friend MT2& derestrict( UniUpperMatrix<MT2,SO2,DF2>& m );
791  //**********************************************************************************************
792 
793  //**Compile time checks*************************************************************************
807  BLAZE_STATIC_ASSERT( ( Size<MT,0UL>::value == Size<MT,1UL>::value ) );
808  //**********************************************************************************************
809 };
811 //*************************************************************************************************
812 
813 
814 
815 
816 //=================================================================================================
817 //
818 // CONSTRUCTORS
819 //
820 //=================================================================================================
821 
822 //*************************************************************************************************
826 template< typename MT // Type of the adapted dense matrix
827  , bool SO > // Storage order of the adapted dense matrix
828 inline UniUpperMatrix<MT,SO,true>::UniUpperMatrix()
829  : matrix_() // The adapted dense matrix
830 {
831  for( size_t i=0UL; i<rows(); ++i )
832  matrix_(i,i) = ElementType(1);
833 
834  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square uniupper matrix detected" );
835  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
836 }
838 //*************************************************************************************************
839 
840 
841 //*************************************************************************************************
859 template< typename MT // Type of the adapted dense matrix
860  , bool SO > // Storage order of the adapted dense matrix
861 template< typename A1 > // Type of the constructor argument
862 inline UniUpperMatrix<MT,SO,true>::UniUpperMatrix( const A1& a1 )
863  : matrix_( construct( a1, typename IsResizable<MT>::Type() ) ) // The adapted dense matrix
864 {
865  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square uniupper matrix detected" );
866  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
867 }
869 //*************************************************************************************************
870 
871 
872 //*************************************************************************************************
879 template< typename MT // Type of the adapted dense matrix
880  , bool SO > // Storage order of the adapted dense matrix
881 inline UniUpperMatrix<MT,SO,true>::UniUpperMatrix( size_t n, const ElementType& init )
882  : matrix_( n, n, ElementType() ) // The adapted dense matrix
883 {
885 
886  if( SO ) {
887  for( size_t j=0UL; j<columns(); ++j ) {
888  for( size_t i=0UL; i<j; ++i )
889  matrix_(i,j) = init;
890  matrix_(j,j) = ElementType(1);
891  }
892  }
893  else {
894  for( size_t i=0UL; i<rows(); ++i ) {
895  matrix_(i,i) = ElementType(1);
896  for( size_t j=i+1UL; j<columns(); ++j )
897  matrix_(i,j) = init;
898  }
899  }
900 
901  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square uniupper matrix detected" );
902  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
903 }
905 //*************************************************************************************************
906 
907 
908 //*************************************************************************************************
932 template< typename MT // Type of the adapted dense matrix
933  , bool SO > // Storage order of the adapted dense matrix
934 inline UniUpperMatrix<MT,SO,true>::UniUpperMatrix( initializer_list< initializer_list<ElementType> > list )
935  : matrix_( list ) // The adapted dense matrix
936 {
937  if( !isUniUpper( matrix_ ) ) {
938  BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of uniupper matrix" );
939  }
940 
941  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
942 }
944 //*************************************************************************************************
945 
946 
947 //*************************************************************************************************
973 template< typename MT // Type of the adapted dense matrix
974  , bool SO > // Storage order of the adapted dense matrix
975 template< typename Other > // Data type of the initialization array
976 inline UniUpperMatrix<MT,SO,true>::UniUpperMatrix( size_t n, const Other* array )
977  : matrix_( n, n, array ) // The adapted dense matrix
978 {
979  if( !isUniUpper( matrix_ ) ) {
980  BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of uniupper matrix" );
981  }
982 
983  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
984 }
986 //*************************************************************************************************
987 
988 
989 //*************************************************************************************************
1012 template< typename MT // Type of the adapted dense matrix
1013  , bool SO > // Storage order of the adapted dense matrix
1014 template< typename Other // Data type of the initialization array
1015  , size_t N > // Number of rows and columns of the initialization array
1016 inline UniUpperMatrix<MT,SO,true>::UniUpperMatrix( const Other (&array)[N][N] )
1017  : matrix_( array ) // The adapted dense matrix
1018 {
1019  if( !isUniUpper( matrix_ ) ) {
1020  BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of uniupper matrix" );
1021  }
1022 
1023  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1024 }
1026 //*************************************************************************************************
1027 
1028 
1029 //*************************************************************************************************
1064 template< typename MT // Type of the adapted dense matrix
1065  , bool SO > // Storage order of the adapted dense matrix
1066 inline UniUpperMatrix<MT,SO,true>::UniUpperMatrix( ElementType* ptr, size_t n )
1067  : matrix_( ptr, n, n ) // The adapted dense matrix
1068 {
1069  if( !isUniUpper( matrix_ ) ) {
1070  BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of uniupper matrix" );
1071  }
1072 
1073  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1074 }
1076 //*************************************************************************************************
1077 
1078 
1079 //*************************************************************************************************
1116 template< typename MT // Type of the adapted dense matrix
1117  , bool SO > // Storage order of the adapted dense matrix
1118 inline UniUpperMatrix<MT,SO,true>::UniUpperMatrix( ElementType* ptr, size_t n, size_t nn )
1119  : matrix_( ptr, n, n, nn ) // The adapted dense matrix
1120 {
1121  if( !isUniUpper( matrix_ ) ) {
1122  BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of uniupper matrix" );
1123  }
1124 
1125  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1126 }
1128 //*************************************************************************************************
1129 
1130 
1131 //*************************************************************************************************
1137 template< typename MT // Type of the adapted dense matrix
1138  , bool SO > // Storage order of the adapted dense matrix
1139 inline UniUpperMatrix<MT,SO,true>::UniUpperMatrix( const UniUpperMatrix& m )
1140  : matrix_( m.matrix_ ) // The adapted dense matrix
1141 {
1142  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square uniupper matrix detected" );
1143  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1144 }
1146 //*************************************************************************************************
1147 
1148 
1149 //*************************************************************************************************
1155 template< typename MT // Type of the adapted dense matrix
1156  , bool SO > // Storage order of the adapted dense matrix
1157 inline UniUpperMatrix<MT,SO,true>::UniUpperMatrix( UniUpperMatrix&& m ) noexcept
1158  : matrix_( std::move( m.matrix_ ) ) // The adapted dense matrix
1159 {
1160  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square uniupper matrix detected" );
1161  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1162 }
1164 //*************************************************************************************************
1165 
1166 
1167 
1168 
1169 //=================================================================================================
1170 //
1171 // DATA ACCESS FUNCTIONS
1172 //
1173 //=================================================================================================
1174 
1175 //*************************************************************************************************
1191 template< typename MT // Type of the adapted dense matrix
1192  , bool SO > // Storage order of the adapted dense matrix
1194  UniUpperMatrix<MT,SO,true>::operator()( size_t i, size_t j )
1195 {
1196  BLAZE_USER_ASSERT( i<rows() , "Invalid row access index" );
1197  BLAZE_USER_ASSERT( j<columns(), "Invalid column access index" );
1198 
1199  return Reference( matrix_, i, j );
1200 }
1202 //*************************************************************************************************
1203 
1204 
1205 //*************************************************************************************************
1221 template< typename MT // Type of the adapted dense matrix
1222  , bool SO > // Storage order of the adapted dense matrix
1224  UniUpperMatrix<MT,SO,true>::operator()( size_t i, size_t j ) const
1225 {
1226  BLAZE_USER_ASSERT( i<rows() , "Invalid row access index" );
1227  BLAZE_USER_ASSERT( j<columns(), "Invalid column access index" );
1228 
1229  return matrix_(i,j);
1230 }
1232 //*************************************************************************************************
1233 
1234 
1235 //*************************************************************************************************
1252 template< typename MT // Type of the adapted dense matrix
1253  , bool SO > // Storage order of the adapted dense matrix
1255  UniUpperMatrix<MT,SO,true>::at( size_t i, size_t j )
1256 {
1257  if( i >= rows() ) {
1258  BLAZE_THROW_OUT_OF_RANGE( "Invalid row access index" );
1259  }
1260  if( j >= columns() ) {
1261  BLAZE_THROW_OUT_OF_RANGE( "Invalid column access index" );
1262  }
1263  return (*this)(i,j);
1264 }
1266 //*************************************************************************************************
1267 
1268 
1269 //*************************************************************************************************
1286 template< typename MT // Type of the adapted dense matrix
1287  , bool SO > // Storage order of the adapted dense matrix
1289  UniUpperMatrix<MT,SO,true>::at( size_t i, size_t j ) const
1290 {
1291  if( i >= rows() ) {
1292  BLAZE_THROW_OUT_OF_RANGE( "Invalid row access index" );
1293  }
1294  if( j >= columns() ) {
1295  BLAZE_THROW_OUT_OF_RANGE( "Invalid column access index" );
1296  }
1297  return (*this)(i,j);
1298 }
1300 //*************************************************************************************************
1301 
1302 
1303 //*************************************************************************************************
1316 template< typename MT // Type of the adapted dense matrix
1317  , bool SO > // Storage order of the adapted dense matrix
1318 inline typename UniUpperMatrix<MT,SO,true>::ConstPointer
1319  UniUpperMatrix<MT,SO,true>::data() const noexcept
1320 {
1321  return matrix_.data();
1322 }
1324 //*************************************************************************************************
1325 
1326 
1327 //*************************************************************************************************
1336 template< typename MT // Type of the adapted dense matrix
1337  , bool SO > // Storage order of the adapted dense matrix
1338 inline typename UniUpperMatrix<MT,SO,true>::ConstPointer
1339  UniUpperMatrix<MT,SO,true>::data( size_t i ) const noexcept
1340 {
1341  return matrix_.data(i);
1342 }
1344 //*************************************************************************************************
1345 
1346 
1347 //*************************************************************************************************
1359 template< typename MT // Type of the adapted dense matrix
1360  , bool SO > // Storage order of the adapted dense matrix
1363 {
1364  if( SO )
1365  return Iterator( matrix_, 0UL, i );
1366  else
1367  return Iterator( matrix_, i, 0UL );
1368 }
1370 //*************************************************************************************************
1371 
1372 
1373 //*************************************************************************************************
1385 template< typename MT // Type of the adapted dense matrix
1386  , bool SO > // Storage order of the adapted dense matrix
1388  UniUpperMatrix<MT,SO,true>::begin( size_t i ) const
1389 {
1390  return matrix_.begin(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
1411  UniUpperMatrix<MT,SO,true>::cbegin( size_t i ) const
1412 {
1413  return matrix_.cbegin(i);
1414 }
1416 //*************************************************************************************************
1417 
1418 
1419 //*************************************************************************************************
1431 template< typename MT // Type of the adapted dense matrix
1432  , bool SO > // Storage order of the adapted dense matrix
1435 {
1436  if( SO )
1437  return Iterator( matrix_, rows(), i );
1438  else
1439  return Iterator( matrix_, i, columns() );
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>::end( size_t i ) const
1461 {
1462  return matrix_.end(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
1483  UniUpperMatrix<MT,SO,true>::cend( size_t i ) const
1484 {
1485  return matrix_.cend(i);
1486 }
1488 //*************************************************************************************************
1489 
1490 
1491 
1492 
1493 //=================================================================================================
1494 //
1495 // ASSIGNMENT OPERATORS
1496 //
1497 //=================================================================================================
1498 
1499 //*************************************************************************************************
1506 template< typename MT // Type of the adapted dense matrix
1507  , bool SO > // Storage order of the adapted dense matrix
1508 inline UniUpperMatrix<MT,SO,true>&
1509  UniUpperMatrix<MT,SO,true>::operator=( const ElementType& rhs )
1510 {
1511  if( SO ) {
1512  for( size_t j=1UL; j<columns(); ++j )
1513  for( size_t i=0UL; i<j; ++i )
1514  matrix_(i,j) = rhs;
1515  }
1516  else {
1517  for( size_t i=0UL; i<rows(); ++i )
1518  for( size_t j=i+1UL; j<columns(); ++j )
1519  matrix_(i,j) = rhs;
1520  }
1521 
1522  return *this;
1523 }
1525 //*************************************************************************************************
1526 
1527 
1528 //*************************************************************************************************
1553 template< typename MT // Type of the adapted dense matrix
1554  , bool SO > // Storage order of the adapted dense matrix
1555 inline UniUpperMatrix<MT,SO,true>&
1556  UniUpperMatrix<MT,SO,true>::operator=( initializer_list< initializer_list<ElementType> > list )
1557 {
1558  const InitializerMatrix<ElementType> tmp( list, list.size() );
1559 
1560  if( !isUniUpper( tmp ) ) {
1561  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to uniupper matrix" );
1562  }
1563 
1564  matrix_ = list;
1565 
1566  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square uniupper matrix detected" );
1567  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1568 
1569  return *this;
1570 }
1572 //*************************************************************************************************
1573 
1574 
1575 //*************************************************************************************************
1599 template< typename MT // Type of the adapted dense matrix
1600  , bool SO > // Storage order of the adapted dense matrix
1601 template< typename Other // Data type of the initialization array
1602  , size_t N > // Number of rows and columns of the initialization array
1603 inline UniUpperMatrix<MT,SO,true>&
1604  UniUpperMatrix<MT,SO,true>::operator=( const Other (&array)[N][N] )
1605 {
1606  MT tmp( array );
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 //*************************************************************************************************
1633 template< typename MT // Type of the adapted dense matrix
1634  , bool SO > // Storage order of the adapted dense matrix
1635 inline UniUpperMatrix<MT,SO,true>&
1636  UniUpperMatrix<MT,SO,true>::operator=( const UniUpperMatrix& rhs )
1637 {
1638  matrix_ = rhs.matrix_;
1639 
1640  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square uniupper matrix detected" );
1641  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1642 
1643  return *this;
1644 }
1646 //*************************************************************************************************
1647 
1648 
1649 //*************************************************************************************************
1656 template< typename MT // Type of the adapted dense matrix
1657  , bool SO > // Storage order of the adapted dense matrix
1658 inline UniUpperMatrix<MT,SO,true>&
1659  UniUpperMatrix<MT,SO,true>::operator=( UniUpperMatrix&& rhs ) noexcept
1660 {
1661  matrix_ = std::move( rhs.matrix_ );
1662 
1663  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square uniupper matrix detected" );
1664  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1665 
1666  return *this;
1667 }
1669 //*************************************************************************************************
1670 
1671 
1672 //*************************************************************************************************
1685 template< typename MT // Type of the adapted dense matrix
1686  , bool SO > // Storage order of the adapted dense matrix
1687 template< typename MT2 // Type of the right-hand side matrix
1688  , bool SO2 > // Storage order of the right-hand side matrix
1689 inline DisableIf_< IsComputation<MT2>, UniUpperMatrix<MT,SO,true>& >
1690  UniUpperMatrix<MT,SO,true>::operator=( const Matrix<MT2,SO2>& rhs )
1691 {
1692  if( IsStrictlyTriangular<MT2>::value || ( !IsUniUpper<MT2>::value && !isUniUpper( ~rhs ) ) ) {
1693  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to uniupper matrix" );
1694  }
1695 
1696  matrix_ = declupp( ~rhs );
1697 
1698  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square uniupper matrix detected" );
1699  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1700 
1701  return *this;
1702 }
1704 //*************************************************************************************************
1705 
1706 
1707 //*************************************************************************************************
1720 template< typename MT // Type of the adapted dense matrix
1721  , bool SO > // Storage order of the adapted dense matrix
1722 template< typename MT2 // Type of the right-hand side matrix
1723  , bool SO2 > // Storage order of the right-hand side matrix
1724 inline EnableIf_< IsComputation<MT2>, UniUpperMatrix<MT,SO,true>& >
1725  UniUpperMatrix<MT,SO,true>::operator=( const Matrix<MT2,SO2>& rhs )
1726 {
1727  if( IsStrictlyTriangular<MT2>::value || ( !IsSquare<MT2>::value && !isSquare( ~rhs ) ) ) {
1728  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to uniupper matrix" );
1729  }
1730 
1731  if( IsUniUpper<MT2>::value ) {
1732  matrix_ = ~rhs;
1733  }
1734  else {
1735  MT tmp( ~rhs );
1736 
1737  if( !isUniUpper( tmp ) ) {
1738  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to uniupper matrix" );
1739  }
1740 
1741  matrix_ = std::move( tmp );
1742  }
1743 
1744  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square uniupper matrix detected" );
1745  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1746 
1747  return *this;
1748 }
1750 //*************************************************************************************************
1751 
1752 
1753 //*************************************************************************************************
1766 template< typename MT // Type of the adapted dense matrix
1767  , bool SO > // Storage order of the adapted dense matrix
1768 template< typename MT2 // Type of the right-hand side matrix
1769  , bool SO2 > // Storage order of the right-hand side matrix
1770 inline DisableIf_< IsComputation<MT2>, UniUpperMatrix<MT,SO,true>& >
1771  UniUpperMatrix<MT,SO,true>::operator+=( const Matrix<MT2,SO2>& rhs )
1772 {
1773  if( IsLower<MT2>::value || IsUniTriangular<MT2>::value ||
1774  ( !IsStrictlyUpper<MT2>::value && !isStrictlyUpper( ~rhs ) ) ) {
1775  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to uniupper matrix" );
1776  }
1777 
1778  matrix_ += declupp( ~rhs );
1779 
1780  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square uniupper matrix detected" );
1781  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1782 
1783  return *this;
1784 }
1786 //*************************************************************************************************
1787 
1788 
1789 //*************************************************************************************************
1802 template< typename MT // Type of the adapted dense matrix
1803  , bool SO > // Storage order of the adapted dense matrix
1804 template< typename MT2 // Type of the right-hand side matrix
1805  , bool SO2 > // Storage order of the right-hand side matrix
1806 inline EnableIf_< IsComputation<MT2>, UniUpperMatrix<MT,SO,true>& >
1807  UniUpperMatrix<MT,SO,true>::operator+=( const Matrix<MT2,SO2>& rhs )
1808 {
1809  if( IsLower<MT2>::value || IsUniTriangular<MT2>::value ||
1810  ( !IsSquare<MT2>::value && !isSquare( ~rhs ) ) ) {
1811  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to uniupper matrix" );
1812  }
1813 
1814  if( IsStrictlyUpper<MT2>::value ) {
1815  matrix_ += ~rhs;
1816  }
1817  else {
1818  const ResultType_<MT2> tmp( ~rhs );
1819 
1820  if( !isStrictlyUpper( tmp ) ) {
1821  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to uniupper matrix" );
1822  }
1823 
1824  matrix_ += declupp( tmp );
1825  }
1826 
1827  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square uniupper matrix detected" );
1828  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1829 
1830  return *this;
1831 }
1833 //*************************************************************************************************
1834 
1835 
1836 //*************************************************************************************************
1849 template< typename MT // Type of the adapted dense matrix
1850  , bool SO > // Storage order of the adapted dense matrix
1851 template< typename MT2 // Type of the right-hand side matrix
1852  , bool SO2 > // Storage order of the right-hand side matrix
1853 inline DisableIf_< IsComputation<MT2>, UniUpperMatrix<MT,SO,true>& >
1854  UniUpperMatrix<MT,SO,true>::operator-=( const Matrix<MT2,SO2>& rhs )
1855 {
1856  if( IsLower<MT2>::value || IsUniTriangular<MT2>::value ||
1857  ( !IsStrictlyUpper<MT2>::value && !isStrictlyUpper( ~rhs ) ) ) {
1858  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to uniupper matrix" );
1859  }
1860 
1861  matrix_ -= declupp( ~rhs );
1862 
1863  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square uniupper matrix detected" );
1864  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1865 
1866  return *this;
1867 }
1869 //*************************************************************************************************
1870 
1871 
1872 //*************************************************************************************************
1885 template< typename MT // Type of the adapted dense matrix
1886  , bool SO > // Storage order of the adapted dense matrix
1887 template< typename MT2 // Type of the right-hand side matrix
1888  , bool SO2 > // Storage order of the right-hand side matrix
1889 inline EnableIf_< IsComputation<MT2>, UniUpperMatrix<MT,SO,true>& >
1890  UniUpperMatrix<MT,SO,true>::operator-=( const Matrix<MT2,SO2>& rhs )
1891 {
1892  if( IsLower<MT2>::value || IsUniTriangular<MT2>::value ||
1893  ( !IsSquare<MT2>::value && !isSquare( ~rhs ) ) ) {
1894  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to uniupper matrix" );
1895  }
1896 
1897  if( IsStrictlyUpper<MT2>::value ) {
1898  matrix_ -= ~rhs;
1899  }
1900  else {
1901  const ResultType_<MT2> tmp( ~rhs );
1902 
1903  if( !isStrictlyUpper( tmp ) ) {
1904  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to uniupper matrix" );
1905  }
1906 
1907  matrix_ -= declupp( tmp );
1908  }
1909 
1910  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square uniupper matrix detected" );
1911  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1912 
1913  return *this;
1914 }
1916 //*************************************************************************************************
1917 
1918 
1919 //*************************************************************************************************
1932 template< typename MT // Type of the adapted dense matrix
1933  , bool SO > // Storage order of the adapted dense matrix
1934 template< typename MT2 // Type of the right-hand side matrix
1935  , bool SO2 > // Storage order of the right-hand side matrix
1936 inline UniUpperMatrix<MT,SO,true>&
1937  UniUpperMatrix<MT,SO,true>::operator%=( const Matrix<MT2,SO2>& rhs )
1938 {
1939  if( !IsSquare<MT2>::value && !isSquare( ~rhs ) ) {
1940  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to uniupper matrix" );
1941  }
1942 
1943  If_< IsComputation<MT2>, ResultType_<MT2>, const MT2& > tmp( ~rhs );
1944 
1945  for( size_t i=0UL; i<(~rhs).rows(); ++i ) {
1946  if( !isOne( tmp(i,i) ) ) {
1947  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to uniupper matrix" );
1948  }
1949  }
1950 
1951  matrix_ %= tmp;
1952 
1953  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square uniupper matrix detected" );
1954  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1955 
1956  return *this;
1957 }
1959 //*************************************************************************************************
1960 
1961 
1962 
1963 
1964 //=================================================================================================
1965 //
1966 // UTILITY FUNCTIONS
1967 //
1968 //=================================================================================================
1969 
1970 //*************************************************************************************************
1976 template< typename MT // Type of the adapted dense matrix
1977  , bool SO > // Storage order of the adapted dense matrix
1978 inline size_t UniUpperMatrix<MT,SO,true>::rows() const noexcept
1979 {
1980  return matrix_.rows();
1981 }
1983 //*************************************************************************************************
1984 
1985 
1986 //*************************************************************************************************
1992 template< typename MT // Type of the adapted dense matrix
1993  , bool SO > // Storage order of the adapted dense matrix
1994 inline size_t UniUpperMatrix<MT,SO,true>::columns() const noexcept
1995 {
1996  return matrix_.columns();
1997 }
1999 //*************************************************************************************************
2000 
2001 
2002 //*************************************************************************************************
2013 template< typename MT // Type of the adapted dense matrix
2014  , bool SO > // Storage order of the adapted dense matrix
2015 inline size_t UniUpperMatrix<MT,SO,true>::spacing() const noexcept
2016 {
2017  return matrix_.spacing();
2018 }
2020 //*************************************************************************************************
2021 
2022 
2023 //*************************************************************************************************
2029 template< typename MT // Type of the adapted dense matrix
2030  , bool SO > // Storage order of the adapted dense matrix
2031 inline size_t UniUpperMatrix<MT,SO,true>::capacity() const noexcept
2032 {
2033  return matrix_.capacity();
2034 }
2036 //*************************************************************************************************
2037 
2038 
2039 //*************************************************************************************************
2051 template< typename MT // Type of the adapted dense matrix
2052  , bool SO > // Storage order of the adapted dense matrix
2053 inline size_t UniUpperMatrix<MT,SO,true>::capacity( size_t i ) const noexcept
2054 {
2055  return matrix_.capacity(i);
2056 }
2058 //*************************************************************************************************
2059 
2060 
2061 //*************************************************************************************************
2067 template< typename MT // Type of the adapted dense matrix
2068  , bool SO > // Storage order of the adapted dense matrix
2069 inline size_t UniUpperMatrix<MT,SO,true>::nonZeros() const
2070 {
2071  return matrix_.nonZeros();
2072 }
2074 //*************************************************************************************************
2075 
2076 
2077 //*************************************************************************************************
2089 template< typename MT // Type of the adapted dense matrix
2090  , bool SO > // Storage order of the adapted dense matrix
2091 inline size_t UniUpperMatrix<MT,SO,true>::nonZeros( size_t i ) const
2092 {
2093  return matrix_.nonZeros(i);
2094 }
2096 //*************************************************************************************************
2097 
2098 
2099 //*************************************************************************************************
2105 template< typename MT // Type of the adapted dense matrix
2106  , bool SO > // Storage order of the adapted dense matrix
2108 {
2109  using blaze::clear;
2110 
2111  if( SO ) {
2112  for( size_t j=1UL; j<columns(); ++j )
2113  for( size_t i=0UL; i<j; ++i )
2114  clear( matrix_(i,j) );
2115  }
2116  else {
2117  for( size_t i=0UL; i<rows(); ++i )
2118  for( size_t j=i+1UL; j<columns(); ++j )
2119  clear( matrix_(i,j) );
2120  }
2121 }
2123 //*************************************************************************************************
2124 
2125 
2126 //*************************************************************************************************
2139 template< typename MT // Type of the adapted dense matrix
2140  , bool SO > // Storage order of the adapted dense matrix
2141 inline void UniUpperMatrix<MT,SO,true>::reset( size_t i )
2142 {
2143  using blaze::clear;
2144 
2145  if( SO ) {
2146  for( size_t j=0UL; j<i; ++j )
2147  clear( matrix_(j,i) );
2148  }
2149  else {
2150  for( size_t j=i+1UL; j<columns(); ++j )
2151  clear( matrix_(i,j) );
2152  }
2153 }
2155 //*************************************************************************************************
2156 
2157 
2158 //*************************************************************************************************
2170 template< typename MT // Type of the adapted dense matrix
2171  , bool SO > // Storage order of the adapted dense matrix
2173 {
2174  using blaze::clear;
2175 
2176  if( IsResizable<MT>::value ) {
2177  clear( matrix_ );
2178  }
2179  else {
2180  reset();
2181  }
2182 }
2184 //*************************************************************************************************
2185 
2186 
2187 //*************************************************************************************************
2223 template< typename MT // Type of the adapted dense matrix
2224  , bool SO > // Storage order of the adapted dense matrix
2225 void UniUpperMatrix<MT,SO,true>::resize( size_t n, bool preserve )
2226 {
2228 
2229  UNUSED_PARAMETER( preserve );
2230 
2231  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square uniupper matrix detected" );
2232 
2233  const size_t oldsize( matrix_.rows() );
2234 
2235  matrix_.resize( n, n, true );
2236 
2237  if( n > oldsize )
2238  {
2239  const size_t increment( n - oldsize );
2240  submatrix( matrix_, oldsize, 0UL, increment, n-1UL ).reset();
2241 
2242  for( size_t i=oldsize; i<n; ++i )
2243  matrix_(i,i) = ElementType(1);
2244  }
2245 }
2247 //*************************************************************************************************
2248 
2249 
2250 //*************************************************************************************************
2263 template< typename MT // Type of the adapted dense matrix
2264  , bool SO > // Storage order of the adapted dense matrix
2265 inline void UniUpperMatrix<MT,SO,true>::extend( size_t n, bool preserve )
2266 {
2268 
2269  UNUSED_PARAMETER( preserve );
2270 
2271  resize( rows() + n, true );
2272 }
2273 //*************************************************************************************************
2274 
2275 
2276 //*************************************************************************************************
2286 template< typename MT // Type of the adapted dense matrix
2287  , bool SO > // Storage order of the adapted dense matrix
2288 inline void UniUpperMatrix<MT,SO,true>::reserve( size_t elements )
2289 {
2290  matrix_.reserve( elements );
2291 }
2293 //*************************************************************************************************
2294 
2295 
2296 //*************************************************************************************************
2306 template< typename MT // Type of the adapted dense matrix
2307  , bool SO > // Storage order of the adapted dense matrix
2309 {
2310  matrix_.shrinkToFit();
2311 }
2313 //*************************************************************************************************
2314 
2315 
2316 //*************************************************************************************************
2323 template< typename MT // Type of the adapted dense matrix
2324  , bool SO > // Storage order of the adapted dense matrix
2325 inline void UniUpperMatrix<MT,SO,true>::swap( UniUpperMatrix& m ) noexcept
2326 {
2327  using std::swap;
2328 
2329  swap( matrix_, m.matrix_ );
2330 }
2332 //*************************************************************************************************
2333 
2334 
2335 //*************************************************************************************************
2347 template< typename MT // Type of the adapted dense matrix
2348  , bool SO > // Storage order of the adapted dense matrix
2349 inline constexpr size_t UniUpperMatrix<MT,SO,true>::maxNonZeros() noexcept
2350 {
2352 
2353  return maxNonZeros( Size<MT,0UL>::value );
2354 }
2356 //*************************************************************************************************
2357 
2358 
2359 //*************************************************************************************************
2369 template< typename MT // Type of the adapted dense matrix
2370  , bool SO > // Storage order of the adapted dense matrix
2371 inline constexpr size_t UniUpperMatrix<MT,SO,true>::maxNonZeros( size_t n ) noexcept
2372 {
2373  return ( ( n + 1UL ) * n ) / 2UL;
2374 }
2376 //*************************************************************************************************
2377 
2378 
2379 
2380 
2381 //=================================================================================================
2382 //
2383 // DEBUGGING FUNCTIONS
2384 //
2385 //=================================================================================================
2386 
2387 //*************************************************************************************************
2397 template< typename MT // Type of the adapted dense matrix
2398  , bool SO > // Storage order of the adapted dense matrix
2399 inline bool UniUpperMatrix<MT,SO,true>::isIntact() const noexcept
2400 {
2401  using blaze::isIntact;
2402 
2403  return ( isIntact( matrix_ ) && isUniUpper( matrix_ ) );
2404 }
2406 //*************************************************************************************************
2407 
2408 
2409 
2410 
2411 //=================================================================================================
2412 //
2413 // EXPRESSION TEMPLATE EVALUATION FUNCTIONS
2414 //
2415 //=================================================================================================
2416 
2417 //*************************************************************************************************
2428 template< typename MT // Type of the adapted dense matrix
2429  , bool SO > // Storage order of the adapted dense matrix
2430 template< typename Other > // Data type of the foreign expression
2431 inline bool UniUpperMatrix<MT,SO,true>::canAlias( const Other* alias ) const noexcept
2432 {
2433  return matrix_.canAlias( alias );
2434 }
2436 //*************************************************************************************************
2437 
2438 
2439 //*************************************************************************************************
2450 template< typename MT // Type of the adapted dense matrix
2451  , bool SO > // Storage order of the adapted dense matrix
2452 template< typename Other > // Data type of the foreign expression
2453 inline bool UniUpperMatrix<MT,SO,true>::isAliased( const Other* alias ) const noexcept
2454 {
2455  return matrix_.isAliased( alias );
2456 }
2458 //*************************************************************************************************
2459 
2460 
2461 //*************************************************************************************************
2471 template< typename MT // Type of the adapted dense matrix
2472  , bool SO > // Storage order of the adapted dense matrix
2473 inline bool UniUpperMatrix<MT,SO,true>::isAligned() const noexcept
2474 {
2475  return matrix_.isAligned();
2476 }
2478 //*************************************************************************************************
2479 
2480 
2481 //*************************************************************************************************
2492 template< typename MT // Type of the adapted dense matrix
2493  , bool SO > // Storage order of the adapted dense matrix
2494 inline bool UniUpperMatrix<MT,SO,true>::canSMPAssign() const noexcept
2495 {
2496  return matrix_.canSMPAssign();
2497 }
2499 //*************************************************************************************************
2500 
2501 
2502 //*************************************************************************************************
2518 template< typename MT // Type of the adapted dense matrix
2519  , bool SO > // Storage order of the adapted dense matrix
2520 BLAZE_ALWAYS_INLINE typename UniUpperMatrix<MT,SO,true>::SIMDType
2521  UniUpperMatrix<MT,SO,true>::load( size_t i, size_t j ) const noexcept
2522 {
2523  return matrix_.load( i, j );
2524 }
2526 //*************************************************************************************************
2527 
2528 
2529 //*************************************************************************************************
2545 template< typename MT // Type of the adapted dense matrix
2546  , bool SO > // Storage order of the adapted dense matrix
2547 BLAZE_ALWAYS_INLINE typename UniUpperMatrix<MT,SO,true>::SIMDType
2548  UniUpperMatrix<MT,SO,true>::loada( size_t i, size_t j ) const noexcept
2549 {
2550  return matrix_.loada( i, j );
2551 }
2553 //*************************************************************************************************
2554 
2555 
2556 //*************************************************************************************************
2572 template< typename MT // Type of the adapted dense matrix
2573  , bool SO > // Storage order of the adapted dense matrix
2574 BLAZE_ALWAYS_INLINE typename UniUpperMatrix<MT,SO,true>::SIMDType
2575  UniUpperMatrix<MT,SO,true>::loadu( size_t i, size_t j ) const noexcept
2576 {
2577  return matrix_.loadu( i, j );
2578 }
2580 //*************************************************************************************************
2581 
2582 
2583 
2584 
2585 //=================================================================================================
2586 //
2587 // CONSTRUCTION FUNCTIONS
2588 //
2589 //=================================================================================================
2590 
2591 //*************************************************************************************************
2598 template< typename MT // Type of the adapted dense matrix
2599  , bool SO > // Storage order of the adapted dense matrix
2600 inline const MT UniUpperMatrix<MT,SO,true>::construct( size_t n, TrueType )
2601 {
2603 
2604  MT tmp( n, n, ElementType() );
2605 
2606  for( size_t i=0UL; i<n; ++i )
2607  tmp(i,i) = ElementType(1);
2608 
2609  return tmp;
2610 }
2612 //*************************************************************************************************
2613 
2614 
2615 //*************************************************************************************************
2622 template< typename MT // Type of the adapted dense matrix
2623  , bool SO > // Storage order of the adapted dense matrix
2624 inline const MT UniUpperMatrix<MT,SO,true>::construct( const ElementType& init, FalseType )
2625 {
2628 
2629  MT tmp;
2630 
2631  if( SO ) {
2632  for( size_t j=0UL; j<columns(); ++j ) {
2633  for( size_t i=0UL; i<j; ++i )
2634  tmp(i,j) = init;
2635  tmp(j,j) = ElementType(1);
2636  }
2637  }
2638  else {
2639  for( size_t i=0UL; i<rows(); ++i ) {
2640  tmp(i,i) = ElementType(1);
2641  for( size_t j=i+1UL; j<columns(); ++j )
2642  tmp(i,j) = init;
2643  }
2644  }
2645 
2646  return tmp;
2647 }
2649 //*************************************************************************************************
2650 
2651 
2652 //*************************************************************************************************
2663 template< typename MT // Type of the adapted dense matrix
2664  , bool SO > // Storage order of the adapted dense matrix
2665 template< typename MT2 // Type of the foreign matrix
2666  , bool SO2 // Storage order of the foreign matrix
2667  , typename T > // Type of the third argument
2668 inline const MT UniUpperMatrix<MT,SO,true>::construct( const Matrix<MT2,SO2>& m, T )
2669 {
2670  const MT tmp( ~m );
2671 
2672  if( IsStrictlyTriangular<MT2>::value || ( !IsUniUpper<MT2>::value && !isUniUpper( tmp ) ) ) {
2673  BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of uniupper matrix" );
2674  }
2675 
2676  return tmp;
2677 }
2679 //*************************************************************************************************
2680 
2681 } // namespace blaze
2682 
2683 #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
Header file for auxiliary alias declarations.
decltype(auto) column(Matrix< MT, SO > &matrix, RCAs... args)
Creating a view on a specific column of the given matrix.
Definition: Column.h:131
Constraint on the data type.
CompressedMatrix< Type, false > OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: CompressedMatrix.h:3077
#define BLAZE_USER_ASSERT(expr, msg)
Run time assertion macro for user checks.In case of an invalid run time expression, the program execution is terminated. The BLAZE_USER_ASSERT macro can be disabled by setting the BLAZE_USER_ASSERT flag to zero or by defining NDEBUG during the compilation.
Definition: Assert.h:117
Header file for the UNUSED_PARAMETER function template.
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:522
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.
This ResultType
Result type for expression template evaluations.
Definition: CompressedMatrix.h:3076
BLAZE_ALWAYS_INLINE MT::Iterator begin(Matrix< MT, SO > &matrix, size_t i)
Returns an iterator to the first element of row/column i.
Definition: Matrix.h:364
CompressedMatrix< Type, true > This
Type of this CompressedMatrix instance.
Definition: CompressedMatrix.h:3074
Constraint on the data type.
void reset(const DiagonalProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: DiagonalProxy.h:588
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:701
BLAZE_ALWAYS_INLINE void shrinkToFit(Matrix< MT, SO > &matrix)
Requesting the removal of unused capacity.
Definition: Matrix.h:775
typename DisableIf< Condition, T >::Type DisableIf_
Auxiliary type for the DisableIf class template.The DisableIf_ alias declaration provides a convenien...
Definition: DisableIf.h:224
void clear(CompressedMatrix< Type, SO > &m)
Clearing the given compressed matrix.
Definition: CompressedMatrix.h:5829
CompressedMatrix< Type, false > TransposeType
Transpose type for expression template evaluations.
Definition: CompressedMatrix.h:3078
const Type & ConstReference
Reference to a constant matrix value.
Definition: CompressedMatrix.h:3083
decltype(auto) declupp(const DenseMatrix< MT, SO > &dm)
Declares the given dense matrix expression dm as upper.
Definition: DMatDeclUppExpr.h:1026
#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:560
const DenseIterator< Type, AF > operator-(const DenseIterator< Type, AF > &it, ptrdiff_t inc) noexcept
Subtraction between a DenseIterator and an integral value.
Definition: DenseIterator.h:733
BoolConstant< true > TrueType
Type traits base class.The TrueType class is used as base class for type traits and value traits that...
Definition: TrueType.h:61
Element * Iterator
Iterator over non-constant elements.
Definition: CompressedMatrix.h:3084
Header file for the extended initializer_list functionality.
Constraint on the data type.
BLAZE_ALWAYS_INLINE 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
BLAZE_ALWAYS_INLINE MT::ConstIterator cend(const Matrix< MT, SO > &matrix, size_t i)
Returns an iterator just past the last element of row/column i.
Definition: Matrix.h:474
BLAZE_ALWAYS_INLINE MT::ConstIterator cbegin(const Matrix< MT, SO > &matrix, size_t i)
Returns an iterator to the first element of row/column i.
Definition: Matrix.h:408
Constraint on the data type.
Constraint on the data type.
Constraint on the data type.
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:252
#define BLAZE_CONSTRAINT_MUST_BE_SQUARE_MATRIX_TYPE(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
Header file for the IsSquare type trait.
Constraint on the data type.
Header file for the implementation of a matrix representation of an initializer list.
Header file for the DisableIf class template.
Header file for the IsStrictlyUpper type trait.
MatrixAccessProxy< This > Reference
Reference to a non-constant matrix value.
Definition: CompressedMatrix.h:3082
Header file for the clear shim.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58
#define BLAZE_ALWAYS_INLINE
Platform dependent setup of an enforced inline keyword.
Definition: Inline.h:85
#define BLAZE_CONSTRAINT_MUST_BE_STATIC_TYPE(T)
Constraint on the data type.In case the given data type T is not a static data type, i.e. a vector or matrix with dimensions fixed at compile time, a compilation error is created.
Definition: Static.h:61
void swap(CompressedMatrix< Type, SO > &a, CompressedMatrix< Type, SO > &b) noexcept
Swapping the contents of two compressed matrices.
Definition: CompressedMatrix.h:5908
Compile time assertion.
bool isIntact(const CompressedMatrix< Type, SO > &m)
Returns whether the invariants of the given compressed matrix are intact.
Definition: CompressedMatrix.h:5891
SparseMatrix< This, true > BaseType
Base type of this CompressedMatrix instance.
Definition: CompressedMatrix.h:3075
#define BLAZE_CONSTRAINT_MUST_NOT_BE_POINTER_TYPE(T)
Constraint on the data type.In case the given data type T is not a pointer type, a compilation error ...
Definition: Pointer.h:79
Type ElementType
Type of the compressed matrix elements.
Definition: CompressedMatrix.h:3079
#define BLAZE_THROW_OUT_OF_RANGE(MESSAGE)
Macro for the emission of a std::out_of_range exception.This macro encapsulates the default way of Bl...
Definition: Exception.h:331
Header file for the DenseMatrix base class.
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
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:3085
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:506
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
Header file for the IsUniTriangular type trait.
Header file for the IsStrictlyTriangular type trait.
Constraints on the storage order of matrix types.
decltype(auto) elements(Vector< VT, TF > &vector, REAs... args)
Creating a view on a selection of elements of the given vector.
Definition: Elements.h:134
Header file for the exception macros of the math module.
#define BLAZE_CONSTRAINT_MUST_NOT_BE_UPPER_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is a upper triangular matrix type...
Definition: Upper.h:81
BLAZE_ALWAYS_INLINE void resize(Matrix< MT, SO > &matrix, size_t rows, size_t columns, bool preserve=true)
Changing the size of the matrix.
Definition: Matrix.h:714
BLAZE_ALWAYS_INLINE MT::Iterator end(Matrix< MT, SO > &matrix, size_t i)
Returns an iterator just past the last element of row/column i.
Definition: Matrix.h:430
decltype(auto) operator*(const DenseMatrix< MT1, false > &lhs, const DenseMatrix< MT2, false > &rhs)
Multiplication operator for the multiplication of two row-major dense matrices ( ).
Definition: DMatDMatMultExpr.h:8893
constexpr bool operator!=(const NegativeAccuracy< A > &lhs, const T &rhs)
Inequality comparison between a NegativeAccuracy object and a floating point value.
Definition: Accuracy.h:290
decltype(auto) submatrix(Matrix< MT, SO > &, RSAs...)
Creating a view on a specific submatrix of the given matrix.
Definition: Submatrix.h:360
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:608
Header file for the isOne shim.
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:1641
BLAZE_ALWAYS_INLINE T1 & operator+=(SIMDPack< T1 > &lhs, const SIMDPack< T2 > &rhs)
Addition assignment operator for the addition of two SIMD packs.
Definition: BasicTypes.h:1357
Header file for run time assertion macros.
Constraint on the data type.
Constraint on the data type.
Constraint on the data type.
decltype(auto) row(Matrix< MT, SO > &, RRAs...)
Creating a view on a specific row of the given matrix.
Definition: Row.h:131
#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_RESIZABLE_TYPE(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
#define BLAZE_CONSTRAINT_MUST_NOT_BE_REFERENCE_TYPE(T)
Constraint on the data type.In case the given data type T is not a reference type, a compilation error is created.
Definition: Reference.h:79
bool isOne(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is 1.
Definition: DiagonalProxy.h:690
Header file for the isDefault shim.
void swap(DiagonalMatrix< MT, SO, DF > &a, DiagonalMatrix< MT, SO, DF > &b) noexcept
Swapping the contents of two matrices.
Definition: DiagonalMatrix.h:272
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
typename EnableIf< Condition, T >::Type EnableIf_
Auxiliary alias declaration for the EnableIf class template.The EnableIf_ alias declaration provides ...
Definition: EnableIf.h:224
BLAZE_ALWAYS_INLINE size_t rows(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of rows of the matrix.
Definition: Matrix.h:490
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:3080
BLAZE_ALWAYS_INLINE MT::ElementType * data(DenseMatrix< MT, SO > &dm) noexcept
Low-level data access to the dense matrix elements.
Definition: DenseMatrix.h:169
#define BLAZE_CONSTRAINT_MUST_BE_RESIZABLE_TYPE(T)
Constraint on the data type.In case the given data type T is not resizable, i.e. does not have a &#39;res...
Definition: Resizable.h:61
Header file for the IsComputation type trait class.
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:3081
#define BLAZE_CONSTRAINT_MUST_NOT_BE_EXPRESSION_TYPE(T)
Constraint on the data type.In case the given data type T is an expression (i.e. a type derived from ...
Definition: Expression.h:81
bool isUniUpper(const DenseMatrix< MT, SO > &dm)
Checks if the given dense matrix is an upper unitriangular matrix.
Definition: DenseMatrix.h:1554
bool isIntact(const DiagonalMatrix< MT, SO, DF > &m)
Returns whether the invariants of the given diagonal matrix are intact.
Definition: DiagonalMatrix.h:254
#define BLAZE_CONSTRAINT_MUST_NOT_BE_HERMITIAN_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is an Hermitian matrix type, a compilation error is created.
Definition: Hermitian.h:79
BLAZE_ALWAYS_INLINE T1 & operator-=(SIMDPack< T1 > &lhs, const SIMDPack< T2 > &rhs)
Subtraction assignment operator for the subtraction of two SIMD packs.
Definition: BasicTypes.h:1375
void UNUSED_PARAMETER(const Args &...)
Suppression of unused parameter warnings.
Definition: Unused.h:81
#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
BLAZE_ALWAYS_INLINE bool isSquare(const Matrix< MT, SO > &matrix) noexcept
Checks if the given matrix is a square matrix.
Definition: Matrix.h:908
Header file for the IsResizable type trait.
System settings for the inline keywords.
Header file for the Size type trait.
#define BLAZE_INTERNAL_ASSERT(expr, msg)
Run time assertion macro for internal checks.In case of an invalid run time expression, the program execution is terminated. The BLAZE_INTERNAL_ASSERT macro can be disabled by setting the BLAZE_USER_ASSERTION flag to zero or by defining NDEBUG during the compilation.
Definition: Assert.h:101
Header file for the implementation of the base template of the UniUpperMatrix.
Header file for the TrueType type/value trait base class.