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 NewType > // Data type of the other matrix
138  struct Rebind {
140  typedef StrictlyUpperMatrix< typename MT::template Rebind<NewType>::Other > Other;
141  };
142  //**********************************************************************************************
143 
144  //**Resize struct definition********************************************************************
147  template< size_t NewM // Number of rows of the other matrix
148  , size_t NewN > // Number of columns of the other matrix
149  struct Resize {
151  typedef StrictlyUpperMatrix< typename MT::template Resize<NewM,NewN>::Other > Other;
152  };
153  //**********************************************************************************************
154 
155  //**Iterator class definition*******************************************************************
158  class Iterator
159  {
160  public:
161  //**Type definitions*************************************************************************
162  typedef std::random_access_iterator_tag IteratorCategory;
163  typedef ElementType_<MT> ValueType;
164  typedef StrictlyUpperProxy<MT> PointerType;
165  typedef StrictlyUpperProxy<MT> ReferenceType;
166  typedef ptrdiff_t DifferenceType;
167 
168  // STL iterator requirements
169  typedef IteratorCategory iterator_category;
170  typedef ValueType value_type;
171  typedef PointerType pointer;
172  typedef ReferenceType reference;
173  typedef DifferenceType difference_type;
174  //*******************************************************************************************
175 
176  //**Constructor******************************************************************************
179  inline Iterator() noexcept
180  : matrix_( nullptr ) // Reference to the adapted dense matrix
181  , row_ ( 0UL ) // The current row index of the iterator
182  , column_( 0UL ) // The current column index of the iterator
183  {}
184  //*******************************************************************************************
185 
186  //**Constructor******************************************************************************
193  inline Iterator( MT& matrix, size_t row, size_t column ) noexcept
194  : matrix_( &matrix ) // Reference to the adapted dense matrix
195  , row_ ( row ) // The current row-index of the iterator
196  , column_( column ) // The current column-index of the iterator
197  {}
198  //*******************************************************************************************
199 
200  //**Addition assignment operator*************************************************************
206  inline Iterator& operator+=( size_t inc ) noexcept {
207  ( SO )?( row_ += inc ):( column_ += inc );
208  return *this;
209  }
210  //*******************************************************************************************
211 
212  //**Subtraction assignment operator**********************************************************
218  inline Iterator& operator-=( size_t dec ) noexcept {
219  ( SO )?( row_ -= dec ):( column_ -= dec );
220  return *this;
221  }
222  //*******************************************************************************************
223 
224  //**Prefix increment operator****************************************************************
229  inline Iterator& operator++() noexcept {
230  ( SO )?( ++row_ ):( ++column_ );
231  return *this;
232  }
233  //*******************************************************************************************
234 
235  //**Postfix increment operator***************************************************************
240  inline const Iterator operator++( int ) noexcept {
241  const Iterator tmp( *this );
242  ++(*this);
243  return tmp;
244  }
245  //*******************************************************************************************
246 
247  //**Prefix decrement operator****************************************************************
252  inline Iterator& operator--() noexcept {
253  ( SO )?( --row_ ):( --column_ );
254  return *this;
255  }
256  //*******************************************************************************************
257 
258  //**Postfix decrement operator***************************************************************
263  inline const Iterator operator--( int ) noexcept {
264  const Iterator tmp( *this );
265  --(*this);
266  return tmp;
267  }
268  //*******************************************************************************************
269 
270  //**Element access operator******************************************************************
275  inline ReferenceType operator*() const {
276  return ReferenceType( *matrix_, row_, column_ );
277  }
278  //*******************************************************************************************
279 
280  //**Element access operator******************************************************************
285  inline PointerType operator->() const {
286  return PointerType( *matrix_, row_, column_ );
287  }
288  //*******************************************************************************************
289 
290  //**Load function****************************************************************************
300  inline SIMDType load() const {
301  return (*matrix_).load(row_,column_);
302  }
303  //*******************************************************************************************
304 
305  //**Loada function***************************************************************************
315  inline SIMDType loada() const {
316  return (*matrix_).loada(row_,column_);
317  }
318  //*******************************************************************************************
319 
320  //**Loadu function***************************************************************************
330  inline SIMDType loadu() const {
331  return (*matrix_).loadu(row_,column_);
332  }
333  //*******************************************************************************************
334 
335  //**Conversion operator**********************************************************************
340  inline operator ConstIterator() const {
341  if( SO )
342  return matrix_->begin( column_ ) + row_;
343  else
344  return matrix_->begin( row_ ) + column_;
345  }
346  //*******************************************************************************************
347 
348  //**Equality operator************************************************************************
355  friend inline bool operator==( const Iterator& lhs, const Iterator& rhs ) noexcept {
356  return ( SO )?( lhs.row_ == rhs.row_ ):( lhs.column_ == rhs.column_ );
357  }
358  //*******************************************************************************************
359 
360  //**Equality operator************************************************************************
367  friend inline bool operator==( const Iterator& lhs, const ConstIterator& rhs ) {
368  return ( ConstIterator( lhs ) == rhs );
369  }
370  //*******************************************************************************************
371 
372  //**Equality operator************************************************************************
379  friend inline bool operator==( const ConstIterator& lhs, const Iterator& rhs ) {
380  return ( lhs == ConstIterator( rhs ) );
381  }
382  //*******************************************************************************************
383 
384  //**Inequality operator**********************************************************************
391  friend inline bool operator!=( const Iterator& lhs, const Iterator& rhs ) noexcept {
392  return ( SO )?( lhs.row_ != rhs.row_ ):( lhs.column_ != rhs.column_ );
393  }
394  //*******************************************************************************************
395 
396  //**Inequality operator**********************************************************************
403  friend inline bool operator!=( const Iterator& lhs, const ConstIterator& rhs ) {
404  return ( ConstIterator( lhs ) != rhs );
405  }
406  //*******************************************************************************************
407 
408  //**Inequality operator**********************************************************************
415  friend inline bool operator!=( const ConstIterator& lhs, const Iterator& rhs ) {
416  return ( lhs != ConstIterator( rhs ) );
417  }
418  //*******************************************************************************************
419 
420  //**Less-than operator***********************************************************************
427  friend inline bool operator<( const Iterator& lhs, const Iterator& rhs ) noexcept {
428  return ( SO )?( lhs.row_ < rhs.row_ ):( lhs.column_ < rhs.column_ );
429  }
430  //*******************************************************************************************
431 
432  //**Less-than operator***********************************************************************
439  friend inline bool operator<( const Iterator& lhs, const ConstIterator& rhs ) {
440  return ( ConstIterator( lhs ) < rhs );
441  }
442  //*******************************************************************************************
443 
444  //**Less-than operator***********************************************************************
451  friend inline bool operator<( const ConstIterator& lhs, const Iterator& rhs ) {
452  return ( lhs < ConstIterator( rhs ) );
453  }
454  //*******************************************************************************************
455 
456  //**Greater-than operator********************************************************************
463  friend inline bool operator>( const Iterator& lhs, const Iterator& rhs ) noexcept {
464  return ( SO )?( lhs.row_ > rhs.row_ ):( lhs.column_ > rhs.column_ );
465  }
466  //*******************************************************************************************
467 
468  //**Greater-than operator********************************************************************
475  friend inline bool operator>( const Iterator& lhs, const ConstIterator& rhs ) {
476  return ( ConstIterator( lhs ) > rhs );
477  }
478  //*******************************************************************************************
479 
480  //**Greater-than operator********************************************************************
487  friend inline bool operator>( const ConstIterator& lhs, const Iterator& rhs ) {
488  return ( lhs > ConstIterator( rhs ) );
489  }
490  //*******************************************************************************************
491 
492  //**Less-or-equal-than operator**************************************************************
499  friend inline bool operator<=( const Iterator& lhs, const Iterator& rhs ) noexcept {
500  return ( SO )?( lhs.row_ <= rhs.row_ ):( lhs.column_ <= rhs.column_ );
501  }
502  //*******************************************************************************************
503 
504  //**Less-or-equal-than operator**************************************************************
511  friend inline bool operator<=( const Iterator& lhs, const ConstIterator& rhs ) {
512  return ( ConstIterator( lhs ) <= rhs );
513  }
514  //*******************************************************************************************
515 
516  //**Less-or-equal-than operator**************************************************************
523  friend inline bool operator<=( const ConstIterator& lhs, const Iterator& rhs ) {
524  return ( lhs <= ConstIterator( rhs ) );
525  }
526  //*******************************************************************************************
527 
528  //**Greater-or-equal-than operator***********************************************************
535  friend inline bool operator>=( const Iterator& lhs, const Iterator& rhs ) noexcept {
536  return ( SO )?( lhs.row_ >= rhs.row_ ):( lhs.column_ >= rhs.column_ );
537  }
538  //*******************************************************************************************
539 
540  //**Greater-or-equal-than operator***********************************************************
547  friend inline bool operator>=( const Iterator& lhs, const ConstIterator& rhs ) {
548  return ( ConstIterator( lhs ) >= rhs );
549  }
550  //*******************************************************************************************
551 
552  //**Greater-or-equal-than operator***********************************************************
559  friend inline bool operator>=( const ConstIterator& lhs, const Iterator& rhs ) {
560  return ( lhs >= ConstIterator( rhs ) );
561  }
562  //*******************************************************************************************
563 
564  //**Subtraction operator*********************************************************************
570  inline DifferenceType operator-( const Iterator& rhs ) const noexcept {
571  return ( SO )?( row_ - rhs.row_ ):( column_ - rhs.column_ );
572  }
573  //*******************************************************************************************
574 
575  //**Addition operator************************************************************************
582  friend inline const Iterator operator+( const Iterator& it, size_t inc ) noexcept {
583  if( SO )
584  return Iterator( *it.matrix_, it.row_ + inc, it.column_ );
585  else
586  return Iterator( *it.matrix_, it.row_, it.column_ + inc );
587  }
588  //*******************************************************************************************
589 
590  //**Addition operator************************************************************************
597  friend inline const Iterator operator+( size_t inc, const Iterator& it ) noexcept {
598  if( SO )
599  return Iterator( *it.matrix_, it.row_ + inc, it.column_ );
600  else
601  return Iterator( *it.matrix_, it.row_, it.column_ + inc );
602  }
603  //*******************************************************************************************
604 
605  //**Subtraction operator*********************************************************************
612  friend inline const Iterator operator-( const Iterator& it, size_t dec ) noexcept {
613  if( SO )
614  return Iterator( *it.matrix_, it.row_ - dec, it.column_ );
615  else
616  return Iterator( *it.matrix_, it.row_, it.column_ - dec );
617  }
618  //*******************************************************************************************
619 
620  private:
621  //**Member variables*************************************************************************
622  MT* matrix_;
623  size_t row_;
624  size_t column_;
625  //*******************************************************************************************
626  };
627  //**********************************************************************************************
628 
629  //**Compilation flags***************************************************************************
631  enum : bool { simdEnabled = MT::simdEnabled };
632 
634  enum : bool { smpAssignable = MT::smpAssignable };
635  //**********************************************************************************************
636 
637  //**Constructors********************************************************************************
640  explicit inline StrictlyUpperMatrix();
641  template< typename A1 > explicit inline StrictlyUpperMatrix( const A1& a1 );
642  explicit inline StrictlyUpperMatrix( size_t n, const ElementType& init );
643 
644  explicit inline StrictlyUpperMatrix( initializer_list< initializer_list<ElementType> > list );
645 
646  template< typename Other >
647  explicit inline StrictlyUpperMatrix( size_t n, const Other* array );
648 
649  template< typename Other, size_t N >
650  explicit inline StrictlyUpperMatrix( const Other (&array)[N][N] );
651 
652  explicit inline StrictlyUpperMatrix( ElementType* ptr, size_t n );
653  explicit inline StrictlyUpperMatrix( ElementType* ptr, size_t n, size_t nn );
654 
655  template< typename Deleter >
656  explicit inline StrictlyUpperMatrix( ElementType* ptr, size_t n, Deleter d );
657 
658  template< typename Deleter >
659  explicit inline StrictlyUpperMatrix( ElementType* ptr, size_t n, size_t nn, Deleter d );
660 
661  inline StrictlyUpperMatrix( const StrictlyUpperMatrix& m );
662  inline StrictlyUpperMatrix( StrictlyUpperMatrix&& 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 StrictlyUpperMatrix& operator=( initializer_list< initializer_list<ElementType> > list );
692 
693  template< typename Other, size_t N >
694  inline StrictlyUpperMatrix& operator=( const Other (&array)[N][N] );
695 
696  inline StrictlyUpperMatrix& operator=( const ElementType& rhs );
697  inline StrictlyUpperMatrix& operator=( const StrictlyUpperMatrix& rhs );
698  inline StrictlyUpperMatrix& operator=( StrictlyUpperMatrix&& rhs ) noexcept;
699 
700  template< typename MT2, bool SO2 >
701  inline DisableIf_< IsComputation<MT2>, StrictlyUpperMatrix& >
702  operator=( const Matrix<MT2,SO2>& rhs );
703 
704  template< typename MT2, bool SO2 >
705  inline EnableIf_< IsComputation<MT2>, StrictlyUpperMatrix& >
706  operator=( const Matrix<MT2,SO2>& rhs );
707 
708  template< typename MT2, bool SO2 >
709  inline DisableIf_< IsComputation<MT2>, StrictlyUpperMatrix& >
710  operator+=( const Matrix<MT2,SO2>& rhs );
711 
712  template< typename MT2, bool SO2 >
713  inline EnableIf_< IsComputation<MT2>, StrictlyUpperMatrix& >
714  operator+=( const Matrix<MT2,SO2>& rhs );
715 
716  template< typename MT2, bool SO2 >
717  inline DisableIf_< IsComputation<MT2>, StrictlyUpperMatrix& >
718  operator-=( const Matrix<MT2,SO2>& rhs );
719 
720  template< typename MT2, bool SO2 >
721  inline EnableIf_< IsComputation<MT2>, StrictlyUpperMatrix& >
722  operator-=( const Matrix<MT2,SO2>& rhs );
723 
724  template< typename MT2, bool SO2 >
725  inline StrictlyUpperMatrix& operator*=( const Matrix<MT2,SO2>& rhs );
726 
727  template< typename Other >
728  inline EnableIf_< IsNumeric<Other>, StrictlyUpperMatrix >& operator*=( Other rhs );
729 
730  template< typename Other >
731  inline EnableIf_< IsNumeric<Other>, StrictlyUpperMatrix >& operator/=( Other rhs );
733  //**********************************************************************************************
734 
735  //**Utility functions***************************************************************************
738  inline size_t rows() const noexcept;
739  inline size_t columns() const noexcept;
740  inline size_t spacing() const noexcept;
741  inline size_t capacity() const noexcept;
742  inline size_t capacity( size_t i ) const noexcept;
743  inline size_t nonZeros() const;
744  inline size_t nonZeros( size_t i ) const;
745  inline void reset();
746  inline void reset( size_t i );
747  inline void clear();
748  void resize ( size_t n, bool preserve=true );
749  inline void extend ( size_t n, bool preserve=true );
750  inline void reserve( size_t elements );
751  inline void swap( StrictlyUpperMatrix& m ) noexcept;
752 
753  static inline constexpr size_t maxNonZeros() noexcept;
754  static inline constexpr size_t maxNonZeros( size_t n ) noexcept;
756  //**********************************************************************************************
757 
758  //**Numeric functions***************************************************************************
761  template< typename Other > inline StrictlyUpperMatrix& scale( const Other& scalar );
763  //**********************************************************************************************
764 
765  //**Debugging functions*************************************************************************
768  inline bool isIntact() const noexcept;
770  //**********************************************************************************************
771 
772  //**Expression template evaluation functions****************************************************
775  template< typename Other > inline bool canAlias ( const Other* alias ) const noexcept;
776  template< typename Other > inline bool isAliased( const Other* alias ) const noexcept;
777 
778  inline bool isAligned () const noexcept;
779  inline bool canSMPAssign() const noexcept;
780 
781  BLAZE_ALWAYS_INLINE SIMDType load ( size_t i, size_t j ) const noexcept;
782  BLAZE_ALWAYS_INLINE SIMDType loada( size_t i, size_t j ) const noexcept;
783  BLAZE_ALWAYS_INLINE SIMDType loadu( size_t i, size_t j ) const noexcept;
785  //**********************************************************************************************
786 
787  private:
788  //**Construction functions**********************************************************************
791  inline const MT construct( size_t n , TrueType );
792  inline const MT construct( const ElementType& value, FalseType );
793 
794  template< typename MT2, bool SO2, typename T >
795  inline const MT construct( const Matrix<MT2,SO2>& m, T );
797  //**********************************************************************************************
798 
799  //**Member variables****************************************************************************
802  MT matrix_;
803 
804  //**********************************************************************************************
805 
806  //**Friend declarations*************************************************************************
807  template< typename MT2, bool SO2, bool DF2 >
808  friend MT2& derestrict( StrictlyUpperMatrix<MT2,SO2,DF2>& m );
809  //**********************************************************************************************
810 
811  //**Compile time checks*************************************************************************
824  BLAZE_STATIC_ASSERT( Rows<MT>::value == Columns<MT>::value );
825  //**********************************************************************************************
826 };
828 //*************************************************************************************************
829 
830 
831 
832 
833 //=================================================================================================
834 //
835 // CONSTRUCTORS
836 //
837 //=================================================================================================
838 
839 //*************************************************************************************************
843 template< typename MT // Type of the adapted dense matrix
844  , bool SO > // Storage order of the adapted dense matrix
845 inline StrictlyUpperMatrix<MT,SO,true>::StrictlyUpperMatrix()
846  : matrix_() // The adapted dense matrix
847 {
848  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly upper matrix detected" );
849  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
850 }
852 //*************************************************************************************************
853 
854 
855 //*************************************************************************************************
873 template< typename MT // Type of the adapted dense matrix
874  , bool SO > // Storage order of the adapted dense matrix
875 template< typename A1 > // Type of the constructor argument
876 inline StrictlyUpperMatrix<MT,SO,true>::StrictlyUpperMatrix( const A1& a1 )
877  : matrix_( construct( a1, typename IsResizable<MT>::Type() ) ) // The adapted dense matrix
878 {
879  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly upper matrix detected" );
880  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
881 }
883 //*************************************************************************************************
884 
885 
886 //*************************************************************************************************
893 template< typename MT // Type of the adapted dense matrix
894  , bool SO > // Storage order of the adapted dense matrix
895 inline StrictlyUpperMatrix<MT,SO,true>::StrictlyUpperMatrix( size_t n, const ElementType& init )
896  : matrix_( n, n, ElementType() ) // The adapted dense matrix
897 {
899 
900  if( SO ) {
901  for( size_t j=0UL; j<columns(); ++j ) {
902  for( size_t i=0UL; i<j; ++i )
903  matrix_(i,j) = init;
904  }
905  }
906  else {
907  for( size_t i=0UL; i<rows(); ++i ) {
908  for( size_t j=i+1UL; j<columns(); ++j )
909  matrix_(i,j) = init;
910  }
911  }
912 
913  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly upper matrix detected" );
914  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
915 }
917 //*************************************************************************************************
918 
919 
920 //*************************************************************************************************
943 template< typename MT // Type of the adapted dense matrix
944  , bool SO > // Storage order of the adapted dense matrix
945 inline StrictlyUpperMatrix<MT,SO,true>::StrictlyUpperMatrix( initializer_list< initializer_list<ElementType> > list )
946  : matrix_( list ) // The adapted dense matrix
947 {
948  if( !isStrictlyUpper( matrix_ ) ) {
949  BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of strictly upper matrix" );
950  }
951 
952  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
953 }
955 //*************************************************************************************************
956 
957 
958 //*************************************************************************************************
985 template< typename MT // Type of the adapted dense matrix
986  , bool SO > // Storage order of the adapted dense matrix
987 template< typename Other > // Data type of the initialization array
988 inline StrictlyUpperMatrix<MT,SO,true>::StrictlyUpperMatrix( size_t n, const Other* array )
989  : matrix_( n, n, array ) // The adapted dense matrix
990 {
991  if( !isStrictlyUpper( matrix_ ) ) {
992  BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of strictly upper matrix" );
993  }
994 
995  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
996 }
998 //*************************************************************************************************
999 
1000 
1001 //*************************************************************************************************
1024 template< typename MT // Type of the adapted dense matrix
1025  , bool SO > // Storage order of the adapted dense matrix
1026 template< typename Other // Data type of the initialization array
1027  , size_t N > // Number of columns of the initialization array
1028 inline StrictlyUpperMatrix<MT,SO,true>::StrictlyUpperMatrix( const Other (&array)[N][N] )
1029  : matrix_( array ) // The adapted dense matrix
1030 {
1031  if( !isStrictlyUpper( matrix_ ) ) {
1032  BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of strictly upper matrix" );
1033  }
1034 
1035  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1036 }
1038 //*************************************************************************************************
1039 
1040 
1041 //*************************************************************************************************
1063 template< typename MT // Type of the adapted dense matrix
1064  , bool SO > // Storage order of the adapted dense matrix
1065 inline StrictlyUpperMatrix<MT,SO,true>::StrictlyUpperMatrix( ElementType* ptr, size_t n )
1066  : matrix_( ptr, n, n ) // The adapted dense matrix
1067 {
1068  if( !isStrictlyUpper( matrix_ ) ) {
1069  BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of strictly upper matrix" );
1070  }
1071 
1072  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1073 }
1075 //*************************************************************************************************
1076 
1077 
1078 //*************************************************************************************************
1101 template< typename MT // Type of the adapted dense matrix
1102  , bool SO > // Storage order of the adapted dense matrix
1103 inline StrictlyUpperMatrix<MT,SO,true>::StrictlyUpperMatrix( ElementType* ptr, size_t n, size_t nn )
1104  : matrix_( ptr, n, n, nn ) // The adapted dense matrix
1105 {
1106  if( !isStrictlyUpper( matrix_ ) ) {
1107  BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of strictly upper matrix" );
1108  }
1109 
1110  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1111 }
1113 //*************************************************************************************************
1114 
1115 
1116 //*************************************************************************************************
1137 template< typename MT // Type of the adapted dense matrix
1138  , bool SO > // Storage order of the adapted dense matrix
1139 template< typename Deleter > // Type of the custom deleter
1140 inline StrictlyUpperMatrix<MT,SO,true>::StrictlyUpperMatrix( ElementType* ptr, size_t n, Deleter d )
1141  : matrix_( ptr, n, n, d ) // The adapted dense matrix
1142 {
1143  if( !isStrictlyUpper( matrix_ ) ) {
1144  BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of strictly upper matrix" );
1145  }
1146 
1147  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1148 }
1150 //*************************************************************************************************
1151 
1152 
1153 //*************************************************************************************************
1175 template< typename MT // Type of the adapted dense matrix
1176  , bool SO > // Storage order of the adapted dense matrix
1177 template< typename Deleter > // Type of the custom deleter
1178 inline StrictlyUpperMatrix<MT,SO,true>::StrictlyUpperMatrix( ElementType* ptr, size_t n, size_t nn, Deleter d )
1179  : matrix_( ptr, n, n, nn, d ) // The adapted dense matrix
1180 {
1181  if( !isStrictlyUpper( matrix_ ) ) {
1182  BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of strictly upper matrix" );
1183  }
1184 
1185  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1186 }
1188 //*************************************************************************************************
1189 
1190 
1191 //*************************************************************************************************
1197 template< typename MT // Type of the adapted dense matrix
1198  , bool SO > // Storage order of the adapted dense matrix
1199 inline StrictlyUpperMatrix<MT,SO,true>::StrictlyUpperMatrix( const StrictlyUpperMatrix& m )
1200  : matrix_( m.matrix_ ) // The adapted dense matrix
1201 {
1202  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly upper matrix detected" );
1203  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1204 }
1206 //*************************************************************************************************
1207 
1208 
1209 //*************************************************************************************************
1215 template< typename MT // Type of the adapted dense matrix
1216  , bool SO > // Storage order of the adapted dense matrix
1217 inline StrictlyUpperMatrix<MT,SO,true>::StrictlyUpperMatrix( StrictlyUpperMatrix&& m ) noexcept
1218  : matrix_( std::move( m.matrix_ ) ) // The adapted dense matrix
1219 {
1220  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly upper matrix detected" );
1221  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1222 }
1224 //*************************************************************************************************
1225 
1226 
1227 
1228 
1229 //=================================================================================================
1230 //
1231 // DATA ACCESS FUNCTIONS
1232 //
1233 //=================================================================================================
1234 
1235 //*************************************************************************************************
1251 template< typename MT // Type of the adapted dense matrix
1252  , bool SO > // Storage order of the adapted dense matrix
1254  StrictlyUpperMatrix<MT,SO,true>::operator()( size_t i, size_t j )
1255 {
1256  BLAZE_USER_ASSERT( i<rows() , "Invalid row access index" );
1257  BLAZE_USER_ASSERT( j<columns(), "Invalid column access index" );
1258 
1259  return Reference( matrix_, i, j );
1260 }
1262 //*************************************************************************************************
1263 
1264 
1265 //*************************************************************************************************
1281 template< typename MT // Type of the adapted dense matrix
1282  , bool SO > // Storage order of the adapted dense matrix
1284  StrictlyUpperMatrix<MT,SO,true>::operator()( size_t i, size_t j ) const
1285 {
1286  BLAZE_USER_ASSERT( i<rows() , "Invalid row access index" );
1287  BLAZE_USER_ASSERT( j<columns(), "Invalid column access index" );
1288 
1289  return matrix_(i,j);
1290 }
1292 //*************************************************************************************************
1293 
1294 
1295 //*************************************************************************************************
1312 template< typename MT // Type of the adapted dense matrix
1313  , bool SO > // Storage order of the adapted dense matrix
1315  StrictlyUpperMatrix<MT,SO,true>::at( size_t i, size_t j )
1316 {
1317  if( i >= rows() ) {
1318  BLAZE_THROW_OUT_OF_RANGE( "Invalid row access index" );
1319  }
1320  if( j >= columns() ) {
1321  BLAZE_THROW_OUT_OF_RANGE( "Invalid column access index" );
1322  }
1323  return (*this)(i,j);
1324 }
1326 //*************************************************************************************************
1327 
1328 
1329 //*************************************************************************************************
1346 template< typename MT // Type of the adapted dense matrix
1347  , bool SO > // Storage order of the adapted dense matrix
1349  StrictlyUpperMatrix<MT,SO,true>::at( size_t i, size_t j ) const
1350 {
1351  if( i >= rows() ) {
1352  BLAZE_THROW_OUT_OF_RANGE( "Invalid row access index" );
1353  }
1354  if( j >= columns() ) {
1355  BLAZE_THROW_OUT_OF_RANGE( "Invalid column access index" );
1356  }
1357  return (*this)(i,j);
1358 }
1360 //*************************************************************************************************
1361 
1362 
1363 //*************************************************************************************************
1376 template< typename MT // Type of the adapted dense matrix
1377  , bool SO > // Storage order of the adapted dense matrix
1378 inline typename StrictlyUpperMatrix<MT,SO,true>::ConstPointer
1379  StrictlyUpperMatrix<MT,SO,true>::data() const noexcept
1380 {
1381  return matrix_.data();
1382 }
1384 //*************************************************************************************************
1385 
1386 
1387 //*************************************************************************************************
1396 template< typename MT // Type of the adapted dense matrix
1397  , bool SO > // Storage order of the adapted dense matrix
1398 inline typename StrictlyUpperMatrix<MT,SO,true>::ConstPointer
1399  StrictlyUpperMatrix<MT,SO,true>::data( size_t i ) const noexcept
1400 {
1401  return matrix_.data(i);
1402 }
1404 //*************************************************************************************************
1405 
1406 
1407 //*************************************************************************************************
1419 template< typename MT // Type of the adapted dense matrix
1420  , bool SO > // Storage order of the adapted dense matrix
1423 {
1424  if( SO )
1425  return Iterator( matrix_, 0UL, i );
1426  else
1427  return Iterator( matrix_, i, 0UL );
1428 }
1430 //*************************************************************************************************
1431 
1432 
1433 //*************************************************************************************************
1445 template< typename MT // Type of the adapted dense matrix
1446  , bool SO > // Storage order of the adapted dense matrix
1448  StrictlyUpperMatrix<MT,SO,true>::begin( size_t i ) const
1449 {
1450  return matrix_.begin(i);
1451 }
1453 //*************************************************************************************************
1454 
1455 
1456 //*************************************************************************************************
1468 template< typename MT // Type of the adapted dense matrix
1469  , bool SO > // Storage order of the adapted dense matrix
1471  StrictlyUpperMatrix<MT,SO,true>::cbegin( size_t i ) const
1472 {
1473  return matrix_.cbegin(i);
1474 }
1476 //*************************************************************************************************
1477 
1478 
1479 //*************************************************************************************************
1491 template< typename MT // Type of the adapted dense matrix
1492  , bool SO > // Storage order of the adapted dense matrix
1495 {
1496  if( SO )
1497  return Iterator( matrix_, rows(), i );
1498  else
1499  return Iterator( matrix_, i, columns() );
1500 }
1502 //*************************************************************************************************
1503 
1504 
1505 //*************************************************************************************************
1517 template< typename MT // Type of the adapted dense matrix
1518  , bool SO > // Storage order of the adapted dense matrix
1520  StrictlyUpperMatrix<MT,SO,true>::end( size_t i ) const
1521 {
1522  return matrix_.end(i);
1523 }
1525 //*************************************************************************************************
1526 
1527 
1528 //*************************************************************************************************
1540 template< typename MT // Type of the adapted dense matrix
1541  , bool SO > // Storage order of the adapted dense matrix
1543  StrictlyUpperMatrix<MT,SO,true>::cend( size_t i ) const
1544 {
1545  return matrix_.cend(i);
1546 }
1548 //*************************************************************************************************
1549 
1550 
1551 
1552 
1553 //=================================================================================================
1554 //
1555 // ASSIGNMENT OPERATORS
1556 //
1557 //=================================================================================================
1558 
1559 //*************************************************************************************************
1566 template< typename MT // Type of the adapted dense matrix
1567  , bool SO > // Storage order of the adapted dense matrix
1568 inline StrictlyUpperMatrix<MT,SO,true>&
1569  StrictlyUpperMatrix<MT,SO,true>::operator=( const ElementType& rhs )
1570 {
1571  if( SO ) {
1572  for( size_t j=1UL; j<columns(); ++j )
1573  for( size_t i=0UL; i<j; ++i )
1574  matrix_(i,j) = rhs;
1575  }
1576  else {
1577  for( size_t i=0UL; i<rows(); ++i )
1578  for( size_t j=i+1UL; j<columns(); ++j )
1579  matrix_(i,j) = rhs;
1580  }
1581 
1582  return *this;
1583 }
1585 //*************************************************************************************************
1586 
1587 
1588 //*************************************************************************************************
1612 template< typename MT // Type of the adapted dense matrix
1613  , bool SO > // Storage order of the adapted dense matrix
1614 inline StrictlyUpperMatrix<MT,SO,true>&
1615  StrictlyUpperMatrix<MT,SO,true>::operator=( initializer_list< initializer_list<ElementType> > list )
1616 {
1617  MT tmp( list );
1618 
1619  if( !isStrictlyUpper( tmp ) ) {
1620  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to strictly upper matrix" );
1621  }
1622 
1623  matrix_ = std::move( tmp );
1624 
1625  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly upper matrix detected" );
1626  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1627 
1628  return *this;
1629 }
1631 //*************************************************************************************************
1632 
1633 
1634 //*************************************************************************************************
1659 template< typename MT // Type of the adapted dense matrix
1660  , bool SO > // Storage order of the adapted dense matrix
1661 template< typename Other // Data type of the initialization array
1662  , size_t N > // Number of rows and columns of the initialization array
1663 inline StrictlyUpperMatrix<MT,SO,true>&
1664  StrictlyUpperMatrix<MT,SO,true>::operator=( const Other (&array)[N][N] )
1665 {
1666  MT tmp( array );
1667 
1668  if( !isStrictlyUpper( tmp ) ) {
1669  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to strictly upper matrix" );
1670  }
1671 
1672  matrix_ = std::move( tmp );
1673 
1674  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly upper matrix detected" );
1675  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1676 
1677  return *this;
1678 }
1680 //*************************************************************************************************
1681 
1682 
1683 //*************************************************************************************************
1693 template< typename MT // Type of the adapted dense matrix
1694  , bool SO > // Storage order of the adapted dense matrix
1695 inline StrictlyUpperMatrix<MT,SO,true>&
1696  StrictlyUpperMatrix<MT,SO,true>::operator=( const StrictlyUpperMatrix& rhs )
1697 {
1698  matrix_ = rhs.matrix_;
1699 
1700  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly upper matrix detected" );
1701  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1702 
1703  return *this;
1704 }
1706 //*************************************************************************************************
1707 
1708 
1709 //*************************************************************************************************
1716 template< typename MT // Type of the adapted dense matrix
1717  , bool SO > // Storage order of the adapted dense matrix
1718 inline StrictlyUpperMatrix<MT,SO,true>&
1719  StrictlyUpperMatrix<MT,SO,true>::operator=( StrictlyUpperMatrix&& rhs ) noexcept
1720 {
1721  matrix_ = std::move( rhs.matrix_ );
1722 
1723  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly upper matrix detected" );
1724  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1725 
1726  return *this;
1727 }
1729 //*************************************************************************************************
1730 
1731 
1732 //*************************************************************************************************
1745 template< typename MT // Type of the adapted dense matrix
1746  , bool SO > // Storage order of the adapted dense matrix
1747 template< typename MT2 // Type of the right-hand side matrix
1748  , bool SO2 > // Storage order of the right-hand side matrix
1749 inline DisableIf_< IsComputation<MT2>, StrictlyUpperMatrix<MT,SO,true>& >
1750  StrictlyUpperMatrix<MT,SO,true>::operator=( const Matrix<MT2,SO2>& rhs )
1751 {
1752  if( IsUniTriangular<MT2>::value ||
1753  ( !IsStrictlyUpper<MT2>::value && !isStrictlyUpper( ~rhs ) ) ) {
1754  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to strictly upper matrix" );
1755  }
1756 
1757  matrix_ = ~rhs;
1758 
1759  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly upper matrix detected" );
1760  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1761 
1762  return *this;
1763 }
1765 //*************************************************************************************************
1766 
1767 
1768 //*************************************************************************************************
1781 template< typename MT // Type of the adapted dense matrix
1782  , bool SO > // Storage order of the adapted dense matrix
1783 template< typename MT2 // Type of the right-hand side matrix
1784  , bool SO2 > // Storage order of the right-hand side matrix
1785 inline EnableIf_< IsComputation<MT2>, StrictlyUpperMatrix<MT,SO,true>& >
1786  StrictlyUpperMatrix<MT,SO,true>::operator=( const Matrix<MT2,SO2>& rhs )
1787 {
1788  if( IsUniTriangular<MT2>::value || ( !IsSquare<MT2>::value && !isSquare( ~rhs ) ) ) {
1789  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to strictly upper matrix" );
1790  }
1791 
1792  if( IsStrictlyUpper<MT2>::value ) {
1793  matrix_ = ~rhs;
1794  }
1795  else {
1796  MT tmp( ~rhs );
1797 
1798  if( !isStrictlyUpper( tmp ) ) {
1799  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to strictly upper matrix" );
1800  }
1801 
1802  matrix_ = std::move( tmp );
1803  }
1804 
1805  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly upper matrix detected" );
1806  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1807 
1808  return *this;
1809 }
1811 //*************************************************************************************************
1812 
1813 
1814 //*************************************************************************************************
1827 template< typename MT // Type of the adapted dense matrix
1828  , bool SO > // Storage order of the adapted dense matrix
1829 template< typename MT2 // Type of the right-hand side matrix
1830  , bool SO2 > // Storage order of the right-hand side matrix
1831 inline DisableIf_< IsComputation<MT2>, StrictlyUpperMatrix<MT,SO,true>& >
1832  StrictlyUpperMatrix<MT,SO,true>::operator+=( const Matrix<MT2,SO2>& rhs )
1833 {
1834  if( IsUniTriangular<MT2>::value ||
1835  ( !IsStrictlyUpper<MT2>::value && !isStrictlyUpper( ~rhs ) ) ) {
1836  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to strictly upper matrix" );
1837  }
1838 
1839  matrix_ += ~rhs;
1840 
1841  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly upper matrix detected" );
1842  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1843 
1844  return *this;
1845 }
1847 //*************************************************************************************************
1848 
1849 
1850 //*************************************************************************************************
1863 template< typename MT // Type of the adapted dense matrix
1864  , bool SO > // Storage order of the adapted dense matrix
1865 template< typename MT2 // Type of the right-hand side matrix
1866  , bool SO2 > // Storage order of the right-hand side matrix
1867 inline EnableIf_< IsComputation<MT2>, StrictlyUpperMatrix<MT,SO,true>& >
1868  StrictlyUpperMatrix<MT,SO,true>::operator+=( const Matrix<MT2,SO2>& rhs )
1869 {
1870  if( IsUniTriangular<MT2>::value || ( !IsSquare<MT2>::value && !isSquare( ~rhs ) ) ) {
1871  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to strictly upper matrix" );
1872  }
1873 
1874  if( IsStrictlyUpper<MT2>::value ) {
1875  matrix_ += ~rhs;
1876  }
1877  else {
1878  const ResultType_<MT2> tmp( ~rhs );
1879 
1880  if( !isStrictlyUpper( tmp ) ) {
1881  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to strictly upper matrix" );
1882  }
1883 
1884  matrix_ += tmp;
1885  }
1886 
1887  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly upper matrix detected" );
1888  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1889 
1890  return *this;
1891 }
1893 //*************************************************************************************************
1894 
1895 
1896 //*************************************************************************************************
1909 template< typename MT // Type of the adapted dense matrix
1910  , bool SO > // Storage order of the adapted dense matrix
1911 template< typename MT2 // Type of the right-hand side matrix
1912  , bool SO2 > // Storage order of the right-hand side matrix
1913 inline DisableIf_< IsComputation<MT2>, StrictlyUpperMatrix<MT,SO,true>& >
1914  StrictlyUpperMatrix<MT,SO,true>::operator-=( const Matrix<MT2,SO2>& rhs )
1915 {
1916  if( !IsStrictlyUpper<MT2>::value && !isStrictlyUpper( ~rhs ) ) {
1917  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to strictly upper matrix" );
1918  }
1919 
1920  matrix_ -= ~rhs;
1921 
1922  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly upper matrix detected" );
1923  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1924 
1925  return *this;
1926 }
1928 //*************************************************************************************************
1929 
1930 
1931 //*************************************************************************************************
1944 template< typename MT // Type of the adapted dense matrix
1945  , bool SO > // Storage order of the adapted dense matrix
1946 template< typename MT2 // Type of the right-hand side matrix
1947  , bool SO2 > // Storage order of the right-hand side matrix
1948 inline EnableIf_< IsComputation<MT2>, StrictlyUpperMatrix<MT,SO,true>& >
1949  StrictlyUpperMatrix<MT,SO,true>::operator-=( const Matrix<MT2,SO2>& rhs )
1950 {
1951  if( !IsSquare<MT2>::value && !isSquare( ~rhs ) ) {
1952  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to strictly upper matrix" );
1953  }
1954 
1955  if( IsStrictlyUpper<MT2>::value ) {
1956  matrix_ -= ~rhs;
1957  }
1958  else {
1959  const ResultType_<MT2> tmp( ~rhs );
1960 
1961  if( !isStrictlyUpper( tmp ) ) {
1962  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to strictly upper matrix" );
1963  }
1964 
1965  matrix_ -= tmp;
1966  }
1967 
1968  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly upper matrix detected" );
1969  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1970 
1971  return *this;
1972 }
1974 //*************************************************************************************************
1975 
1976 
1977 //*************************************************************************************************
1989 template< typename MT // Type of the adapted dense matrix
1990  , bool SO > // Storage order of the adapted dense matrix
1991 template< typename MT2 // Type of the right-hand side matrix
1992  , bool SO2 > // Storage order of the right-hand side matrix
1993 inline StrictlyUpperMatrix<MT,SO,true>&
1994  StrictlyUpperMatrix<MT,SO,true>::operator*=( const Matrix<MT2,SO2>& rhs )
1995 {
1996  if( matrix_.rows() != (~rhs).columns() ) {
1997  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to strictly upper matrix" );
1998  }
1999 
2000  MT tmp( matrix_ * ~rhs );
2001 
2002  if( !isStrictlyUpper( tmp ) ) {
2003  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to strictly upper matrix" );
2004  }
2005 
2006  matrix_ = std::move( tmp );
2007 
2008  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly upper matrix detected" );
2009  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
2010 
2011  return *this;
2012 }
2014 //*************************************************************************************************
2015 
2016 
2017 //*************************************************************************************************
2025 template< typename MT // Type of the adapted dense matrix
2026  , bool SO > // Storage order of the adapted dense matrix
2027 template< typename Other > // Data type of the right-hand side scalar
2028 inline EnableIf_< IsNumeric<Other>, StrictlyUpperMatrix<MT,SO,true> >&
2030 {
2031  matrix_ *= rhs;
2032  return *this;
2033 }
2034 //*************************************************************************************************
2035 
2036 
2037 //*************************************************************************************************
2045 template< typename MT // Type of the adapted dense matrix
2046  , bool SO > // Storage order of the adapted dense matrix
2047 template< typename Other > // Data type of the right-hand side scalar
2048 inline EnableIf_< IsNumeric<Other>, StrictlyUpperMatrix<MT,SO,true> >&
2050 {
2051  BLAZE_USER_ASSERT( rhs != Other(0), "Division by zero detected" );
2052 
2053  matrix_ /= rhs;
2054  return *this;
2055 }
2057 //*************************************************************************************************
2058 
2059 
2060 
2061 
2062 //=================================================================================================
2063 //
2064 // UTILITY FUNCTIONS
2065 //
2066 //=================================================================================================
2067 
2068 //*************************************************************************************************
2074 template< typename MT // Type of the adapted dense matrix
2075  , bool SO > // Storage order of the adapted dense matrix
2076 inline size_t StrictlyUpperMatrix<MT,SO,true>::rows() const noexcept
2077 {
2078  return matrix_.rows();
2079 }
2081 //*************************************************************************************************
2082 
2083 
2084 //*************************************************************************************************
2090 template< typename MT // Type of the adapted dense matrix
2091  , bool SO > // Storage order of the adapted dense matrix
2092 inline size_t StrictlyUpperMatrix<MT,SO,true>::columns() const noexcept
2093 {
2094  return matrix_.columns();
2095 }
2097 //*************************************************************************************************
2098 
2099 
2100 //*************************************************************************************************
2111 template< typename MT // Type of the adapted dense matrix
2112  , bool SO > // Storage order of the adapted dense matrix
2113 inline size_t StrictlyUpperMatrix<MT,SO,true>::spacing() const noexcept
2114 {
2115  return matrix_.spacing();
2116 }
2118 //*************************************************************************************************
2119 
2120 
2121 //*************************************************************************************************
2127 template< typename MT // Type of the adapted dense matrix
2128  , bool SO > // Storage order of the adapted dense matrix
2129 inline size_t StrictlyUpperMatrix<MT,SO,true>::capacity() const noexcept
2130 {
2131  return matrix_.capacity();
2132 }
2134 //*************************************************************************************************
2135 
2136 
2137 //*************************************************************************************************
2149 template< typename MT // Type of the adapted dense matrix
2150  , bool SO > // Storage order of the adapted dense matrix
2151 inline size_t StrictlyUpperMatrix<MT,SO,true>::capacity( size_t i ) const noexcept
2152 {
2153  return matrix_.capacity(i);
2154 }
2156 //*************************************************************************************************
2157 
2158 
2159 //*************************************************************************************************
2165 template< typename MT // Type of the adapted dense matrix
2166  , bool SO > // Storage order of the adapted dense matrix
2167 inline size_t StrictlyUpperMatrix<MT,SO,true>::nonZeros() const
2168 {
2169  return matrix_.nonZeros();
2170 }
2172 //*************************************************************************************************
2173 
2174 
2175 //*************************************************************************************************
2187 template< typename MT // Type of the adapted dense matrix
2188  , bool SO > // Storage order of the adapted dense matrix
2189 inline size_t StrictlyUpperMatrix<MT,SO,true>::nonZeros( size_t i ) const
2190 {
2191  return matrix_.nonZeros(i);
2192 }
2194 //*************************************************************************************************
2195 
2196 
2197 //*************************************************************************************************
2203 template< typename MT // Type of the adapted dense matrix
2204  , bool SO > // Storage order of the adapted dense matrix
2206 {
2207  using blaze::clear;
2208 
2209  if( SO ) {
2210  for( size_t j=1UL; j<columns(); ++j )
2211  for( size_t i=0UL; i<j; ++i )
2212  clear( matrix_(i,j) );
2213  }
2214  else {
2215  for( size_t i=0UL; i<rows(); ++i )
2216  for( size_t j=i+1UL; j<columns(); ++j )
2217  clear( matrix_(i,j) );
2218  }
2219 }
2221 //*************************************************************************************************
2222 
2223 
2224 //*************************************************************************************************
2237 template< typename MT // Type of the adapted dense matrix
2238  , bool SO > // Storage order of the adapted dense matrix
2239 inline void StrictlyUpperMatrix<MT,SO,true>::reset( size_t i )
2240 {
2241  using blaze::clear;
2242 
2243  if( SO ) {
2244  for( size_t j=0UL; j<i; ++j )
2245  clear( matrix_(j,i) );
2246  }
2247  else {
2248  for( size_t j=i+1UL; j<columns(); ++j )
2249  clear( matrix_(i,j) );
2250  }
2251 }
2253 //*************************************************************************************************
2254 
2255 
2256 //*************************************************************************************************
2268 template< typename MT // Type of the adapted dense matrix
2269  , bool SO > // Storage order of the adapted dense matrix
2271 {
2272  using blaze::clear;
2273 
2274  if( IsResizable<MT>::value ) {
2275  clear( matrix_ );
2276  }
2277  else {
2278  reset();
2279  }
2280 }
2282 //*************************************************************************************************
2283 
2284 
2285 //*************************************************************************************************
2321 template< typename MT // Type of the adapted dense matrix
2322  , bool SO > // Storage order of the adapted dense matrix
2323 void StrictlyUpperMatrix<MT,SO,true>::resize( size_t n, bool preserve )
2324 {
2326 
2327  UNUSED_PARAMETER( preserve );
2328 
2329  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly upper matrix detected" );
2330 
2331  const size_t oldsize( matrix_.rows() );
2332 
2333  matrix_.resize( n, n, true );
2334 
2335  if( n > oldsize )
2336  {
2337  const size_t increment( n - oldsize );
2338  submatrix( matrix_, oldsize, 0UL, increment, n ).reset();
2339  }
2340 }
2342 //*************************************************************************************************
2343 
2344 
2345 //*************************************************************************************************
2358 template< typename MT // Type of the adapted dense matrix
2359  , bool SO > // Storage order of the adapted dense matrix
2360 inline void StrictlyUpperMatrix<MT,SO,true>::extend( size_t n, bool preserve )
2361 {
2363 
2364  UNUSED_PARAMETER( preserve );
2365 
2366  resize( rows() + n, true );
2367 }
2368 //*************************************************************************************************
2369 
2370 
2371 //*************************************************************************************************
2381 template< typename MT // Type of the adapted dense matrix
2382  , bool SO > // Storage order of the adapted dense matrix
2383 inline void StrictlyUpperMatrix<MT,SO,true>::reserve( size_t elements )
2384 {
2385  matrix_.reserve( elements );
2386 }
2388 //*************************************************************************************************
2389 
2390 
2391 //*************************************************************************************************
2398 template< typename MT // Type of the adapted dense matrix
2399  , bool SO > // Storage order of the adapted dense matrix
2400 inline void StrictlyUpperMatrix<MT,SO,true>::swap( StrictlyUpperMatrix& m ) noexcept
2401 {
2402  using std::swap;
2403 
2404  swap( matrix_, m.matrix_ );
2405 }
2407 //*************************************************************************************************
2408 
2409 
2410 //*************************************************************************************************
2422 template< typename MT // Type of the adapted dense matrix
2423  , bool SO > // Storage order of the adapted dense matrix
2424 inline constexpr size_t StrictlyUpperMatrix<MT,SO,true>::maxNonZeros() noexcept
2425 {
2427 
2428  return maxNonZeros( Rows<MT>::value );
2429 }
2431 //*************************************************************************************************
2432 
2433 
2434 //*************************************************************************************************
2444 template< typename MT // Type of the adapted dense matrix
2445  , bool SO > // Storage order of the adapted dense matrix
2446 inline constexpr size_t StrictlyUpperMatrix<MT,SO,true>::maxNonZeros( size_t n ) noexcept
2447 {
2448  return ( ( n - 1UL ) * n ) / 2UL;
2449 }
2451 //*************************************************************************************************
2452 
2453 
2454 
2455 
2456 //=================================================================================================
2457 //
2458 // NUMERIC FUNCTIONS
2459 //
2460 //=================================================================================================
2461 
2462 //*************************************************************************************************
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 scalar value
2472 inline StrictlyUpperMatrix<MT,SO,true>&
2473  StrictlyUpperMatrix<MT,SO,true>::scale( const Other& scalar )
2474 {
2475  matrix_.scale( scalar );
2476  return *this;
2477 }
2479 //*************************************************************************************************
2480 
2481 
2482 
2483 
2484 //=================================================================================================
2485 //
2486 // DEBUGGING FUNCTIONS
2487 //
2488 //=================================================================================================
2489 
2490 //*************************************************************************************************
2500 template< typename MT // Type of the adapted dense matrix
2501  , bool SO > // Storage order of the adapted dense matrix
2502 inline bool StrictlyUpperMatrix<MT,SO,true>::isIntact() const noexcept
2503 {
2504  using blaze::isIntact;
2505 
2506  return ( isIntact( matrix_ ) && isStrictlyUpper( matrix_ ) );
2507 }
2509 //*************************************************************************************************
2510 
2511 
2512 
2513 
2514 //=================================================================================================
2515 //
2516 // EXPRESSION TEMPLATE EVALUATION FUNCTIONS
2517 //
2518 //=================================================================================================
2519 
2520 //*************************************************************************************************
2531 template< typename MT // Type of the adapted dense matrix
2532  , bool SO > // Storage order of the adapted dense matrix
2533 template< typename Other > // Data type of the foreign expression
2534 inline bool StrictlyUpperMatrix<MT,SO,true>::canAlias( const Other* alias ) const noexcept
2535 {
2536  return matrix_.canAlias( alias );
2537 }
2539 //*************************************************************************************************
2540 
2541 
2542 //*************************************************************************************************
2553 template< typename MT // Type of the adapted dense matrix
2554  , bool SO > // Storage order of the adapted dense matrix
2555 template< typename Other > // Data type of the foreign expression
2556 inline bool StrictlyUpperMatrix<MT,SO,true>::isAliased( const Other* alias ) const noexcept
2557 {
2558  return matrix_.isAliased( alias );
2559 }
2561 //*************************************************************************************************
2562 
2563 
2564 //*************************************************************************************************
2574 template< typename MT // Type of the adapted dense matrix
2575  , bool SO > // Storage order of the adapted dense matrix
2576 inline bool StrictlyUpperMatrix<MT,SO,true>::isAligned() const noexcept
2577 {
2578  return matrix_.isAligned();
2579 }
2581 //*************************************************************************************************
2582 
2583 
2584 //*************************************************************************************************
2595 template< typename MT // Type of the adapted dense matrix
2596  , bool SO > // Storage order of the adapted dense matrix
2597 inline bool StrictlyUpperMatrix<MT,SO,true>::canSMPAssign() const noexcept
2598 {
2599  return matrix_.canSMPAssign();
2600 }
2602 //*************************************************************************************************
2603 
2604 
2605 //*************************************************************************************************
2621 template< typename MT // Type of the adapted dense matrix
2622  , bool SO > // Storage order of the adapted dense matrix
2623 BLAZE_ALWAYS_INLINE typename StrictlyUpperMatrix<MT,SO,true>::SIMDType
2624  StrictlyUpperMatrix<MT,SO,true>::load( size_t i, size_t j ) const noexcept
2625 {
2626  return matrix_.load( i, j );
2627 }
2629 //*************************************************************************************************
2630 
2631 
2632 //*************************************************************************************************
2648 template< typename MT // Type of the adapted dense matrix
2649  , bool SO > // Storage order of the adapted dense matrix
2650 BLAZE_ALWAYS_INLINE typename StrictlyUpperMatrix<MT,SO,true>::SIMDType
2651  StrictlyUpperMatrix<MT,SO,true>::loada( size_t i, size_t j ) const noexcept
2652 {
2653  return matrix_.loada( i, j );
2654 }
2656 //*************************************************************************************************
2657 
2658 
2659 //*************************************************************************************************
2675 template< typename MT // Type of the adapted dense matrix
2676  , bool SO > // Storage order of the adapted dense matrix
2677 BLAZE_ALWAYS_INLINE typename StrictlyUpperMatrix<MT,SO,true>::SIMDType
2678  StrictlyUpperMatrix<MT,SO,true>::loadu( size_t i, size_t j ) const noexcept
2679 {
2680  return matrix_.loadu( i, j );
2681 }
2683 //*************************************************************************************************
2684 
2685 
2686 
2687 
2688 //=================================================================================================
2689 //
2690 // CONSTRUCTION FUNCTIONS
2691 //
2692 //=================================================================================================
2693 
2694 //*************************************************************************************************
2701 template< typename MT // Type of the adapted dense matrix
2702  , bool SO > // Storage order of the adapted dense matrix
2703 inline const MT StrictlyUpperMatrix<MT,SO,true>::construct( size_t n, TrueType )
2704 {
2706 
2707  return MT( n, n, ElementType() );
2708 }
2710 //*************************************************************************************************
2711 
2712 
2713 //*************************************************************************************************
2720 template< typename MT // Type of the adapted dense matrix
2721  , bool SO > // Storage order of the adapted dense matrix
2722 inline const MT StrictlyUpperMatrix<MT,SO,true>::construct( const ElementType& init, FalseType )
2723 {
2726 
2727  MT tmp;
2728 
2729  if( SO ) {
2730  for( size_t j=0UL; j<columns(); ++j ) {
2731  for( size_t i=0UL; i<j; ++i )
2732  tmp(i,j) = init;
2733  }
2734  }
2735  else {
2736  for( size_t i=0UL; i<rows(); ++i ) {
2737  for( size_t j=i+1UL; j<columns(); ++j )
2738  tmp(i,j) = init;
2739  }
2740  }
2741 
2742  return tmp;
2743 }
2745 //*************************************************************************************************
2746 
2747 
2748 //*************************************************************************************************
2759 template< typename MT // Type of the adapted dense matrix
2760  , bool SO > // Storage order of the adapted dense matrix
2761 template< typename MT2 // Type of the foreign matrix
2762  , bool SO2 // Storage order of the foreign matrix
2763  , typename T > // Type of the third argument
2764 inline const MT StrictlyUpperMatrix<MT,SO,true>::construct( const Matrix<MT2,SO2>& m, T )
2765 {
2766  const MT tmp( ~m );
2767 
2768  if( IsUniTriangular<MT2>::value ||
2769  ( !IsStrictlyUpper<MT2>::value && !isStrictlyUpper( tmp ) ) ) {
2770  BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of strictly upper matrix" );
2771  }
2772 
2773  return tmp;
2774 }
2776 //*************************************************************************************************
2777 
2778 } // namespace blaze
2779 
2780 #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
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:102
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.
BLAZE_ALWAYS_INLINE size_t capacity(const Matrix< MT, SO > &matrix) noexcept
Returns the maximum capacity of the matrix.
Definition: Matrix.h:352
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
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:194
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:2935
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:5556
CompressedMatrix< Type, true > This
Type of this CompressedMatrix instance.
Definition: CompressedMatrix.h:2928
#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:390
#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.
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:2931
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:304
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:238
Constraint on the data type.
Constraint on the data type.
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:5635
Compile time assertion.
bool isIntact(const CompressedMatrix< Type, SO > &m)
Returns whether the invariants of the given compressed matrix are intact.
Definition: CompressedMatrix.h:5618
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2939
#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.
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
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.
BLAZE_ALWAYS_INLINE size_t columns(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of columns of the matrix.
Definition: Matrix.h:336
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
DisableIf_< Or< IsComputation< MT >, IsTransExpr< MT >, IsDeclExpr< 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:128
Header file for the IsUniTriangular type trait.
CompressedMatrix< Type, false > TransposeType
Transpose type for expression template evaluations.
Definition: CompressedMatrix.h:2932
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:544
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:260
Type ElementType
Type of the compressed matrix elements.
Definition: CompressedMatrix.h:2933
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
const Type & ConstReference
Reference to a constant matrix value.
Definition: CompressedMatrix.h:2937
DisableIf_< Or< IsComputation< MT >, IsTransExpr< MT >, IsDeclExpr< 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:128
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.
#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:1493
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:2934
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:2938
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:267
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
#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 &#39;resize&#39; 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:320
SparseMatrix< This, true > BaseType
Base type of this CompressedMatrix instance.
Definition: CompressedMatrix.h:2929
#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 &#39;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
This ResultType
Result type for expression template evaluations.
Definition: CompressedMatrix.h:2930
bool isIntact(const DiagonalMatrix< MT, SO, DF > &m)
Returns whether the invariants of the given diagonal matrix are intact.
Definition: DiagonalMatrix.h:249
MatrixAccessProxy< This > Reference
Reference to a non-constant matrix value.
Definition: CompressedMatrix.h:2936
#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:168
BLAZE_ALWAYS_INLINE bool isSquare(const Matrix< MT, SO > &matrix) noexcept
Checks if the given matrix is a square matrix.
Definition: Matrix.h:677
Header file for the IsResizable type trait.
const DMatDMatMultExpr< T1, T2, false, false, false, false > 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:7505
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.