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>
60 #include <blaze/math/Exception.h>
63 #include <blaze/math/shims/Clear.h>
65 #include <blaze/math/shims/IsOne.h>
77 #include <blaze/system/Inline.h>
78 #include <blaze/util/Assert.h>
85 #include <blaze/util/DisableIf.h>
86 #include <blaze/util/EnableIf.h>
87 #include <blaze/util/FalseType.h>
89 #include <blaze/util/TrueType.h>
90 #include <blaze/util/Types.h>
91 #include <blaze/util/Unused.h>
92 
93 
94 namespace blaze {
95 
96 //=================================================================================================
97 //
98 // CLASS TEMPLATE SPECIALIZATION FOR DENSE MATRICES
99 //
100 //=================================================================================================
101 
102 //*************************************************************************************************
110 template< typename MT // Type of the adapted dense matrix
111  , bool SO > // Storage order of the adapted dense matrix
112 class UniUpperMatrix<MT,SO,true>
113  : public DenseMatrix< UniUpperMatrix<MT,SO,true>, SO >
114 {
115  private:
116  //**Type definitions****************************************************************************
117  using OT = OppositeType_<MT>;
118  using TT = TransposeType_<MT>;
119  using ET = ElementType_<MT>;
120  //**********************************************************************************************
121 
122  public:
123  //**Type definitions****************************************************************************
124  using This = UniUpperMatrix<MT,SO,true>;
125  using BaseType = DenseMatrix<This,SO>;
126  using ResultType = This;
127  using OppositeType = UniUpperMatrix<OT,!SO,true>;
128  using TransposeType = UniLowerMatrix<TT,!SO,true>;
129  using ElementType = ET;
130  using SIMDType = SIMDType_<MT>;
131  using ReturnType = ReturnType_<MT>;
132  using CompositeType = const This&;
133  using Reference = UniUpperProxy<MT>;
134  using ConstReference = ConstReference_<MT>;
135  using Pointer = Pointer_<MT>;
136  using ConstPointer = ConstPointer_<MT>;
137  using ConstIterator = ConstIterator_<MT>;
138  //**********************************************************************************************
139 
140  //**Rebind struct definition********************************************************************
143  template< typename NewType > // Data type of the other matrix
144  struct Rebind {
146  using Other = UniUpperMatrix< typename MT::template Rebind<NewType>::Other >;
147  };
148  //**********************************************************************************************
149 
150  //**Resize struct definition********************************************************************
153  template< size_t NewM // Number of rows of the other matrix
154  , size_t NewN > // Number of columns of the other matrix
155  struct Resize {
157  using Other = UniUpperMatrix< typename MT::template Resize<NewM,NewN>::Other >;
158  };
159  //**********************************************************************************************
160 
161  //**Iterator class definition*******************************************************************
164  class Iterator
165  {
166  public:
167  //**Type definitions*************************************************************************
168  using IteratorCategory = std::random_access_iterator_tag;
169  using ValueType = ElementType_<MT>;
170  using PointerType = UniUpperProxy<MT>;
171  using ReferenceType = UniUpperProxy<MT>;
172  using DifferenceType = ptrdiff_t;
173 
174  // STL iterator requirements
175  using iterator_category = IteratorCategory;
176  using value_type = ValueType;
177  using pointer = PointerType;
178  using reference = ReferenceType;
179  using difference_type = DifferenceType;
180  //*******************************************************************************************
181 
182  //**Constructor******************************************************************************
185  inline Iterator() noexcept
186  : matrix_( nullptr ) // Reference to the adapted dense matrix
187  , row_ ( 0UL ) // The current row index of the iterator
188  , column_( 0UL ) // The current column index of the iterator
189  {}
190  //*******************************************************************************************
191 
192  //**Constructor******************************************************************************
199  inline Iterator( MT& matrix, size_t row, size_t column ) noexcept
200  : matrix_( &matrix ) // Reference to the adapted dense matrix
201  , row_ ( row ) // The current row-index of the iterator
202  , column_( column ) // The current column-index of the iterator
203  {}
204  //*******************************************************************************************
205 
206  //**Addition assignment operator*************************************************************
212  inline Iterator& operator+=( size_t inc ) noexcept {
213  ( SO )?( row_ += inc ):( column_ += inc );
214  return *this;
215  }
216  //*******************************************************************************************
217 
218  //**Subtraction assignment operator**********************************************************
224  inline Iterator& operator-=( size_t dec ) noexcept {
225  ( SO )?( row_ -= dec ):( column_ -= dec );
226  return *this;
227  }
228  //*******************************************************************************************
229 
230  //**Prefix increment operator****************************************************************
235  inline Iterator& operator++() noexcept {
236  ( SO )?( ++row_ ):( ++column_ );
237  return *this;
238  }
239  //*******************************************************************************************
240 
241  //**Postfix increment operator***************************************************************
246  inline const Iterator operator++( int ) noexcept {
247  const Iterator tmp( *this );
248  ++(*this);
249  return tmp;
250  }
251  //*******************************************************************************************
252 
253  //**Prefix decrement operator****************************************************************
258  inline Iterator& operator--() noexcept {
259  ( SO )?( --row_ ):( --column_ );
260  return *this;
261  }
262  //*******************************************************************************************
263 
264  //**Postfix decrement operator***************************************************************
269  inline const Iterator operator--( int ) {
270  const Iterator tmp( *this );
271  --(*this);
272  return tmp;
273  }
274  //*******************************************************************************************
275 
276  //**Element access operator******************************************************************
281  inline ReferenceType operator*() const {
282  return ReferenceType( *matrix_, row_, column_ );
283  }
284  //*******************************************************************************************
285 
286  //**Element access operator******************************************************************
291  inline PointerType operator->() const {
292  return PointerType( *matrix_, row_, column_ );
293  }
294  //*******************************************************************************************
295 
296  //**Load function****************************************************************************
306  inline SIMDType load() const {
307  return (*matrix_).load(row_,column_);
308  }
309  //*******************************************************************************************
310 
311  //**Loada function***************************************************************************
321  inline SIMDType loada() const {
322  return (*matrix_).loada(row_,column_);
323  }
324  //*******************************************************************************************
325 
326  //**Loadu function***************************************************************************
336  inline SIMDType loadu() const {
337  return (*matrix_).loadu(row_,column_);
338  }
339  //*******************************************************************************************
340 
341  //**Conversion operator**********************************************************************
346  inline operator ConstIterator() const {
347  if( SO )
348  return matrix_->begin( column_ ) + row_;
349  else
350  return matrix_->begin( row_ ) + column_;
351  }
352  //*******************************************************************************************
353 
354  //**Equality operator************************************************************************
361  friend inline bool operator==( const Iterator& lhs, const Iterator& rhs ) noexcept {
362  return ( SO )?( lhs.row_ == rhs.row_ ):( lhs.column_ == rhs.column_ );
363  }
364  //*******************************************************************************************
365 
366  //**Equality operator************************************************************************
373  friend inline bool operator==( const Iterator& lhs, const ConstIterator& rhs ) {
374  return ( ConstIterator( lhs ) == rhs );
375  }
376  //*******************************************************************************************
377 
378  //**Equality operator************************************************************************
385  friend inline bool operator==( const ConstIterator& lhs, const Iterator& rhs ) {
386  return ( lhs == ConstIterator( rhs ) );
387  }
388  //*******************************************************************************************
389 
390  //**Inequality operator**********************************************************************
397  friend inline bool operator!=( const Iterator& lhs, const Iterator& rhs ) noexcept {
398  return ( SO )?( lhs.row_ != rhs.row_ ):( lhs.column_ != rhs.column_ );
399  }
400  //*******************************************************************************************
401 
402  //**Inequality operator**********************************************************************
409  friend inline bool operator!=( const Iterator& lhs, const ConstIterator& rhs ) {
410  return ( ConstIterator( lhs ) != rhs );
411  }
412  //*******************************************************************************************
413 
414  //**Inequality operator**********************************************************************
421  friend inline bool operator!=( const ConstIterator& lhs, const Iterator& rhs ) {
422  return ( lhs != ConstIterator( rhs ) );
423  }
424  //*******************************************************************************************
425 
426  //**Less-than operator***********************************************************************
433  friend inline bool operator<( const Iterator& lhs, const Iterator& rhs ) noexcept {
434  return ( SO )?( lhs.row_ < rhs.row_ ):( lhs.column_ < rhs.column_ );
435  }
436  //*******************************************************************************************
437 
438  //**Less-than operator***********************************************************************
445  friend inline bool operator<( const Iterator& lhs, const ConstIterator& rhs ) {
446  return ( ConstIterator( lhs ) < rhs );
447  }
448  //*******************************************************************************************
449 
450  //**Less-than operator***********************************************************************
457  friend inline bool operator<( const ConstIterator& lhs, const Iterator& rhs ) {
458  return ( lhs < ConstIterator( rhs ) );
459  }
460  //*******************************************************************************************
461 
462  //**Greater-than operator********************************************************************
469  friend inline bool operator>( const Iterator& lhs, const Iterator& rhs ) noexcept {
470  return ( SO )?( lhs.row_ > rhs.row_ ):( lhs.column_ > rhs.column_ );
471  }
472  //*******************************************************************************************
473 
474  //**Greater-than operator********************************************************************
481  friend inline bool operator>( const Iterator& lhs, const ConstIterator& rhs ) {
482  return ( ConstIterator( lhs ) > rhs );
483  }
484  //*******************************************************************************************
485 
486  //**Greater-than operator********************************************************************
493  friend inline bool operator>( const ConstIterator& lhs, const Iterator& rhs ) {
494  return ( lhs > ConstIterator( rhs ) );
495  }
496  //*******************************************************************************************
497 
498  //**Less-or-equal-than operator**************************************************************
505  friend inline bool operator<=( const Iterator& lhs, const Iterator& rhs ) noexcept {
506  return ( SO )?( lhs.row_ <= rhs.row_ ):( lhs.column_ <= rhs.column_ );
507  }
508  //*******************************************************************************************
509 
510  //**Less-or-equal-than operator**************************************************************
517  friend inline bool operator<=( const Iterator& lhs, const ConstIterator& rhs ) {
518  return ( ConstIterator( lhs ) <= rhs );
519  }
520  //*******************************************************************************************
521 
522  //**Less-or-equal-than operator**************************************************************
529  friend inline bool operator<=( const ConstIterator& lhs, const Iterator& rhs ) {
530  return ( lhs <= ConstIterator( rhs ) );
531  }
532  //*******************************************************************************************
533 
534  //**Greater-or-equal-than operator***********************************************************
541  friend inline bool operator>=( const Iterator& lhs, const Iterator& rhs ) noexcept {
542  return ( SO )?( lhs.row_ >= rhs.row_ ):( lhs.column_ >= rhs.column_ );
543  }
544  //*******************************************************************************************
545 
546  //**Greater-or-equal-than operator***********************************************************
553  friend inline bool operator>=( const Iterator& lhs, const ConstIterator& rhs ) {
554  return ( ConstIterator( lhs ) >= rhs );
555  }
556  //*******************************************************************************************
557 
558  //**Greater-or-equal-than operator***********************************************************
565  friend inline bool operator>=( const ConstIterator& lhs, const Iterator& rhs ) {
566  return ( lhs >= ConstIterator( rhs ) );
567  }
568  //*******************************************************************************************
569 
570  //**Subtraction operator*********************************************************************
576  inline DifferenceType operator-( const Iterator& rhs ) const noexcept {
577  return ( SO )?( row_ - rhs.row_ ):( column_ - rhs.column_ );
578  }
579  //*******************************************************************************************
580 
581  //**Addition operator************************************************************************
588  friend inline const Iterator operator+( const Iterator& it, size_t inc ) noexcept {
589  if( SO )
590  return Iterator( *it.matrix_, it.row_ + inc, it.column_ );
591  else
592  return Iterator( *it.matrix_, it.row_, it.column_ + inc );
593  }
594  //*******************************************************************************************
595 
596  //**Addition operator************************************************************************
603  friend inline const Iterator operator+( size_t inc, const Iterator& it ) noexcept {
604  if( SO )
605  return Iterator( *it.matrix_, it.row_ + inc, it.column_ );
606  else
607  return Iterator( *it.matrix_, it.row_, it.column_ + inc );
608  }
609  //*******************************************************************************************
610 
611  //**Subtraction operator*********************************************************************
618  friend inline const Iterator operator-( const Iterator& it, size_t dec ) noexcept {
619  if( SO )
620  return Iterator( *it.matrix_, it.row_ - dec, it.column_ );
621  else
622  return Iterator( *it.matrix_, it.row_, it.column_ - dec );
623  }
624  //*******************************************************************************************
625 
626  private:
627  //**Member variables*************************************************************************
628  MT* matrix_;
629  size_t row_;
630  size_t column_;
631  //*******************************************************************************************
632  };
633  //**********************************************************************************************
634 
635  //**Compilation flags***************************************************************************
637  enum : bool { simdEnabled = MT::simdEnabled };
638 
640  enum : bool { smpAssignable = MT::smpAssignable };
641  //**********************************************************************************************
642 
643  //**Constructors********************************************************************************
646  explicit inline UniUpperMatrix();
647  template< typename A1 > explicit inline UniUpperMatrix( const A1& a1 );
648  explicit inline UniUpperMatrix( size_t n, const ElementType& init );
649 
650  explicit inline UniUpperMatrix( initializer_list< initializer_list<ElementType> > list );
651 
652  template< typename Other >
653  explicit inline UniUpperMatrix( size_t n, const Other* array );
654 
655  template< typename Other, size_t N >
656  explicit inline UniUpperMatrix( const Other (&array)[N][N] );
657 
658  explicit inline UniUpperMatrix( ElementType* ptr, size_t n );
659  explicit inline UniUpperMatrix( ElementType* ptr, size_t n, size_t nn );
660 
661  inline UniUpperMatrix( const UniUpperMatrix& m );
662  inline UniUpperMatrix( UniUpperMatrix&& m ) noexcept;
664  //**********************************************************************************************
665 
666  //**Destructor**********************************************************************************
667  // No explicitly declared destructor.
668  //**********************************************************************************************
669 
670  //**Data access functions***********************************************************************
673  inline Reference operator()( size_t i, size_t j );
674  inline ConstReference operator()( size_t i, size_t j ) const;
675  inline Reference at( size_t i, size_t j );
676  inline ConstReference at( size_t i, size_t j ) const;
677  inline ConstPointer data () const noexcept;
678  inline ConstPointer data ( size_t i ) const noexcept;
679  inline Iterator begin ( size_t i );
680  inline ConstIterator begin ( size_t i ) const;
681  inline ConstIterator cbegin( size_t i ) const;
682  inline Iterator end ( size_t i );
683  inline ConstIterator end ( size_t i ) const;
684  inline ConstIterator cend ( size_t i ) const;
686  //**********************************************************************************************
687 
688  //**Assignment operators************************************************************************
691  inline UniUpperMatrix& operator=( const ElementType& rhs );
692  inline UniUpperMatrix& operator=( initializer_list< initializer_list<ElementType> > list );
693 
694  template< typename Other, size_t N >
695  inline UniUpperMatrix& operator=( const Other (&array)[N][N] );
696 
697  inline UniUpperMatrix& operator=( const UniUpperMatrix& rhs );
698  inline UniUpperMatrix& operator=( UniUpperMatrix&& rhs ) noexcept;
699 
700  template< typename MT2, bool SO2 >
701  inline DisableIf_< IsComputation<MT2>, UniUpperMatrix& > operator=( const Matrix<MT2,SO2>& rhs );
702 
703  template< typename MT2, bool SO2 >
704  inline EnableIf_< IsComputation<MT2>, UniUpperMatrix& > operator=( const Matrix<MT2,SO2>& rhs );
705 
706  template< typename MT2, bool SO2 >
707  inline DisableIf_< IsComputation<MT2>, UniUpperMatrix& > operator+=( const Matrix<MT2,SO2>& rhs );
708 
709  template< typename MT2, bool SO2 >
710  inline EnableIf_< IsComputation<MT2>, UniUpperMatrix& > operator+=( const Matrix<MT2,SO2>& rhs );
711 
712  template< typename MT2, bool SO2 >
713  inline DisableIf_< IsComputation<MT2>, UniUpperMatrix& > operator-=( const Matrix<MT2,SO2>& rhs );
714 
715  template< typename MT2, bool SO2 >
716  inline EnableIf_< IsComputation<MT2>, UniUpperMatrix& > operator-=( const Matrix<MT2,SO2>& rhs );
717 
718  template< typename MT2, bool SO2 >
719  inline UniUpperMatrix& operator%=( const Matrix<MT2,SO2>& rhs );
720 
721  template< typename MT2, bool SO2 >
722  inline UniUpperMatrix& operator*=( const Matrix<MT2,SO2>& rhs );
724  //**********************************************************************************************
725 
726  //**Utility functions***************************************************************************
729  inline size_t rows() const noexcept;
730  inline size_t columns() const noexcept;
731  inline size_t spacing() const noexcept;
732  inline size_t capacity() const noexcept;
733  inline size_t capacity( size_t i ) const noexcept;
734  inline size_t nonZeros() const;
735  inline size_t nonZeros( size_t i ) const;
736  inline void reset();
737  inline void reset( size_t i );
738  inline void clear();
739  void resize ( size_t n, bool preserve=true );
740  inline void extend ( size_t n, bool preserve=true );
741  inline void reserve( size_t elements );
742  inline void shrinkToFit();
743  inline void swap( UniUpperMatrix& m ) noexcept;
744 
745  static inline constexpr size_t maxNonZeros() noexcept;
746  static inline constexpr size_t maxNonZeros( size_t n ) noexcept;
748  //**********************************************************************************************
749 
750  //**Debugging functions*************************************************************************
753  inline bool isIntact() const noexcept;
755  //**********************************************************************************************
756 
757  //**Expression template evaluation functions****************************************************
760  template< typename Other > inline bool canAlias ( const Other* alias ) const noexcept;
761  template< typename Other > inline bool isAliased( const Other* alias ) const noexcept;
762 
763  inline bool isAligned () const noexcept;
764  inline bool canSMPAssign() const noexcept;
765 
766  BLAZE_ALWAYS_INLINE SIMDType load ( size_t i, size_t j ) const noexcept;
767  BLAZE_ALWAYS_INLINE SIMDType loada( size_t i, size_t j ) const noexcept;
768  BLAZE_ALWAYS_INLINE SIMDType loadu( size_t i, size_t j ) const noexcept;
770  //**********************************************************************************************
771 
772  private:
773  //**Construction functions**********************************************************************
776  inline const MT construct( size_t n , TrueType );
777  inline const MT construct( const ElementType& value, FalseType );
778 
779  template< typename MT2, bool SO2, typename T >
780  inline const MT construct( const Matrix<MT2,SO2>& m, T );
782  //**********************************************************************************************
783 
784  //**Member variables****************************************************************************
787  MT matrix_;
788 
789  //**********************************************************************************************
790 
791  //**Friend declarations*************************************************************************
792  template< typename MT2, bool SO2, bool DF2 >
793  friend MT2& derestrict( UniUpperMatrix<MT2,SO2,DF2>& m );
794  //**********************************************************************************************
795 
796  //**Compile time checks*************************************************************************
810  BLAZE_STATIC_ASSERT( Rows<MT>::value == Columns<MT>::value );
811  //**********************************************************************************************
812 };
814 //*************************************************************************************************
815 
816 
817 
818 
819 //=================================================================================================
820 //
821 // CONSTRUCTORS
822 //
823 //=================================================================================================
824 
825 //*************************************************************************************************
829 template< typename MT // Type of the adapted dense matrix
830  , bool SO > // Storage order of the adapted dense matrix
831 inline UniUpperMatrix<MT,SO,true>::UniUpperMatrix()
832  : matrix_() // The adapted dense matrix
833 {
834  for( size_t i=0UL; i<rows(); ++i )
835  matrix_(i,i) = ElementType(1);
836 
837  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square uniupper matrix detected" );
838  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
839 }
841 //*************************************************************************************************
842 
843 
844 //*************************************************************************************************
862 template< typename MT // Type of the adapted dense matrix
863  , bool SO > // Storage order of the adapted dense matrix
864 template< typename A1 > // Type of the constructor argument
865 inline UniUpperMatrix<MT,SO,true>::UniUpperMatrix( const A1& a1 )
866  : matrix_( construct( a1, typename IsResizable<MT>::Type() ) ) // The adapted dense matrix
867 {
868  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square uniupper matrix detected" );
869  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
870 }
872 //*************************************************************************************************
873 
874 
875 //*************************************************************************************************
882 template< typename MT // Type of the adapted dense matrix
883  , bool SO > // Storage order of the adapted dense matrix
884 inline UniUpperMatrix<MT,SO,true>::UniUpperMatrix( size_t n, const ElementType& init )
885  : matrix_( n, n, ElementType() ) // The adapted dense matrix
886 {
888 
889  if( SO ) {
890  for( size_t j=0UL; j<columns(); ++j ) {
891  for( size_t i=0UL; i<j; ++i )
892  matrix_(i,j) = init;
893  matrix_(j,j) = ElementType(1);
894  }
895  }
896  else {
897  for( size_t i=0UL; i<rows(); ++i ) {
898  matrix_(i,i) = ElementType(1);
899  for( size_t j=i+1UL; j<columns(); ++j )
900  matrix_(i,j) = init;
901  }
902  }
903 
904  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square uniupper matrix detected" );
905  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
906 }
908 //*************************************************************************************************
909 
910 
911 //*************************************************************************************************
934 template< typename MT // Type of the adapted dense matrix
935  , bool SO > // Storage order of the adapted dense matrix
936 inline UniUpperMatrix<MT,SO,true>::UniUpperMatrix( initializer_list< initializer_list<ElementType> > list )
937  : matrix_( list ) // The adapted dense matrix
938 {
939  if( !isUniUpper( matrix_ ) ) {
940  BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of uniupper matrix" );
941  }
942 
943  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
944 }
946 //*************************************************************************************************
947 
948 
949 //*************************************************************************************************
975 template< typename MT // Type of the adapted dense matrix
976  , bool SO > // Storage order of the adapted dense matrix
977 template< typename Other > // Data type of the initialization array
978 inline UniUpperMatrix<MT,SO,true>::UniUpperMatrix( size_t n, const Other* array )
979  : matrix_( n, n, array ) // The adapted dense matrix
980 {
981  if( !isUniUpper( matrix_ ) ) {
982  BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of uniupper matrix" );
983  }
984 
985  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
986 }
988 //*************************************************************************************************
989 
990 
991 //*************************************************************************************************
1014 template< typename MT // Type of the adapted dense matrix
1015  , bool SO > // Storage order of the adapted dense matrix
1016 template< typename Other // Data type of the initialization array
1017  , size_t N > // Number of rows and columns of the initialization array
1018 inline UniUpperMatrix<MT,SO,true>::UniUpperMatrix( const Other (&array)[N][N] )
1019  : matrix_( array ) // The adapted dense matrix
1020 {
1021  if( !isUniUpper( matrix_ ) ) {
1022  BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of uniupper matrix" );
1023  }
1024 
1025  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1026 }
1028 //*************************************************************************************************
1029 
1030 
1031 //*************************************************************************************************
1066 template< typename MT // Type of the adapted dense matrix
1067  , bool SO > // Storage order of the adapted dense matrix
1068 inline UniUpperMatrix<MT,SO,true>::UniUpperMatrix( ElementType* ptr, size_t n )
1069  : matrix_( ptr, n, n ) // The adapted dense matrix
1070 {
1071  if( !isUniUpper( matrix_ ) ) {
1072  BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of uniupper matrix" );
1073  }
1074 
1075  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1076 }
1078 //*************************************************************************************************
1079 
1080 
1081 //*************************************************************************************************
1118 template< typename MT // Type of the adapted dense matrix
1119  , bool SO > // Storage order of the adapted dense matrix
1120 inline UniUpperMatrix<MT,SO,true>::UniUpperMatrix( ElementType* ptr, size_t n, size_t nn )
1121  : matrix_( ptr, n, n, nn ) // The adapted dense matrix
1122 {
1123  if( !isUniUpper( matrix_ ) ) {
1124  BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of uniupper matrix" );
1125  }
1126 
1127  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1128 }
1130 //*************************************************************************************************
1131 
1132 
1133 //*************************************************************************************************
1139 template< typename MT // Type of the adapted dense matrix
1140  , bool SO > // Storage order of the adapted dense matrix
1141 inline UniUpperMatrix<MT,SO,true>::UniUpperMatrix( const UniUpperMatrix& m )
1142  : matrix_( m.matrix_ ) // The adapted dense matrix
1143 {
1144  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square uniupper matrix detected" );
1145  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1146 }
1148 //*************************************************************************************************
1149 
1150 
1151 //*************************************************************************************************
1157 template< typename MT // Type of the adapted dense matrix
1158  , bool SO > // Storage order of the adapted dense matrix
1159 inline UniUpperMatrix<MT,SO,true>::UniUpperMatrix( UniUpperMatrix&& m ) noexcept
1160  : matrix_( std::move( m.matrix_ ) ) // The adapted dense matrix
1161 {
1162  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square uniupper matrix detected" );
1163  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1164 }
1166 //*************************************************************************************************
1167 
1168 
1169 
1170 
1171 //=================================================================================================
1172 //
1173 // DATA ACCESS FUNCTIONS
1174 //
1175 //=================================================================================================
1176 
1177 //*************************************************************************************************
1193 template< typename MT // Type of the adapted dense matrix
1194  , bool SO > // Storage order of the adapted dense matrix
1196  UniUpperMatrix<MT,SO,true>::operator()( size_t i, size_t j )
1197 {
1198  BLAZE_USER_ASSERT( i<rows() , "Invalid row access index" );
1199  BLAZE_USER_ASSERT( j<columns(), "Invalid column access index" );
1200 
1201  return Reference( matrix_, i, j );
1202 }
1204 //*************************************************************************************************
1205 
1206 
1207 //*************************************************************************************************
1223 template< typename MT // Type of the adapted dense matrix
1224  , bool SO > // Storage order of the adapted dense matrix
1226  UniUpperMatrix<MT,SO,true>::operator()( size_t i, size_t j ) const
1227 {
1228  BLAZE_USER_ASSERT( i<rows() , "Invalid row access index" );
1229  BLAZE_USER_ASSERT( j<columns(), "Invalid column access index" );
1230 
1231  return matrix_(i,j);
1232 }
1234 //*************************************************************************************************
1235 
1236 
1237 //*************************************************************************************************
1254 template< typename MT // Type of the adapted dense matrix
1255  , bool SO > // Storage order of the adapted dense matrix
1257  UniUpperMatrix<MT,SO,true>::at( size_t i, size_t j )
1258 {
1259  if( i >= rows() ) {
1260  BLAZE_THROW_OUT_OF_RANGE( "Invalid row access index" );
1261  }
1262  if( j >= columns() ) {
1263  BLAZE_THROW_OUT_OF_RANGE( "Invalid column access index" );
1264  }
1265  return (*this)(i,j);
1266 }
1268 //*************************************************************************************************
1269 
1270 
1271 //*************************************************************************************************
1288 template< typename MT // Type of the adapted dense matrix
1289  , bool SO > // Storage order of the adapted dense matrix
1291  UniUpperMatrix<MT,SO,true>::at( size_t i, size_t j ) const
1292 {
1293  if( i >= rows() ) {
1294  BLAZE_THROW_OUT_OF_RANGE( "Invalid row access index" );
1295  }
1296  if( j >= columns() ) {
1297  BLAZE_THROW_OUT_OF_RANGE( "Invalid column access index" );
1298  }
1299  return (*this)(i,j);
1300 }
1302 //*************************************************************************************************
1303 
1304 
1305 //*************************************************************************************************
1318 template< typename MT // Type of the adapted dense matrix
1319  , bool SO > // Storage order of the adapted dense matrix
1320 inline typename UniUpperMatrix<MT,SO,true>::ConstPointer
1321  UniUpperMatrix<MT,SO,true>::data() const noexcept
1322 {
1323  return matrix_.data();
1324 }
1326 //*************************************************************************************************
1327 
1328 
1329 //*************************************************************************************************
1338 template< typename MT // Type of the adapted dense matrix
1339  , bool SO > // Storage order of the adapted dense matrix
1340 inline typename UniUpperMatrix<MT,SO,true>::ConstPointer
1341  UniUpperMatrix<MT,SO,true>::data( size_t i ) const noexcept
1342 {
1343  return matrix_.data(i);
1344 }
1346 //*************************************************************************************************
1347 
1348 
1349 //*************************************************************************************************
1361 template< typename MT // Type of the adapted dense matrix
1362  , bool SO > // Storage order of the adapted dense matrix
1365 {
1366  if( SO )
1367  return Iterator( matrix_, 0UL, i );
1368  else
1369  return Iterator( matrix_, i, 0UL );
1370 }
1372 //*************************************************************************************************
1373 
1374 
1375 //*************************************************************************************************
1387 template< typename MT // Type of the adapted dense matrix
1388  , bool SO > // Storage order of the adapted dense matrix
1390  UniUpperMatrix<MT,SO,true>::begin( size_t i ) const
1391 {
1392  return matrix_.begin(i);
1393 }
1395 //*************************************************************************************************
1396 
1397 
1398 //*************************************************************************************************
1410 template< typename MT // Type of the adapted dense matrix
1411  , bool SO > // Storage order of the adapted dense matrix
1413  UniUpperMatrix<MT,SO,true>::cbegin( size_t i ) const
1414 {
1415  return matrix_.cbegin(i);
1416 }
1418 //*************************************************************************************************
1419 
1420 
1421 //*************************************************************************************************
1433 template< typename MT // Type of the adapted dense matrix
1434  , bool SO > // Storage order of the adapted dense matrix
1437 {
1438  if( SO )
1439  return Iterator( matrix_, rows(), i );
1440  else
1441  return Iterator( matrix_, i, columns() );
1442 }
1444 //*************************************************************************************************
1445 
1446 
1447 //*************************************************************************************************
1459 template< typename MT // Type of the adapted dense matrix
1460  , bool SO > // Storage order of the adapted dense matrix
1462  UniUpperMatrix<MT,SO,true>::end( size_t i ) const
1463 {
1464  return matrix_.end(i);
1465 }
1467 //*************************************************************************************************
1468 
1469 
1470 //*************************************************************************************************
1482 template< typename MT // Type of the adapted dense matrix
1483  , bool SO > // Storage order of the adapted dense matrix
1485  UniUpperMatrix<MT,SO,true>::cend( size_t i ) const
1486 {
1487  return matrix_.cend(i);
1488 }
1490 //*************************************************************************************************
1491 
1492 
1493 
1494 
1495 //=================================================================================================
1496 //
1497 // ASSIGNMENT OPERATORS
1498 //
1499 //=================================================================================================
1500 
1501 //*************************************************************************************************
1508 template< typename MT // Type of the adapted dense matrix
1509  , bool SO > // Storage order of the adapted dense matrix
1510 inline UniUpperMatrix<MT,SO,true>&
1511  UniUpperMatrix<MT,SO,true>::operator=( const ElementType& rhs )
1512 {
1513  if( SO ) {
1514  for( size_t j=1UL; j<columns(); ++j )
1515  for( size_t i=0UL; i<j; ++i )
1516  matrix_(i,j) = rhs;
1517  }
1518  else {
1519  for( size_t i=0UL; i<rows(); ++i )
1520  for( size_t j=i+1UL; j<columns(); ++j )
1521  matrix_(i,j) = rhs;
1522  }
1523 
1524  return *this;
1525 }
1527 //*************************************************************************************************
1528 
1529 
1530 //*************************************************************************************************
1554 template< typename MT // Type of the adapted dense matrix
1555  , bool SO > // Storage order of the adapted dense matrix
1556 inline UniUpperMatrix<MT,SO,true>&
1557  UniUpperMatrix<MT,SO,true>::operator=( initializer_list< initializer_list<ElementType> > list )
1558 {
1559  MT tmp( list );
1560 
1561  if( !isUniUpper( tmp ) ) {
1562  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to uniupper matrix" );
1563  }
1564 
1565  matrix_ = std::move( tmp );
1566 
1567  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square uniupper matrix detected" );
1568  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1569 
1570  return *this;
1571 }
1573 //*************************************************************************************************
1574 
1575 
1576 //*************************************************************************************************
1600 template< typename MT // Type of the adapted dense matrix
1601  , bool SO > // Storage order of the adapted dense matrix
1602 template< typename Other // Data type of the initialization array
1603  , size_t N > // Number of rows and columns of the initialization array
1604 inline UniUpperMatrix<MT,SO,true>&
1605  UniUpperMatrix<MT,SO,true>::operator=( const Other (&array)[N][N] )
1606 {
1607  MT tmp( array );
1608 
1609  if( !isUniUpper( tmp ) ) {
1610  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to uniupper matrix" );
1611  }
1612 
1613  matrix_ = std::move( tmp );
1614 
1615  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square uniupper matrix detected" );
1616  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1617 
1618  return *this;
1619 }
1621 //*************************************************************************************************
1622 
1623 
1624 //*************************************************************************************************
1634 template< typename MT // Type of the adapted dense matrix
1635  , bool SO > // Storage order of the adapted dense matrix
1636 inline UniUpperMatrix<MT,SO,true>&
1637  UniUpperMatrix<MT,SO,true>::operator=( const UniUpperMatrix& rhs )
1638 {
1639  matrix_ = rhs.matrix_;
1640 
1641  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square uniupper matrix detected" );
1642  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1643 
1644  return *this;
1645 }
1647 //*************************************************************************************************
1648 
1649 
1650 //*************************************************************************************************
1657 template< typename MT // Type of the adapted dense matrix
1658  , bool SO > // Storage order of the adapted dense matrix
1659 inline UniUpperMatrix<MT,SO,true>&
1660  UniUpperMatrix<MT,SO,true>::operator=( UniUpperMatrix&& rhs ) noexcept
1661 {
1662  matrix_ = std::move( rhs.matrix_ );
1663 
1664  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square uniupper matrix detected" );
1665  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1666 
1667  return *this;
1668 }
1670 //*************************************************************************************************
1671 
1672 
1673 //*************************************************************************************************
1686 template< typename MT // Type of the adapted dense matrix
1687  , bool SO > // Storage order of the adapted dense matrix
1688 template< typename MT2 // Type of the right-hand side matrix
1689  , bool SO2 > // Storage order of the right-hand side matrix
1690 inline DisableIf_< IsComputation<MT2>, UniUpperMatrix<MT,SO,true>& >
1691  UniUpperMatrix<MT,SO,true>::operator=( const Matrix<MT2,SO2>& rhs )
1692 {
1693  if( IsStrictlyTriangular<MT2>::value || ( !IsUniUpper<MT2>::value && !isUniUpper( ~rhs ) ) ) {
1694  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to uniupper matrix" );
1695  }
1696 
1697  matrix_ = declupp( ~rhs );
1698 
1699  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square uniupper matrix detected" );
1700  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1701 
1702  return *this;
1703 }
1705 //*************************************************************************************************
1706 
1707 
1708 //*************************************************************************************************
1721 template< typename MT // Type of the adapted dense matrix
1722  , bool SO > // Storage order of the adapted dense matrix
1723 template< typename MT2 // Type of the right-hand side matrix
1724  , bool SO2 > // Storage order of the right-hand side matrix
1725 inline EnableIf_< IsComputation<MT2>, UniUpperMatrix<MT,SO,true>& >
1726  UniUpperMatrix<MT,SO,true>::operator=( const Matrix<MT2,SO2>& rhs )
1727 {
1728  if( IsStrictlyTriangular<MT2>::value || ( !IsSquare<MT2>::value && !isSquare( ~rhs ) ) ) {
1729  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to uniupper matrix" );
1730  }
1731 
1732  if( IsUniUpper<MT2>::value ) {
1733  matrix_ = ~rhs;
1734  }
1735  else {
1736  MT tmp( ~rhs );
1737 
1738  if( !isUniUpper( tmp ) ) {
1739  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to uniupper matrix" );
1740  }
1741 
1742  matrix_ = std::move( tmp );
1743  }
1744 
1745  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square uniupper matrix detected" );
1746  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1747 
1748  return *this;
1749 }
1751 //*************************************************************************************************
1752 
1753 
1754 //*************************************************************************************************
1767 template< typename MT // Type of the adapted dense matrix
1768  , bool SO > // Storage order of the adapted dense matrix
1769 template< typename MT2 // Type of the right-hand side matrix
1770  , bool SO2 > // Storage order of the right-hand side matrix
1771 inline DisableIf_< IsComputation<MT2>, UniUpperMatrix<MT,SO,true>& >
1772  UniUpperMatrix<MT,SO,true>::operator+=( const Matrix<MT2,SO2>& rhs )
1773 {
1774  if( IsLower<MT2>::value || IsUniTriangular<MT2>::value ||
1775  ( !IsStrictlyUpper<MT2>::value && !isStrictlyUpper( ~rhs ) ) ) {
1776  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to uniupper matrix" );
1777  }
1778 
1779  matrix_ += declupp( ~rhs );
1780 
1781  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square uniupper matrix detected" );
1782  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1783 
1784  return *this;
1785 }
1787 //*************************************************************************************************
1788 
1789 
1790 //*************************************************************************************************
1803 template< typename MT // Type of the adapted dense matrix
1804  , bool SO > // Storage order of the adapted dense matrix
1805 template< typename MT2 // Type of the right-hand side matrix
1806  , bool SO2 > // Storage order of the right-hand side matrix
1807 inline EnableIf_< IsComputation<MT2>, UniUpperMatrix<MT,SO,true>& >
1808  UniUpperMatrix<MT,SO,true>::operator+=( const Matrix<MT2,SO2>& rhs )
1809 {
1810  if( IsLower<MT2>::value || IsUniTriangular<MT2>::value ||
1811  ( !IsSquare<MT2>::value && !isSquare( ~rhs ) ) ) {
1812  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to uniupper matrix" );
1813  }
1814 
1815  if( IsStrictlyUpper<MT2>::value ) {
1816  matrix_ += ~rhs;
1817  }
1818  else {
1819  const ResultType_<MT2> tmp( ~rhs );
1820 
1821  if( !isStrictlyUpper( tmp ) ) {
1822  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to uniupper matrix" );
1823  }
1824 
1825  matrix_ += declupp( tmp );
1826  }
1827 
1828  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square uniupper matrix detected" );
1829  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1830 
1831  return *this;
1832 }
1834 //*************************************************************************************************
1835 
1836 
1837 //*************************************************************************************************
1850 template< typename MT // Type of the adapted dense matrix
1851  , bool SO > // Storage order of the adapted dense matrix
1852 template< typename MT2 // Type of the right-hand side matrix
1853  , bool SO2 > // Storage order of the right-hand side matrix
1854 inline DisableIf_< IsComputation<MT2>, UniUpperMatrix<MT,SO,true>& >
1855  UniUpperMatrix<MT,SO,true>::operator-=( const Matrix<MT2,SO2>& rhs )
1856 {
1857  if( IsLower<MT2>::value || IsUniTriangular<MT2>::value ||
1858  ( !IsStrictlyUpper<MT2>::value && !isStrictlyUpper( ~rhs ) ) ) {
1859  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to uniupper matrix" );
1860  }
1861 
1862  matrix_ -= declupp( ~rhs );
1863 
1864  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square uniupper matrix detected" );
1865  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1866 
1867  return *this;
1868 }
1870 //*************************************************************************************************
1871 
1872 
1873 //*************************************************************************************************
1886 template< typename MT // Type of the adapted dense matrix
1887  , bool SO > // Storage order of the adapted dense matrix
1888 template< typename MT2 // Type of the right-hand side matrix
1889  , bool SO2 > // Storage order of the right-hand side matrix
1890 inline EnableIf_< IsComputation<MT2>, UniUpperMatrix<MT,SO,true>& >
1891  UniUpperMatrix<MT,SO,true>::operator-=( const Matrix<MT2,SO2>& rhs )
1892 {
1893  if( IsLower<MT2>::value || IsUniTriangular<MT2>::value ||
1894  ( !IsSquare<MT2>::value && !isSquare( ~rhs ) ) ) {
1895  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to uniupper matrix" );
1896  }
1897 
1898  if( IsStrictlyUpper<MT2>::value ) {
1899  matrix_ -= ~rhs;
1900  }
1901  else {
1902  const ResultType_<MT2> tmp( ~rhs );
1903 
1904  if( !isStrictlyUpper( tmp ) ) {
1905  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to uniupper matrix" );
1906  }
1907 
1908  matrix_ -= declupp( tmp );
1909  }
1910 
1911  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square uniupper matrix detected" );
1912  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1913 
1914  return *this;
1915 }
1917 //*************************************************************************************************
1918 
1919 
1920 //*************************************************************************************************
1933 template< typename MT // Type of the adapted dense matrix
1934  , bool SO > // Storage order of the adapted dense matrix
1935 template< typename MT2 // Type of the right-hand side matrix
1936  , bool SO2 > // Storage order of the right-hand side matrix
1937 inline UniUpperMatrix<MT,SO,true>&
1938  UniUpperMatrix<MT,SO,true>::operator%=( const Matrix<MT2,SO2>& rhs )
1939 {
1940  if( !IsSquare<MT2>::value && !isSquare( ~rhs ) ) {
1941  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to uniupper matrix" );
1942  }
1943 
1944  If_< IsComputation<MT2>, ResultType_<MT2>, const MT2& > tmp( ~rhs );
1945 
1946  for( size_t i=0UL; i<(~rhs).rows(); ++i ) {
1947  if( !isOne( tmp(i,i) ) ) {
1948  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to uniupper matrix" );
1949  }
1950  }
1951 
1952  matrix_ %= tmp;
1953 
1954  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square uniupper matrix detected" );
1955  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1956 
1957  return *this;
1958 }
1960 //*************************************************************************************************
1961 
1962 
1963 //*************************************************************************************************
1975 template< typename MT // Type of the adapted dense matrix
1976  , bool SO > // Storage order of the adapted dense matrix
1977 template< typename MT2 // Type of the right-hand side matrix
1978  , bool SO2 > // Storage order of the right-hand side matrix
1979 inline UniUpperMatrix<MT,SO,true>&
1980  UniUpperMatrix<MT,SO,true>::operator*=( const Matrix<MT2,SO2>& rhs )
1981 {
1982  if( matrix_.rows() != (~rhs).columns() ) {
1983  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to uniupper matrix" );
1984  }
1985 
1986  MT tmp( matrix_ * ~rhs );
1987 
1988  if( !isUniUpper( tmp ) ) {
1989  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to uniupper matrix" );
1990  }
1991 
1992  matrix_ = std::move( tmp );
1993 
1994  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square uniupper matrix detected" );
1995  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1996 
1997  return *this;
1998 }
2000 //*************************************************************************************************
2001 
2002 
2003 
2004 
2005 //=================================================================================================
2006 //
2007 // UTILITY FUNCTIONS
2008 //
2009 //=================================================================================================
2010 
2011 //*************************************************************************************************
2017 template< typename MT // Type of the adapted dense matrix
2018  , bool SO > // Storage order of the adapted dense matrix
2019 inline size_t UniUpperMatrix<MT,SO,true>::rows() const noexcept
2020 {
2021  return matrix_.rows();
2022 }
2024 //*************************************************************************************************
2025 
2026 
2027 //*************************************************************************************************
2033 template< typename MT // Type of the adapted dense matrix
2034  , bool SO > // Storage order of the adapted dense matrix
2035 inline size_t UniUpperMatrix<MT,SO,true>::columns() const noexcept
2036 {
2037  return matrix_.columns();
2038 }
2040 //*************************************************************************************************
2041 
2042 
2043 //*************************************************************************************************
2054 template< typename MT // Type of the adapted dense matrix
2055  , bool SO > // Storage order of the adapted dense matrix
2056 inline size_t UniUpperMatrix<MT,SO,true>::spacing() const noexcept
2057 {
2058  return matrix_.spacing();
2059 }
2061 //*************************************************************************************************
2062 
2063 
2064 //*************************************************************************************************
2070 template< typename MT // Type of the adapted dense matrix
2071  , bool SO > // Storage order of the adapted dense matrix
2072 inline size_t UniUpperMatrix<MT,SO,true>::capacity() const noexcept
2073 {
2074  return matrix_.capacity();
2075 }
2077 //*************************************************************************************************
2078 
2079 
2080 //*************************************************************************************************
2092 template< typename MT // Type of the adapted dense matrix
2093  , bool SO > // Storage order of the adapted dense matrix
2094 inline size_t UniUpperMatrix<MT,SO,true>::capacity( size_t i ) const noexcept
2095 {
2096  return matrix_.capacity(i);
2097 }
2099 //*************************************************************************************************
2100 
2101 
2102 //*************************************************************************************************
2108 template< typename MT // Type of the adapted dense matrix
2109  , bool SO > // Storage order of the adapted dense matrix
2110 inline size_t UniUpperMatrix<MT,SO,true>::nonZeros() const
2111 {
2112  return matrix_.nonZeros();
2113 }
2115 //*************************************************************************************************
2116 
2117 
2118 //*************************************************************************************************
2130 template< typename MT // Type of the adapted dense matrix
2131  , bool SO > // Storage order of the adapted dense matrix
2132 inline size_t UniUpperMatrix<MT,SO,true>::nonZeros( size_t i ) const
2133 {
2134  return matrix_.nonZeros(i);
2135 }
2137 //*************************************************************************************************
2138 
2139 
2140 //*************************************************************************************************
2146 template< typename MT // Type of the adapted dense matrix
2147  , bool SO > // Storage order of the adapted dense matrix
2149 {
2150  using blaze::clear;
2151 
2152  if( SO ) {
2153  for( size_t j=1UL; j<columns(); ++j )
2154  for( size_t i=0UL; i<j; ++i )
2155  clear( matrix_(i,j) );
2156  }
2157  else {
2158  for( size_t i=0UL; i<rows(); ++i )
2159  for( size_t j=i+1UL; j<columns(); ++j )
2160  clear( matrix_(i,j) );
2161  }
2162 }
2164 //*************************************************************************************************
2165 
2166 
2167 //*************************************************************************************************
2180 template< typename MT // Type of the adapted dense matrix
2181  , bool SO > // Storage order of the adapted dense matrix
2182 inline void UniUpperMatrix<MT,SO,true>::reset( size_t i )
2183 {
2184  using blaze::clear;
2185 
2186  if( SO ) {
2187  for( size_t j=0UL; j<i; ++j )
2188  clear( matrix_(j,i) );
2189  }
2190  else {
2191  for( size_t j=i+1UL; j<columns(); ++j )
2192  clear( matrix_(i,j) );
2193  }
2194 }
2196 //*************************************************************************************************
2197 
2198 
2199 //*************************************************************************************************
2211 template< typename MT // Type of the adapted dense matrix
2212  , bool SO > // Storage order of the adapted dense matrix
2214 {
2215  using blaze::clear;
2216 
2217  if( IsResizable<MT>::value ) {
2218  clear( matrix_ );
2219  }
2220  else {
2221  reset();
2222  }
2223 }
2225 //*************************************************************************************************
2226 
2227 
2228 //*************************************************************************************************
2264 template< typename MT // Type of the adapted dense matrix
2265  , bool SO > // Storage order of the adapted dense matrix
2266 void UniUpperMatrix<MT,SO,true>::resize( size_t n, bool preserve )
2267 {
2269 
2270  UNUSED_PARAMETER( preserve );
2271 
2272  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square uniupper matrix detected" );
2273 
2274  const size_t oldsize( matrix_.rows() );
2275 
2276  matrix_.resize( n, n, true );
2277 
2278  if( n > oldsize )
2279  {
2280  const size_t increment( n - oldsize );
2281  submatrix( matrix_, oldsize, 0UL, increment, n-1UL ).reset();
2282 
2283  for( size_t i=oldsize; i<n; ++i )
2284  matrix_(i,i) = ElementType(1);
2285  }
2286 }
2288 //*************************************************************************************************
2289 
2290 
2291 //*************************************************************************************************
2304 template< typename MT // Type of the adapted dense matrix
2305  , bool SO > // Storage order of the adapted dense matrix
2306 inline void UniUpperMatrix<MT,SO,true>::extend( size_t n, bool preserve )
2307 {
2309 
2310  UNUSED_PARAMETER( preserve );
2311 
2312  resize( rows() + n, true );
2313 }
2314 //*************************************************************************************************
2315 
2316 
2317 //*************************************************************************************************
2327 template< typename MT // Type of the adapted dense matrix
2328  , bool SO > // Storage order of the adapted dense matrix
2329 inline void UniUpperMatrix<MT,SO,true>::reserve( size_t elements )
2330 {
2331  matrix_.reserve( elements );
2332 }
2334 //*************************************************************************************************
2335 
2336 
2337 //*************************************************************************************************
2347 template< typename MT // Type of the adapted dense matrix
2348  , bool SO > // Storage order of the adapted dense matrix
2350 {
2351  matrix_.shrinkToFit();
2352 }
2354 //*************************************************************************************************
2355 
2356 
2357 //*************************************************************************************************
2364 template< typename MT // Type of the adapted dense matrix
2365  , bool SO > // Storage order of the adapted dense matrix
2366 inline void UniUpperMatrix<MT,SO,true>::swap( UniUpperMatrix& m ) noexcept
2367 {
2368  using std::swap;
2369 
2370  swap( matrix_, m.matrix_ );
2371 }
2373 //*************************************************************************************************
2374 
2375 
2376 //*************************************************************************************************
2388 template< typename MT // Type of the adapted dense matrix
2389  , bool SO > // Storage order of the adapted dense matrix
2390 inline constexpr size_t UniUpperMatrix<MT,SO,true>::maxNonZeros() noexcept
2391 {
2393 
2394  return maxNonZeros( Rows<MT>::value );
2395 }
2397 //*************************************************************************************************
2398 
2399 
2400 //*************************************************************************************************
2410 template< typename MT // Type of the adapted dense matrix
2411  , bool SO > // Storage order of the adapted dense matrix
2412 inline constexpr size_t UniUpperMatrix<MT,SO,true>::maxNonZeros( size_t n ) noexcept
2413 {
2414  return ( ( n + 1UL ) * n ) / 2UL;
2415 }
2417 //*************************************************************************************************
2418 
2419 
2420 
2421 
2422 //=================================================================================================
2423 //
2424 // DEBUGGING FUNCTIONS
2425 //
2426 //=================================================================================================
2427 
2428 //*************************************************************************************************
2438 template< typename MT // Type of the adapted dense matrix
2439  , bool SO > // Storage order of the adapted dense matrix
2440 inline bool UniUpperMatrix<MT,SO,true>::isIntact() const noexcept
2441 {
2442  using blaze::isIntact;
2443 
2444  return ( isIntact( matrix_ ) && isUniUpper( matrix_ ) );
2445 }
2447 //*************************************************************************************************
2448 
2449 
2450 
2451 
2452 //=================================================================================================
2453 //
2454 // EXPRESSION TEMPLATE EVALUATION FUNCTIONS
2455 //
2456 //=================================================================================================
2457 
2458 //*************************************************************************************************
2469 template< typename MT // Type of the adapted dense matrix
2470  , bool SO > // Storage order of the adapted dense matrix
2471 template< typename Other > // Data type of the foreign expression
2472 inline bool UniUpperMatrix<MT,SO,true>::canAlias( const Other* alias ) const noexcept
2473 {
2474  return matrix_.canAlias( alias );
2475 }
2477 //*************************************************************************************************
2478 
2479 
2480 //*************************************************************************************************
2491 template< typename MT // Type of the adapted dense matrix
2492  , bool SO > // Storage order of the adapted dense matrix
2493 template< typename Other > // Data type of the foreign expression
2494 inline bool UniUpperMatrix<MT,SO,true>::isAliased( const Other* alias ) const noexcept
2495 {
2496  return matrix_.isAliased( alias );
2497 }
2499 //*************************************************************************************************
2500 
2501 
2502 //*************************************************************************************************
2512 template< typename MT // Type of the adapted dense matrix
2513  , bool SO > // Storage order of the adapted dense matrix
2514 inline bool UniUpperMatrix<MT,SO,true>::isAligned() const noexcept
2515 {
2516  return matrix_.isAligned();
2517 }
2519 //*************************************************************************************************
2520 
2521 
2522 //*************************************************************************************************
2533 template< typename MT // Type of the adapted dense matrix
2534  , bool SO > // Storage order of the adapted dense matrix
2535 inline bool UniUpperMatrix<MT,SO,true>::canSMPAssign() const noexcept
2536 {
2537  return matrix_.canSMPAssign();
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>::load( size_t i, size_t j ) const noexcept
2563 {
2564  return matrix_.load( 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>::loada( size_t i, size_t j ) const noexcept
2590 {
2591  return matrix_.loada( i, j );
2592 }
2594 //*************************************************************************************************
2595 
2596 
2597 //*************************************************************************************************
2613 template< typename MT // Type of the adapted dense matrix
2614  , bool SO > // Storage order of the adapted dense matrix
2615 BLAZE_ALWAYS_INLINE typename UniUpperMatrix<MT,SO,true>::SIMDType
2616  UniUpperMatrix<MT,SO,true>::loadu( size_t i, size_t j ) const noexcept
2617 {
2618  return matrix_.loadu( i, j );
2619 }
2621 //*************************************************************************************************
2622 
2623 
2624 
2625 
2626 //=================================================================================================
2627 //
2628 // CONSTRUCTION FUNCTIONS
2629 //
2630 //=================================================================================================
2631 
2632 //*************************************************************************************************
2639 template< typename MT // Type of the adapted dense matrix
2640  , bool SO > // Storage order of the adapted dense matrix
2641 inline const MT UniUpperMatrix<MT,SO,true>::construct( size_t n, TrueType )
2642 {
2644 
2645  MT tmp( n, n, ElementType() );
2646 
2647  for( size_t i=0UL; i<n; ++i )
2648  tmp(i,i) = ElementType(1);
2649 
2650  return tmp;
2651 }
2653 //*************************************************************************************************
2654 
2655 
2656 //*************************************************************************************************
2663 template< typename MT // Type of the adapted dense matrix
2664  , bool SO > // Storage order of the adapted dense matrix
2665 inline const MT UniUpperMatrix<MT,SO,true>::construct( const ElementType& init, FalseType )
2666 {
2669 
2670  MT tmp;
2671 
2672  if( SO ) {
2673  for( size_t j=0UL; j<columns(); ++j ) {
2674  for( size_t i=0UL; i<j; ++i )
2675  tmp(i,j) = init;
2676  tmp(j,j) = ElementType(1);
2677  }
2678  }
2679  else {
2680  for( size_t i=0UL; i<rows(); ++i ) {
2681  tmp(i,i) = ElementType(1);
2682  for( size_t j=i+1UL; j<columns(); ++j )
2683  tmp(i,j) = init;
2684  }
2685  }
2686 
2687  return tmp;
2688 }
2690 //*************************************************************************************************
2691 
2692 
2693 //*************************************************************************************************
2704 template< typename MT // Type of the adapted dense matrix
2705  , bool SO > // Storage order of the adapted dense matrix
2706 template< typename MT2 // Type of the foreign matrix
2707  , bool SO2 // Storage order of the foreign matrix
2708  , typename T > // Type of the third argument
2709 inline const MT UniUpperMatrix<MT,SO,true>::construct( const Matrix<MT2,SO2>& m, T )
2710 {
2711  const MT tmp( ~m );
2712 
2713  if( IsStrictlyTriangular<MT2>::value || ( !IsUniUpper<MT2>::value && !isUniUpper( tmp ) ) ) {
2714  BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of uniupper matrix" );
2715  }
2716 
2717  return tmp;
2718 }
2720 //*************************************************************************************************
2721 
2722 } // namespace blaze
2723 
2724 #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.
Constraint on the data type.
CompressedMatrix< Type, false > OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: CompressedMatrix.h:3079
#define BLAZE_USER_ASSERT(expr, msg)
Run time assertion macro for user checks.In case of an invalid run time expression, the program execution is terminated. The BLAZE_USER_ASSERT macro can be disabled by setting the BLAZE_USER_ASSERT flag to zero or by defining NDEBUG during the compilation.
Definition: Assert.h:117
Header file for the Rows type trait.
Header file for the UNUSED_PARAMETER function template.
Header file for the IsUniUpper type trait.
BLAZE_ALWAYS_INLINE size_t capacity(const Matrix< MT, SO > &matrix) noexcept
Returns the maximum capacity of the matrix.
Definition: Matrix.h:356
Header file for basic type definitions.
Header file for the FalseType type/value trait base class.
#define BLAZE_CONSTRAINT_MUST_BE_MATRIX_WITH_STORAGE_ORDER(T, SO)
Constraint on the data type.In case the given data type T is not a dense or sparse matrix type and in...
Definition: StorageOrder.h:63
#define BLAZE_CONSTRAINT_MUST_BE_DENSE_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is not a dense, N-dimensional matrix type...
Definition: DenseMatrix.h:61
constexpr bool operator<(const NegativeAccuracy< A > &lhs, const T &rhs)
Less-than comparison between a NegativeAccuracy object and a floating point value.
Definition: Accuracy.h:329
Constraint on the data type.
This ResultType
Result type for expression template evaluations.
Definition: CompressedMatrix.h:3078
BLAZE_ALWAYS_INLINE MT::Iterator begin(Matrix< MT, SO > &matrix, size_t i)
Returns an iterator to the first element of row/column i.
Definition: Matrix.h:198
CompressedMatrix< Type, true > This
Type of this CompressedMatrix instance.
Definition: CompressedMatrix.h:3076
Constraint on the data type.
void reset(const DiagonalProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: DiagonalProxy.h:560
const DenseIterator< Type, AF > operator+(const DenseIterator< Type, AF > &it, ptrdiff_t inc) noexcept
Addition between a DenseIterator and an integral value.
Definition: DenseIterator.h:699
BLAZE_ALWAYS_INLINE void shrinkToFit(Matrix< MT, SO > &matrix)
Requesting the removal of unused capacity.
Definition: Matrix.h:609
typename DisableIf< Condition, T >::Type DisableIf_
Auxiliary type for the DisableIf class template.The DisableIf_ alias declaration provides a convenien...
Definition: DisableIf.h:224
void clear(CompressedMatrix< Type, SO > &m)
Clearing the given compressed matrix.
Definition: CompressedMatrix.h:5845
CompressedMatrix< Type, false > TransposeType
Transpose type for expression template evaluations.
Definition: CompressedMatrix.h:3080
Submatrix< MT, AF > submatrix(Matrix< MT, SO > &matrix, size_t row, size_t column, size_t m, size_t n)
Creating a view on a specific submatrix of the given matrix.
Definition: Submatrix.h:352
const Type & ConstReference
Reference to a constant matrix value.
Definition: CompressedMatrix.h:3085
decltype(auto) declupp(const DenseMatrix< MT, SO > &dm)
Declares the given dense matrix expression dm as upper.
Definition: DMatDeclUppExpr.h:1027
#define BLAZE_CONSTRAINT_MUST_NOT_BE_VOLATILE(T)
Constraint on the data type.In case the given data type is a volatile-qualified type, a compilation error is created.
Definition: Volatile.h:79
BLAZE_ALWAYS_INLINE size_t nonZeros(const Matrix< MT, SO > &matrix)
Returns the total number of non-zero elements in the matrix.
Definition: Matrix.h:394
Column< MT > column(Matrix< MT, SO > &matrix, size_t index)
Creating a view on a specific column of the given matrix.
Definition: Column.h:124
const DenseIterator< Type, AF > operator-(const DenseIterator< Type, AF > &it, ptrdiff_t inc) noexcept
Subtraction between a DenseIterator and an integral value.
Definition: DenseIterator.h:731
BoolConstant< true > TrueType
Type traits base class.The TrueType class is used as base class for type traits and value traits that...
Definition: TrueType.h:61
Element * Iterator
Iterator over non-constant elements.
Definition: CompressedMatrix.h:3086
BLAZE_ALWAYS_INLINE T1 & operator*=(SIMDPack< T1 > &lhs, const SIMDPack< T2 > &rhs)
Multiplication assignment operator for the multiplication of two SIMD packs.
Definition: BasicTypes.h:1393
Constraint on the data type.
BLAZE_ALWAYS_INLINE const EnableIf_< And< IsIntegral< T >, HasSize< T, 1UL > >, If_< IsSigned< T >, SIMDint8, SIMDuint8 > > loadu(const T *address) noexcept
Loads a vector of 1-byte integral values.
Definition: Loadu.h:77
BLAZE_ALWAYS_INLINE MT::ConstIterator cend(const Matrix< MT, SO > &matrix, size_t i)
Returns an iterator just past the last element of row/column i.
Definition: Matrix.h:308
BLAZE_ALWAYS_INLINE MT::ConstIterator cbegin(const Matrix< MT, SO > &matrix, size_t i)
Returns an iterator to the first element of row/column i.
Definition: Matrix.h:242
Constraint on the data type.
Constraint on the data type.
Constraint on the data type.
BLAZE_ALWAYS_INLINE size_t spacing(const DenseMatrix< MT, SO > &dm) noexcept
Returns the spacing between the beginning of two rows/columns.
Definition: DenseMatrix.h:110
#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 std::initializer_list aliases.
Header file for the IsSquare type trait.
Row< MT > row(Matrix< MT, SO > &matrix, size_t index)
Creating a view on a specific row of the given matrix.
Definition: Row.h:124
Constraint on the data type.
Constraint on the data type.
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:3084
Header file for the clear shim.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
#define BLAZE_ALWAYS_INLINE
Platform dependent setup of an enforced inline keyword.
Definition: Inline.h:85
#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:5924
Compile time assertion.
bool isIntact(const CompressedMatrix< Type, SO > &m)
Returns whether the invariants of the given compressed matrix are intact.
Definition: CompressedMatrix.h:5907
SparseMatrix< This, true > BaseType
Base type of this CompressedMatrix instance.
Definition: CompressedMatrix.h:3077
#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:3081
#define BLAZE_THROW_OUT_OF_RANGE(MESSAGE)
Macro for the emission of a std::out_of_range exception.This macro encapsulates the default way of Bl...
Definition: Exception.h:331
Header file for the DenseMatrix base class.
Header file for the Columns type trait.
constexpr bool operator>(const NegativeAccuracy< A > &lhs, const T &rhs)
Greater-than comparison between a NegativeAccuracy object and a floating point value.
Definition: Accuracy.h:367
constexpr bool operator>=(const NegativeAccuracy< A > &, const T &rhs)
Greater-or-equal-than comparison between a NegativeAccuracy object and a floating point value...
Definition: Accuracy.h:443
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:3087
constexpr bool operator==(const NegativeAccuracy< A > &lhs, const T &rhs)
Equality comparison between a NegativeAccuracy object and a floating point value. ...
Definition: Accuracy.h:250
Constraint on the data type.
Header file for the IsLower type trait.
Header file for the UniUpperProxy class.
BLAZE_ALWAYS_INLINE size_t columns(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of columns of the matrix.
Definition: Matrix.h:340
BLAZE_ALWAYS_INLINE const EnableIf_< And< IsIntegral< T >, HasSize< T, 1UL > >, If_< IsSigned< T >, SIMDint8, SIMDuint8 > > loada(const T *address) noexcept
Loads a vector of 1-byte integral values.
Definition: Loada.h:80
Header file for the IsUniTriangular type trait.
Header file for the IsStrictlyTriangular type trait.
Constraints on the storage order of matrix types.
Header file for the exception macros of the math module.
#define BLAZE_CONSTRAINT_MUST_NOT_BE_UPPER_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is a upper triangular matrix type...
Definition: Upper.h:81
BLAZE_ALWAYS_INLINE void resize(Matrix< MT, SO > &matrix, size_t rows, size_t columns, bool preserve=true)
Changing the size of the matrix.
Definition: Matrix.h:548
BLAZE_ALWAYS_INLINE MT::Iterator end(Matrix< MT, SO > &matrix, size_t i)
Returns an iterator just past the last element of row/column i.
Definition: Matrix.h:264
decltype(auto) operator*(const DenseMatrix< MT1, false > &lhs, const DenseMatrix< MT2, false > &rhs)
Multiplication operator for the multiplication of two row-major dense matrices ( ).
Definition: DMatDMatMultExpr.h:8893
constexpr bool operator!=(const NegativeAccuracy< A > &lhs, const T &rhs)
Inequality comparison between a NegativeAccuracy object and a floating point value.
Definition: Accuracy.h:290
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:580
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:1500
BLAZE_ALWAYS_INLINE T1 & operator+=(SIMDPack< T1 > &lhs, const SIMDPack< T2 > &rhs)
Addition assignment operator for the addition of two SIMD packs.
Definition: BasicTypes.h:1357
Header file for run time assertion macros.
Constraint on the data type.
Constraint on the data type.
#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:662
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:270
Constraint on the data type.
Constraint on the data type.
constexpr bool operator<=(const NegativeAccuracy< A > &, const T &rhs)
Less-or-equal-than comparison between a NegativeAccuracy object and a floating point value...
Definition: Accuracy.h:405
typename EnableIf< Condition, T >::Type EnableIf_
Auxiliary alias declaration for the EnableIf class template.The EnableIf_ alias declaration provides ...
Definition: EnableIf.h:224
BLAZE_ALWAYS_INLINE size_t rows(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of rows of the matrix.
Definition: Matrix.h:324
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:3082
#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:3083
#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:1413
bool isIntact(const DiagonalMatrix< MT, SO, DF > &m)
Returns whether the invariants of the given diagonal matrix are intact.
Definition: DiagonalMatrix.h:252
#define BLAZE_CONSTRAINT_MUST_NOT_BE_HERMITIAN_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is an Hermitian matrix type, a compilation error is created.
Definition: Hermitian.h:79
BLAZE_ALWAYS_INLINE T1 & operator-=(SIMDPack< T1 > &lhs, const SIMDPack< T2 > &rhs)
Subtraction assignment operator for the subtraction of two SIMD packs.
Definition: BasicTypes.h:1375
void UNUSED_PARAMETER(const Args &...)
Suppression of unused parameter warnings.
Definition: Unused.h:81
#define BLAZE_STATIC_ASSERT(expr)
Compile time assertion macro.In case of an invalid compile time expression, a compilation error is cr...
Definition: StaticAssert.h:112
BLAZE_ALWAYS_INLINE bool isSquare(const Matrix< MT, SO > &matrix) noexcept
Checks if the given matrix is a square matrix.
Definition: Matrix.h:742
Header file for the IsResizable type trait.
System settings for the inline keywords.
#define BLAZE_INTERNAL_ASSERT(expr, msg)
Run time assertion macro for internal checks.In case of an invalid run time expression, the program execution is terminated. The BLAZE_INTERNAL_ASSERT macro can be disabled by setting the BLAZE_USER_ASSERTION flag to zero or by defining NDEBUG during the compilation.
Definition: Assert.h:101
Header file for the implementation of the base template of the UniUpperMatrix.
Header file for the TrueType type/value trait base class.