Blaze  3.6
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>
64 #include <blaze/math/Exception.h>
67 #include <blaze/math/shims/Clear.h>
69 #include <blaze/math/shims/IsOne.h>
80 #include <blaze/system/Inline.h>
81 #include <blaze/util/Assert.h>
88 #include <blaze/util/DisableIf.h>
89 #include <blaze/util/EnableIf.h>
91 #include <blaze/util/MaybeUnused.h>
93 #include <blaze/util/Types.h>
94 
95 
96 namespace blaze {
97 
98 //=================================================================================================
99 //
100 // CLASS TEMPLATE SPECIALIZATION FOR DENSE MATRICES
101 //
102 //=================================================================================================
103 
104 //*************************************************************************************************
112 template< typename MT // Type of the adapted dense matrix
113  , bool SO > // Storage order of the adapted dense matrix
114 class UniUpperMatrix<MT,SO,true>
115  : public DenseMatrix< UniUpperMatrix<MT,SO,true>, SO >
116 {
117  private:
118  //**Type definitions****************************************************************************
119  using OT = OppositeType_t<MT>;
120  using TT = TransposeType_t<MT>;
121  using ET = ElementType_t<MT>;
122  //**********************************************************************************************
123 
124  public:
125  //**Type definitions****************************************************************************
126  using This = UniUpperMatrix<MT,SO,true>;
127  using BaseType = DenseMatrix<This,SO>;
128  using ResultType = This;
129  using OppositeType = UniUpperMatrix<OT,!SO,true>;
130  using TransposeType = UniLowerMatrix<TT,!SO,true>;
131  using ElementType = ET;
132  using SIMDType = SIMDType_t<MT>;
133  using ReturnType = ReturnType_t<MT>;
134  using CompositeType = const This&;
135  using Reference = UniUpperProxy<MT>;
136  using ConstReference = ConstReference_t<MT>;
137  using Pointer = Pointer_t<MT>;
138  using ConstPointer = ConstPointer_t<MT>;
139  using ConstIterator = ConstIterator_t<MT>;
140  //**********************************************************************************************
141 
142  //**Rebind struct definition********************************************************************
145  template< typename NewType > // Data type of the other matrix
146  struct Rebind {
148  using Other = UniUpperMatrix< typename MT::template Rebind<NewType>::Other >;
149  };
150  //**********************************************************************************************
151 
152  //**Resize struct definition********************************************************************
155  template< size_t NewM // Number of rows of the other matrix
156  , size_t NewN > // Number of columns of the other matrix
157  struct Resize {
159  using Other = UniUpperMatrix< typename MT::template Resize<NewM,NewN>::Other >;
160  };
161  //**********************************************************************************************
162 
163  //**Iterator class definition*******************************************************************
166  class Iterator
167  {
168  public:
169  //**Type definitions*************************************************************************
170  using IteratorCategory = std::random_access_iterator_tag;
171  using ValueType = ElementType_t<MT>;
172  using PointerType = UniUpperProxy<MT>;
173  using ReferenceType = UniUpperProxy<MT>;
174  using DifferenceType = ptrdiff_t;
175 
176  // STL iterator requirements
177  using iterator_category = IteratorCategory;
178  using value_type = ValueType;
179  using pointer = PointerType;
180  using reference = ReferenceType;
181  using difference_type = DifferenceType;
182  //*******************************************************************************************
183 
184  //**Constructor******************************************************************************
187  inline Iterator() noexcept
188  : matrix_( nullptr ) // Reference to the adapted dense matrix
189  , row_ ( 0UL ) // The current row index of the iterator
190  , column_( 0UL ) // The current column index of the iterator
191  {}
192  //*******************************************************************************************
193 
194  //**Constructor******************************************************************************
201  inline Iterator( MT& matrix, size_t row, size_t column ) noexcept
202  : matrix_( &matrix ) // Reference to the adapted dense matrix
203  , row_ ( row ) // The current row-index of the iterator
204  , column_( column ) // The current column-index of the iterator
205  {}
206  //*******************************************************************************************
207 
208  //**Addition assignment operator*************************************************************
214  inline Iterator& operator+=( size_t inc ) noexcept {
215  ( SO )?( row_ += inc ):( column_ += inc );
216  return *this;
217  }
218  //*******************************************************************************************
219 
220  //**Subtraction assignment operator**********************************************************
226  inline Iterator& operator-=( size_t dec ) noexcept {
227  ( SO )?( row_ -= dec ):( column_ -= dec );
228  return *this;
229  }
230  //*******************************************************************************************
231 
232  //**Prefix increment operator****************************************************************
237  inline Iterator& operator++() noexcept {
238  ( SO )?( ++row_ ):( ++column_ );
239  return *this;
240  }
241  //*******************************************************************************************
242 
243  //**Postfix increment operator***************************************************************
248  inline const Iterator operator++( int ) noexcept {
249  const Iterator tmp( *this );
250  ++(*this);
251  return tmp;
252  }
253  //*******************************************************************************************
254 
255  //**Prefix decrement operator****************************************************************
260  inline Iterator& operator--() noexcept {
261  ( SO )?( --row_ ):( --column_ );
262  return *this;
263  }
264  //*******************************************************************************************
265 
266  //**Postfix decrement operator***************************************************************
271  inline const Iterator operator--( int ) {
272  const Iterator tmp( *this );
273  --(*this);
274  return tmp;
275  }
276  //*******************************************************************************************
277 
278  //**Element access operator******************************************************************
283  inline ReferenceType operator*() const {
284  return ReferenceType( *matrix_, row_, column_ );
285  }
286  //*******************************************************************************************
287 
288  //**Element access operator******************************************************************
293  inline PointerType operator->() const {
294  return PointerType( *matrix_, row_, column_ );
295  }
296  //*******************************************************************************************
297 
298  //**Load function****************************************************************************
308  inline SIMDType load() const {
309  return (*matrix_).load(row_,column_);
310  }
311  //*******************************************************************************************
312 
313  //**Loada function***************************************************************************
323  inline SIMDType loada() const {
324  return (*matrix_).loada(row_,column_);
325  }
326  //*******************************************************************************************
327 
328  //**Loadu function***************************************************************************
338  inline SIMDType loadu() const {
339  return (*matrix_).loadu(row_,column_);
340  }
341  //*******************************************************************************************
342 
343  //**Conversion operator**********************************************************************
348  inline operator ConstIterator() const {
349  if( SO )
350  return matrix_->begin( column_ ) + row_;
351  else
352  return matrix_->begin( row_ ) + column_;
353  }
354  //*******************************************************************************************
355 
356  //**Equality operator************************************************************************
363  friend inline bool operator==( const Iterator& lhs, const Iterator& rhs ) noexcept {
364  return ( SO )?( lhs.row_ == rhs.row_ ):( lhs.column_ == rhs.column_ );
365  }
366  //*******************************************************************************************
367 
368  //**Equality operator************************************************************************
375  friend inline bool operator==( const Iterator& lhs, const ConstIterator& rhs ) {
376  return ( ConstIterator( lhs ) == rhs );
377  }
378  //*******************************************************************************************
379 
380  //**Equality operator************************************************************************
387  friend inline bool operator==( const ConstIterator& lhs, const Iterator& rhs ) {
388  return ( lhs == ConstIterator( rhs ) );
389  }
390  //*******************************************************************************************
391 
392  //**Inequality operator**********************************************************************
399  friend inline bool operator!=( const Iterator& lhs, const Iterator& rhs ) noexcept {
400  return ( SO )?( lhs.row_ != rhs.row_ ):( lhs.column_ != rhs.column_ );
401  }
402  //*******************************************************************************************
403 
404  //**Inequality operator**********************************************************************
411  friend inline bool operator!=( const Iterator& lhs, const ConstIterator& rhs ) {
412  return ( ConstIterator( lhs ) != rhs );
413  }
414  //*******************************************************************************************
415 
416  //**Inequality operator**********************************************************************
423  friend inline bool operator!=( const ConstIterator& lhs, const Iterator& rhs ) {
424  return ( lhs != ConstIterator( rhs ) );
425  }
426  //*******************************************************************************************
427 
428  //**Less-than operator***********************************************************************
435  friend inline bool operator<( const Iterator& lhs, const Iterator& rhs ) noexcept {
436  return ( SO )?( lhs.row_ < rhs.row_ ):( lhs.column_ < rhs.column_ );
437  }
438  //*******************************************************************************************
439 
440  //**Less-than operator***********************************************************************
447  friend inline bool operator<( const Iterator& lhs, const ConstIterator& rhs ) {
448  return ( ConstIterator( lhs ) < rhs );
449  }
450  //*******************************************************************************************
451 
452  //**Less-than operator***********************************************************************
459  friend inline bool operator<( const ConstIterator& lhs, const Iterator& rhs ) {
460  return ( lhs < ConstIterator( rhs ) );
461  }
462  //*******************************************************************************************
463 
464  //**Greater-than operator********************************************************************
471  friend inline bool operator>( const Iterator& lhs, const Iterator& rhs ) noexcept {
472  return ( SO )?( lhs.row_ > rhs.row_ ):( lhs.column_ > rhs.column_ );
473  }
474  //*******************************************************************************************
475 
476  //**Greater-than operator********************************************************************
483  friend inline bool operator>( const Iterator& lhs, const ConstIterator& rhs ) {
484  return ( ConstIterator( lhs ) > rhs );
485  }
486  //*******************************************************************************************
487 
488  //**Greater-than operator********************************************************************
495  friend inline bool operator>( const ConstIterator& lhs, const Iterator& rhs ) {
496  return ( lhs > ConstIterator( rhs ) );
497  }
498  //*******************************************************************************************
499 
500  //**Less-or-equal-than operator**************************************************************
507  friend inline bool operator<=( const Iterator& lhs, const Iterator& rhs ) noexcept {
508  return ( SO )?( lhs.row_ <= rhs.row_ ):( lhs.column_ <= rhs.column_ );
509  }
510  //*******************************************************************************************
511 
512  //**Less-or-equal-than operator**************************************************************
519  friend inline bool operator<=( const Iterator& lhs, const ConstIterator& rhs ) {
520  return ( ConstIterator( lhs ) <= rhs );
521  }
522  //*******************************************************************************************
523 
524  //**Less-or-equal-than operator**************************************************************
531  friend inline bool operator<=( const ConstIterator& lhs, const Iterator& rhs ) {
532  return ( lhs <= ConstIterator( rhs ) );
533  }
534  //*******************************************************************************************
535 
536  //**Greater-or-equal-than operator***********************************************************
543  friend inline bool operator>=( const Iterator& lhs, const Iterator& rhs ) noexcept {
544  return ( SO )?( lhs.row_ >= rhs.row_ ):( lhs.column_ >= rhs.column_ );
545  }
546  //*******************************************************************************************
547 
548  //**Greater-or-equal-than operator***********************************************************
555  friend inline bool operator>=( const Iterator& lhs, const ConstIterator& rhs ) {
556  return ( ConstIterator( lhs ) >= rhs );
557  }
558  //*******************************************************************************************
559 
560  //**Greater-or-equal-than operator***********************************************************
567  friend inline bool operator>=( const ConstIterator& lhs, const Iterator& rhs ) {
568  return ( lhs >= ConstIterator( rhs ) );
569  }
570  //*******************************************************************************************
571 
572  //**Subtraction operator*********************************************************************
578  inline DifferenceType operator-( const Iterator& rhs ) const noexcept {
579  return ( SO )?( row_ - rhs.row_ ):( column_ - rhs.column_ );
580  }
581  //*******************************************************************************************
582 
583  //**Addition operator************************************************************************
590  friend inline const Iterator operator+( const Iterator& it, size_t inc ) noexcept {
591  if( SO )
592  return Iterator( *it.matrix_, it.row_ + inc, it.column_ );
593  else
594  return Iterator( *it.matrix_, it.row_, it.column_ + inc );
595  }
596  //*******************************************************************************************
597 
598  //**Addition operator************************************************************************
605  friend inline const Iterator operator+( size_t inc, const Iterator& it ) noexcept {
606  if( SO )
607  return Iterator( *it.matrix_, it.row_ + inc, it.column_ );
608  else
609  return Iterator( *it.matrix_, it.row_, it.column_ + inc );
610  }
611  //*******************************************************************************************
612 
613  //**Subtraction operator*********************************************************************
620  friend inline const Iterator operator-( const Iterator& it, size_t dec ) noexcept {
621  if( SO )
622  return Iterator( *it.matrix_, it.row_ - dec, it.column_ );
623  else
624  return Iterator( *it.matrix_, it.row_, it.column_ - dec );
625  }
626  //*******************************************************************************************
627 
628  private:
629  //**Member variables*************************************************************************
630  MT* matrix_;
631  size_t row_;
632  size_t column_;
633  //*******************************************************************************************
634  };
635  //**********************************************************************************************
636 
637  //**Compilation flags***************************************************************************
639  static constexpr bool simdEnabled = MT::simdEnabled;
640 
642  static constexpr bool smpAssignable = MT::smpAssignable;
643  //**********************************************************************************************
644 
645  //**Constructors********************************************************************************
648  explicit inline UniUpperMatrix();
649  template< typename A1 > explicit inline UniUpperMatrix( const A1& a1 );
650  explicit inline UniUpperMatrix( size_t n, const ElementType& init );
651 
652  inline UniUpperMatrix( initializer_list< initializer_list<ElementType> > list );
653 
654  template< typename Other >
655  explicit inline UniUpperMatrix( size_t n, const Other* array );
656 
657  template< typename Other, size_t N >
658  explicit inline UniUpperMatrix( const Other (&array)[N][N] );
659 
660  explicit inline UniUpperMatrix( ElementType* ptr, size_t n );
661  explicit inline UniUpperMatrix( ElementType* ptr, size_t n, size_t nn );
662 
663  inline UniUpperMatrix( const UniUpperMatrix& m );
664  inline UniUpperMatrix( UniUpperMatrix&& m ) noexcept;
666  //**********************************************************************************************
667 
668  //**Destructor**********************************************************************************
671  ~UniUpperMatrix() = default;
673  //**********************************************************************************************
674 
675  //**Data access functions***********************************************************************
678  inline Reference operator()( size_t i, size_t j );
679  inline ConstReference operator()( size_t i, size_t j ) const;
680  inline Reference at( size_t i, size_t j );
681  inline ConstReference at( size_t i, size_t j ) const;
682  inline ConstPointer data () const noexcept;
683  inline ConstPointer data ( size_t i ) const noexcept;
684  inline Iterator begin ( size_t i );
685  inline ConstIterator begin ( size_t i ) const;
686  inline ConstIterator cbegin( size_t i ) const;
687  inline Iterator end ( size_t i );
688  inline ConstIterator end ( size_t i ) const;
689  inline ConstIterator cend ( size_t i ) const;
691  //**********************************************************************************************
692 
693  //**Assignment operators************************************************************************
696  inline UniUpperMatrix& operator=( const ElementType& rhs );
697  inline UniUpperMatrix& operator=( initializer_list< initializer_list<ElementType> > list );
698 
699  template< typename Other, size_t N >
700  inline UniUpperMatrix& operator=( const Other (&array)[N][N] );
701 
702  inline UniUpperMatrix& operator=( const UniUpperMatrix& rhs );
703  inline UniUpperMatrix& operator=( UniUpperMatrix&& rhs ) noexcept;
704 
705  template< typename MT2, bool SO2 >
706  inline auto operator=( const Matrix<MT2,SO2>& rhs )
707  -> DisableIf_t< IsComputation_v<MT2>, UniUpperMatrix& >;
708 
709  template< typename MT2, bool SO2 >
710  inline auto operator=( const Matrix<MT2,SO2>& rhs )
711  -> EnableIf_t< IsComputation_v<MT2>, UniUpperMatrix& >;
712 
713  template< typename MT2, bool SO2 >
714  inline auto operator+=( const Matrix<MT2,SO2>& rhs )
715  -> DisableIf_t< IsComputation_v<MT2>, UniUpperMatrix& >;
716 
717  template< typename MT2, bool SO2 >
718  inline auto operator+=( const Matrix<MT2,SO2>& rhs )
719  -> EnableIf_t< IsComputation_v<MT2>, UniUpperMatrix& >;
720 
721  template< typename MT2, bool SO2 >
722  inline auto operator-=( const Matrix<MT2,SO2>& rhs )
723  -> DisableIf_t< IsComputation_v<MT2>, UniUpperMatrix& >;
724 
725  template< typename MT2, bool SO2 >
726  inline auto operator-=( const Matrix<MT2,SO2>& rhs )
727  -> EnableIf_t< IsComputation_v<MT2>, UniUpperMatrix& >;
728 
729  template< typename MT2, bool SO2 >
730  inline auto operator%=( const Matrix<MT2,SO2>& rhs ) -> UniUpperMatrix&;
732  //**********************************************************************************************
733 
734  //**Utility functions***************************************************************************
737  inline size_t rows() const noexcept;
738  inline size_t columns() const noexcept;
739  inline size_t spacing() const noexcept;
740  inline size_t capacity() const noexcept;
741  inline size_t capacity( size_t i ) const noexcept;
742  inline size_t nonZeros() const;
743  inline size_t nonZeros( size_t i ) const;
744  inline void reset();
745  inline void reset( size_t i );
746  inline void clear();
747  void resize ( size_t n, bool preserve=true );
748  inline void extend ( size_t n, bool preserve=true );
749  inline void reserve( size_t elements );
750  inline void shrinkToFit();
751  inline void swap( UniUpperMatrix& m ) noexcept;
752 
753  static inline constexpr size_t maxNonZeros() noexcept;
754  static inline constexpr size_t maxNonZeros( size_t n ) noexcept;
756  //**********************************************************************************************
757 
758  //**Debugging functions*************************************************************************
761  inline bool isIntact() const noexcept;
763  //**********************************************************************************************
764 
765  //**Expression template evaluation functions****************************************************
768  template< typename Other > inline bool canAlias ( const Other* alias ) const noexcept;
769  template< typename Other > inline bool isAliased( const Other* alias ) const noexcept;
770 
771  inline bool isAligned () const noexcept;
772  inline bool canSMPAssign() const noexcept;
773 
774  BLAZE_ALWAYS_INLINE SIMDType load ( size_t i, size_t j ) const noexcept;
775  BLAZE_ALWAYS_INLINE SIMDType loada( size_t i, size_t j ) const noexcept;
776  BLAZE_ALWAYS_INLINE SIMDType loadu( size_t i, size_t j ) const noexcept;
778  //**********************************************************************************************
779 
780  private:
781  //**Construction functions**********************************************************************
784  inline const MT construct( size_t n , TrueType );
785  inline const MT construct( const ElementType& value, FalseType );
786 
787  template< typename MT2, bool SO2, typename T >
788  inline const MT construct( const Matrix<MT2,SO2>& m, T );
790  //**********************************************************************************************
791 
792  //**Member variables****************************************************************************
795  MT matrix_;
796 
797  //**********************************************************************************************
798 
799  //**Friend declarations*************************************************************************
800  template< typename MT2, bool SO2, bool DF2 >
801  friend MT2& derestrict( UniUpperMatrix<MT2,SO2,DF2>& m );
802  //**********************************************************************************************
803 
804  //**Compile time checks*************************************************************************
821  BLAZE_STATIC_ASSERT( ( Size_v<MT,0UL> == Size_v<MT,1UL> ) );
822  //**********************************************************************************************
823 };
825 //*************************************************************************************************
826 
827 
828 
829 
830 //=================================================================================================
831 //
832 // CONSTRUCTORS
833 //
834 //=================================================================================================
835 
836 //*************************************************************************************************
840 template< typename MT // Type of the adapted dense matrix
841  , bool SO > // Storage order of the adapted dense matrix
842 inline UniUpperMatrix<MT,SO,true>::UniUpperMatrix()
843  : matrix_() // The adapted dense matrix
844 {
845  for( size_t i=0UL; i<rows(); ++i )
846  matrix_(i,i) = ElementType(1);
847 
848  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square uniupper matrix detected" );
849  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
850 }
852 //*************************************************************************************************
853 
854 
855 //*************************************************************************************************
873 template< typename MT // Type of the adapted dense matrix
874  , bool SO > // Storage order of the adapted dense matrix
875 template< typename A1 > // Type of the constructor argument
876 inline UniUpperMatrix<MT,SO,true>::UniUpperMatrix( const A1& a1 )
877  : matrix_( construct( a1, typename IsResizable<MT>::Type() ) ) // The adapted dense matrix
878 {
879  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square uniupper matrix detected" );
880  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
881 }
883 //*************************************************************************************************
884 
885 
886 //*************************************************************************************************
893 template< typename MT // Type of the adapted dense matrix
894  , bool SO > // Storage order of the adapted dense matrix
895 inline UniUpperMatrix<MT,SO,true>::UniUpperMatrix( size_t n, const ElementType& init )
896  : matrix_( n, n, ElementType() ) // The adapted dense matrix
897 {
899 
900  if( SO ) {
901  for( size_t j=0UL; j<columns(); ++j ) {
902  for( size_t i=0UL; i<j; ++i )
903  matrix_(i,j) = init;
904  matrix_(j,j) = ElementType(1);
905  }
906  }
907  else {
908  for( size_t i=0UL; i<rows(); ++i ) {
909  matrix_(i,i) = ElementType(1);
910  for( size_t j=i+1UL; j<columns(); ++j )
911  matrix_(i,j) = init;
912  }
913  }
914 
915  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square uniupper matrix detected" );
916  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
917 }
919 //*************************************************************************************************
920 
921 
922 //*************************************************************************************************
946 template< typename MT // Type of the adapted dense matrix
947  , bool SO > // Storage order of the adapted dense matrix
948 inline UniUpperMatrix<MT,SO,true>::UniUpperMatrix( initializer_list< initializer_list<ElementType> > list )
949  : matrix_( list ) // The adapted dense matrix
950 {
951  if( !isUniUpper( matrix_ ) ) {
952  BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of uniupper matrix" );
953  }
954 
955  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
956 }
958 //*************************************************************************************************
959 
960 
961 //*************************************************************************************************
987 template< typename MT // Type of the adapted dense matrix
988  , bool SO > // Storage order of the adapted dense matrix
989 template< typename Other > // Data type of the initialization array
990 inline UniUpperMatrix<MT,SO,true>::UniUpperMatrix( size_t n, const Other* array )
991  : matrix_( n, n, array ) // The adapted dense matrix
992 {
993  if( !isUniUpper( matrix_ ) ) {
994  BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of uniupper matrix" );
995  }
996 
997  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
998 }
1000 //*************************************************************************************************
1001 
1002 
1003 //*************************************************************************************************
1026 template< typename MT // Type of the adapted dense matrix
1027  , bool SO > // Storage order of the adapted dense matrix
1028 template< typename Other // Data type of the initialization array
1029  , size_t N > // Number of rows and columns of the initialization array
1030 inline UniUpperMatrix<MT,SO,true>::UniUpperMatrix( const Other (&array)[N][N] )
1031  : matrix_( array ) // The adapted dense matrix
1032 {
1033  if( !isUniUpper( matrix_ ) ) {
1034  BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of uniupper matrix" );
1035  }
1036 
1037  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1038 }
1040 //*************************************************************************************************
1041 
1042 
1043 //*************************************************************************************************
1078 template< typename MT // Type of the adapted dense matrix
1079  , bool SO > // Storage order of the adapted dense matrix
1080 inline UniUpperMatrix<MT,SO,true>::UniUpperMatrix( ElementType* ptr, size_t n )
1081  : matrix_( ptr, n, n ) // The adapted dense matrix
1082 {
1083  if( !isUniUpper( matrix_ ) ) {
1084  BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of uniupper matrix" );
1085  }
1086 
1087  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1088 }
1090 //*************************************************************************************************
1091 
1092 
1093 //*************************************************************************************************
1130 template< typename MT // Type of the adapted dense matrix
1131  , bool SO > // Storage order of the adapted dense matrix
1132 inline UniUpperMatrix<MT,SO,true>::UniUpperMatrix( ElementType* ptr, size_t n, size_t nn )
1133  : matrix_( ptr, n, n, nn ) // The adapted dense matrix
1134 {
1135  if( !isUniUpper( matrix_ ) ) {
1136  BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of uniupper matrix" );
1137  }
1138 
1139  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1140 }
1142 //*************************************************************************************************
1143 
1144 
1145 //*************************************************************************************************
1151 template< typename MT // Type of the adapted dense matrix
1152  , bool SO > // Storage order of the adapted dense matrix
1153 inline UniUpperMatrix<MT,SO,true>::UniUpperMatrix( const UniUpperMatrix& m )
1154  : matrix_( m.matrix_ ) // The adapted dense matrix
1155 {
1156  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square uniupper matrix detected" );
1157  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1158 }
1160 //*************************************************************************************************
1161 
1162 
1163 //*************************************************************************************************
1169 template< typename MT // Type of the adapted dense matrix
1170  , bool SO > // Storage order of the adapted dense matrix
1171 inline UniUpperMatrix<MT,SO,true>::UniUpperMatrix( UniUpperMatrix&& m ) noexcept
1172  : matrix_( std::move( m.matrix_ ) ) // The adapted dense matrix
1173 {
1174  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square uniupper matrix detected" );
1175  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1176 }
1178 //*************************************************************************************************
1179 
1180 
1181 
1182 
1183 //=================================================================================================
1184 //
1185 // DATA ACCESS FUNCTIONS
1186 //
1187 //=================================================================================================
1188 
1189 //*************************************************************************************************
1205 template< typename MT // Type of the adapted dense matrix
1206  , bool SO > // Storage order of the adapted dense matrix
1207 inline typename UniUpperMatrix<MT,SO,true>::Reference
1208  UniUpperMatrix<MT,SO,true>::operator()( size_t i, size_t j )
1209 {
1210  BLAZE_USER_ASSERT( i<rows() , "Invalid row access index" );
1211  BLAZE_USER_ASSERT( j<columns(), "Invalid column access index" );
1212 
1213  return Reference( matrix_, i, j );
1214 }
1216 //*************************************************************************************************
1217 
1218 
1219 //*************************************************************************************************
1235 template< typename MT // Type of the adapted dense matrix
1236  , bool SO > // Storage order of the adapted dense matrix
1237 inline typename UniUpperMatrix<MT,SO,true>::ConstReference
1238  UniUpperMatrix<MT,SO,true>::operator()( size_t i, size_t j ) const
1239 {
1240  BLAZE_USER_ASSERT( i<rows() , "Invalid row access index" );
1241  BLAZE_USER_ASSERT( j<columns(), "Invalid column access index" );
1242 
1243  return matrix_(i,j);
1244 }
1246 //*************************************************************************************************
1247 
1248 
1249 //*************************************************************************************************
1266 template< typename MT // Type of the adapted dense matrix
1267  , bool SO > // Storage order of the adapted dense matrix
1268 inline typename UniUpperMatrix<MT,SO,true>::Reference
1269  UniUpperMatrix<MT,SO,true>::at( size_t i, size_t j )
1270 {
1271  if( i >= rows() ) {
1272  BLAZE_THROW_OUT_OF_RANGE( "Invalid row access index" );
1273  }
1274  if( j >= columns() ) {
1275  BLAZE_THROW_OUT_OF_RANGE( "Invalid column access index" );
1276  }
1277  return (*this)(i,j);
1278 }
1280 //*************************************************************************************************
1281 
1282 
1283 //*************************************************************************************************
1300 template< typename MT // Type of the adapted dense matrix
1301  , bool SO > // Storage order of the adapted dense matrix
1302 inline typename UniUpperMatrix<MT,SO,true>::ConstReference
1303  UniUpperMatrix<MT,SO,true>::at( size_t i, size_t j ) const
1304 {
1305  if( i >= rows() ) {
1306  BLAZE_THROW_OUT_OF_RANGE( "Invalid row access index" );
1307  }
1308  if( j >= columns() ) {
1309  BLAZE_THROW_OUT_OF_RANGE( "Invalid column access index" );
1310  }
1311  return (*this)(i,j);
1312 }
1314 //*************************************************************************************************
1315 
1316 
1317 //*************************************************************************************************
1330 template< typename MT // Type of the adapted dense matrix
1331  , bool SO > // Storage order of the adapted dense matrix
1332 inline typename UniUpperMatrix<MT,SO,true>::ConstPointer
1333  UniUpperMatrix<MT,SO,true>::data() const noexcept
1334 {
1335  return matrix_.data();
1336 }
1338 //*************************************************************************************************
1339 
1340 
1341 //*************************************************************************************************
1350 template< typename MT // Type of the adapted dense matrix
1351  , bool SO > // Storage order of the adapted dense matrix
1352 inline typename UniUpperMatrix<MT,SO,true>::ConstPointer
1353  UniUpperMatrix<MT,SO,true>::data( size_t i ) const noexcept
1354 {
1355  return matrix_.data(i);
1356 }
1358 //*************************************************************************************************
1359 
1360 
1361 //*************************************************************************************************
1373 template< typename MT // Type of the adapted dense matrix
1374  , bool SO > // Storage order of the adapted dense matrix
1375 inline typename UniUpperMatrix<MT,SO,true>::Iterator
1377 {
1378  if( SO )
1379  return Iterator( matrix_, 0UL, i );
1380  else
1381  return Iterator( matrix_, i, 0UL );
1382 }
1384 //*************************************************************************************************
1385 
1386 
1387 //*************************************************************************************************
1399 template< typename MT // Type of the adapted dense matrix
1400  , bool SO > // Storage order of the adapted dense matrix
1401 inline typename UniUpperMatrix<MT,SO,true>::ConstIterator
1402  UniUpperMatrix<MT,SO,true>::begin( size_t i ) const
1403 {
1404  return matrix_.begin(i);
1405 }
1407 //*************************************************************************************************
1408 
1409 
1410 //*************************************************************************************************
1422 template< typename MT // Type of the adapted dense matrix
1423  , bool SO > // Storage order of the adapted dense matrix
1424 inline typename UniUpperMatrix<MT,SO,true>::ConstIterator
1425  UniUpperMatrix<MT,SO,true>::cbegin( size_t i ) const
1426 {
1427  return matrix_.cbegin(i);
1428 }
1430 //*************************************************************************************************
1431 
1432 
1433 //*************************************************************************************************
1445 template< typename MT // Type of the adapted dense matrix
1446  , bool SO > // Storage order of the adapted dense matrix
1447 inline typename UniUpperMatrix<MT,SO,true>::Iterator
1449 {
1450  if( SO )
1451  return Iterator( matrix_, rows(), i );
1452  else
1453  return Iterator( matrix_, i, columns() );
1454 }
1456 //*************************************************************************************************
1457 
1458 
1459 //*************************************************************************************************
1471 template< typename MT // Type of the adapted dense matrix
1472  , bool SO > // Storage order of the adapted dense matrix
1473 inline typename UniUpperMatrix<MT,SO,true>::ConstIterator
1474  UniUpperMatrix<MT,SO,true>::end( size_t i ) const
1475 {
1476  return matrix_.end(i);
1477 }
1479 //*************************************************************************************************
1480 
1481 
1482 //*************************************************************************************************
1494 template< typename MT // Type of the adapted dense matrix
1495  , bool SO > // Storage order of the adapted dense matrix
1496 inline typename UniUpperMatrix<MT,SO,true>::ConstIterator
1497  UniUpperMatrix<MT,SO,true>::cend( size_t i ) const
1498 {
1499  return matrix_.cend(i);
1500 }
1502 //*************************************************************************************************
1503 
1504 
1505 
1506 
1507 //=================================================================================================
1508 //
1509 // ASSIGNMENT OPERATORS
1510 //
1511 //=================================================================================================
1512 
1513 //*************************************************************************************************
1520 template< typename MT // Type of the adapted dense matrix
1521  , bool SO > // Storage order of the adapted dense matrix
1522 inline UniUpperMatrix<MT,SO,true>&
1523  UniUpperMatrix<MT,SO,true>::operator=( const ElementType& rhs )
1524 {
1525  if( SO ) {
1526  for( size_t j=1UL; j<columns(); ++j )
1527  for( size_t i=0UL; i<j; ++i )
1528  matrix_(i,j) = rhs;
1529  }
1530  else {
1531  for( size_t i=0UL; i<rows(); ++i )
1532  for( size_t j=i+1UL; j<columns(); ++j )
1533  matrix_(i,j) = rhs;
1534  }
1535 
1536  return *this;
1537 }
1539 //*************************************************************************************************
1540 
1541 
1542 //*************************************************************************************************
1567 template< typename MT // Type of the adapted dense matrix
1568  , bool SO > // Storage order of the adapted dense matrix
1569 inline UniUpperMatrix<MT,SO,true>&
1570  UniUpperMatrix<MT,SO,true>::operator=( initializer_list< initializer_list<ElementType> > list )
1571 {
1572  const InitializerMatrix<ElementType> tmp( list, list.size() );
1573 
1574  if( !isUniUpper( tmp ) ) {
1575  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to uniupper matrix" );
1576  }
1577 
1578  matrix_ = list;
1579 
1580  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square uniupper matrix detected" );
1581  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1582 
1583  return *this;
1584 }
1586 //*************************************************************************************************
1587 
1588 
1589 //*************************************************************************************************
1613 template< typename MT // Type of the adapted dense matrix
1614  , bool SO > // Storage order of the adapted dense matrix
1615 template< typename Other // Data type of the initialization array
1616  , size_t N > // Number of rows and columns of the initialization array
1617 inline UniUpperMatrix<MT,SO,true>&
1618  UniUpperMatrix<MT,SO,true>::operator=( const Other (&array)[N][N] )
1619 {
1620  MT tmp( array );
1621 
1622  if( !isUniUpper( tmp ) ) {
1623  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to uniupper matrix" );
1624  }
1625 
1626  matrix_ = std::move( tmp );
1627 
1628  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square uniupper matrix detected" );
1629  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1630 
1631  return *this;
1632 }
1634 //*************************************************************************************************
1635 
1636 
1637 //*************************************************************************************************
1647 template< typename MT // Type of the adapted dense matrix
1648  , bool SO > // Storage order of the adapted dense matrix
1649 inline UniUpperMatrix<MT,SO,true>&
1650  UniUpperMatrix<MT,SO,true>::operator=( const UniUpperMatrix& rhs )
1651 {
1652  matrix_ = rhs.matrix_;
1653 
1654  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square uniupper matrix detected" );
1655  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1656 
1657  return *this;
1658 }
1660 //*************************************************************************************************
1661 
1662 
1663 //*************************************************************************************************
1670 template< typename MT // Type of the adapted dense matrix
1671  , bool SO > // Storage order of the adapted dense matrix
1672 inline UniUpperMatrix<MT,SO,true>&
1673  UniUpperMatrix<MT,SO,true>::operator=( UniUpperMatrix&& rhs ) noexcept
1674 {
1675  matrix_ = std::move( rhs.matrix_ );
1676 
1677  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square uniupper matrix detected" );
1678  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1679 
1680  return *this;
1681 }
1683 //*************************************************************************************************
1684 
1685 
1686 //*************************************************************************************************
1699 template< typename MT // Type of the adapted dense matrix
1700  , bool SO > // Storage order of the adapted dense matrix
1701 template< typename MT2 // Type of the right-hand side matrix
1702  , bool SO2 > // Storage order of the right-hand side matrix
1703 inline auto UniUpperMatrix<MT,SO,true>::operator=( const Matrix<MT2,SO2>& rhs )
1704  -> DisableIf_t< IsComputation_v<MT2>, UniUpperMatrix& >
1705 {
1706  if( IsStrictlyTriangular_v<MT2> || ( !IsUniUpper_v<MT2> && !isUniUpper( ~rhs ) ) ) {
1707  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to uniupper matrix" );
1708  }
1709 
1710  matrix_ = declupp( ~rhs );
1711 
1712  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square uniupper matrix detected" );
1713  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1714 
1715  return *this;
1716 }
1718 //*************************************************************************************************
1719 
1720 
1721 //*************************************************************************************************
1734 template< typename MT // Type of the adapted dense matrix
1735  , bool SO > // Storage order of the adapted dense matrix
1736 template< typename MT2 // Type of the right-hand side matrix
1737  , bool SO2 > // Storage order of the right-hand side matrix
1738 inline auto UniUpperMatrix<MT,SO,true>::operator=( const Matrix<MT2,SO2>& rhs )
1739  -> EnableIf_t< IsComputation_v<MT2>, UniUpperMatrix& >
1740 {
1741  if( IsStrictlyTriangular_v<MT2> || ( !IsSquare_v<MT2> && !isSquare( ~rhs ) ) ) {
1742  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to uniupper matrix" );
1743  }
1744 
1745  if( IsUniUpper_v<MT2> ) {
1746  matrix_ = ~rhs;
1747  }
1748  else {
1749  MT tmp( ~rhs );
1750 
1751  if( !isUniUpper( tmp ) ) {
1752  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to uniupper matrix" );
1753  }
1754 
1755  matrix_ = std::move( tmp );
1756  }
1757 
1758  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square uniupper matrix detected" );
1759  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1760 
1761  return *this;
1762 }
1764 //*************************************************************************************************
1765 
1766 
1767 //*************************************************************************************************
1780 template< typename MT // Type of the adapted dense matrix
1781  , bool SO > // Storage order of the adapted dense matrix
1782 template< typename MT2 // Type of the right-hand side matrix
1783  , bool SO2 > // Storage order of the right-hand side matrix
1784 inline auto UniUpperMatrix<MT,SO,true>::operator+=( const Matrix<MT2,SO2>& rhs )
1785  -> DisableIf_t< IsComputation_v<MT2>, UniUpperMatrix& >
1786 {
1787  if( IsLower_v<MT2> || IsUniTriangular_v<MT2> ||
1788  ( !IsStrictlyUpper_v<MT2> && !isStrictlyUpper( ~rhs ) ) ) {
1789  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to uniupper matrix" );
1790  }
1791 
1792  matrix_ += declupp( ~rhs );
1793 
1794  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square uniupper matrix detected" );
1795  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1796 
1797  return *this;
1798 }
1800 //*************************************************************************************************
1801 
1802 
1803 //*************************************************************************************************
1816 template< typename MT // Type of the adapted dense matrix
1817  , bool SO > // Storage order of the adapted dense matrix
1818 template< typename MT2 // Type of the right-hand side matrix
1819  , bool SO2 > // Storage order of the right-hand side matrix
1820 inline auto UniUpperMatrix<MT,SO,true>::operator+=( const Matrix<MT2,SO2>& rhs )
1821  -> EnableIf_t< IsComputation_v<MT2>, UniUpperMatrix& >
1822 {
1823  if( IsLower_v<MT2> || IsUniTriangular_v<MT2> ||
1824  ( !IsSquare_v<MT2> && !isSquare( ~rhs ) ) ) {
1825  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to uniupper matrix" );
1826  }
1827 
1828  if( IsStrictlyUpper_v<MT2> ) {
1829  matrix_ += ~rhs;
1830  }
1831  else {
1832  const ResultType_t<MT2> tmp( ~rhs );
1833 
1834  if( !isStrictlyUpper( tmp ) ) {
1835  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to uniupper matrix" );
1836  }
1837 
1838  matrix_ += declupp( tmp );
1839  }
1840 
1841  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square uniupper matrix detected" );
1842  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1843 
1844  return *this;
1845 }
1847 //*************************************************************************************************
1848 
1849 
1850 //*************************************************************************************************
1863 template< typename MT // Type of the adapted dense matrix
1864  , bool SO > // Storage order of the adapted dense matrix
1865 template< typename MT2 // Type of the right-hand side matrix
1866  , bool SO2 > // Storage order of the right-hand side matrix
1867 inline auto UniUpperMatrix<MT,SO,true>::operator-=( const Matrix<MT2,SO2>& rhs )
1868  -> DisableIf_t< IsComputation_v<MT2>, UniUpperMatrix& >
1869 {
1870  if( IsLower_v<MT2> || IsUniTriangular_v<MT2> ||
1871  ( !IsStrictlyUpper_v<MT2> && !isStrictlyUpper( ~rhs ) ) ) {
1872  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to uniupper matrix" );
1873  }
1874 
1875  matrix_ -= declupp( ~rhs );
1876 
1877  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square uniupper matrix detected" );
1878  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1879 
1880  return *this;
1881 }
1883 //*************************************************************************************************
1884 
1885 
1886 //*************************************************************************************************
1899 template< typename MT // Type of the adapted dense matrix
1900  , bool SO > // Storage order of the adapted dense matrix
1901 template< typename MT2 // Type of the right-hand side matrix
1902  , bool SO2 > // Storage order of the right-hand side matrix
1903 inline auto UniUpperMatrix<MT,SO,true>::operator-=( const Matrix<MT2,SO2>& rhs )
1904  -> EnableIf_t< IsComputation_v<MT2>, UniUpperMatrix& >
1905 {
1906  if( IsLower_v<MT2> || IsUniTriangular_v<MT2> ||
1907  ( !IsSquare_v<MT2> && !isSquare( ~rhs ) ) ) {
1908  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to uniupper matrix" );
1909  }
1910 
1911  if( IsStrictlyUpper_v<MT2> ) {
1912  matrix_ -= ~rhs;
1913  }
1914  else {
1915  const ResultType_t<MT2> tmp( ~rhs );
1916 
1917  if( !isStrictlyUpper( tmp ) ) {
1918  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to uniupper matrix" );
1919  }
1920 
1921  matrix_ -= declupp( tmp );
1922  }
1923 
1924  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square uniupper matrix detected" );
1925  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1926 
1927  return *this;
1928 }
1930 //*************************************************************************************************
1931 
1932 
1933 //*************************************************************************************************
1946 template< typename MT // Type of the adapted dense matrix
1947  , bool SO > // Storage order of the adapted dense matrix
1948 template< typename MT2 // Type of the right-hand side matrix
1949  , bool SO2 > // Storage order of the right-hand side matrix
1950 inline auto UniUpperMatrix<MT,SO,true>::operator%=( const Matrix<MT2,SO2>& rhs )
1951  -> UniUpperMatrix&
1952 {
1953  if( !IsSquare_v<MT2> && !isSquare( ~rhs ) ) {
1954  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to uniupper matrix" );
1955  }
1956 
1957  If_t< IsComputation_v<MT2>, ResultType_t<MT2>, const MT2& > tmp( ~rhs );
1958 
1959  for( size_t i=0UL; i<(~rhs).rows(); ++i ) {
1960  if( !isOne( tmp(i,i) ) ) {
1961  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to uniupper matrix" );
1962  }
1963  }
1964 
1965  matrix_ %= tmp;
1966 
1967  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square uniupper matrix detected" );
1968  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1969 
1970  return *this;
1971 }
1973 //*************************************************************************************************
1974 
1975 
1976 
1977 
1978 //=================================================================================================
1979 //
1980 // UTILITY FUNCTIONS
1981 //
1982 //=================================================================================================
1983 
1984 //*************************************************************************************************
1990 template< typename MT // Type of the adapted dense matrix
1991  , bool SO > // Storage order of the adapted dense matrix
1992 inline size_t UniUpperMatrix<MT,SO,true>::rows() const noexcept
1993 {
1994  return matrix_.rows();
1995 }
1997 //*************************************************************************************************
1998 
1999 
2000 //*************************************************************************************************
2006 template< typename MT // Type of the adapted dense matrix
2007  , bool SO > // Storage order of the adapted dense matrix
2008 inline size_t UniUpperMatrix<MT,SO,true>::columns() const noexcept
2009 {
2010  return matrix_.columns();
2011 }
2013 //*************************************************************************************************
2014 
2015 
2016 //*************************************************************************************************
2027 template< typename MT // Type of the adapted dense matrix
2028  , bool SO > // Storage order of the adapted dense matrix
2029 inline size_t UniUpperMatrix<MT,SO,true>::spacing() const noexcept
2030 {
2031  return matrix_.spacing();
2032 }
2034 //*************************************************************************************************
2035 
2036 
2037 //*************************************************************************************************
2043 template< typename MT // Type of the adapted dense matrix
2044  , bool SO > // Storage order of the adapted dense matrix
2045 inline size_t UniUpperMatrix<MT,SO,true>::capacity() const noexcept
2046 {
2047  return matrix_.capacity();
2048 }
2050 //*************************************************************************************************
2051 
2052 
2053 //*************************************************************************************************
2065 template< typename MT // Type of the adapted dense matrix
2066  , bool SO > // Storage order of the adapted dense matrix
2067 inline size_t UniUpperMatrix<MT,SO,true>::capacity( size_t i ) const noexcept
2068 {
2069  return matrix_.capacity(i);
2070 }
2072 //*************************************************************************************************
2073 
2074 
2075 //*************************************************************************************************
2081 template< typename MT // Type of the adapted dense matrix
2082  , bool SO > // Storage order of the adapted dense matrix
2083 inline size_t UniUpperMatrix<MT,SO,true>::nonZeros() const
2084 {
2085  return matrix_.nonZeros();
2086 }
2088 //*************************************************************************************************
2089 
2090 
2091 //*************************************************************************************************
2103 template< typename MT // Type of the adapted dense matrix
2104  , bool SO > // Storage order of the adapted dense matrix
2105 inline size_t UniUpperMatrix<MT,SO,true>::nonZeros( size_t i ) const
2106 {
2107  return matrix_.nonZeros(i);
2108 }
2110 //*************************************************************************************************
2111 
2112 
2113 //*************************************************************************************************
2119 template< typename MT // Type of the adapted dense matrix
2120  , bool SO > // Storage order of the adapted dense matrix
2122 {
2123  using blaze::clear;
2124 
2125  if( SO ) {
2126  for( size_t j=1UL; j<columns(); ++j )
2127  for( size_t i=0UL; i<j; ++i )
2128  clear( matrix_(i,j) );
2129  }
2130  else {
2131  for( size_t i=0UL; i<rows(); ++i )
2132  for( size_t j=i+1UL; j<columns(); ++j )
2133  clear( matrix_(i,j) );
2134  }
2135 }
2137 //*************************************************************************************************
2138 
2139 
2140 //*************************************************************************************************
2153 template< typename MT // Type of the adapted dense matrix
2154  , bool SO > // Storage order of the adapted dense matrix
2155 inline void UniUpperMatrix<MT,SO,true>::reset( size_t i )
2156 {
2157  using blaze::clear;
2158 
2159  if( SO ) {
2160  for( size_t j=0UL; j<i; ++j )
2161  clear( matrix_(j,i) );
2162  }
2163  else {
2164  for( size_t j=i+1UL; j<columns(); ++j )
2165  clear( matrix_(i,j) );
2166  }
2167 }
2169 //*************************************************************************************************
2170 
2171 
2172 //*************************************************************************************************
2184 template< typename MT // Type of the adapted dense matrix
2185  , bool SO > // Storage order of the adapted dense matrix
2187 {
2188  using blaze::clear;
2189 
2190  if( IsResizable_v<MT> ) {
2191  clear( matrix_ );
2192  }
2193  else {
2194  reset();
2195  }
2196 }
2198 //*************************************************************************************************
2199 
2200 
2201 //*************************************************************************************************
2237 template< typename MT // Type of the adapted dense matrix
2238  , bool SO > // Storage order of the adapted dense matrix
2239 void UniUpperMatrix<MT,SO,true>::resize( size_t n, bool preserve )
2240 {
2242 
2243  MAYBE_UNUSED( preserve );
2244 
2245  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square uniupper matrix detected" );
2246 
2247  const size_t oldsize( matrix_.rows() );
2248 
2249  matrix_.resize( n, n, true );
2250 
2251  if( n > oldsize )
2252  {
2253  const size_t increment( n - oldsize );
2254  submatrix( matrix_, oldsize, 0UL, increment, n-1UL ).reset();
2255 
2256  for( size_t i=oldsize; i<n; ++i )
2257  matrix_(i,i) = ElementType(1);
2258  }
2259 }
2261 //*************************************************************************************************
2262 
2263 
2264 //*************************************************************************************************
2277 template< typename MT // Type of the adapted dense matrix
2278  , bool SO > // Storage order of the adapted dense matrix
2279 inline void UniUpperMatrix<MT,SO,true>::extend( size_t n, bool preserve )
2280 {
2282 
2283  MAYBE_UNUSED( preserve );
2284 
2285  resize( rows() + n, true );
2286 }
2287 //*************************************************************************************************
2288 
2289 
2290 //*************************************************************************************************
2300 template< typename MT // Type of the adapted dense matrix
2301  , bool SO > // Storage order of the adapted dense matrix
2302 inline void UniUpperMatrix<MT,SO,true>::reserve( size_t elements )
2303 {
2304  matrix_.reserve( elements );
2305 }
2307 //*************************************************************************************************
2308 
2309 
2310 //*************************************************************************************************
2320 template< typename MT // Type of the adapted dense matrix
2321  , bool SO > // Storage order of the adapted dense matrix
2323 {
2324  matrix_.shrinkToFit();
2325 }
2327 //*************************************************************************************************
2328 
2329 
2330 //*************************************************************************************************
2337 template< typename MT // Type of the adapted dense matrix
2338  , bool SO > // Storage order of the adapted dense matrix
2339 inline void UniUpperMatrix<MT,SO,true>::swap( UniUpperMatrix& m ) noexcept
2340 {
2341  using std::swap;
2342 
2343  swap( matrix_, m.matrix_ );
2344 }
2346 //*************************************************************************************************
2347 
2348 
2349 //*************************************************************************************************
2361 template< typename MT // Type of the adapted dense matrix
2362  , bool SO > // Storage order of the adapted dense matrix
2363 inline constexpr size_t UniUpperMatrix<MT,SO,true>::maxNonZeros() noexcept
2364 {
2366 
2367  return maxNonZeros( Size_v<MT,0UL> );
2368 }
2370 //*************************************************************************************************
2371 
2372 
2373 //*************************************************************************************************
2383 template< typename MT // Type of the adapted dense matrix
2384  , bool SO > // Storage order of the adapted dense matrix
2385 inline constexpr size_t UniUpperMatrix<MT,SO,true>::maxNonZeros( size_t n ) noexcept
2386 {
2387  return ( ( n + 1UL ) * n ) / 2UL;
2388 }
2390 //*************************************************************************************************
2391 
2392 
2393 
2394 
2395 //=================================================================================================
2396 //
2397 // DEBUGGING FUNCTIONS
2398 //
2399 //=================================================================================================
2400 
2401 //*************************************************************************************************
2411 template< typename MT // Type of the adapted dense matrix
2412  , bool SO > // Storage order of the adapted dense matrix
2413 inline bool UniUpperMatrix<MT,SO,true>::isIntact() const noexcept
2414 {
2415  using blaze::isIntact;
2416 
2417  return ( isIntact( matrix_ ) && isUniUpper( matrix_ ) );
2418 }
2420 //*************************************************************************************************
2421 
2422 
2423 
2424 
2425 //=================================================================================================
2426 //
2427 // EXPRESSION TEMPLATE EVALUATION FUNCTIONS
2428 //
2429 //=================================================================================================
2430 
2431 //*************************************************************************************************
2442 template< typename MT // Type of the adapted dense matrix
2443  , bool SO > // Storage order of the adapted dense matrix
2444 template< typename Other > // Data type of the foreign expression
2445 inline bool UniUpperMatrix<MT,SO,true>::canAlias( const Other* alias ) const noexcept
2446 {
2447  return matrix_.canAlias( alias );
2448 }
2450 //*************************************************************************************************
2451 
2452 
2453 //*************************************************************************************************
2464 template< typename MT // Type of the adapted dense matrix
2465  , bool SO > // Storage order of the adapted dense matrix
2466 template< typename Other > // Data type of the foreign expression
2467 inline bool UniUpperMatrix<MT,SO,true>::isAliased( const Other* alias ) const noexcept
2468 {
2469  return matrix_.isAliased( alias );
2470 }
2472 //*************************************************************************************************
2473 
2474 
2475 //*************************************************************************************************
2485 template< typename MT // Type of the adapted dense matrix
2486  , bool SO > // Storage order of the adapted dense matrix
2487 inline bool UniUpperMatrix<MT,SO,true>::isAligned() const noexcept
2488 {
2489  return matrix_.isAligned();
2490 }
2492 //*************************************************************************************************
2493 
2494 
2495 //*************************************************************************************************
2506 template< typename MT // Type of the adapted dense matrix
2507  , bool SO > // Storage order of the adapted dense matrix
2508 inline bool UniUpperMatrix<MT,SO,true>::canSMPAssign() const noexcept
2509 {
2510  return matrix_.canSMPAssign();
2511 }
2513 //*************************************************************************************************
2514 
2515 
2516 //*************************************************************************************************
2532 template< typename MT // Type of the adapted dense matrix
2533  , bool SO > // Storage order of the adapted dense matrix
2534 BLAZE_ALWAYS_INLINE typename UniUpperMatrix<MT,SO,true>::SIMDType
2535  UniUpperMatrix<MT,SO,true>::load( size_t i, size_t j ) const noexcept
2536 {
2537  return matrix_.load( i, j );
2538 }
2540 //*************************************************************************************************
2541 
2542 
2543 //*************************************************************************************************
2559 template< typename MT // Type of the adapted dense matrix
2560  , bool SO > // Storage order of the adapted dense matrix
2561 BLAZE_ALWAYS_INLINE typename UniUpperMatrix<MT,SO,true>::SIMDType
2562  UniUpperMatrix<MT,SO,true>::loada( size_t i, size_t j ) const noexcept
2563 {
2564  return matrix_.loada( i, j );
2565 }
2567 //*************************************************************************************************
2568 
2569 
2570 //*************************************************************************************************
2586 template< typename MT // Type of the adapted dense matrix
2587  , bool SO > // Storage order of the adapted dense matrix
2588 BLAZE_ALWAYS_INLINE typename UniUpperMatrix<MT,SO,true>::SIMDType
2589  UniUpperMatrix<MT,SO,true>::loadu( size_t i, size_t j ) const noexcept
2590 {
2591  return matrix_.loadu( i, j );
2592 }
2594 //*************************************************************************************************
2595 
2596 
2597 
2598 
2599 //=================================================================================================
2600 //
2601 // CONSTRUCTION FUNCTIONS
2602 //
2603 //=================================================================================================
2604 
2605 //*************************************************************************************************
2612 template< typename MT // Type of the adapted dense matrix
2613  , bool SO > // Storage order of the adapted dense matrix
2614 inline const MT UniUpperMatrix<MT,SO,true>::construct( size_t n, TrueType )
2615 {
2617 
2618  MT tmp( n, n, ElementType() );
2619 
2620  for( size_t i=0UL; i<n; ++i )
2621  tmp(i,i) = ElementType(1);
2622 
2623  return tmp;
2624 }
2626 //*************************************************************************************************
2627 
2628 
2629 //*************************************************************************************************
2636 template< typename MT // Type of the adapted dense matrix
2637  , bool SO > // Storage order of the adapted dense matrix
2638 inline const MT UniUpperMatrix<MT,SO,true>::construct( const ElementType& init, FalseType )
2639 {
2642 
2643  MT tmp;
2644 
2645  if( SO ) {
2646  for( size_t j=0UL; j<columns(); ++j ) {
2647  for( size_t i=0UL; i<j; ++i )
2648  tmp(i,j) = init;
2649  tmp(j,j) = ElementType(1);
2650  }
2651  }
2652  else {
2653  for( size_t i=0UL; i<rows(); ++i ) {
2654  tmp(i,i) = ElementType(1);
2655  for( size_t j=i+1UL; j<columns(); ++j )
2656  tmp(i,j) = init;
2657  }
2658  }
2659 
2660  return tmp;
2661 }
2663 //*************************************************************************************************
2664 
2665 
2666 //*************************************************************************************************
2677 template< typename MT // Type of the adapted dense matrix
2678  , bool SO > // Storage order of the adapted dense matrix
2679 template< typename MT2 // Type of the foreign matrix
2680  , bool SO2 // Storage order of the foreign matrix
2681  , typename T > // Type of the third argument
2682 inline const MT UniUpperMatrix<MT,SO,true>::construct( const Matrix<MT2,SO2>& m, T )
2683 {
2684  const MT tmp( ~m );
2685 
2686  if( IsStrictlyTriangular_v<MT2> || ( !IsUniUpper_v<MT2> && !isUniUpper( tmp ) ) ) {
2687  BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of uniupper matrix" );
2688  }
2689 
2690  return tmp;
2691 }
2693 //*************************************************************************************************
2694 
2695 } // namespace blaze
2696 
2697 #endif
#define BLAZE_CONSTRAINT_MUST_NOT_BE_TRANSFORMATION_TYPE(T)
Constraint on the data type.In case the given data type T is a transformation expression (i....
Definition: Transformation.h:81
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,...
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: IntegralConstant.h:121
#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
Constraint on the data type.
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:133
auto operator-=(DenseMatrix< MT, SO > &mat, ST scalar) -> EnableIf_t< IsNumeric_v< ST >, MT & >
Subtraction assignment operator for the subtraction of a dense matrix and a scalar value ( ).
Definition: DenseMatrix.h:432
constexpr ptrdiff_t Size_v
Auxiliary variable template for the Size type trait.The Size_v variable template provides a convenien...
Definition: Size.h:176
Constraint on the data type.
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,...
Definition: Assert.h:117
Header file for the IsUniUpper type trait.
size_t capacity(const Matrix< MT, SO > &matrix) noexcept
Returns the maximum capacity of the matrix.
Definition: Matrix.h:546
Header file for basic type definitions.
constexpr 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:750
MT::ElementType * data(DenseMatrix< MT, SO > &dm) noexcept
Low-level data access to the dense matrix elements.
Definition: DenseMatrix.h:170
decltype(auto) submatrix(Matrix< MT, SO > &, RSAs...)
Creating a view on a specific submatrix of the given matrix.
Definition: Submatrix.h:178
#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_NOT_BE_COMPUTATION_TYPE(T)
Constraint on the data type.In case the given data type T is a computational expression (i....
Definition: Computation.h:81
#define BLAZE_CONSTRAINT_MUST_BE_DENSE_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is not a dense, N-dimensional matrix type,...
Definition: DenseMatrix.h: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:332
BLAZE_ALWAYS_INLINE const EnableIf_t< IsIntegral_v< T > &&HasSize_v< T, 1UL >, If_t< IsSigned_v< T >, SIMDint8, SIMDuint8 > > loadu(const T *address) noexcept
Loads a vector of 1-byte integral values.
Definition: Loadu.h:76
Constraint on the data type.
MT::Iterator begin(Matrix< MT, SO > &matrix, size_t i)
Returns an iterator to the first element of row/column i.
Definition: Matrix.h:372
void reset(const DiagonalProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: DiagonalProxy.h:595
void shrinkToFit(Matrix< MT, SO > &matrix)
Requesting the removal of unused capacity.
Definition: Matrix.h:799
Header file for the MAYBE_UNUSED function template.
Header file for all adaptor forward declarations.
decltype(auto) declupp(const DenseMatrix< MT, SO > &dm)
Declares the given dense matrix expression dm as upper.
Definition: DMatDeclUppExpr.h:1001
#define BLAZE_CONSTRAINT_MUST_NOT_BE_VOLATILE(T)
Constraint on the data type.In case the given data type is a volatile-qualified type,...
Definition: Volatile.h:79
size_t nonZeros(const Matrix< MT, SO > &matrix)
Returns the total number of non-zero elements in the matrix.
Definition: Matrix.h:584
BoolConstant< true > TrueType
Type traits base class.The TrueType class is used as base class for type traits and value traits that...
Definition: IntegralConstant.h:132
Header file for the extended initializer_list functionality.
Constraint on the data type.
constexpr size_t columns(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of columns of the matrix.
Definition: Matrix.h:514
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:482
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:416
Constraint on the data type.
Constraint on the data type.
Constraint on the data type.
size_t spacing(const DenseMatrix< MT, SO > &dm) noexcept
Returns the spacing between the beginning of two rows/columns.
Definition: DenseMatrix.h:253
#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,...
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.
typename EnableIf< Condition, T >::Type EnableIf_t
Auxiliary type for the EnableIf class template.The EnableIf_t alias declaration provides a convenient...
Definition: EnableIf.h:138
Header file for the DisableIf class template.
Header file for the IsStrictlyUpper type trait.
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,...
Definition: Static.h:61
Compile time assertion.
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:9091
#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.
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:370
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:446
auto operator+=(DenseMatrix< MT, SO > &mat, ST scalar) -> EnableIf_t< IsNumeric_v< ST >, MT & >
Addition assignment operator for the addition of a dense matrix and a scalar value ( ).
Definition: DenseMatrix.h:370
constexpr bool operator==(const NegativeAccuracy< A > &lhs, const T &rhs)
Equality comparison between a NegativeAccuracy object and a floating point value.
Definition: Accuracy.h:253
Constraint on the data type.
Header file for the IsLower type trait.
constexpr void MAYBE_UNUSED(const Args &...)
Suppression of unused parameter warnings.
Definition: MaybeUnused.h:81
Header file for the UniUpperProxy class.
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:139
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
void resize(Matrix< MT, SO > &matrix, size_t rows, size_t columns, bool preserve=true)
Changing the size of the matrix.
Definition: Matrix.h:738
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:438
Constraint on the data type.
constexpr bool operator!=(const NegativeAccuracy< A > &lhs, const T &rhs)
Inequality comparison between a NegativeAccuracy object and a floating point value.
Definition: Accuracy.h:293
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:615
constexpr bool IsComputation_v
Auxiliary variable template for the IsComputation type trait.The IsComputation_v variable template pr...
Definition: IsComputation.h:90
Header file for the isOne shim.
#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,...
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:2235
Header file for run time assertion macros.
#define BLAZE_CONSTRAINT_MUST_NOT_BE_UNIFORM_TYPE(T)
Constraint on the data type.In case the given data type T is a uniform vector or matrix type,...
Definition: Uniform.h:81
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:133
#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 'resize' 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,...
Definition: Reference.h:79
bool isOne(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is 1.
Definition: DiagonalProxy.h:697
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:282
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:408
#define BLAZE_CONSTRAINT_MUST_NOT_BE_VIEW_TYPE(T)
Constraint on the data type.In case the given data type T is a view type (i.e. a subvector,...
Definition: View.h:81
constexpr size_t rows(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of rows of the matrix.
Definition: Matrix.h:498
constexpr 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:718
BLAZE_ALWAYS_INLINE const EnableIf_t< IsIntegral_v< T > &&HasSize_v< T, 1UL >, If_t< IsSigned_v< T >, SIMDint8, SIMDuint8 > > loada(const T *address) noexcept
Loads a vector of 1-byte integral values.
Definition: Loada.h:79
#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 'res...
Definition: Resizable.h:61
Header file for the IsComputation type trait class.
Header file for the IntegralConstant class template.
bool isUniUpper(const DenseMatrix< MT, SO > &dm)
Checks if the given dense matrix is an upper unitriangular matrix.
Definition: DenseMatrix.h:2148
bool isIntact(const DiagonalMatrix< MT, SO, DF > &m)
Returns whether the invariants of the given diagonal matrix are intact.
Definition: DiagonalMatrix.h:264
#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,...
Definition: Hermitian.h:79
typename DisableIf< Condition, T >::Type DisableIf_t
Auxiliary type for the DisableIf class template.The DisableIf_t alias declaration provides a convenie...
Definition: DisableIf.h:138
#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
bool isSquare(const Matrix< MT, SO > &matrix) noexcept
Checks if the given matrix is a square matrix.
Definition: Matrix.h:951
Header file for the IsResizable type trait.
Constraint on the data type.
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,...
Definition: Assert.h:101
Header file for the implementation of the base template of the UniUpperMatrix.
Header file for the clear shim.