Dense.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_ADAPTORS_STRICTLYUPPERMATRIX_DENSE_H_
36 #define _BLAZE_MATH_ADAPTORS_STRICTLYUPPERMATRIX_DENSE_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
43 #include <iterator>
44 #include <utility>
48 #include <blaze/math/Aliases.h>
59 #include <blaze/math/Exception.h>
62 #include <blaze/math/shims/Clear.h>
72 #include <blaze/system/Inline.h>
73 #include <blaze/util/Assert.h>
79 #include <blaze/util/DisableIf.h>
80 #include <blaze/util/EnableIf.h>
81 #include <blaze/util/FalseType.h>
83 #include <blaze/util/TrueType.h>
84 #include <blaze/util/Types.h>
85 #include <blaze/util/Unused.h>
86 
87 
88 namespace blaze {
89 
90 //=================================================================================================
91 //
92 // CLASS TEMPLATE SPECIALIZATION FOR DENSE MATRICES
93 //
94 //=================================================================================================
95 
96 //*************************************************************************************************
104 template< typename MT // Type of the adapted dense matrix
105  , bool SO > // Storage order of the adapted dense matrix
106 class StrictlyUpperMatrix<MT,SO,true>
107  : public DenseMatrix< StrictlyUpperMatrix<MT,SO,true>, SO >
108 {
109  private:
110  //**Type definitions****************************************************************************
111  typedef OppositeType_<MT> OT;
112  typedef TransposeType_<MT> TT;
113  typedef ElementType_<MT> ET;
114  //**********************************************************************************************
115 
116  public:
117  //**Type definitions****************************************************************************
118  typedef StrictlyUpperMatrix<MT,SO,true> This;
119  typedef DenseMatrix<This,SO> BaseType;
120  typedef This ResultType;
121  typedef StrictlyUpperMatrix<OT,!SO,true> OppositeType;
122  typedef StrictlyLowerMatrix<TT,!SO,true> TransposeType;
123  typedef ET ElementType;
124  typedef SIMDType_<MT> SIMDType;
125  typedef ReturnType_<MT> ReturnType;
126  typedef const This& CompositeType;
127  typedef StrictlyUpperProxy<MT> Reference;
128  typedef ConstReference_<MT> ConstReference;
129  typedef Pointer_<MT> Pointer;
130  typedef ConstPointer_<MT> ConstPointer;
131  typedef ConstIterator_<MT> ConstIterator;
132  //**********************************************************************************************
133 
134  //**Rebind struct definition********************************************************************
137  template< typename ET > // Data type of the other matrix
138  struct Rebind {
140  typedef StrictlyUpperMatrix< typename MT::template Rebind<ET>::Other > Other;
141  };
142  //**********************************************************************************************
143 
144  //**Iterator class definition*******************************************************************
147  class Iterator
148  {
149  public:
150  //**Type definitions*************************************************************************
151  typedef std::random_access_iterator_tag IteratorCategory;
152  typedef ElementType_<MT> ValueType;
153  typedef StrictlyUpperProxy<MT> PointerType;
154  typedef StrictlyUpperProxy<MT> ReferenceType;
155  typedef ptrdiff_t DifferenceType;
156 
157  // STL iterator requirements
158  typedef IteratorCategory iterator_category;
159  typedef ValueType value_type;
160  typedef PointerType pointer;
161  typedef ReferenceType reference;
162  typedef DifferenceType difference_type;
163  //*******************************************************************************************
164 
165  //**Constructor******************************************************************************
168  inline Iterator() noexcept
169  : matrix_( nullptr ) // Reference to the adapted dense matrix
170  , row_ ( 0UL ) // The current row index of the iterator
171  , column_( 0UL ) // The current column index of the iterator
172  {}
173  //*******************************************************************************************
174 
175  //**Constructor******************************************************************************
182  inline Iterator( MT& matrix, size_t row, size_t column ) noexcept
183  : matrix_( &matrix ) // Reference to the adapted dense matrix
184  , row_ ( row ) // The current row-index of the iterator
185  , column_( column ) // The current column-index of the iterator
186  {}
187  //*******************************************************************************************
188 
189  //**Addition assignment operator*************************************************************
195  inline Iterator& operator+=( size_t inc ) noexcept {
196  ( SO )?( row_ += inc ):( column_ += inc );
197  return *this;
198  }
199  //*******************************************************************************************
200 
201  //**Subtraction assignment operator**********************************************************
207  inline Iterator& operator-=( size_t dec ) noexcept {
208  ( SO )?( row_ -= dec ):( column_ -= dec );
209  return *this;
210  }
211  //*******************************************************************************************
212 
213  //**Prefix increment operator****************************************************************
218  inline Iterator& operator++() noexcept {
219  ( SO )?( ++row_ ):( ++column_ );
220  return *this;
221  }
222  //*******************************************************************************************
223 
224  //**Postfix increment operator***************************************************************
229  inline const Iterator operator++( int ) noexcept {
230  const Iterator tmp( *this );
231  ++(*this);
232  return tmp;
233  }
234  //*******************************************************************************************
235 
236  //**Prefix decrement operator****************************************************************
241  inline Iterator& operator--() noexcept {
242  ( SO )?( --row_ ):( --column_ );
243  return *this;
244  }
245  //*******************************************************************************************
246 
247  //**Postfix decrement operator***************************************************************
252  inline const Iterator operator--( int ) noexcept {
253  const Iterator tmp( *this );
254  --(*this);
255  return tmp;
256  }
257  //*******************************************************************************************
258 
259  //**Element access operator******************************************************************
264  inline ReferenceType operator*() const {
265  return ReferenceType( *matrix_, row_, column_ );
266  }
267  //*******************************************************************************************
268 
269  //**Element access operator******************************************************************
274  inline PointerType operator->() const {
275  return PointerType( *matrix_, row_, column_ );
276  }
277  //*******************************************************************************************
278 
279  //**Load function****************************************************************************
289  inline SIMDType load() const {
290  return (*matrix_).load(row_,column_);
291  }
292  //*******************************************************************************************
293 
294  //**Loada function***************************************************************************
304  inline SIMDType loada() const {
305  return (*matrix_).loada(row_,column_);
306  }
307  //*******************************************************************************************
308 
309  //**Loadu function***************************************************************************
319  inline SIMDType loadu() const {
320  return (*matrix_).loadu(row_,column_);
321  }
322  //*******************************************************************************************
323 
324  //**Conversion operator**********************************************************************
329  inline operator ConstIterator() const {
330  if( SO )
331  return matrix_->begin( column_ ) + row_;
332  else
333  return matrix_->begin( row_ ) + column_;
334  }
335  //*******************************************************************************************
336 
337  //**Equality operator************************************************************************
344  friend inline bool operator==( const Iterator& lhs, const Iterator& rhs ) noexcept {
345  return ( SO )?( lhs.row_ == rhs.row_ ):( lhs.column_ == rhs.column_ );
346  }
347  //*******************************************************************************************
348 
349  //**Equality operator************************************************************************
356  friend inline bool operator==( const Iterator& lhs, const ConstIterator& rhs ) {
357  return ( ConstIterator( lhs ) == rhs );
358  }
359  //*******************************************************************************************
360 
361  //**Equality operator************************************************************************
368  friend inline bool operator==( const ConstIterator& lhs, const Iterator& rhs ) {
369  return ( lhs == ConstIterator( rhs ) );
370  }
371  //*******************************************************************************************
372 
373  //**Inequality operator**********************************************************************
380  friend inline bool operator!=( const Iterator& lhs, const Iterator& rhs ) noexcept {
381  return ( SO )?( lhs.row_ != rhs.row_ ):( lhs.column_ != rhs.column_ );
382  }
383  //*******************************************************************************************
384 
385  //**Inequality operator**********************************************************************
392  friend inline bool operator!=( const Iterator& lhs, const ConstIterator& rhs ) {
393  return ( ConstIterator( lhs ) != rhs );
394  }
395  //*******************************************************************************************
396 
397  //**Inequality operator**********************************************************************
404  friend inline bool operator!=( const ConstIterator& lhs, const Iterator& rhs ) {
405  return ( lhs != ConstIterator( rhs ) );
406  }
407  //*******************************************************************************************
408 
409  //**Less-than operator***********************************************************************
416  friend inline bool operator<( const Iterator& lhs, const Iterator& rhs ) noexcept {
417  return ( SO )?( lhs.row_ < rhs.row_ ):( lhs.column_ < rhs.column_ );
418  }
419  //*******************************************************************************************
420 
421  //**Less-than operator***********************************************************************
428  friend inline bool operator<( const Iterator& lhs, const ConstIterator& rhs ) {
429  return ( ConstIterator( lhs ) < rhs );
430  }
431  //*******************************************************************************************
432 
433  //**Less-than operator***********************************************************************
440  friend inline bool operator<( const ConstIterator& lhs, const Iterator& rhs ) {
441  return ( lhs < ConstIterator( rhs ) );
442  }
443  //*******************************************************************************************
444 
445  //**Greater-than operator********************************************************************
452  friend inline bool operator>( const Iterator& lhs, const Iterator& rhs ) noexcept {
453  return ( SO )?( lhs.row_ > rhs.row_ ):( lhs.column_ > rhs.column_ );
454  }
455  //*******************************************************************************************
456 
457  //**Greater-than operator********************************************************************
464  friend inline bool operator>( const Iterator& lhs, const ConstIterator& rhs ) {
465  return ( ConstIterator( lhs ) > rhs );
466  }
467  //*******************************************************************************************
468 
469  //**Greater-than operator********************************************************************
476  friend inline bool operator>( const ConstIterator& lhs, const Iterator& rhs ) {
477  return ( lhs > ConstIterator( rhs ) );
478  }
479  //*******************************************************************************************
480 
481  //**Less-or-equal-than operator**************************************************************
488  friend inline bool operator<=( const Iterator& lhs, const Iterator& rhs ) noexcept {
489  return ( SO )?( lhs.row_ <= rhs.row_ ):( lhs.column_ <= rhs.column_ );
490  }
491  //*******************************************************************************************
492 
493  //**Less-or-equal-than operator**************************************************************
500  friend inline bool operator<=( const Iterator& lhs, const ConstIterator& rhs ) {
501  return ( ConstIterator( lhs ) <= rhs );
502  }
503  //*******************************************************************************************
504 
505  //**Less-or-equal-than operator**************************************************************
512  friend inline bool operator<=( const ConstIterator& lhs, const Iterator& rhs ) {
513  return ( lhs <= ConstIterator( rhs ) );
514  }
515  //*******************************************************************************************
516 
517  //**Greater-or-equal-than operator***********************************************************
524  friend inline bool operator>=( const Iterator& lhs, const Iterator& rhs ) noexcept {
525  return ( SO )?( lhs.row_ >= rhs.row_ ):( lhs.column_ >= rhs.column_ );
526  }
527  //*******************************************************************************************
528 
529  //**Greater-or-equal-than operator***********************************************************
536  friend inline bool operator>=( const Iterator& lhs, const ConstIterator& rhs ) {
537  return ( ConstIterator( lhs ) >= rhs );
538  }
539  //*******************************************************************************************
540 
541  //**Greater-or-equal-than operator***********************************************************
548  friend inline bool operator>=( const ConstIterator& lhs, const Iterator& rhs ) {
549  return ( lhs >= ConstIterator( rhs ) );
550  }
551  //*******************************************************************************************
552 
553  //**Subtraction operator*********************************************************************
559  inline DifferenceType operator-( const Iterator& rhs ) const noexcept {
560  return ( SO )?( row_ - rhs.row_ ):( column_ - rhs.column_ );
561  }
562  //*******************************************************************************************
563 
564  //**Addition operator************************************************************************
571  friend inline const Iterator operator+( const Iterator& it, size_t inc ) noexcept {
572  if( SO )
573  return Iterator( *it.matrix_, it.row_ + inc, it.column_ );
574  else
575  return Iterator( *it.matrix_, it.row_, it.column_ + inc );
576  }
577  //*******************************************************************************************
578 
579  //**Addition operator************************************************************************
586  friend inline const Iterator operator+( size_t inc, const Iterator& it ) noexcept {
587  if( SO )
588  return Iterator( *it.matrix_, it.row_ + inc, it.column_ );
589  else
590  return Iterator( *it.matrix_, it.row_, it.column_ + inc );
591  }
592  //*******************************************************************************************
593 
594  //**Subtraction operator*********************************************************************
601  friend inline const Iterator operator-( const Iterator& it, size_t dec ) noexcept {
602  if( SO )
603  return Iterator( *it.matrix_, it.row_ - dec, it.column_ );
604  else
605  return Iterator( *it.matrix_, it.row_, it.column_ - dec );
606  }
607  //*******************************************************************************************
608 
609  private:
610  //**Member variables*************************************************************************
611  MT* matrix_;
612  size_t row_;
613  size_t column_;
614  //*******************************************************************************************
615  };
616  //**********************************************************************************************
617 
618  //**Compilation flags***************************************************************************
620  enum : bool { simdEnabled = MT::simdEnabled };
621 
623  enum : bool { smpAssignable = MT::smpAssignable };
624  //**********************************************************************************************
625 
626  //**Constructors********************************************************************************
629  explicit inline StrictlyUpperMatrix();
630  template< typename A1 > explicit inline StrictlyUpperMatrix( const A1& a1 );
631  explicit inline StrictlyUpperMatrix( size_t n, const ElementType& init );
632 
633  explicit inline StrictlyUpperMatrix( initializer_list< initializer_list<ElementType> > list );
634 
635  template< typename Other >
636  explicit inline StrictlyUpperMatrix( size_t n, const Other* array );
637 
638  template< typename Other, size_t N >
639  explicit inline StrictlyUpperMatrix( const Other (&array)[N][N] );
640 
641  explicit inline StrictlyUpperMatrix( ElementType* ptr, size_t n );
642  explicit inline StrictlyUpperMatrix( ElementType* ptr, size_t n, size_t nn );
643 
644  template< typename Deleter >
645  explicit inline StrictlyUpperMatrix( ElementType* ptr, size_t n, Deleter d );
646 
647  template< typename Deleter >
648  explicit inline StrictlyUpperMatrix( ElementType* ptr, size_t n, size_t nn, Deleter d );
649 
650  inline StrictlyUpperMatrix( const StrictlyUpperMatrix& m );
651  inline StrictlyUpperMatrix( StrictlyUpperMatrix&& m ) noexcept;
653  //**********************************************************************************************
654 
655  //**Destructor**********************************************************************************
656  // No explicitly declared destructor.
657  //**********************************************************************************************
658 
659  //**Data access functions***********************************************************************
662  inline Reference operator()( size_t i, size_t j );
663  inline ConstReference operator()( size_t i, size_t j ) const;
664  inline Reference at( size_t i, size_t j );
665  inline ConstReference at( size_t i, size_t j ) const;
666  inline ConstPointer data () const noexcept;
667  inline ConstPointer data ( size_t i ) const noexcept;
668  inline Iterator begin ( size_t i );
669  inline ConstIterator begin ( size_t i ) const;
670  inline ConstIterator cbegin( size_t i ) const;
671  inline Iterator end ( size_t i );
672  inline ConstIterator end ( size_t i ) const;
673  inline ConstIterator cend ( size_t i ) const;
675  //**********************************************************************************************
676 
677  //**Assignment operators************************************************************************
680  inline StrictlyUpperMatrix& operator=( initializer_list< initializer_list<ElementType> > list );
681 
682  template< typename Other, size_t N >
683  inline StrictlyUpperMatrix& operator=( const Other (&array)[N][N] );
684 
685  inline StrictlyUpperMatrix& operator=( const ElementType& rhs );
686  inline StrictlyUpperMatrix& operator=( const StrictlyUpperMatrix& rhs );
687  inline StrictlyUpperMatrix& operator=( StrictlyUpperMatrix&& rhs ) noexcept;
688 
689  template< typename MT2, bool SO2 >
690  inline DisableIf_< IsComputation<MT2>, StrictlyUpperMatrix& >
691  operator=( const Matrix<MT2,SO2>& rhs );
692 
693  template< typename MT2, bool SO2 >
694  inline EnableIf_< IsComputation<MT2>, StrictlyUpperMatrix& >
695  operator=( const Matrix<MT2,SO2>& rhs );
696 
697  template< typename MT2, bool SO2 >
698  inline DisableIf_< IsComputation<MT2>, StrictlyUpperMatrix& >
699  operator+=( const Matrix<MT2,SO2>& rhs );
700 
701  template< typename MT2, bool SO2 >
702  inline EnableIf_< IsComputation<MT2>, StrictlyUpperMatrix& >
703  operator+=( const Matrix<MT2,SO2>& rhs );
704 
705  template< typename MT2, bool SO2 >
706  inline DisableIf_< IsComputation<MT2>, StrictlyUpperMatrix& >
707  operator-=( const Matrix<MT2,SO2>& rhs );
708 
709  template< typename MT2, bool SO2 >
710  inline EnableIf_< IsComputation<MT2>, StrictlyUpperMatrix& >
711  operator-=( const Matrix<MT2,SO2>& rhs );
712 
713  template< typename MT2, bool SO2 >
714  inline StrictlyUpperMatrix& operator*=( const Matrix<MT2,SO2>& rhs );
715 
716  template< typename Other >
717  inline EnableIf_< IsNumeric<Other>, StrictlyUpperMatrix >& operator*=( Other rhs );
718 
719  template< typename Other >
720  inline EnableIf_< IsNumeric<Other>, StrictlyUpperMatrix >& operator/=( Other rhs );
722  //**********************************************************************************************
723 
724  //**Utility functions***************************************************************************
727  inline size_t rows() const noexcept;
728  inline size_t columns() const noexcept;
729  inline size_t spacing() const noexcept;
730  inline size_t capacity() const noexcept;
731  inline size_t capacity( size_t i ) const noexcept;
732  inline size_t nonZeros() const;
733  inline size_t nonZeros( size_t i ) const;
734  inline void reset();
735  inline void reset( size_t i );
736  inline void clear();
737  void resize ( size_t n, bool preserve=true );
738  inline void extend ( size_t n, bool preserve=true );
739  inline void reserve( size_t elements );
740 
741  template< typename Other > inline StrictlyUpperMatrix& scale( const Other& scalar );
742 
743  inline void swap( StrictlyUpperMatrix& 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( StrictlyUpperMatrix<MT2,SO2,DF2>& m );
794  //**********************************************************************************************
795 
796  //**Compile time checks*************************************************************************
809  BLAZE_STATIC_ASSERT( Rows<MT>::value == Columns<MT>::value );
810  //**********************************************************************************************
811 };
813 //*************************************************************************************************
814 
815 
816 
817 
818 //=================================================================================================
819 //
820 // CONSTRUCTORS
821 //
822 //=================================================================================================
823 
824 //*************************************************************************************************
828 template< typename MT // Type of the adapted dense matrix
829  , bool SO > // Storage order of the adapted dense matrix
830 inline StrictlyUpperMatrix<MT,SO,true>::StrictlyUpperMatrix()
831  : matrix_() // The adapted dense matrix
832 {
833  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly upper matrix detected" );
834  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
835 }
837 //*************************************************************************************************
838 
839 
840 //*************************************************************************************************
858 template< typename MT // Type of the adapted dense matrix
859  , bool SO > // Storage order of the adapted dense matrix
860 template< typename A1 > // Type of the constructor argument
861 inline StrictlyUpperMatrix<MT,SO,true>::StrictlyUpperMatrix( const A1& a1 )
862  : matrix_( construct( a1, typename IsResizable<MT>::Type() ) ) // The adapted dense matrix
863 {
864  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly upper matrix detected" );
865  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
866 }
868 //*************************************************************************************************
869 
870 
871 //*************************************************************************************************
878 template< typename MT // Type of the adapted dense matrix
879  , bool SO > // Storage order of the adapted dense matrix
880 inline StrictlyUpperMatrix<MT,SO,true>::StrictlyUpperMatrix( size_t n, const ElementType& init )
881  : matrix_( n, n, ElementType() ) // The adapted dense matrix
882 {
884 
885  if( SO ) {
886  for( size_t j=0UL; j<columns(); ++j ) {
887  for( size_t i=0UL; i<j; ++i )
888  matrix_(i,j) = init;
889  }
890  }
891  else {
892  for( size_t i=0UL; i<rows(); ++i ) {
893  for( size_t j=i+1UL; j<columns(); ++j )
894  matrix_(i,j) = init;
895  }
896  }
897 
898  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly upper matrix detected" );
899  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
900 }
902 //*************************************************************************************************
903 
904 
905 //*************************************************************************************************
928 template< typename MT // Type of the adapted dense matrix
929  , bool SO > // Storage order of the adapted dense matrix
930 inline StrictlyUpperMatrix<MT,SO,true>::StrictlyUpperMatrix( initializer_list< initializer_list<ElementType> > list )
931  : matrix_( list ) // The adapted dense matrix
932 {
933  if( !isStrictlyUpper( matrix_ ) ) {
934  BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of strictly upper matrix" );
935  }
936 
937  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
938 }
940 //*************************************************************************************************
941 
942 
943 //*************************************************************************************************
970 template< typename MT // Type of the adapted dense matrix
971  , bool SO > // Storage order of the adapted dense matrix
972 template< typename Other > // Data type of the initialization array
973 inline StrictlyUpperMatrix<MT,SO,true>::StrictlyUpperMatrix( size_t n, const Other* array )
974  : matrix_( n, n, array ) // The adapted dense matrix
975 {
976  if( !isStrictlyUpper( matrix_ ) ) {
977  BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of strictly upper matrix" );
978  }
979 
980  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
981 }
983 //*************************************************************************************************
984 
985 
986 //*************************************************************************************************
1009 template< typename MT // Type of the adapted dense matrix
1010  , bool SO > // Storage order of the adapted dense matrix
1011 template< typename Other // Data type of the initialization array
1012  , size_t N > // Number of columns of the initialization array
1013 inline StrictlyUpperMatrix<MT,SO,true>::StrictlyUpperMatrix( const Other (&array)[N][N] )
1014  : matrix_( array ) // The adapted dense matrix
1015 {
1016  if( !isStrictlyUpper( matrix_ ) ) {
1017  BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of strictly upper matrix" );
1018  }
1019 
1020  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1021 }
1023 //*************************************************************************************************
1024 
1025 
1026 //*************************************************************************************************
1048 template< typename MT // Type of the adapted dense matrix
1049  , bool SO > // Storage order of the adapted dense matrix
1050 inline StrictlyUpperMatrix<MT,SO,true>::StrictlyUpperMatrix( ElementType* ptr, size_t n )
1051  : matrix_( ptr, n, n ) // The adapted dense matrix
1052 {
1053  if( !isStrictlyUpper( matrix_ ) ) {
1054  BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of strictly upper matrix" );
1055  }
1056 
1057  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1058 }
1060 //*************************************************************************************************
1061 
1062 
1063 //*************************************************************************************************
1086 template< typename MT // Type of the adapted dense matrix
1087  , bool SO > // Storage order of the adapted dense matrix
1088 inline StrictlyUpperMatrix<MT,SO,true>::StrictlyUpperMatrix( ElementType* ptr, size_t n, size_t nn )
1089  : matrix_( ptr, n, n, nn ) // The adapted dense matrix
1090 {
1091  if( !isStrictlyUpper( matrix_ ) ) {
1092  BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of strictly upper matrix" );
1093  }
1094 
1095  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1096 }
1098 //*************************************************************************************************
1099 
1100 
1101 //*************************************************************************************************
1122 template< typename MT // Type of the adapted dense matrix
1123  , bool SO > // Storage order of the adapted dense matrix
1124 template< typename Deleter > // Type of the custom deleter
1125 inline StrictlyUpperMatrix<MT,SO,true>::StrictlyUpperMatrix( ElementType* ptr, size_t n, Deleter d )
1126  : matrix_( ptr, n, n, d ) // The adapted dense matrix
1127 {
1128  if( !isStrictlyUpper( matrix_ ) ) {
1129  BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of strictly upper matrix" );
1130  }
1131 
1132  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1133 }
1135 //*************************************************************************************************
1136 
1137 
1138 //*************************************************************************************************
1160 template< typename MT // Type of the adapted dense matrix
1161  , bool SO > // Storage order of the adapted dense matrix
1162 template< typename Deleter > // Type of the custom deleter
1163 inline StrictlyUpperMatrix<MT,SO,true>::StrictlyUpperMatrix( ElementType* ptr, size_t n, size_t nn, Deleter d )
1164  : matrix_( ptr, n, n, nn, d ) // The adapted dense matrix
1165 {
1166  if( !isStrictlyUpper( matrix_ ) ) {
1167  BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of strictly upper matrix" );
1168  }
1169 
1170  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1171 }
1173 //*************************************************************************************************
1174 
1175 
1176 //*************************************************************************************************
1182 template< typename MT // Type of the adapted dense matrix
1183  , bool SO > // Storage order of the adapted dense matrix
1184 inline StrictlyUpperMatrix<MT,SO,true>::StrictlyUpperMatrix( const StrictlyUpperMatrix& m )
1185  : matrix_( m.matrix_ ) // The adapted dense matrix
1186 {
1187  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly upper matrix detected" );
1188  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1189 }
1191 //*************************************************************************************************
1192 
1193 
1194 //*************************************************************************************************
1200 template< typename MT // Type of the adapted dense matrix
1201  , bool SO > // Storage order of the adapted dense matrix
1202 inline StrictlyUpperMatrix<MT,SO,true>::StrictlyUpperMatrix( StrictlyUpperMatrix&& m ) noexcept
1203  : matrix_( std::move( m.matrix_ ) ) // The adapted dense matrix
1204 {
1205  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly upper matrix detected" );
1206  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1207 }
1209 //*************************************************************************************************
1210 
1211 
1212 
1213 
1214 //=================================================================================================
1215 //
1216 // DATA ACCESS FUNCTIONS
1217 //
1218 //=================================================================================================
1219 
1220 //*************************************************************************************************
1236 template< typename MT // Type of the adapted dense matrix
1237  , bool SO > // Storage order of the adapted dense matrix
1239  StrictlyUpperMatrix<MT,SO,true>::operator()( size_t i, size_t j )
1240 {
1241  BLAZE_USER_ASSERT( i<rows() , "Invalid row access index" );
1242  BLAZE_USER_ASSERT( j<columns(), "Invalid column access index" );
1243 
1244  return Reference( matrix_, i, j );
1245 }
1247 //*************************************************************************************************
1248 
1249 
1250 //*************************************************************************************************
1266 template< typename MT // Type of the adapted dense matrix
1267  , bool SO > // Storage order of the adapted dense matrix
1269  StrictlyUpperMatrix<MT,SO,true>::operator()( size_t i, size_t j ) const
1270 {
1271  BLAZE_USER_ASSERT( i<rows() , "Invalid row access index" );
1272  BLAZE_USER_ASSERT( j<columns(), "Invalid column access index" );
1273 
1274  return matrix_(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  StrictlyUpperMatrix<MT,SO,true>::at( size_t i, size_t j )
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 //*************************************************************************************************
1331 template< typename MT // Type of the adapted dense matrix
1332  , bool SO > // Storage order of the adapted dense matrix
1334  StrictlyUpperMatrix<MT,SO,true>::at( size_t i, size_t j ) const
1335 {
1336  if( i >= rows() ) {
1337  BLAZE_THROW_OUT_OF_RANGE( "Invalid row access index" );
1338  }
1339  if( j >= columns() ) {
1340  BLAZE_THROW_OUT_OF_RANGE( "Invalid column access index" );
1341  }
1342  return (*this)(i,j);
1343 }
1345 //*************************************************************************************************
1346 
1347 
1348 //*************************************************************************************************
1361 template< typename MT // Type of the adapted dense matrix
1362  , bool SO > // Storage order of the adapted dense matrix
1363 inline typename StrictlyUpperMatrix<MT,SO,true>::ConstPointer
1364  StrictlyUpperMatrix<MT,SO,true>::data() const noexcept
1365 {
1366  return matrix_.data();
1367 }
1369 //*************************************************************************************************
1370 
1371 
1372 //*************************************************************************************************
1381 template< typename MT // Type of the adapted dense matrix
1382  , bool SO > // Storage order of the adapted dense matrix
1383 inline typename StrictlyUpperMatrix<MT,SO,true>::ConstPointer
1384  StrictlyUpperMatrix<MT,SO,true>::data( size_t i ) const noexcept
1385 {
1386  return matrix_.data(i);
1387 }
1389 //*************************************************************************************************
1390 
1391 
1392 //*************************************************************************************************
1404 template< typename MT // Type of the adapted dense matrix
1405  , bool SO > // Storage order of the adapted dense matrix
1408 {
1409  if( SO )
1410  return Iterator( matrix_, 0UL, i );
1411  else
1412  return Iterator( matrix_, i, 0UL );
1413 }
1415 //*************************************************************************************************
1416 
1417 
1418 //*************************************************************************************************
1430 template< typename MT // Type of the adapted dense matrix
1431  , bool SO > // Storage order of the adapted dense matrix
1433  StrictlyUpperMatrix<MT,SO,true>::begin( size_t i ) const
1434 {
1435  return matrix_.begin(i);
1436 }
1438 //*************************************************************************************************
1439 
1440 
1441 //*************************************************************************************************
1453 template< typename MT // Type of the adapted dense matrix
1454  , bool SO > // Storage order of the adapted dense matrix
1456  StrictlyUpperMatrix<MT,SO,true>::cbegin( size_t i ) const
1457 {
1458  return matrix_.cbegin(i);
1459 }
1461 //*************************************************************************************************
1462 
1463 
1464 //*************************************************************************************************
1476 template< typename MT // Type of the adapted dense matrix
1477  , bool SO > // Storage order of the adapted dense matrix
1480 {
1481  if( SO )
1482  return Iterator( matrix_, rows(), i );
1483  else
1484  return Iterator( matrix_, i, columns() );
1485 }
1487 //*************************************************************************************************
1488 
1489 
1490 //*************************************************************************************************
1502 template< typename MT // Type of the adapted dense matrix
1503  , bool SO > // Storage order of the adapted dense matrix
1505  StrictlyUpperMatrix<MT,SO,true>::end( size_t i ) const
1506 {
1507  return matrix_.end(i);
1508 }
1510 //*************************************************************************************************
1511 
1512 
1513 //*************************************************************************************************
1525 template< typename MT // Type of the adapted dense matrix
1526  , bool SO > // Storage order of the adapted dense matrix
1528  StrictlyUpperMatrix<MT,SO,true>::cend( size_t i ) const
1529 {
1530  return matrix_.cend(i);
1531 }
1533 //*************************************************************************************************
1534 
1535 
1536 
1537 
1538 //=================================================================================================
1539 //
1540 // ASSIGNMENT OPERATORS
1541 //
1542 //=================================================================================================
1543 
1544 //*************************************************************************************************
1551 template< typename MT // Type of the adapted dense matrix
1552  , bool SO > // Storage order of the adapted dense matrix
1553 inline StrictlyUpperMatrix<MT,SO,true>&
1554  StrictlyUpperMatrix<MT,SO,true>::operator=( const ElementType& rhs )
1555 {
1556  if( SO ) {
1557  for( size_t j=1UL; j<columns(); ++j )
1558  for( size_t i=0UL; i<j; ++i )
1559  matrix_(i,j) = rhs;
1560  }
1561  else {
1562  for( size_t i=0UL; i<rows(); ++i )
1563  for( size_t j=i+1UL; j<columns(); ++j )
1564  matrix_(i,j) = rhs;
1565  }
1566 
1567  return *this;
1568 }
1570 //*************************************************************************************************
1571 
1572 
1573 //*************************************************************************************************
1597 template< typename MT // Type of the adapted dense matrix
1598  , bool SO > // Storage order of the adapted dense matrix
1599 inline StrictlyUpperMatrix<MT,SO,true>&
1600  StrictlyUpperMatrix<MT,SO,true>::operator=( initializer_list< initializer_list<ElementType> > list )
1601 {
1602  MT tmp( list );
1603 
1604  if( !isStrictlyUpper( tmp ) ) {
1605  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to strictly upper matrix" );
1606  }
1607 
1608  matrix_ = std::move( tmp );
1609 
1610  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly upper matrix detected" );
1611  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1612 
1613  return *this;
1614 }
1616 //*************************************************************************************************
1617 
1618 
1619 //*************************************************************************************************
1644 template< typename MT // Type of the adapted dense matrix
1645  , bool SO > // Storage order of the adapted dense matrix
1646 template< typename Other // Data type of the initialization array
1647  , size_t N > // Number of rows and columns of the initialization array
1648 inline StrictlyUpperMatrix<MT,SO,true>&
1649  StrictlyUpperMatrix<MT,SO,true>::operator=( const Other (&array)[N][N] )
1650 {
1651  MT tmp( array );
1652 
1653  if( !isStrictlyUpper( tmp ) ) {
1654  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to strictly upper matrix" );
1655  }
1656 
1657  matrix_ = std::move( tmp );
1658 
1659  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly upper matrix detected" );
1660  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1661 
1662  return *this;
1663 }
1665 //*************************************************************************************************
1666 
1667 
1668 //*************************************************************************************************
1678 template< typename MT // Type of the adapted dense matrix
1679  , bool SO > // Storage order of the adapted dense matrix
1680 inline StrictlyUpperMatrix<MT,SO,true>&
1681  StrictlyUpperMatrix<MT,SO,true>::operator=( const StrictlyUpperMatrix& rhs )
1682 {
1683  matrix_ = rhs.matrix_;
1684 
1685  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly upper matrix detected" );
1686  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1687 
1688  return *this;
1689 }
1691 //*************************************************************************************************
1692 
1693 
1694 //*************************************************************************************************
1701 template< typename MT // Type of the adapted dense matrix
1702  , bool SO > // Storage order of the adapted dense matrix
1703 inline StrictlyUpperMatrix<MT,SO,true>&
1704  StrictlyUpperMatrix<MT,SO,true>::operator=( StrictlyUpperMatrix&& rhs ) noexcept
1705 {
1706  matrix_ = std::move( rhs.matrix_ );
1707 
1708  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly upper matrix detected" );
1709  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1710 
1711  return *this;
1712 }
1714 //*************************************************************************************************
1715 
1716 
1717 //*************************************************************************************************
1730 template< typename MT // Type of the adapted dense matrix
1731  , bool SO > // Storage order of the adapted dense matrix
1732 template< typename MT2 // Type of the right-hand side matrix
1733  , bool SO2 > // Storage order of the right-hand side matrix
1734 inline DisableIf_< IsComputation<MT2>, StrictlyUpperMatrix<MT,SO,true>& >
1735  StrictlyUpperMatrix<MT,SO,true>::operator=( const Matrix<MT2,SO2>& rhs )
1736 {
1737  if( IsUniTriangular<MT2>::value ||
1738  ( !IsStrictlyUpper<MT2>::value && !isStrictlyUpper( ~rhs ) ) ) {
1739  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to strictly upper matrix" );
1740  }
1741 
1742  matrix_ = ~rhs;
1743 
1744  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly upper matrix detected" );
1745  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1746 
1747  return *this;
1748 }
1750 //*************************************************************************************************
1751 
1752 
1753 //*************************************************************************************************
1766 template< typename MT // Type of the adapted dense matrix
1767  , bool SO > // Storage order of the adapted dense matrix
1768 template< typename MT2 // Type of the right-hand side matrix
1769  , bool SO2 > // Storage order of the right-hand side matrix
1770 inline EnableIf_< IsComputation<MT2>, StrictlyUpperMatrix<MT,SO,true>& >
1771  StrictlyUpperMatrix<MT,SO,true>::operator=( const Matrix<MT2,SO2>& rhs )
1772 {
1773  if( IsUniTriangular<MT2>::value || ( !IsSquare<MT2>::value && !isSquare( ~rhs ) ) ) {
1774  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to strictly upper matrix" );
1775  }
1776 
1777  if( IsStrictlyUpper<MT2>::value ) {
1778  matrix_ = ~rhs;
1779  }
1780  else {
1781  MT tmp( ~rhs );
1782 
1783  if( !isStrictlyUpper( tmp ) ) {
1784  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to strictly upper matrix" );
1785  }
1786 
1787  matrix_ = std::move( tmp );
1788  }
1789 
1790  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly upper matrix detected" );
1791  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1792 
1793  return *this;
1794 }
1796 //*************************************************************************************************
1797 
1798 
1799 //*************************************************************************************************
1812 template< typename MT // Type of the adapted dense matrix
1813  , bool SO > // Storage order of the adapted dense matrix
1814 template< typename MT2 // Type of the right-hand side matrix
1815  , bool SO2 > // Storage order of the right-hand side matrix
1816 inline DisableIf_< IsComputation<MT2>, StrictlyUpperMatrix<MT,SO,true>& >
1817  StrictlyUpperMatrix<MT,SO,true>::operator+=( const Matrix<MT2,SO2>& rhs )
1818 {
1819  if( IsUniTriangular<MT2>::value ||
1820  ( !IsStrictlyUpper<MT2>::value && !isStrictlyUpper( ~rhs ) ) ) {
1821  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to strictly upper matrix" );
1822  }
1823 
1824  matrix_ += ~rhs;
1825 
1826  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly upper matrix detected" );
1827  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1828 
1829  return *this;
1830 }
1832 //*************************************************************************************************
1833 
1834 
1835 //*************************************************************************************************
1848 template< typename MT // Type of the adapted dense matrix
1849  , bool SO > // Storage order of the adapted dense matrix
1850 template< typename MT2 // Type of the right-hand side matrix
1851  , bool SO2 > // Storage order of the right-hand side matrix
1852 inline EnableIf_< IsComputation<MT2>, StrictlyUpperMatrix<MT,SO,true>& >
1853  StrictlyUpperMatrix<MT,SO,true>::operator+=( const Matrix<MT2,SO2>& rhs )
1854 {
1855  if( IsUniTriangular<MT2>::value || ( !IsSquare<MT2>::value && !isSquare( ~rhs ) ) ) {
1856  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to strictly upper matrix" );
1857  }
1858 
1859  if( IsStrictlyUpper<MT2>::value ) {
1860  matrix_ += ~rhs;
1861  }
1862  else {
1863  const ResultType_<MT2> tmp( ~rhs );
1864 
1865  if( !isStrictlyUpper( tmp ) ) {
1866  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to strictly upper matrix" );
1867  }
1868 
1869  matrix_ += tmp;
1870  }
1871 
1872  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly upper matrix detected" );
1873  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1874 
1875  return *this;
1876 }
1878 //*************************************************************************************************
1879 
1880 
1881 //*************************************************************************************************
1894 template< typename MT // Type of the adapted dense matrix
1895  , bool SO > // Storage order of the adapted dense matrix
1896 template< typename MT2 // Type of the right-hand side matrix
1897  , bool SO2 > // Storage order of the right-hand side matrix
1898 inline DisableIf_< IsComputation<MT2>, StrictlyUpperMatrix<MT,SO,true>& >
1899  StrictlyUpperMatrix<MT,SO,true>::operator-=( const Matrix<MT2,SO2>& rhs )
1900 {
1901  if( !IsStrictlyUpper<MT2>::value && !isStrictlyUpper( ~rhs ) ) {
1902  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to strictly upper matrix" );
1903  }
1904 
1905  matrix_ -= ~rhs;
1906 
1907  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly upper matrix detected" );
1908  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1909 
1910  return *this;
1911 }
1913 //*************************************************************************************************
1914 
1915 
1916 //*************************************************************************************************
1929 template< typename MT // Type of the adapted dense matrix
1930  , bool SO > // Storage order of the adapted dense matrix
1931 template< typename MT2 // Type of the right-hand side matrix
1932  , bool SO2 > // Storage order of the right-hand side matrix
1933 inline EnableIf_< IsComputation<MT2>, StrictlyUpperMatrix<MT,SO,true>& >
1934  StrictlyUpperMatrix<MT,SO,true>::operator-=( const Matrix<MT2,SO2>& rhs )
1935 {
1936  if( !IsSquare<MT2>::value && !isSquare( ~rhs ) ) {
1937  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to strictly upper matrix" );
1938  }
1939 
1940  if( IsStrictlyUpper<MT2>::value ) {
1941  matrix_ -= ~rhs;
1942  }
1943  else {
1944  const ResultType_<MT2> tmp( ~rhs );
1945 
1946  if( !isStrictlyUpper( tmp ) ) {
1947  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to strictly upper matrix" );
1948  }
1949 
1950  matrix_ -= tmp;
1951  }
1952 
1953  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly upper matrix detected" );
1954  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1955 
1956  return *this;
1957 }
1959 //*************************************************************************************************
1960 
1961 
1962 //*************************************************************************************************
1974 template< typename MT // Type of the adapted dense matrix
1975  , bool SO > // Storage order of the adapted dense matrix
1976 template< typename MT2 // Type of the right-hand side matrix
1977  , bool SO2 > // Storage order of the right-hand side matrix
1978 inline StrictlyUpperMatrix<MT,SO,true>&
1979  StrictlyUpperMatrix<MT,SO,true>::operator*=( const Matrix<MT2,SO2>& rhs )
1980 {
1981  if( matrix_.rows() != (~rhs).columns() ) {
1982  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to strictly upper matrix" );
1983  }
1984 
1985  MT tmp( matrix_ * ~rhs );
1986 
1987  if( !isStrictlyUpper( tmp ) ) {
1988  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to strictly upper matrix" );
1989  }
1990 
1991  matrix_ = std::move( tmp );
1992 
1993  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly upper matrix detected" );
1994  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1995 
1996  return *this;
1997 }
1999 //*************************************************************************************************
2000 
2001 
2002 //*************************************************************************************************
2010 template< typename MT // Type of the adapted dense matrix
2011  , bool SO > // Storage order of the adapted dense matrix
2012 template< typename Other > // Data type of the right-hand side scalar
2013 inline EnableIf_< IsNumeric<Other>, StrictlyUpperMatrix<MT,SO,true> >&
2015 {
2016  matrix_ *= rhs;
2017  return *this;
2018 }
2019 //*************************************************************************************************
2020 
2021 
2022 //*************************************************************************************************
2030 template< typename MT // Type of the adapted dense matrix
2031  , bool SO > // Storage order of the adapted dense matrix
2032 template< typename Other > // Data type of the right-hand side scalar
2033 inline EnableIf_< IsNumeric<Other>, StrictlyUpperMatrix<MT,SO,true> >&
2035 {
2036  BLAZE_USER_ASSERT( rhs != Other(0), "Division by zero detected" );
2037 
2038  matrix_ /= rhs;
2039  return *this;
2040 }
2042 //*************************************************************************************************
2043 
2044 
2045 
2046 
2047 //=================================================================================================
2048 //
2049 // UTILITY FUNCTIONS
2050 //
2051 //=================================================================================================
2052 
2053 //*************************************************************************************************
2059 template< typename MT // Type of the adapted dense matrix
2060  , bool SO > // Storage order of the adapted dense matrix
2061 inline size_t StrictlyUpperMatrix<MT,SO,true>::rows() const noexcept
2062 {
2063  return matrix_.rows();
2064 }
2066 //*************************************************************************************************
2067 
2068 
2069 //*************************************************************************************************
2075 template< typename MT // Type of the adapted dense matrix
2076  , bool SO > // Storage order of the adapted dense matrix
2077 inline size_t StrictlyUpperMatrix<MT,SO,true>::columns() const noexcept
2078 {
2079  return matrix_.columns();
2080 }
2082 //*************************************************************************************************
2083 
2084 
2085 //*************************************************************************************************
2096 template< typename MT // Type of the adapted dense matrix
2097  , bool SO > // Storage order of the adapted dense matrix
2098 inline size_t StrictlyUpperMatrix<MT,SO,true>::spacing() const noexcept
2099 {
2100  return matrix_.spacing();
2101 }
2103 //*************************************************************************************************
2104 
2105 
2106 //*************************************************************************************************
2112 template< typename MT // Type of the adapted dense matrix
2113  , bool SO > // Storage order of the adapted dense matrix
2114 inline size_t StrictlyUpperMatrix<MT,SO,true>::capacity() const noexcept
2115 {
2116  return matrix_.capacity();
2117 }
2119 //*************************************************************************************************
2120 
2121 
2122 //*************************************************************************************************
2134 template< typename MT // Type of the adapted dense matrix
2135  , bool SO > // Storage order of the adapted dense matrix
2136 inline size_t StrictlyUpperMatrix<MT,SO,true>::capacity( size_t i ) const noexcept
2137 {
2138  return matrix_.capacity(i);
2139 }
2141 //*************************************************************************************************
2142 
2143 
2144 //*************************************************************************************************
2150 template< typename MT // Type of the adapted dense matrix
2151  , bool SO > // Storage order of the adapted dense matrix
2152 inline size_t StrictlyUpperMatrix<MT,SO,true>::nonZeros() const
2153 {
2154  return matrix_.nonZeros();
2155 }
2157 //*************************************************************************************************
2158 
2159 
2160 //*************************************************************************************************
2172 template< typename MT // Type of the adapted dense matrix
2173  , bool SO > // Storage order of the adapted dense matrix
2174 inline size_t StrictlyUpperMatrix<MT,SO,true>::nonZeros( size_t i ) const
2175 {
2176  return matrix_.nonZeros(i);
2177 }
2179 //*************************************************************************************************
2180 
2181 
2182 //*************************************************************************************************
2188 template< typename MT // Type of the adapted dense matrix
2189  , bool SO > // Storage order of the adapted dense matrix
2191 {
2192  using blaze::clear;
2193 
2194  if( SO ) {
2195  for( size_t j=1UL; j<columns(); ++j )
2196  for( size_t i=0UL; i<j; ++i )
2197  clear( matrix_(i,j) );
2198  }
2199  else {
2200  for( size_t i=0UL; i<rows(); ++i )
2201  for( size_t j=i+1UL; j<columns(); ++j )
2202  clear( matrix_(i,j) );
2203  }
2204 }
2206 //*************************************************************************************************
2207 
2208 
2209 //*************************************************************************************************
2222 template< typename MT // Type of the adapted dense matrix
2223  , bool SO > // Storage order of the adapted dense matrix
2224 inline void StrictlyUpperMatrix<MT,SO,true>::reset( size_t i )
2225 {
2226  using blaze::clear;
2227 
2228  if( SO ) {
2229  for( size_t j=0UL; j<i; ++j )
2230  clear( matrix_(j,i) );
2231  }
2232  else {
2233  for( size_t j=i+1UL; j<columns(); ++j )
2234  clear( matrix_(i,j) );
2235  }
2236 }
2238 //*************************************************************************************************
2239 
2240 
2241 //*************************************************************************************************
2253 template< typename MT // Type of the adapted dense matrix
2254  , bool SO > // Storage order of the adapted dense matrix
2256 {
2257  using blaze::clear;
2258 
2259  if( IsResizable<MT>::value ) {
2260  clear( matrix_ );
2261  }
2262  else {
2263  reset();
2264  }
2265 }
2267 //*************************************************************************************************
2268 
2269 
2270 //*************************************************************************************************
2306 template< typename MT // Type of the adapted dense matrix
2307  , bool SO > // Storage order of the adapted dense matrix
2308 void StrictlyUpperMatrix<MT,SO,true>::resize( size_t n, bool preserve )
2309 {
2311 
2312  UNUSED_PARAMETER( preserve );
2313 
2314  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly upper matrix detected" );
2315 
2316  const size_t oldsize( matrix_.rows() );
2317 
2318  matrix_.resize( n, n, true );
2319 
2320  if( n > oldsize )
2321  {
2322  const size_t increment( n - oldsize );
2323  submatrix( matrix_, oldsize, 0UL, increment, n ).reset();
2324  }
2325 }
2327 //*************************************************************************************************
2328 
2329 
2330 //*************************************************************************************************
2343 template< typename MT // Type of the adapted dense matrix
2344  , bool SO > // Storage order of the adapted dense matrix
2345 inline void StrictlyUpperMatrix<MT,SO,true>::extend( size_t n, bool preserve )
2346 {
2348 
2349  UNUSED_PARAMETER( preserve );
2350 
2351  resize( rows() + n, true );
2352 }
2353 //*************************************************************************************************
2354 
2355 
2356 //*************************************************************************************************
2366 template< typename MT // Type of the adapted dense matrix
2367  , bool SO > // Storage order of the adapted dense matrix
2368 inline void StrictlyUpperMatrix<MT,SO,true>::reserve( size_t elements )
2369 {
2370  matrix_.reserve( elements );
2371 }
2373 //*************************************************************************************************
2374 
2375 
2376 //*************************************************************************************************
2383 template< typename MT // Type of the adapted dense matrix
2384  , bool SO > // Storage order of the adapted dense matrix
2385 template< typename Other > // Data type of the scalar value
2386 inline StrictlyUpperMatrix<MT,SO,true>&
2387  StrictlyUpperMatrix<MT,SO,true>::scale( const Other& scalar )
2388 {
2389  matrix_.scale( scalar );
2390  return *this;
2391 }
2393 //*************************************************************************************************
2394 
2395 
2396 //*************************************************************************************************
2403 template< typename MT // Type of the adapted dense matrix
2404  , bool SO > // Storage order of the adapted dense matrix
2405 inline void StrictlyUpperMatrix<MT,SO,true>::swap( StrictlyUpperMatrix& m ) noexcept
2406 {
2407  using std::swap;
2408 
2409  swap( matrix_, m.matrix_ );
2410 }
2412 //*************************************************************************************************
2413 
2414 
2415 //*************************************************************************************************
2427 template< typename MT // Type of the adapted dense matrix
2428  , bool SO > // Storage order of the adapted dense matrix
2429 inline constexpr size_t StrictlyUpperMatrix<MT,SO,true>::maxNonZeros() noexcept
2430 {
2432 
2433  return maxNonZeros( Rows<MT>::value );
2434 }
2436 //*************************************************************************************************
2437 
2438 
2439 //*************************************************************************************************
2449 template< typename MT // Type of the adapted dense matrix
2450  , bool SO > // Storage order of the adapted dense matrix
2451 inline constexpr size_t StrictlyUpperMatrix<MT,SO,true>::maxNonZeros( size_t n ) noexcept
2452 {
2453  return ( ( n - 1UL ) * n ) / 2UL;
2454 }
2456 //*************************************************************************************************
2457 
2458 
2459 
2460 
2461 //=================================================================================================
2462 //
2463 // DEBUGGING FUNCTIONS
2464 //
2465 //=================================================================================================
2466 
2467 //*************************************************************************************************
2477 template< typename MT // Type of the adapted dense matrix
2478  , bool SO > // Storage order of the adapted dense matrix
2479 inline bool StrictlyUpperMatrix<MT,SO,true>::isIntact() const noexcept
2480 {
2481  using blaze::isIntact;
2482 
2483  return ( isIntact( matrix_ ) && isStrictlyUpper( matrix_ ) );
2484 }
2486 //*************************************************************************************************
2487 
2488 
2489 
2490 
2491 //=================================================================================================
2492 //
2493 // EXPRESSION TEMPLATE EVALUATION FUNCTIONS
2494 //
2495 //=================================================================================================
2496 
2497 //*************************************************************************************************
2508 template< typename MT // Type of the adapted dense matrix
2509  , bool SO > // Storage order of the adapted dense matrix
2510 template< typename Other > // Data type of the foreign expression
2511 inline bool StrictlyUpperMatrix<MT,SO,true>::canAlias( const Other* alias ) const noexcept
2512 {
2513  return matrix_.canAlias( alias );
2514 }
2516 //*************************************************************************************************
2517 
2518 
2519 //*************************************************************************************************
2530 template< typename MT // Type of the adapted dense matrix
2531  , bool SO > // Storage order of the adapted dense matrix
2532 template< typename Other > // Data type of the foreign expression
2533 inline bool StrictlyUpperMatrix<MT,SO,true>::isAliased( const Other* alias ) const noexcept
2534 {
2535  return matrix_.isAliased( alias );
2536 }
2538 //*************************************************************************************************
2539 
2540 
2541 //*************************************************************************************************
2551 template< typename MT // Type of the adapted dense matrix
2552  , bool SO > // Storage order of the adapted dense matrix
2553 inline bool StrictlyUpperMatrix<MT,SO,true>::isAligned() const noexcept
2554 {
2555  return matrix_.isAligned();
2556 }
2558 //*************************************************************************************************
2559 
2560 
2561 //*************************************************************************************************
2572 template< typename MT // Type of the adapted dense matrix
2573  , bool SO > // Storage order of the adapted dense matrix
2574 inline bool StrictlyUpperMatrix<MT,SO,true>::canSMPAssign() const noexcept
2575 {
2576  return matrix_.canSMPAssign();
2577 }
2579 //*************************************************************************************************
2580 
2581 
2582 //*************************************************************************************************
2598 template< typename MT // Type of the adapted dense matrix
2599  , bool SO > // Storage order of the adapted dense matrix
2600 BLAZE_ALWAYS_INLINE typename StrictlyUpperMatrix<MT,SO,true>::SIMDType
2601  StrictlyUpperMatrix<MT,SO,true>::load( size_t i, size_t j ) const noexcept
2602 {
2603  return matrix_.load( i, j );
2604 }
2606 //*************************************************************************************************
2607 
2608 
2609 //*************************************************************************************************
2625 template< typename MT // Type of the adapted dense matrix
2626  , bool SO > // Storage order of the adapted dense matrix
2627 BLAZE_ALWAYS_INLINE typename StrictlyUpperMatrix<MT,SO,true>::SIMDType
2628  StrictlyUpperMatrix<MT,SO,true>::loada( size_t i, size_t j ) const noexcept
2629 {
2630  return matrix_.loada( i, j );
2631 }
2633 //*************************************************************************************************
2634 
2635 
2636 //*************************************************************************************************
2652 template< typename MT // Type of the adapted dense matrix
2653  , bool SO > // Storage order of the adapted dense matrix
2654 BLAZE_ALWAYS_INLINE typename StrictlyUpperMatrix<MT,SO,true>::SIMDType
2655  StrictlyUpperMatrix<MT,SO,true>::loadu( size_t i, size_t j ) const noexcept
2656 {
2657  return matrix_.loadu( i, j );
2658 }
2660 //*************************************************************************************************
2661 
2662 
2663 
2664 
2665 //=================================================================================================
2666 //
2667 // CONSTRUCTION FUNCTIONS
2668 //
2669 //=================================================================================================
2670 
2671 //*************************************************************************************************
2678 template< typename MT // Type of the adapted dense matrix
2679  , bool SO > // Storage order of the adapted dense matrix
2680 inline const MT StrictlyUpperMatrix<MT,SO,true>::construct( size_t n, TrueType )
2681 {
2683 
2684  return MT( n, n, ElementType() );
2685 }
2687 //*************************************************************************************************
2688 
2689 
2690 //*************************************************************************************************
2697 template< typename MT // Type of the adapted dense matrix
2698  , bool SO > // Storage order of the adapted dense matrix
2699 inline const MT StrictlyUpperMatrix<MT,SO,true>::construct( const ElementType& init, FalseType )
2700 {
2703 
2704  MT tmp;
2705 
2706  if( SO ) {
2707  for( size_t j=0UL; j<columns(); ++j ) {
2708  for( size_t i=0UL; i<j; ++i )
2709  tmp(i,j) = init;
2710  }
2711  }
2712  else {
2713  for( size_t i=0UL; i<rows(); ++i ) {
2714  for( size_t j=i+1UL; j<columns(); ++j )
2715  tmp(i,j) = init;
2716  }
2717  }
2718 
2719  return tmp;
2720 }
2722 //*************************************************************************************************
2723 
2724 
2725 //*************************************************************************************************
2736 template< typename MT // Type of the adapted dense matrix
2737  , bool SO > // Storage order of the adapted dense matrix
2738 template< typename MT2 // Type of the foreign matrix
2739  , bool SO2 // Storage order of the foreign matrix
2740  , typename T > // Type of the third argument
2741 inline const MT StrictlyUpperMatrix<MT,SO,true>::construct( const Matrix<MT2,SO2>& m, T )
2742 {
2743  const MT tmp( ~m );
2744 
2745  if( IsUniTriangular<MT2>::value ||
2746  ( !IsStrictlyUpper<MT2>::value && !isStrictlyUpper( tmp ) ) ) {
2747  BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of strictly upper matrix" );
2748  }
2749 
2750  return tmp;
2751 }
2753 //*************************************************************************************************
2754 
2755 } // namespace blaze
2756 
2757 #endif
Header file for the StrictlyUpperProxy class.
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.
#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.
const DMatDMatMultExpr< T1, T2 > operator*(const DenseMatrix< T1, false > &lhs, const DenseMatrix< T2, false > &rhs)
Multiplication operator for the multiplication of two row-major dense matrices ( ).
Definition: DMatDMatMultExpr.h:7800
BLAZE_ALWAYS_INLINE size_t capacity(const Matrix< MT, SO > &matrix) noexcept
Returns the maximum capacity of the matrix.
Definition: Matrix.h:346
Header file for basic type definitions.
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:404
bool isStrictlyUpper(const DenseMatrix< MT, SO > &dm)
Checks if the given dense matrix is a strictly upper triangular matrix.
Definition: DenseMatrix.h:1423
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
BLAZE_ALWAYS_INLINE T1 & operator/=(SIMDPack< T1 > &lhs, const SIMDPack< T2 > &rhs)
Division assignment operator for the division of two SIMD packs.
Definition: BasicTypes.h:1339
Constraint on the data type.
BLAZE_ALWAYS_INLINE MT::Iterator begin(Matrix< MT, SO > &matrix, size_t i)
Returns an iterator to the first element of row/column i.
Definition: Matrix.h:188
Constraint on the data type.
void reset(const DiagonalProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: DiagonalProxy.h:533
const DenseIterator< Type, AF > operator+(const DenseIterator< Type, AF > &it, ptrdiff_t inc) noexcept
Addition between a DenseIterator and an integral value.
Definition: DenseIterator.h:699
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:2643
typename DisableIf< Condition, T >::Type DisableIf_
Auxiliary type for the DisableIf class template.The DisableIf_ alias declaration provides a convenien...
Definition: DisableIf.h:223
void clear(CompressedMatrix< Type, SO > &m)
Clearing the given compressed matrix.
Definition: CompressedMatrix.h:5077
bool operator>(const NegativeAccuracy< A > &lhs, const T &rhs)
Greater-than comparison between a NegativeAccuracy object and a floating point value.
Definition: Accuracy.h:366
CompressedMatrix< Type, true > This
Type of this CompressedMatrix instance.
Definition: CompressedMatrix.h:2636
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:442
#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:384
#define BLAZE_CONSTRAINT_MUST_BE_SQUARE(T)
Constraint on the data type.In case the given data type T is not a square matrix type, a compilation error is created.
Definition: Square.h:60
const DenseIterator< Type, AF > operator-(const DenseIterator< Type, AF > &it, ptrdiff_t inc) noexcept
Subtraction between a DenseIterator and an integral value.
Definition: DenseIterator.h:731
BoolConstant< true > TrueType
Type traits base class.The TrueType class is used as base class for type traits and value traits that...
Definition: TrueType.h:61
BLAZE_ALWAYS_INLINE T1 & operator*=(SIMDPack< T1 > &lhs, const SIMDPack< T2 > &rhs)
Multiplication assignment operator for the multiplication of two SIMD packs.
Definition: BasicTypes.h:1321
Constraint on the data type.
STL namespace.
BLAZE_ALWAYS_INLINE const EnableIf_< And< IsIntegral< T >, HasSize< T, 1UL > >, If_< IsSigned< T >, SIMDint8, SIMDuint8 > > loadu(const T *address) noexcept
Loads a vector of 1-byte integral values.
Definition: Loadu.h:77
CompressedMatrix< Type, false > OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: CompressedMatrix.h:2639
DisableIf_< Or< IsComputation< MT >, IsTransExpr< MT > >, ColumnExprTrait_< MT > > column(Matrix< MT, SO > &matrix, size_t index)
Creating a view on a specific column of the given matrix.
Definition: Column.h:126
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:298
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:232
Constraint on the data type.
Constraint on the data type.
constexpr bool spacing
Adding an additional spacing line between two log messages.This setting gives the opportunity to add ...
Definition: Logging.h:70
Header file for the std::initializer_list aliases.
Header file for the IsSquare type trait.
Constraint on the data type.
Constraint on the data type.
Header file for the DisableIf class template.
Header file for the IsStrictlyUpper type trait.
Header file for the clear shim.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
#define BLAZE_ALWAYS_INLINE
Platform dependent setup of an enforced inline keyword.
Definition: Inline.h:85
void swap(CompressedMatrix< Type, SO > &a, CompressedMatrix< Type, SO > &b) noexcept
Swapping the contents of two compressed matrices.
Definition: CompressedMatrix.h:5148
Compile time assertion.
bool isIntact(const CompressedMatrix< Type, SO > &m)
Returns whether the invariants of the given compressed matrix are intact.
Definition: CompressedMatrix.h:5131
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2647
#define BLAZE_CONSTRAINT_MUST_NOT_BE_POINTER_TYPE(T)
Constraint on the data type.In case the given data type T is not a pointer type, a compilation error ...
Definition: Pointer.h:79
#define BLAZE_THROW_OUT_OF_RANGE(MESSAGE)
Macro for the emission of a std::out_of_range exception.This macro encapsulates the default way of Bl...
Definition: Exception.h:331
Header file for the DenseMatrix base class.
Header file for the Columns type trait.
Constraint on the data type.
BLAZE_ALWAYS_INLINE size_t columns(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of columns of the matrix.
Definition: Matrix.h:330
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.
CompressedMatrix< Type, false > TransposeType
Transpose type for expression template evaluations.
Definition: CompressedMatrix.h:2640
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:538
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:254
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:2641
const Type & ConstReference
Reference to a constant matrix value.
Definition: CompressedMatrix.h:2645
Header file for the EnableIf class template.
Header file for utility functions for dense matrices.
void clear(const DiagonalProxy< MT > &proxy)
Clearing the represented element.
Definition: DiagonalProxy.h:553
Header file for the implementation of the base template of the StrictlyUpperMatrix.
Header file for all adaptor forward declarations.
DisableIf_< Or< IsComputation< MT >, IsTransExpr< MT > >, RowExprTrait_< MT > > row(Matrix< MT, SO > &matrix, size_t index)
Creating a view on a specific row of the given matrix.
Definition: Row.h:126
#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
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:2642
BLAZE_ALWAYS_INLINE T1 & operator+=(SIMDPack< T1 > &lhs, const SIMDPack< T2 > &rhs)
Addition assignment operator for the addition of two SIMD packs.
Definition: BasicTypes.h:1285
Header file for run time assertion macros.
Constraint on the data type.
Constraint on the data type.
#define BLAZE_CONSTRAINT_MUST_NOT_BE_LOWER_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is a lower triangular matrix type...
Definition: Lower.h:81
#define BLAZE_CONSTRAINT_MUST_NOT_BE_REFERENCE_TYPE(T)
Constraint on the data type.In case the given data type T is not a reference type, a compilation error is created.
Definition: Reference.h:79
Element * Iterator
Iterator over non-constant elements.
Definition: CompressedMatrix.h:2646
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:258
Constraint on the data type.
Constraint on the data type.
#define BLAZE_CONSTRAINT_MUST_NOT_BE_RESIZABLE(T)
Constraint on the data type.In case the given data type T is resizable, i.e. has a 'resize' member fu...
Definition: Resizable.h:81
typename EnableIf< Condition, T >::Type EnableIf_
Auxiliary alias declaration for the EnableIf class template.The EnableIf_ alias declaration provides ...
Definition: EnableIf.h:223
BLAZE_ALWAYS_INLINE size_t rows(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of rows of the matrix.
Definition: Matrix.h:314
SparseMatrix< This, true > BaseType
Base type of this CompressedMatrix instance.
Definition: CompressedMatrix.h:2637
bool operator<(const NegativeAccuracy< A > &lhs, const T &rhs)
Less-than comparison between a NegativeAccuracy object and a floating point value.
Definition: Accuracy.h:328
#define BLAZE_CONSTRAINT_MUST_BE_RESIZABLE(T)
Constraint on the data type.In case the given data type T is not resizable, i.e. does not have a 'res...
Definition: Resizable.h:61
Header file for the IsComputation type trait class.
#define BLAZE_CONSTRAINT_MUST_NOT_BE_EXPRESSION_TYPE(T)
Constraint on the data type.In case the given data type T is an expression (i.e. a type derived from ...
Definition: Expression.h:81
bool operator==(const NegativeAccuracy< A > &lhs, const T &rhs)
Equality comparison between a NegativeAccuracy object and a floating point value. ...
Definition: Accuracy.h:249
This ResultType
Result type for expression template evaluations.
Definition: CompressedMatrix.h:2638
bool operator!=(const NegativeAccuracy< A > &lhs, const T &rhs)
Inequality comparison between a NegativeAccuracy object and a floating point value.
Definition: Accuracy.h:289
bool isIntact(const DiagonalMatrix< MT, SO, DF > &m)
Returns whether the invariants of the given diagonal matrix are intact.
Definition: DiagonalMatrix.h:240
MatrixAccessProxy< This > Reference
Reference to a non-constant matrix value.
Definition: CompressedMatrix.h:2644
#define BLAZE_CONSTRAINT_MUST_NOT_BE_HERMITIAN_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is an Hermitian matrix type, a compilation error is created.
Definition: Hermitian.h:79
BLAZE_ALWAYS_INLINE T1 & operator-=(SIMDPack< T1 > &lhs, const SIMDPack< T2 > &rhs)
Subtraction assignment operator for the subtraction of two SIMD packs.
Definition: BasicTypes.h:1303
void UNUSED_PARAMETER(const Args &...)
Suppression of unused parameter warnings.
Definition: Unused.h:81
#define BLAZE_STATIC_ASSERT(expr)
Compile time assertion macro.In case of an invalid compile time expression, a compilation error is cr...
Definition: StaticAssert.h:112
SubmatrixExprTrait_< MT, unaligned > submatrix(Matrix< MT, SO > &matrix, size_t row, size_t column, size_t m, size_t n)
Creating a view on a specific submatrix of the given matrix.
Definition: Submatrix.h:167
BLAZE_ALWAYS_INLINE bool isSquare(const Matrix< MT, SO > &matrix) noexcept
Checks if the given matrix is a square matrix.
Definition: Matrix.h:609
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 TrueType type/value trait base class.