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>
62 #include <blaze/math/Exception.h>
65 #include <blaze/math/shims/Clear.h>
67 #include <blaze/math/shims/IsOne.h>
78 #include <blaze/system/Inline.h>
79 #include <blaze/util/Assert.h>
86 #include <blaze/util/DisableIf.h>
87 #include <blaze/util/EnableIf.h>
88 #include <blaze/util/FalseType.h>
90 #include <blaze/util/TrueType.h>
91 #include <blaze/util/Types.h>
92 #include <blaze/util/Unused.h>
93 
94 
95 namespace blaze {
96 
97 //=================================================================================================
98 //
99 // CLASS TEMPLATE SPECIALIZATION FOR DENSE MATRICES
100 //
101 //=================================================================================================
102 
103 //*************************************************************************************************
111 template< typename MT // Type of the adapted dense matrix
112  , bool SO > // Storage order of the adapted dense matrix
113 class UniUpperMatrix<MT,SO,true>
114  : public DenseMatrix< UniUpperMatrix<MT,SO,true>, SO >
115 {
116  private:
117  //**Type definitions****************************************************************************
118  using OT = OppositeType_t<MT>;
119  using TT = TransposeType_t<MT>;
120  using ET = ElementType_t<MT>;
121  //**********************************************************************************************
122 
123  public:
124  //**Type definitions****************************************************************************
125  using This = UniUpperMatrix<MT,SO,true>;
126  using BaseType = DenseMatrix<This,SO>;
127  using ResultType = This;
128  using OppositeType = UniUpperMatrix<OT,!SO,true>;
129  using TransposeType = UniLowerMatrix<TT,!SO,true>;
130  using ElementType = ET;
131  using SIMDType = SIMDType_t<MT>;
132  using ReturnType = ReturnType_t<MT>;
133  using CompositeType = const This&;
134  using Reference = UniUpperProxy<MT>;
135  using ConstReference = ConstReference_t<MT>;
136  using Pointer = Pointer_t<MT>;
137  using ConstPointer = ConstPointer_t<MT>;
138  using ConstIterator = ConstIterator_t<MT>;
139  //**********************************************************************************************
140 
141  //**Rebind struct definition********************************************************************
144  template< typename NewType > // Data type of the other matrix
145  struct Rebind {
147  using Other = UniUpperMatrix< typename MT::template Rebind<NewType>::Other >;
148  };
149  //**********************************************************************************************
150 
151  //**Resize struct definition********************************************************************
154  template< size_t NewM // Number of rows of the other matrix
155  , size_t NewN > // Number of columns of the other matrix
156  struct Resize {
158  using Other = UniUpperMatrix< typename MT::template Resize<NewM,NewN>::Other >;
159  };
160  //**********************************************************************************************
161 
162  //**Iterator class definition*******************************************************************
165  class Iterator
166  {
167  public:
168  //**Type definitions*************************************************************************
169  using IteratorCategory = std::random_access_iterator_tag;
170  using ValueType = ElementType_t<MT>;
171  using PointerType = UniUpperProxy<MT>;
172  using ReferenceType = UniUpperProxy<MT>;
173  using DifferenceType = ptrdiff_t;
174 
175  // STL iterator requirements
176  using iterator_category = IteratorCategory;
177  using value_type = ValueType;
178  using pointer = PointerType;
179  using reference = ReferenceType;
180  using difference_type = DifferenceType;
181  //*******************************************************************************************
182 
183  //**Constructor******************************************************************************
186  inline Iterator() noexcept
187  : matrix_( nullptr ) // Reference to the adapted dense matrix
188  , row_ ( 0UL ) // The current row index of the iterator
189  , column_( 0UL ) // The current column index of the iterator
190  {}
191  //*******************************************************************************************
192 
193  //**Constructor******************************************************************************
200  inline Iterator( MT& matrix, size_t row, size_t column ) noexcept
201  : matrix_( &matrix ) // Reference to the adapted dense matrix
202  , row_ ( row ) // The current row-index of the iterator
203  , column_( column ) // The current column-index of the iterator
204  {}
205  //*******************************************************************************************
206 
207  //**Addition assignment operator*************************************************************
213  inline Iterator& operator+=( size_t inc ) noexcept {
214  ( SO )?( row_ += inc ):( column_ += inc );
215  return *this;
216  }
217  //*******************************************************************************************
218 
219  //**Subtraction assignment operator**********************************************************
225  inline Iterator& operator-=( size_t dec ) noexcept {
226  ( SO )?( row_ -= dec ):( column_ -= dec );
227  return *this;
228  }
229  //*******************************************************************************************
230 
231  //**Prefix increment operator****************************************************************
236  inline Iterator& operator++() noexcept {
237  ( SO )?( ++row_ ):( ++column_ );
238  return *this;
239  }
240  //*******************************************************************************************
241 
242  //**Postfix increment operator***************************************************************
247  inline const Iterator operator++( int ) noexcept {
248  const Iterator tmp( *this );
249  ++(*this);
250  return tmp;
251  }
252  //*******************************************************************************************
253 
254  //**Prefix decrement operator****************************************************************
259  inline Iterator& operator--() noexcept {
260  ( SO )?( --row_ ):( --column_ );
261  return *this;
262  }
263  //*******************************************************************************************
264 
265  //**Postfix decrement operator***************************************************************
270  inline const Iterator operator--( int ) {
271  const Iterator tmp( *this );
272  --(*this);
273  return tmp;
274  }
275  //*******************************************************************************************
276 
277  //**Element access operator******************************************************************
282  inline ReferenceType operator*() const {
283  return ReferenceType( *matrix_, row_, column_ );
284  }
285  //*******************************************************************************************
286 
287  //**Element access operator******************************************************************
292  inline PointerType operator->() const {
293  return PointerType( *matrix_, row_, column_ );
294  }
295  //*******************************************************************************************
296 
297  //**Load function****************************************************************************
307  inline SIMDType load() const {
308  return (*matrix_).load(row_,column_);
309  }
310  //*******************************************************************************************
311 
312  //**Loada function***************************************************************************
322  inline SIMDType loada() const {
323  return (*matrix_).loada(row_,column_);
324  }
325  //*******************************************************************************************
326 
327  //**Loadu function***************************************************************************
337  inline SIMDType loadu() const {
338  return (*matrix_).loadu(row_,column_);
339  }
340  //*******************************************************************************************
341 
342  //**Conversion operator**********************************************************************
347  inline operator ConstIterator() const {
348  if( SO )
349  return matrix_->begin( column_ ) + row_;
350  else
351  return matrix_->begin( row_ ) + column_;
352  }
353  //*******************************************************************************************
354 
355  //**Equality operator************************************************************************
362  friend inline bool operator==( const Iterator& lhs, const Iterator& rhs ) noexcept {
363  return ( SO )?( lhs.row_ == rhs.row_ ):( lhs.column_ == rhs.column_ );
364  }
365  //*******************************************************************************************
366 
367  //**Equality operator************************************************************************
374  friend inline bool operator==( const Iterator& lhs, const ConstIterator& rhs ) {
375  return ( ConstIterator( lhs ) == rhs );
376  }
377  //*******************************************************************************************
378 
379  //**Equality operator************************************************************************
386  friend inline bool operator==( const ConstIterator& lhs, const Iterator& rhs ) {
387  return ( lhs == ConstIterator( rhs ) );
388  }
389  //*******************************************************************************************
390 
391  //**Inequality operator**********************************************************************
398  friend inline bool operator!=( const Iterator& lhs, const Iterator& rhs ) noexcept {
399  return ( SO )?( lhs.row_ != rhs.row_ ):( lhs.column_ != rhs.column_ );
400  }
401  //*******************************************************************************************
402 
403  //**Inequality operator**********************************************************************
410  friend inline bool operator!=( const Iterator& lhs, const ConstIterator& rhs ) {
411  return ( ConstIterator( lhs ) != rhs );
412  }
413  //*******************************************************************************************
414 
415  //**Inequality operator**********************************************************************
422  friend inline bool operator!=( const ConstIterator& lhs, const Iterator& rhs ) {
423  return ( lhs != ConstIterator( rhs ) );
424  }
425  //*******************************************************************************************
426 
427  //**Less-than operator***********************************************************************
434  friend inline bool operator<( const Iterator& lhs, const Iterator& rhs ) noexcept {
435  return ( SO )?( lhs.row_ < rhs.row_ ):( lhs.column_ < rhs.column_ );
436  }
437  //*******************************************************************************************
438 
439  //**Less-than operator***********************************************************************
446  friend inline bool operator<( const Iterator& lhs, const ConstIterator& rhs ) {
447  return ( ConstIterator( lhs ) < rhs );
448  }
449  //*******************************************************************************************
450 
451  //**Less-than operator***********************************************************************
458  friend inline bool operator<( const ConstIterator& lhs, const Iterator& rhs ) {
459  return ( lhs < ConstIterator( rhs ) );
460  }
461  //*******************************************************************************************
462 
463  //**Greater-than operator********************************************************************
470  friend inline bool operator>( const Iterator& lhs, const Iterator& rhs ) noexcept {
471  return ( SO )?( lhs.row_ > rhs.row_ ):( lhs.column_ > rhs.column_ );
472  }
473  //*******************************************************************************************
474 
475  //**Greater-than operator********************************************************************
482  friend inline bool operator>( const Iterator& lhs, const ConstIterator& rhs ) {
483  return ( ConstIterator( lhs ) > rhs );
484  }
485  //*******************************************************************************************
486 
487  //**Greater-than operator********************************************************************
494  friend inline bool operator>( const ConstIterator& lhs, const Iterator& rhs ) {
495  return ( lhs > ConstIterator( rhs ) );
496  }
497  //*******************************************************************************************
498 
499  //**Less-or-equal-than operator**************************************************************
506  friend inline bool operator<=( const Iterator& lhs, const Iterator& rhs ) noexcept {
507  return ( SO )?( lhs.row_ <= rhs.row_ ):( lhs.column_ <= rhs.column_ );
508  }
509  //*******************************************************************************************
510 
511  //**Less-or-equal-than operator**************************************************************
518  friend inline bool operator<=( const Iterator& lhs, const ConstIterator& rhs ) {
519  return ( ConstIterator( lhs ) <= rhs );
520  }
521  //*******************************************************************************************
522 
523  //**Less-or-equal-than operator**************************************************************
530  friend inline bool operator<=( const ConstIterator& lhs, const Iterator& rhs ) {
531  return ( lhs <= ConstIterator( rhs ) );
532  }
533  //*******************************************************************************************
534 
535  //**Greater-or-equal-than operator***********************************************************
542  friend inline bool operator>=( const Iterator& lhs, const Iterator& rhs ) noexcept {
543  return ( SO )?( lhs.row_ >= rhs.row_ ):( lhs.column_ >= rhs.column_ );
544  }
545  //*******************************************************************************************
546 
547  //**Greater-or-equal-than operator***********************************************************
554  friend inline bool operator>=( const Iterator& lhs, const ConstIterator& rhs ) {
555  return ( ConstIterator( lhs ) >= rhs );
556  }
557  //*******************************************************************************************
558 
559  //**Greater-or-equal-than operator***********************************************************
566  friend inline bool operator>=( const ConstIterator& lhs, const Iterator& rhs ) {
567  return ( lhs >= ConstIterator( rhs ) );
568  }
569  //*******************************************************************************************
570 
571  //**Subtraction operator*********************************************************************
577  inline DifferenceType operator-( const Iterator& rhs ) const noexcept {
578  return ( SO )?( row_ - rhs.row_ ):( column_ - rhs.column_ );
579  }
580  //*******************************************************************************************
581 
582  //**Addition operator************************************************************************
589  friend inline const Iterator operator+( const Iterator& it, size_t inc ) noexcept {
590  if( SO )
591  return Iterator( *it.matrix_, it.row_ + inc, it.column_ );
592  else
593  return Iterator( *it.matrix_, it.row_, it.column_ + inc );
594  }
595  //*******************************************************************************************
596 
597  //**Addition operator************************************************************************
604  friend inline const Iterator operator+( size_t inc, const Iterator& it ) noexcept {
605  if( SO )
606  return Iterator( *it.matrix_, it.row_ + inc, it.column_ );
607  else
608  return Iterator( *it.matrix_, it.row_, it.column_ + inc );
609  }
610  //*******************************************************************************************
611 
612  //**Subtraction operator*********************************************************************
619  friend inline const Iterator operator-( const Iterator& it, size_t dec ) noexcept {
620  if( SO )
621  return Iterator( *it.matrix_, it.row_ - dec, it.column_ );
622  else
623  return Iterator( *it.matrix_, it.row_, it.column_ - dec );
624  }
625  //*******************************************************************************************
626 
627  private:
628  //**Member variables*************************************************************************
629  MT* matrix_;
630  size_t row_;
631  size_t column_;
632  //*******************************************************************************************
633  };
634  //**********************************************************************************************
635 
636  //**Compilation flags***************************************************************************
638  static constexpr bool simdEnabled = MT::simdEnabled;
639 
641  static constexpr bool smpAssignable = MT::smpAssignable;
642  //**********************************************************************************************
643 
644  //**Constructors********************************************************************************
647  explicit inline UniUpperMatrix();
648  template< typename A1 > explicit inline UniUpperMatrix( const A1& a1 );
649  explicit inline UniUpperMatrix( size_t n, const ElementType& init );
650 
651  explicit inline UniUpperMatrix( initializer_list< initializer_list<ElementType> > list );
652 
653  template< typename Other >
654  explicit inline UniUpperMatrix( size_t n, const Other* array );
655 
656  template< typename Other, size_t N >
657  explicit inline UniUpperMatrix( const Other (&array)[N][N] );
658 
659  explicit inline UniUpperMatrix( ElementType* ptr, size_t n );
660  explicit inline UniUpperMatrix( ElementType* ptr, size_t n, size_t nn );
661 
662  inline UniUpperMatrix( const UniUpperMatrix& m );
663  inline UniUpperMatrix( UniUpperMatrix&& m ) noexcept;
665  //**********************************************************************************************
666 
667  //**Destructor**********************************************************************************
670  ~UniUpperMatrix() = default;
672  //**********************************************************************************************
673 
674  //**Data access functions***********************************************************************
677  inline Reference operator()( size_t i, size_t j );
678  inline ConstReference operator()( size_t i, size_t j ) const;
679  inline Reference at( size_t i, size_t j );
680  inline ConstReference at( size_t i, size_t j ) const;
681  inline ConstPointer data () const noexcept;
682  inline ConstPointer data ( size_t i ) const noexcept;
683  inline Iterator begin ( size_t i );
684  inline ConstIterator begin ( size_t i ) const;
685  inline ConstIterator cbegin( size_t i ) const;
686  inline Iterator end ( size_t i );
687  inline ConstIterator end ( size_t i ) const;
688  inline ConstIterator cend ( size_t i ) const;
690  //**********************************************************************************************
691 
692  //**Assignment operators************************************************************************
695  inline UniUpperMatrix& operator=( const ElementType& rhs );
696  inline UniUpperMatrix& operator=( initializer_list< initializer_list<ElementType> > list );
697 
698  template< typename Other, size_t N >
699  inline UniUpperMatrix& operator=( const Other (&array)[N][N] );
700 
701  inline UniUpperMatrix& operator=( const UniUpperMatrix& rhs );
702  inline UniUpperMatrix& operator=( UniUpperMatrix&& rhs ) noexcept;
703 
704  template< typename MT2, bool SO2 >
705  inline auto operator=( const Matrix<MT2,SO2>& rhs )
706  -> DisableIf_t< IsComputation_v<MT2>, UniUpperMatrix& >;
707 
708  template< typename MT2, bool SO2 >
709  inline auto operator=( const Matrix<MT2,SO2>& rhs )
710  -> EnableIf_t< IsComputation_v<MT2>, UniUpperMatrix& >;
711 
712  template< typename MT2, bool SO2 >
713  inline auto operator+=( const Matrix<MT2,SO2>& rhs )
714  -> DisableIf_t< IsComputation_v<MT2>, UniUpperMatrix& >;
715 
716  template< typename MT2, bool SO2 >
717  inline auto operator+=( const Matrix<MT2,SO2>& rhs )
718  -> EnableIf_t< IsComputation_v<MT2>, UniUpperMatrix& >;
719 
720  template< typename MT2, bool SO2 >
721  inline auto operator-=( const Matrix<MT2,SO2>& rhs )
722  -> DisableIf_t< IsComputation_v<MT2>, UniUpperMatrix& >;
723 
724  template< typename MT2, bool SO2 >
725  inline auto operator-=( const Matrix<MT2,SO2>& rhs )
726  -> EnableIf_t< IsComputation_v<MT2>, UniUpperMatrix& >;
727 
728  template< typename MT2, bool SO2 >
729  inline auto operator%=( const Matrix<MT2,SO2>& rhs ) -> UniUpperMatrix&;
731  //**********************************************************************************************
732 
733  //**Utility functions***************************************************************************
736  inline size_t rows() const noexcept;
737  inline size_t columns() const noexcept;
738  inline size_t spacing() const noexcept;
739  inline size_t capacity() const noexcept;
740  inline size_t capacity( size_t i ) const noexcept;
741  inline size_t nonZeros() const;
742  inline size_t nonZeros( size_t i ) const;
743  inline void reset();
744  inline void reset( size_t i );
745  inline void clear();
746  void resize ( size_t n, bool preserve=true );
747  inline void extend ( size_t n, bool preserve=true );
748  inline void reserve( size_t elements );
749  inline void shrinkToFit();
750  inline void swap( UniUpperMatrix& m ) noexcept;
751 
752  static inline constexpr size_t maxNonZeros() noexcept;
753  static inline constexpr size_t maxNonZeros( size_t n ) noexcept;
755  //**********************************************************************************************
756 
757  //**Debugging functions*************************************************************************
760  inline bool isIntact() const noexcept;
762  //**********************************************************************************************
763 
764  //**Expression template evaluation functions****************************************************
767  template< typename Other > inline bool canAlias ( const Other* alias ) const noexcept;
768  template< typename Other > inline bool isAliased( const Other* alias ) const noexcept;
769 
770  inline bool isAligned () const noexcept;
771  inline bool canSMPAssign() const noexcept;
772 
773  BLAZE_ALWAYS_INLINE SIMDType load ( size_t i, size_t j ) const noexcept;
774  BLAZE_ALWAYS_INLINE SIMDType loada( size_t i, size_t j ) const noexcept;
775  BLAZE_ALWAYS_INLINE SIMDType loadu( size_t i, size_t j ) const noexcept;
777  //**********************************************************************************************
778 
779  private:
780  //**Construction functions**********************************************************************
783  inline const MT construct( size_t n , TrueType );
784  inline const MT construct( const ElementType& value, FalseType );
785 
786  template< typename MT2, bool SO2, typename T >
787  inline const MT construct( const Matrix<MT2,SO2>& m, T );
789  //**********************************************************************************************
790 
791  //**Member variables****************************************************************************
794  MT matrix_;
795 
796  //**********************************************************************************************
797 
798  //**Friend declarations*************************************************************************
799  template< typename MT2, bool SO2, bool DF2 >
800  friend MT2& derestrict( UniUpperMatrix<MT2,SO2,DF2>& m );
801  //**********************************************************************************************
802 
803  //**Compile time checks*************************************************************************
818  BLAZE_STATIC_ASSERT( ( Size_v<MT,0UL> == Size_v<MT,1UL> ) );
819  //**********************************************************************************************
820 };
822 //*************************************************************************************************
823 
824 
825 
826 
827 //=================================================================================================
828 //
829 // CONSTRUCTORS
830 //
831 //=================================================================================================
832 
833 //*************************************************************************************************
837 template< typename MT // Type of the adapted dense matrix
838  , bool SO > // Storage order of the adapted dense matrix
839 inline UniUpperMatrix<MT,SO,true>::UniUpperMatrix()
840  : matrix_() // The adapted dense matrix
841 {
842  for( size_t i=0UL; i<rows(); ++i )
843  matrix_(i,i) = ElementType(1);
844 
845  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square uniupper matrix detected" );
846  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
847 }
849 //*************************************************************************************************
850 
851 
852 //*************************************************************************************************
870 template< typename MT // Type of the adapted dense matrix
871  , bool SO > // Storage order of the adapted dense matrix
872 template< typename A1 > // Type of the constructor argument
873 inline UniUpperMatrix<MT,SO,true>::UniUpperMatrix( const A1& a1 )
874  : matrix_( construct( a1, typename IsResizable<MT>::Type() ) ) // The adapted dense matrix
875 {
876  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square uniupper matrix detected" );
877  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
878 }
880 //*************************************************************************************************
881 
882 
883 //*************************************************************************************************
890 template< typename MT // Type of the adapted dense matrix
891  , bool SO > // Storage order of the adapted dense matrix
892 inline UniUpperMatrix<MT,SO,true>::UniUpperMatrix( size_t n, const ElementType& init )
893  : matrix_( n, n, ElementType() ) // The adapted dense matrix
894 {
896 
897  if( SO ) {
898  for( size_t j=0UL; j<columns(); ++j ) {
899  for( size_t i=0UL; i<j; ++i )
900  matrix_(i,j) = init;
901  matrix_(j,j) = ElementType(1);
902  }
903  }
904  else {
905  for( size_t i=0UL; i<rows(); ++i ) {
906  matrix_(i,i) = ElementType(1);
907  for( size_t j=i+1UL; j<columns(); ++j )
908  matrix_(i,j) = init;
909  }
910  }
911 
912  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square uniupper matrix detected" );
913  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
914 }
916 //*************************************************************************************************
917 
918 
919 //*************************************************************************************************
943 template< typename MT // Type of the adapted dense matrix
944  , bool SO > // Storage order of the adapted dense matrix
945 inline UniUpperMatrix<MT,SO,true>::UniUpperMatrix( initializer_list< initializer_list<ElementType> > list )
946  : matrix_( list ) // The adapted dense matrix
947 {
948  if( !isUniUpper( matrix_ ) ) {
949  BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of uniupper matrix" );
950  }
951 
952  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
953 }
955 //*************************************************************************************************
956 
957 
958 //*************************************************************************************************
984 template< typename MT // Type of the adapted dense matrix
985  , bool SO > // Storage order of the adapted dense matrix
986 template< typename Other > // Data type of the initialization array
987 inline UniUpperMatrix<MT,SO,true>::UniUpperMatrix( size_t n, const Other* array )
988  : matrix_( n, n, array ) // The adapted dense matrix
989 {
990  if( !isUniUpper( matrix_ ) ) {
991  BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of uniupper matrix" );
992  }
993 
994  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
995 }
997 //*************************************************************************************************
998 
999 
1000 //*************************************************************************************************
1023 template< typename MT // Type of the adapted dense matrix
1024  , bool SO > // Storage order of the adapted dense matrix
1025 template< typename Other // Data type of the initialization array
1026  , size_t N > // Number of rows and columns of the initialization array
1027 inline UniUpperMatrix<MT,SO,true>::UniUpperMatrix( const Other (&array)[N][N] )
1028  : matrix_( array ) // The adapted dense matrix
1029 {
1030  if( !isUniUpper( matrix_ ) ) {
1031  BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of uniupper matrix" );
1032  }
1033 
1034  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1035 }
1037 //*************************************************************************************************
1038 
1039 
1040 //*************************************************************************************************
1075 template< typename MT // Type of the adapted dense matrix
1076  , bool SO > // Storage order of the adapted dense matrix
1077 inline UniUpperMatrix<MT,SO,true>::UniUpperMatrix( ElementType* ptr, size_t n )
1078  : matrix_( ptr, n, n ) // The adapted dense matrix
1079 {
1080  if( !isUniUpper( matrix_ ) ) {
1081  BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of uniupper matrix" );
1082  }
1083 
1084  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1085 }
1087 //*************************************************************************************************
1088 
1089 
1090 //*************************************************************************************************
1127 template< typename MT // Type of the adapted dense matrix
1128  , bool SO > // Storage order of the adapted dense matrix
1129 inline UniUpperMatrix<MT,SO,true>::UniUpperMatrix( ElementType* ptr, size_t n, size_t nn )
1130  : matrix_( ptr, n, n, nn ) // The adapted dense matrix
1131 {
1132  if( !isUniUpper( matrix_ ) ) {
1133  BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of uniupper matrix" );
1134  }
1135 
1136  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1137 }
1139 //*************************************************************************************************
1140 
1141 
1142 //*************************************************************************************************
1148 template< typename MT // Type of the adapted dense matrix
1149  , bool SO > // Storage order of the adapted dense matrix
1150 inline UniUpperMatrix<MT,SO,true>::UniUpperMatrix( const UniUpperMatrix& m )
1151  : matrix_( m.matrix_ ) // The adapted dense matrix
1152 {
1153  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square uniupper matrix detected" );
1154  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1155 }
1157 //*************************************************************************************************
1158 
1159 
1160 //*************************************************************************************************
1166 template< typename MT // Type of the adapted dense matrix
1167  , bool SO > // Storage order of the adapted dense matrix
1168 inline UniUpperMatrix<MT,SO,true>::UniUpperMatrix( UniUpperMatrix&& m ) noexcept
1169  : matrix_( std::move( m.matrix_ ) ) // The adapted dense matrix
1170 {
1171  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square uniupper matrix detected" );
1172  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1173 }
1175 //*************************************************************************************************
1176 
1177 
1178 
1179 
1180 //=================================================================================================
1181 //
1182 // DATA ACCESS FUNCTIONS
1183 //
1184 //=================================================================================================
1185 
1186 //*************************************************************************************************
1202 template< typename MT // Type of the adapted dense matrix
1203  , bool SO > // Storage order of the adapted dense matrix
1205  UniUpperMatrix<MT,SO,true>::operator()( size_t i, size_t j )
1206 {
1207  BLAZE_USER_ASSERT( i<rows() , "Invalid row access index" );
1208  BLAZE_USER_ASSERT( j<columns(), "Invalid column access index" );
1209 
1210  return Reference( matrix_, i, j );
1211 }
1213 //*************************************************************************************************
1214 
1215 
1216 //*************************************************************************************************
1232 template< typename MT // Type of the adapted dense matrix
1233  , bool SO > // Storage order of the adapted dense matrix
1235  UniUpperMatrix<MT,SO,true>::operator()( size_t i, size_t j ) const
1236 {
1237  BLAZE_USER_ASSERT( i<rows() , "Invalid row access index" );
1238  BLAZE_USER_ASSERT( j<columns(), "Invalid column access index" );
1239 
1240  return matrix_(i,j);
1241 }
1243 //*************************************************************************************************
1244 
1245 
1246 //*************************************************************************************************
1263 template< typename MT // Type of the adapted dense matrix
1264  , bool SO > // Storage order of the adapted dense matrix
1266  UniUpperMatrix<MT,SO,true>::at( size_t i, size_t j )
1267 {
1268  if( i >= rows() ) {
1269  BLAZE_THROW_OUT_OF_RANGE( "Invalid row access index" );
1270  }
1271  if( j >= columns() ) {
1272  BLAZE_THROW_OUT_OF_RANGE( "Invalid column access index" );
1273  }
1274  return (*this)(i,j);
1275 }
1277 //*************************************************************************************************
1278 
1279 
1280 //*************************************************************************************************
1297 template< typename MT // Type of the adapted dense matrix
1298  , bool SO > // Storage order of the adapted dense matrix
1300  UniUpperMatrix<MT,SO,true>::at( size_t i, size_t j ) const
1301 {
1302  if( i >= rows() ) {
1303  BLAZE_THROW_OUT_OF_RANGE( "Invalid row access index" );
1304  }
1305  if( j >= columns() ) {
1306  BLAZE_THROW_OUT_OF_RANGE( "Invalid column access index" );
1307  }
1308  return (*this)(i,j);
1309 }
1311 //*************************************************************************************************
1312 
1313 
1314 //*************************************************************************************************
1327 template< typename MT // Type of the adapted dense matrix
1328  , bool SO > // Storage order of the adapted dense matrix
1329 inline typename UniUpperMatrix<MT,SO,true>::ConstPointer
1330  UniUpperMatrix<MT,SO,true>::data() const noexcept
1331 {
1332  return matrix_.data();
1333 }
1335 //*************************************************************************************************
1336 
1337 
1338 //*************************************************************************************************
1347 template< typename MT // Type of the adapted dense matrix
1348  , bool SO > // Storage order of the adapted dense matrix
1349 inline typename UniUpperMatrix<MT,SO,true>::ConstPointer
1350  UniUpperMatrix<MT,SO,true>::data( size_t i ) const noexcept
1351 {
1352  return matrix_.data(i);
1353 }
1355 //*************************************************************************************************
1356 
1357 
1358 //*************************************************************************************************
1370 template< typename MT // Type of the adapted dense matrix
1371  , bool SO > // Storage order of the adapted dense matrix
1374 {
1375  if( SO )
1376  return Iterator( matrix_, 0UL, i );
1377  else
1378  return Iterator( matrix_, i, 0UL );
1379 }
1381 //*************************************************************************************************
1382 
1383 
1384 //*************************************************************************************************
1396 template< typename MT // Type of the adapted dense matrix
1397  , bool SO > // Storage order of the adapted dense matrix
1399  UniUpperMatrix<MT,SO,true>::begin( size_t i ) const
1400 {
1401  return matrix_.begin(i);
1402 }
1404 //*************************************************************************************************
1405 
1406 
1407 //*************************************************************************************************
1419 template< typename MT // Type of the adapted dense matrix
1420  , bool SO > // Storage order of the adapted dense matrix
1422  UniUpperMatrix<MT,SO,true>::cbegin( size_t i ) const
1423 {
1424  return matrix_.cbegin(i);
1425 }
1427 //*************************************************************************************************
1428 
1429 
1430 //*************************************************************************************************
1442 template< typename MT // Type of the adapted dense matrix
1443  , bool SO > // Storage order of the adapted dense matrix
1446 {
1447  if( SO )
1448  return Iterator( matrix_, rows(), i );
1449  else
1450  return Iterator( matrix_, i, columns() );
1451 }
1453 //*************************************************************************************************
1454 
1455 
1456 //*************************************************************************************************
1468 template< typename MT // Type of the adapted dense matrix
1469  , bool SO > // Storage order of the adapted dense matrix
1471  UniUpperMatrix<MT,SO,true>::end( size_t i ) const
1472 {
1473  return matrix_.end(i);
1474 }
1476 //*************************************************************************************************
1477 
1478 
1479 //*************************************************************************************************
1491 template< typename MT // Type of the adapted dense matrix
1492  , bool SO > // Storage order of the adapted dense matrix
1494  UniUpperMatrix<MT,SO,true>::cend( size_t i ) const
1495 {
1496  return matrix_.cend(i);
1497 }
1499 //*************************************************************************************************
1500 
1501 
1502 
1503 
1504 //=================================================================================================
1505 //
1506 // ASSIGNMENT OPERATORS
1507 //
1508 //=================================================================================================
1509 
1510 //*************************************************************************************************
1517 template< typename MT // Type of the adapted dense matrix
1518  , bool SO > // Storage order of the adapted dense matrix
1519 inline UniUpperMatrix<MT,SO,true>&
1520  UniUpperMatrix<MT,SO,true>::operator=( const ElementType& rhs )
1521 {
1522  if( SO ) {
1523  for( size_t j=1UL; j<columns(); ++j )
1524  for( size_t i=0UL; i<j; ++i )
1525  matrix_(i,j) = rhs;
1526  }
1527  else {
1528  for( size_t i=0UL; i<rows(); ++i )
1529  for( size_t j=i+1UL; j<columns(); ++j )
1530  matrix_(i,j) = rhs;
1531  }
1532 
1533  return *this;
1534 }
1536 //*************************************************************************************************
1537 
1538 
1539 //*************************************************************************************************
1564 template< typename MT // Type of the adapted dense matrix
1565  , bool SO > // Storage order of the adapted dense matrix
1566 inline UniUpperMatrix<MT,SO,true>&
1567  UniUpperMatrix<MT,SO,true>::operator=( initializer_list< initializer_list<ElementType> > list )
1568 {
1569  const InitializerMatrix<ElementType> tmp( list, list.size() );
1570 
1571  if( !isUniUpper( tmp ) ) {
1572  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to uniupper matrix" );
1573  }
1574 
1575  matrix_ = list;
1576 
1577  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square uniupper matrix detected" );
1578  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1579 
1580  return *this;
1581 }
1583 //*************************************************************************************************
1584 
1585 
1586 //*************************************************************************************************
1610 template< typename MT // Type of the adapted dense matrix
1611  , bool SO > // Storage order of the adapted dense matrix
1612 template< typename Other // Data type of the initialization array
1613  , size_t N > // Number of rows and columns of the initialization array
1614 inline UniUpperMatrix<MT,SO,true>&
1615  UniUpperMatrix<MT,SO,true>::operator=( const Other (&array)[N][N] )
1616 {
1617  MT tmp( array );
1618 
1619  if( !isUniUpper( tmp ) ) {
1620  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to uniupper matrix" );
1621  }
1622 
1623  matrix_ = std::move( tmp );
1624 
1625  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square uniupper matrix detected" );
1626  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1627 
1628  return *this;
1629 }
1631 //*************************************************************************************************
1632 
1633 
1634 //*************************************************************************************************
1644 template< typename MT // Type of the adapted dense matrix
1645  , bool SO > // Storage order of the adapted dense matrix
1646 inline UniUpperMatrix<MT,SO,true>&
1647  UniUpperMatrix<MT,SO,true>::operator=( const UniUpperMatrix& rhs )
1648 {
1649  matrix_ = rhs.matrix_;
1650 
1651  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square uniupper matrix detected" );
1652  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1653 
1654  return *this;
1655 }
1657 //*************************************************************************************************
1658 
1659 
1660 //*************************************************************************************************
1667 template< typename MT // Type of the adapted dense matrix
1668  , bool SO > // Storage order of the adapted dense matrix
1669 inline UniUpperMatrix<MT,SO,true>&
1670  UniUpperMatrix<MT,SO,true>::operator=( UniUpperMatrix&& rhs ) noexcept
1671 {
1672  matrix_ = std::move( rhs.matrix_ );
1673 
1674  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square uniupper matrix detected" );
1675  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1676 
1677  return *this;
1678 }
1680 //*************************************************************************************************
1681 
1682 
1683 //*************************************************************************************************
1696 template< typename MT // Type of the adapted dense matrix
1697  , bool SO > // Storage order of the adapted dense matrix
1698 template< typename MT2 // Type of the right-hand side matrix
1699  , bool SO2 > // Storage order of the right-hand side matrix
1700 inline auto UniUpperMatrix<MT,SO,true>::operator=( const Matrix<MT2,SO2>& rhs )
1701  -> DisableIf_t< IsComputation_v<MT2>, UniUpperMatrix& >
1702 {
1703  if( IsStrictlyTriangular_v<MT2> || ( !IsUniUpper_v<MT2> && !isUniUpper( ~rhs ) ) ) {
1704  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to uniupper matrix" );
1705  }
1706 
1707  matrix_ = declupp( ~rhs );
1708 
1709  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square uniupper matrix detected" );
1710  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1711 
1712  return *this;
1713 }
1715 //*************************************************************************************************
1716 
1717 
1718 //*************************************************************************************************
1731 template< typename MT // Type of the adapted dense matrix
1732  , bool SO > // Storage order of the adapted dense matrix
1733 template< typename MT2 // Type of the right-hand side matrix
1734  , bool SO2 > // Storage order of the right-hand side matrix
1735 inline auto UniUpperMatrix<MT,SO,true>::operator=( const Matrix<MT2,SO2>& rhs )
1736  -> EnableIf_t< IsComputation_v<MT2>, UniUpperMatrix& >
1737 {
1738  if( IsStrictlyTriangular_v<MT2> || ( !IsSquare_v<MT2> && !isSquare( ~rhs ) ) ) {
1739  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to uniupper matrix" );
1740  }
1741 
1742  if( IsUniUpper_v<MT2> ) {
1743  matrix_ = ~rhs;
1744  }
1745  else {
1746  MT tmp( ~rhs );
1747 
1748  if( !isUniUpper( tmp ) ) {
1749  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to uniupper matrix" );
1750  }
1751 
1752  matrix_ = std::move( tmp );
1753  }
1754 
1755  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square uniupper matrix detected" );
1756  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1757 
1758  return *this;
1759 }
1761 //*************************************************************************************************
1762 
1763 
1764 //*************************************************************************************************
1777 template< typename MT // Type of the adapted dense matrix
1778  , bool SO > // Storage order of the adapted dense matrix
1779 template< typename MT2 // Type of the right-hand side matrix
1780  , bool SO2 > // Storage order of the right-hand side matrix
1781 inline auto UniUpperMatrix<MT,SO,true>::operator+=( const Matrix<MT2,SO2>& rhs )
1782  -> DisableIf_t< IsComputation_v<MT2>, UniUpperMatrix& >
1783 {
1784  if( IsLower_v<MT2> || IsUniTriangular_v<MT2> ||
1785  ( !IsStrictlyUpper_v<MT2> && !isStrictlyUpper( ~rhs ) ) ) {
1786  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to uniupper matrix" );
1787  }
1788 
1789  matrix_ += declupp( ~rhs );
1790 
1791  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square uniupper matrix detected" );
1792  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1793 
1794  return *this;
1795 }
1797 //*************************************************************************************************
1798 
1799 
1800 //*************************************************************************************************
1813 template< typename MT // Type of the adapted dense matrix
1814  , bool SO > // Storage order of the adapted dense matrix
1815 template< typename MT2 // Type of the right-hand side matrix
1816  , bool SO2 > // Storage order of the right-hand side matrix
1817 inline auto UniUpperMatrix<MT,SO,true>::operator+=( const Matrix<MT2,SO2>& rhs )
1818  -> EnableIf_t< IsComputation_v<MT2>, UniUpperMatrix& >
1819 {
1820  if( IsLower_v<MT2> || IsUniTriangular_v<MT2> ||
1821  ( !IsSquare_v<MT2> && !isSquare( ~rhs ) ) ) {
1822  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to uniupper matrix" );
1823  }
1824 
1825  if( IsStrictlyUpper_v<MT2> ) {
1826  matrix_ += ~rhs;
1827  }
1828  else {
1829  const ResultType_t<MT2> tmp( ~rhs );
1830 
1831  if( !isStrictlyUpper( tmp ) ) {
1832  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to uniupper matrix" );
1833  }
1834 
1835  matrix_ += declupp( tmp );
1836  }
1837 
1838  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square uniupper matrix detected" );
1839  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1840 
1841  return *this;
1842 }
1844 //*************************************************************************************************
1845 
1846 
1847 //*************************************************************************************************
1860 template< typename MT // Type of the adapted dense matrix
1861  , bool SO > // Storage order of the adapted dense matrix
1862 template< typename MT2 // Type of the right-hand side matrix
1863  , bool SO2 > // Storage order of the right-hand side matrix
1864 inline auto UniUpperMatrix<MT,SO,true>::operator-=( const Matrix<MT2,SO2>& rhs )
1865  -> DisableIf_t< IsComputation_v<MT2>, UniUpperMatrix& >
1866 {
1867  if( IsLower_v<MT2> || IsUniTriangular_v<MT2> ||
1868  ( !IsStrictlyUpper_v<MT2> && !isStrictlyUpper( ~rhs ) ) ) {
1869  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to uniupper matrix" );
1870  }
1871 
1872  matrix_ -= declupp( ~rhs );
1873 
1874  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square uniupper matrix detected" );
1875  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1876 
1877  return *this;
1878 }
1880 //*************************************************************************************************
1881 
1882 
1883 //*************************************************************************************************
1896 template< typename MT // Type of the adapted dense matrix
1897  , bool SO > // Storage order of the adapted dense matrix
1898 template< typename MT2 // Type of the right-hand side matrix
1899  , bool SO2 > // Storage order of the right-hand side matrix
1900 inline auto UniUpperMatrix<MT,SO,true>::operator-=( const Matrix<MT2,SO2>& rhs )
1901  -> EnableIf_t< IsComputation_v<MT2>, UniUpperMatrix& >
1902 {
1903  if( IsLower_v<MT2> || IsUniTriangular_v<MT2> ||
1904  ( !IsSquare_v<MT2> && !isSquare( ~rhs ) ) ) {
1905  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to uniupper matrix" );
1906  }
1907 
1908  if( IsStrictlyUpper_v<MT2> ) {
1909  matrix_ -= ~rhs;
1910  }
1911  else {
1912  const ResultType_t<MT2> tmp( ~rhs );
1913 
1914  if( !isStrictlyUpper( tmp ) ) {
1915  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to uniupper matrix" );
1916  }
1917 
1918  matrix_ -= declupp( tmp );
1919  }
1920 
1921  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square uniupper matrix detected" );
1922  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1923 
1924  return *this;
1925 }
1927 //*************************************************************************************************
1928 
1929 
1930 //*************************************************************************************************
1943 template< typename MT // Type of the adapted dense matrix
1944  , bool SO > // Storage order of the adapted dense matrix
1945 template< typename MT2 // Type of the right-hand side matrix
1946  , bool SO2 > // Storage order of the right-hand side matrix
1947 inline auto UniUpperMatrix<MT,SO,true>::operator%=( const Matrix<MT2,SO2>& rhs )
1948  -> UniUpperMatrix&
1949 {
1950  if( !IsSquare_v<MT2> && !isSquare( ~rhs ) ) {
1951  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to uniupper matrix" );
1952  }
1953 
1954  If_t< IsComputation_v<MT2>, ResultType_t<MT2>, const MT2& > tmp( ~rhs );
1955 
1956  for( size_t i=0UL; i<(~rhs).rows(); ++i ) {
1957  if( !isOne( tmp(i,i) ) ) {
1958  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to uniupper matrix" );
1959  }
1960  }
1961 
1962  matrix_ %= tmp;
1963 
1964  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square uniupper matrix detected" );
1965  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1966 
1967  return *this;
1968 }
1970 //*************************************************************************************************
1971 
1972 
1973 
1974 
1975 //=================================================================================================
1976 //
1977 // UTILITY FUNCTIONS
1978 //
1979 //=================================================================================================
1980 
1981 //*************************************************************************************************
1987 template< typename MT // Type of the adapted dense matrix
1988  , bool SO > // Storage order of the adapted dense matrix
1989 inline size_t UniUpperMatrix<MT,SO,true>::rows() const noexcept
1990 {
1991  return matrix_.rows();
1992 }
1994 //*************************************************************************************************
1995 
1996 
1997 //*************************************************************************************************
2003 template< typename MT // Type of the adapted dense matrix
2004  , bool SO > // Storage order of the adapted dense matrix
2005 inline size_t UniUpperMatrix<MT,SO,true>::columns() const noexcept
2006 {
2007  return matrix_.columns();
2008 }
2010 //*************************************************************************************************
2011 
2012 
2013 //*************************************************************************************************
2024 template< typename MT // Type of the adapted dense matrix
2025  , bool SO > // Storage order of the adapted dense matrix
2026 inline size_t UniUpperMatrix<MT,SO,true>::spacing() const noexcept
2027 {
2028  return matrix_.spacing();
2029 }
2031 //*************************************************************************************************
2032 
2033 
2034 //*************************************************************************************************
2040 template< typename MT // Type of the adapted dense matrix
2041  , bool SO > // Storage order of the adapted dense matrix
2042 inline size_t UniUpperMatrix<MT,SO,true>::capacity() const noexcept
2043 {
2044  return matrix_.capacity();
2045 }
2047 //*************************************************************************************************
2048 
2049 
2050 //*************************************************************************************************
2062 template< typename MT // Type of the adapted dense matrix
2063  , bool SO > // Storage order of the adapted dense matrix
2064 inline size_t UniUpperMatrix<MT,SO,true>::capacity( size_t i ) const noexcept
2065 {
2066  return matrix_.capacity(i);
2067 }
2069 //*************************************************************************************************
2070 
2071 
2072 //*************************************************************************************************
2078 template< typename MT // Type of the adapted dense matrix
2079  , bool SO > // Storage order of the adapted dense matrix
2080 inline size_t UniUpperMatrix<MT,SO,true>::nonZeros() const
2081 {
2082  return matrix_.nonZeros();
2083 }
2085 //*************************************************************************************************
2086 
2087 
2088 //*************************************************************************************************
2100 template< typename MT // Type of the adapted dense matrix
2101  , bool SO > // Storage order of the adapted dense matrix
2102 inline size_t UniUpperMatrix<MT,SO,true>::nonZeros( size_t i ) const
2103 {
2104  return matrix_.nonZeros(i);
2105 }
2107 //*************************************************************************************************
2108 
2109 
2110 //*************************************************************************************************
2116 template< typename MT // Type of the adapted dense matrix
2117  , bool SO > // Storage order of the adapted dense matrix
2119 {
2120  using blaze::clear;
2121 
2122  if( SO ) {
2123  for( size_t j=1UL; j<columns(); ++j )
2124  for( size_t i=0UL; i<j; ++i )
2125  clear( matrix_(i,j) );
2126  }
2127  else {
2128  for( size_t i=0UL; i<rows(); ++i )
2129  for( size_t j=i+1UL; j<columns(); ++j )
2130  clear( matrix_(i,j) );
2131  }
2132 }
2134 //*************************************************************************************************
2135 
2136 
2137 //*************************************************************************************************
2150 template< typename MT // Type of the adapted dense matrix
2151  , bool SO > // Storage order of the adapted dense matrix
2152 inline void UniUpperMatrix<MT,SO,true>::reset( size_t i )
2153 {
2154  using blaze::clear;
2155 
2156  if( SO ) {
2157  for( size_t j=0UL; j<i; ++j )
2158  clear( matrix_(j,i) );
2159  }
2160  else {
2161  for( size_t j=i+1UL; j<columns(); ++j )
2162  clear( matrix_(i,j) );
2163  }
2164 }
2166 //*************************************************************************************************
2167 
2168 
2169 //*************************************************************************************************
2181 template< typename MT // Type of the adapted dense matrix
2182  , bool SO > // Storage order of the adapted dense matrix
2184 {
2185  using blaze::clear;
2186 
2187  if( IsResizable_v<MT> ) {
2188  clear( matrix_ );
2189  }
2190  else {
2191  reset();
2192  }
2193 }
2195 //*************************************************************************************************
2196 
2197 
2198 //*************************************************************************************************
2234 template< typename MT // Type of the adapted dense matrix
2235  , bool SO > // Storage order of the adapted dense matrix
2236 void UniUpperMatrix<MT,SO,true>::resize( size_t n, bool preserve )
2237 {
2239 
2240  UNUSED_PARAMETER( preserve );
2241 
2242  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square uniupper matrix detected" );
2243 
2244  const size_t oldsize( matrix_.rows() );
2245 
2246  matrix_.resize( n, n, true );
2247 
2248  if( n > oldsize )
2249  {
2250  const size_t increment( n - oldsize );
2251  submatrix( matrix_, oldsize, 0UL, increment, n-1UL ).reset();
2252 
2253  for( size_t i=oldsize; i<n; ++i )
2254  matrix_(i,i) = ElementType(1);
2255  }
2256 }
2258 //*************************************************************************************************
2259 
2260 
2261 //*************************************************************************************************
2274 template< typename MT // Type of the adapted dense matrix
2275  , bool SO > // Storage order of the adapted dense matrix
2276 inline void UniUpperMatrix<MT,SO,true>::extend( size_t n, bool preserve )
2277 {
2279 
2280  UNUSED_PARAMETER( preserve );
2281 
2282  resize( rows() + n, true );
2283 }
2284 //*************************************************************************************************
2285 
2286 
2287 //*************************************************************************************************
2297 template< typename MT // Type of the adapted dense matrix
2298  , bool SO > // Storage order of the adapted dense matrix
2299 inline void UniUpperMatrix<MT,SO,true>::reserve( size_t elements )
2300 {
2301  matrix_.reserve( elements );
2302 }
2304 //*************************************************************************************************
2305 
2306 
2307 //*************************************************************************************************
2317 template< typename MT // Type of the adapted dense matrix
2318  , bool SO > // Storage order of the adapted dense matrix
2320 {
2321  matrix_.shrinkToFit();
2322 }
2324 //*************************************************************************************************
2325 
2326 
2327 //*************************************************************************************************
2334 template< typename MT // Type of the adapted dense matrix
2335  , bool SO > // Storage order of the adapted dense matrix
2336 inline void UniUpperMatrix<MT,SO,true>::swap( UniUpperMatrix& m ) noexcept
2337 {
2338  using std::swap;
2339 
2340  swap( matrix_, m.matrix_ );
2341 }
2343 //*************************************************************************************************
2344 
2345 
2346 //*************************************************************************************************
2358 template< typename MT // Type of the adapted dense matrix
2359  , bool SO > // Storage order of the adapted dense matrix
2360 inline constexpr size_t UniUpperMatrix<MT,SO,true>::maxNonZeros() noexcept
2361 {
2363 
2364  return maxNonZeros( Size_v<MT,0UL> );
2365 }
2367 //*************************************************************************************************
2368 
2369 
2370 //*************************************************************************************************
2380 template< typename MT // Type of the adapted dense matrix
2381  , bool SO > // Storage order of the adapted dense matrix
2382 inline constexpr size_t UniUpperMatrix<MT,SO,true>::maxNonZeros( size_t n ) noexcept
2383 {
2384  return ( ( n + 1UL ) * n ) / 2UL;
2385 }
2387 //*************************************************************************************************
2388 
2389 
2390 
2391 
2392 //=================================================================================================
2393 //
2394 // DEBUGGING FUNCTIONS
2395 //
2396 //=================================================================================================
2397 
2398 //*************************************************************************************************
2408 template< typename MT // Type of the adapted dense matrix
2409  , bool SO > // Storage order of the adapted dense matrix
2410 inline bool UniUpperMatrix<MT,SO,true>::isIntact() const noexcept
2411 {
2412  using blaze::isIntact;
2413 
2414  return ( isIntact( matrix_ ) && isUniUpper( matrix_ ) );
2415 }
2417 //*************************************************************************************************
2418 
2419 
2420 
2421 
2422 //=================================================================================================
2423 //
2424 // EXPRESSION TEMPLATE EVALUATION FUNCTIONS
2425 //
2426 //=================================================================================================
2427 
2428 //*************************************************************************************************
2439 template< typename MT // Type of the adapted dense matrix
2440  , bool SO > // Storage order of the adapted dense matrix
2441 template< typename Other > // Data type of the foreign expression
2442 inline bool UniUpperMatrix<MT,SO,true>::canAlias( const Other* alias ) const noexcept
2443 {
2444  return matrix_.canAlias( alias );
2445 }
2447 //*************************************************************************************************
2448 
2449 
2450 //*************************************************************************************************
2461 template< typename MT // Type of the adapted dense matrix
2462  , bool SO > // Storage order of the adapted dense matrix
2463 template< typename Other > // Data type of the foreign expression
2464 inline bool UniUpperMatrix<MT,SO,true>::isAliased( const Other* alias ) const noexcept
2465 {
2466  return matrix_.isAliased( alias );
2467 }
2469 //*************************************************************************************************
2470 
2471 
2472 //*************************************************************************************************
2482 template< typename MT // Type of the adapted dense matrix
2483  , bool SO > // Storage order of the adapted dense matrix
2484 inline bool UniUpperMatrix<MT,SO,true>::isAligned() const noexcept
2485 {
2486  return matrix_.isAligned();
2487 }
2489 //*************************************************************************************************
2490 
2491 
2492 //*************************************************************************************************
2503 template< typename MT // Type of the adapted dense matrix
2504  , bool SO > // Storage order of the adapted dense matrix
2505 inline bool UniUpperMatrix<MT,SO,true>::canSMPAssign() const noexcept
2506 {
2507  return matrix_.canSMPAssign();
2508 }
2510 //*************************************************************************************************
2511 
2512 
2513 //*************************************************************************************************
2529 template< typename MT // Type of the adapted dense matrix
2530  , bool SO > // Storage order of the adapted dense matrix
2531 BLAZE_ALWAYS_INLINE typename UniUpperMatrix<MT,SO,true>::SIMDType
2532  UniUpperMatrix<MT,SO,true>::load( size_t i, size_t j ) const noexcept
2533 {
2534  return matrix_.load( i, j );
2535 }
2537 //*************************************************************************************************
2538 
2539 
2540 //*************************************************************************************************
2556 template< typename MT // Type of the adapted dense matrix
2557  , bool SO > // Storage order of the adapted dense matrix
2558 BLAZE_ALWAYS_INLINE typename UniUpperMatrix<MT,SO,true>::SIMDType
2559  UniUpperMatrix<MT,SO,true>::loada( size_t i, size_t j ) const noexcept
2560 {
2561  return matrix_.loada( i, j );
2562 }
2564 //*************************************************************************************************
2565 
2566 
2567 //*************************************************************************************************
2583 template< typename MT // Type of the adapted dense matrix
2584  , bool SO > // Storage order of the adapted dense matrix
2585 BLAZE_ALWAYS_INLINE typename UniUpperMatrix<MT,SO,true>::SIMDType
2586  UniUpperMatrix<MT,SO,true>::loadu( size_t i, size_t j ) const noexcept
2587 {
2588  return matrix_.loadu( i, j );
2589 }
2591 //*************************************************************************************************
2592 
2593 
2594 
2595 
2596 //=================================================================================================
2597 //
2598 // CONSTRUCTION FUNCTIONS
2599 //
2600 //=================================================================================================
2601 
2602 //*************************************************************************************************
2609 template< typename MT // Type of the adapted dense matrix
2610  , bool SO > // Storage order of the adapted dense matrix
2611 inline const MT UniUpperMatrix<MT,SO,true>::construct( size_t n, TrueType )
2612 {
2614 
2615  MT tmp( n, n, ElementType() );
2616 
2617  for( size_t i=0UL; i<n; ++i )
2618  tmp(i,i) = ElementType(1);
2619 
2620  return tmp;
2621 }
2623 //*************************************************************************************************
2624 
2625 
2626 //*************************************************************************************************
2633 template< typename MT // Type of the adapted dense matrix
2634  , bool SO > // Storage order of the adapted dense matrix
2635 inline const MT UniUpperMatrix<MT,SO,true>::construct( const ElementType& init, FalseType )
2636 {
2639 
2640  MT tmp;
2641 
2642  if( SO ) {
2643  for( size_t j=0UL; j<columns(); ++j ) {
2644  for( size_t i=0UL; i<j; ++i )
2645  tmp(i,j) = init;
2646  tmp(j,j) = ElementType(1);
2647  }
2648  }
2649  else {
2650  for( size_t i=0UL; i<rows(); ++i ) {
2651  tmp(i,i) = ElementType(1);
2652  for( size_t j=i+1UL; j<columns(); ++j )
2653  tmp(i,j) = init;
2654  }
2655  }
2656 
2657  return tmp;
2658 }
2660 //*************************************************************************************************
2661 
2662 
2663 //*************************************************************************************************
2674 template< typename MT // Type of the adapted dense matrix
2675  , bool SO > // Storage order of the adapted dense matrix
2676 template< typename MT2 // Type of the foreign matrix
2677  , bool SO2 // Storage order of the foreign matrix
2678  , typename T > // Type of the third argument
2679 inline const MT UniUpperMatrix<MT,SO,true>::construct( const Matrix<MT2,SO2>& m, T )
2680 {
2681  const MT tmp( ~m );
2682 
2683  if( IsStrictlyTriangular_v<MT2> || ( !IsUniUpper_v<MT2> && !isUniUpper( tmp ) ) ) {
2684  BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of uniupper matrix" );
2685  }
2686 
2687  return tmp;
2688 }
2690 //*************************************************************************************************
2691 
2692 } // namespace blaze
2693 
2694 #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:133
Constraint on the data type.
CompressedMatrix< Type, false > OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: CompressedMatrix.h:3078
#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.
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:169
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: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.
This ResultType
Result type for expression template evaluations.
Definition: CompressedMatrix.h:3077
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
CompressedMatrix< Type, true > This
Type of this CompressedMatrix instance.
Definition: CompressedMatrix.h:3075
Constraint on the data type.
void reset(const DiagonalProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: DiagonalProxy.h:591
static constexpr bool smpAssignable
Compilation flag for SMP assignments.
Definition: CompressedMatrix.h:3113
void shrinkToFit(Matrix< MT, SO > &matrix)
Requesting the removal of unused capacity.
Definition: Matrix.h:799
void clear(CompressedMatrix< Type, SO > &m)
Clearing the given compressed matrix.
Definition: CompressedMatrix.h:5828
CompressedMatrix< Type, false > TransposeType
Transpose type for expression template evaluations.
Definition: CompressedMatrix.h:3079
const Type & ConstReference
Reference to a constant matrix value.
Definition: CompressedMatrix.h:3084
decltype(auto) declupp(const DenseMatrix< MT, SO > &dm)
Declares the given dense matrix expression dm as upper.
Definition: DMatDeclUppExpr.h:1002
#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
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: TrueType.h:61
Element * Iterator
Iterator over non-constant elements.
Definition: CompressedMatrix.h:3085
Header file for the extended initializer_list functionality.
constexpr void UNUSED_PARAMETER(const Args &...)
Suppression of unused parameter warnings.
Definition: Unused.h:81
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: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.
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.
MatrixAccessProxy< This > Reference
Reference to a non-constant matrix value.
Definition: CompressedMatrix.h:3083
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:5907
Compile time assertion.
bool isIntact(const CompressedMatrix< Type, SO > &m)
Returns whether the invariants of the given compressed matrix are intact.
Definition: CompressedMatrix.h:5890
SparseMatrix< This, true > BaseType
Base type of this CompressedMatrix instance.
Definition: CompressedMatrix.h:3076
#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:3080
#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
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:3086
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.
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:135
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
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:8908
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
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:611
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:1446
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.
#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 &#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:693
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:281
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
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
constexpr bool IsComputation_v
Auxiliary variable template for the IsComputation type trait.The IsComputation_v variable template pr...
Definition: IsComputation.h:90
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:3081
#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:3082
#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:1359
bool isIntact(const DiagonalMatrix< MT, SO, DF > &m)
Returns whether the invariants of the given diagonal matrix are intact.
Definition: DiagonalMatrix.h:263
#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
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.
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.
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
Header file for the TrueType type/value trait base class.
Header file for the clear shim.