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>
61 #include <blaze/math/Exception.h>
64 #include <blaze/math/shims/Clear.h>
74 #include <blaze/system/Inline.h>
75 #include <blaze/util/Assert.h>
81 #include <blaze/util/DisableIf.h>
82 #include <blaze/util/EnableIf.h>
83 #include <blaze/util/FalseType.h>
85 #include <blaze/util/TrueType.h>
86 #include <blaze/util/Types.h>
87 #include <blaze/util/Unused.h>
88 
89 
90 namespace blaze {
91 
92 //=================================================================================================
93 //
94 // CLASS TEMPLATE SPECIALIZATION FOR DENSE MATRICES
95 //
96 //=================================================================================================
97 
98 //*************************************************************************************************
106 template< typename MT // Type of the adapted dense matrix
107  , bool SO > // Storage order of the adapted dense matrix
108 class StrictlyUpperMatrix<MT,SO,true>
109  : public DenseMatrix< StrictlyUpperMatrix<MT,SO,true>, SO >
110 {
111  private:
112  //**Type definitions****************************************************************************
113  using OT = OppositeType_<MT>;
114  using TT = TransposeType_<MT>;
115  using ET = ElementType_<MT>;
116  //**********************************************************************************************
117 
118  public:
119  //**Type definitions****************************************************************************
120  using This = StrictlyUpperMatrix<MT,SO,true>;
121  using BaseType = DenseMatrix<This,SO>;
122  using ResultType = This;
123  using OppositeType = StrictlyUpperMatrix<OT,!SO,true>;
124  using TransposeType = StrictlyLowerMatrix<TT,!SO,true>;
125  using ElementType = ET;
126  using SIMDType = SIMDType_<MT>;
127  using ReturnType = ReturnType_<MT>;
128  using CompositeType = const This&;
129  using Reference = StrictlyUpperProxy<MT>;
130  using ConstReference = ConstReference_<MT>;
131  using Pointer = Pointer_<MT>;
132  using ConstPointer = ConstPointer_<MT>;
133  using ConstIterator = ConstIterator_<MT>;
134  //**********************************************************************************************
135 
136  //**Rebind struct definition********************************************************************
139  template< typename NewType > // Data type of the other matrix
140  struct Rebind {
142  using Other = StrictlyUpperMatrix< typename MT::template Rebind<NewType>::Other >;
143  };
144  //**********************************************************************************************
145 
146  //**Resize struct definition********************************************************************
149  template< size_t NewM // Number of rows of the other matrix
150  , size_t NewN > // Number of columns of the other matrix
151  struct Resize {
153  using Other = StrictlyUpperMatrix< typename MT::template Resize<NewM,NewN>::Other >;
154  };
155  //**********************************************************************************************
156 
157  //**Iterator class definition*******************************************************************
160  class Iterator
161  {
162  public:
163  //**Type definitions*************************************************************************
164  using IteratorCategory = std::random_access_iterator_tag;
165  using ValueType = ElementType_<MT>;
166  using PointerType = StrictlyUpperProxy<MT>;
167  using ReferenceType = StrictlyUpperProxy<MT>;
168  using DifferenceType = ptrdiff_t;
169 
170  // STL iterator requirements
171  using iterator_category = IteratorCategory;
172  using value_type = ValueType;
173  using pointer = PointerType;
174  using reference = ReferenceType;
175  using difference_type = DifferenceType;
176  //*******************************************************************************************
177 
178  //**Constructor******************************************************************************
181  inline Iterator() noexcept
182  : matrix_( nullptr ) // Reference to the adapted dense matrix
183  , row_ ( 0UL ) // The current row index of the iterator
184  , column_( 0UL ) // The current column index of the iterator
185  {}
186  //*******************************************************************************************
187 
188  //**Constructor******************************************************************************
195  inline Iterator( MT& matrix, size_t row, size_t column ) noexcept
196  : matrix_( &matrix ) // Reference to the adapted dense matrix
197  , row_ ( row ) // The current row-index of the iterator
198  , column_( column ) // The current column-index of the iterator
199  {}
200  //*******************************************************************************************
201 
202  //**Addition assignment operator*************************************************************
208  inline Iterator& operator+=( size_t inc ) noexcept {
209  ( SO )?( row_ += inc ):( column_ += inc );
210  return *this;
211  }
212  //*******************************************************************************************
213 
214  //**Subtraction assignment operator**********************************************************
220  inline Iterator& operator-=( size_t dec ) noexcept {
221  ( SO )?( row_ -= dec ):( column_ -= dec );
222  return *this;
223  }
224  //*******************************************************************************************
225 
226  //**Prefix increment operator****************************************************************
231  inline Iterator& operator++() noexcept {
232  ( SO )?( ++row_ ):( ++column_ );
233  return *this;
234  }
235  //*******************************************************************************************
236 
237  //**Postfix increment operator***************************************************************
242  inline const Iterator operator++( int ) noexcept {
243  const Iterator tmp( *this );
244  ++(*this);
245  return tmp;
246  }
247  //*******************************************************************************************
248 
249  //**Prefix decrement operator****************************************************************
254  inline Iterator& operator--() noexcept {
255  ( SO )?( --row_ ):( --column_ );
256  return *this;
257  }
258  //*******************************************************************************************
259 
260  //**Postfix decrement operator***************************************************************
265  inline const Iterator operator--( int ) noexcept {
266  const Iterator tmp( *this );
267  --(*this);
268  return tmp;
269  }
270  //*******************************************************************************************
271 
272  //**Element access operator******************************************************************
277  inline ReferenceType operator*() const {
278  return ReferenceType( *matrix_, row_, column_ );
279  }
280  //*******************************************************************************************
281 
282  //**Element access operator******************************************************************
287  inline PointerType operator->() const {
288  return PointerType( *matrix_, row_, column_ );
289  }
290  //*******************************************************************************************
291 
292  //**Load function****************************************************************************
302  inline SIMDType load() const {
303  return (*matrix_).load(row_,column_);
304  }
305  //*******************************************************************************************
306 
307  //**Loada function***************************************************************************
317  inline SIMDType loada() const {
318  return (*matrix_).loada(row_,column_);
319  }
320  //*******************************************************************************************
321 
322  //**Loadu function***************************************************************************
332  inline SIMDType loadu() const {
333  return (*matrix_).loadu(row_,column_);
334  }
335  //*******************************************************************************************
336 
337  //**Conversion operator**********************************************************************
342  inline operator ConstIterator() const {
343  if( SO )
344  return matrix_->begin( column_ ) + row_;
345  else
346  return matrix_->begin( row_ ) + column_;
347  }
348  //*******************************************************************************************
349 
350  //**Equality operator************************************************************************
357  friend inline bool operator==( const Iterator& lhs, const Iterator& rhs ) noexcept {
358  return ( SO )?( lhs.row_ == rhs.row_ ):( lhs.column_ == rhs.column_ );
359  }
360  //*******************************************************************************************
361 
362  //**Equality operator************************************************************************
369  friend inline bool operator==( const Iterator& lhs, const ConstIterator& rhs ) {
370  return ( ConstIterator( lhs ) == rhs );
371  }
372  //*******************************************************************************************
373 
374  //**Equality operator************************************************************************
381  friend inline bool operator==( const ConstIterator& lhs, const Iterator& rhs ) {
382  return ( lhs == ConstIterator( rhs ) );
383  }
384  //*******************************************************************************************
385 
386  //**Inequality operator**********************************************************************
393  friend inline bool operator!=( const Iterator& lhs, const Iterator& rhs ) noexcept {
394  return ( SO )?( lhs.row_ != rhs.row_ ):( lhs.column_ != rhs.column_ );
395  }
396  //*******************************************************************************************
397 
398  //**Inequality operator**********************************************************************
405  friend inline bool operator!=( const Iterator& lhs, const ConstIterator& rhs ) {
406  return ( ConstIterator( lhs ) != rhs );
407  }
408  //*******************************************************************************************
409 
410  //**Inequality operator**********************************************************************
417  friend inline bool operator!=( const ConstIterator& lhs, const Iterator& rhs ) {
418  return ( lhs != ConstIterator( rhs ) );
419  }
420  //*******************************************************************************************
421 
422  //**Less-than operator***********************************************************************
429  friend inline bool operator<( const Iterator& lhs, const Iterator& rhs ) noexcept {
430  return ( SO )?( lhs.row_ < rhs.row_ ):( lhs.column_ < rhs.column_ );
431  }
432  //*******************************************************************************************
433 
434  //**Less-than operator***********************************************************************
441  friend inline bool operator<( const Iterator& lhs, const ConstIterator& rhs ) {
442  return ( ConstIterator( lhs ) < rhs );
443  }
444  //*******************************************************************************************
445 
446  //**Less-than operator***********************************************************************
453  friend inline bool operator<( const ConstIterator& lhs, const Iterator& rhs ) {
454  return ( lhs < ConstIterator( rhs ) );
455  }
456  //*******************************************************************************************
457 
458  //**Greater-than operator********************************************************************
465  friend inline bool operator>( const Iterator& lhs, const Iterator& rhs ) noexcept {
466  return ( SO )?( lhs.row_ > rhs.row_ ):( lhs.column_ > rhs.column_ );
467  }
468  //*******************************************************************************************
469 
470  //**Greater-than operator********************************************************************
477  friend inline bool operator>( const Iterator& lhs, const ConstIterator& rhs ) {
478  return ( ConstIterator( lhs ) > rhs );
479  }
480  //*******************************************************************************************
481 
482  //**Greater-than operator********************************************************************
489  friend inline bool operator>( const ConstIterator& lhs, const Iterator& rhs ) {
490  return ( lhs > ConstIterator( rhs ) );
491  }
492  //*******************************************************************************************
493 
494  //**Less-or-equal-than operator**************************************************************
501  friend inline bool operator<=( const Iterator& lhs, const Iterator& rhs ) noexcept {
502  return ( SO )?( lhs.row_ <= rhs.row_ ):( lhs.column_ <= rhs.column_ );
503  }
504  //*******************************************************************************************
505 
506  //**Less-or-equal-than operator**************************************************************
513  friend inline bool operator<=( const Iterator& lhs, const ConstIterator& rhs ) {
514  return ( ConstIterator( lhs ) <= rhs );
515  }
516  //*******************************************************************************************
517 
518  //**Less-or-equal-than operator**************************************************************
525  friend inline bool operator<=( const ConstIterator& lhs, const Iterator& rhs ) {
526  return ( lhs <= ConstIterator( rhs ) );
527  }
528  //*******************************************************************************************
529 
530  //**Greater-or-equal-than operator***********************************************************
537  friend inline bool operator>=( const Iterator& lhs, const Iterator& rhs ) noexcept {
538  return ( SO )?( lhs.row_ >= rhs.row_ ):( lhs.column_ >= rhs.column_ );
539  }
540  //*******************************************************************************************
541 
542  //**Greater-or-equal-than operator***********************************************************
549  friend inline bool operator>=( const Iterator& lhs, const ConstIterator& rhs ) {
550  return ( ConstIterator( lhs ) >= rhs );
551  }
552  //*******************************************************************************************
553 
554  //**Greater-or-equal-than operator***********************************************************
561  friend inline bool operator>=( const ConstIterator& lhs, const Iterator& rhs ) {
562  return ( lhs >= ConstIterator( rhs ) );
563  }
564  //*******************************************************************************************
565 
566  //**Subtraction operator*********************************************************************
572  inline DifferenceType operator-( const Iterator& rhs ) const noexcept {
573  return ( SO )?( row_ - rhs.row_ ):( column_ - rhs.column_ );
574  }
575  //*******************************************************************************************
576 
577  //**Addition operator************************************************************************
584  friend inline const Iterator operator+( const Iterator& it, size_t inc ) noexcept {
585  if( SO )
586  return Iterator( *it.matrix_, it.row_ + inc, it.column_ );
587  else
588  return Iterator( *it.matrix_, it.row_, it.column_ + inc );
589  }
590  //*******************************************************************************************
591 
592  //**Addition operator************************************************************************
599  friend inline const Iterator operator+( size_t inc, const Iterator& it ) noexcept {
600  if( SO )
601  return Iterator( *it.matrix_, it.row_ + inc, it.column_ );
602  else
603  return Iterator( *it.matrix_, it.row_, it.column_ + inc );
604  }
605  //*******************************************************************************************
606 
607  //**Subtraction operator*********************************************************************
614  friend inline const Iterator operator-( const Iterator& it, size_t dec ) noexcept {
615  if( SO )
616  return Iterator( *it.matrix_, it.row_ - dec, it.column_ );
617  else
618  return Iterator( *it.matrix_, it.row_, it.column_ - dec );
619  }
620  //*******************************************************************************************
621 
622  private:
623  //**Member variables*************************************************************************
624  MT* matrix_;
625  size_t row_;
626  size_t column_;
627  //*******************************************************************************************
628  };
629  //**********************************************************************************************
630 
631  //**Compilation flags***************************************************************************
633  enum : bool { simdEnabled = MT::simdEnabled };
634 
636  enum : bool { smpAssignable = MT::smpAssignable };
637  //**********************************************************************************************
638 
639  //**Constructors********************************************************************************
642  explicit inline StrictlyUpperMatrix();
643  template< typename A1 > explicit inline StrictlyUpperMatrix( const A1& a1 );
644  explicit inline StrictlyUpperMatrix( size_t n, const ElementType& init );
645 
646  explicit inline StrictlyUpperMatrix( initializer_list< initializer_list<ElementType> > list );
647 
648  template< typename Other >
649  explicit inline StrictlyUpperMatrix( size_t n, const Other* array );
650 
651  template< typename Other, size_t N >
652  explicit inline StrictlyUpperMatrix( const Other (&array)[N][N] );
653 
654  explicit inline StrictlyUpperMatrix( ElementType* ptr, size_t n );
655  explicit inline StrictlyUpperMatrix( ElementType* ptr, size_t n, size_t nn );
656 
657  inline StrictlyUpperMatrix( const StrictlyUpperMatrix& m );
658  inline StrictlyUpperMatrix( StrictlyUpperMatrix&& m ) noexcept;
660  //**********************************************************************************************
661 
662  //**Destructor**********************************************************************************
663  // No explicitly declared destructor.
664  //**********************************************************************************************
665 
666  //**Data access functions***********************************************************************
669  inline Reference operator()( size_t i, size_t j );
670  inline ConstReference operator()( size_t i, size_t j ) const;
671  inline Reference at( size_t i, size_t j );
672  inline ConstReference at( size_t i, size_t j ) const;
673  inline ConstPointer data () const noexcept;
674  inline ConstPointer data ( size_t i ) const noexcept;
675  inline Iterator begin ( size_t i );
676  inline ConstIterator begin ( size_t i ) const;
677  inline ConstIterator cbegin( size_t i ) const;
678  inline Iterator end ( size_t i );
679  inline ConstIterator end ( size_t i ) const;
680  inline ConstIterator cend ( size_t i ) const;
682  //**********************************************************************************************
683 
684  //**Assignment operators************************************************************************
687  inline StrictlyUpperMatrix& operator=( initializer_list< initializer_list<ElementType> > list );
688 
689  template< typename Other, size_t N >
690  inline StrictlyUpperMatrix& operator=( const Other (&array)[N][N] );
691 
692  inline StrictlyUpperMatrix& operator=( const ElementType& rhs );
693  inline StrictlyUpperMatrix& operator=( const StrictlyUpperMatrix& rhs );
694  inline StrictlyUpperMatrix& operator=( StrictlyUpperMatrix&& rhs ) noexcept;
695 
696  template< typename MT2, bool SO2 >
697  inline DisableIf_< IsComputation<MT2>, StrictlyUpperMatrix& >
698  operator=( const Matrix<MT2,SO2>& rhs );
699 
700  template< typename MT2, bool SO2 >
701  inline EnableIf_< IsComputation<MT2>, StrictlyUpperMatrix& >
702  operator=( const Matrix<MT2,SO2>& rhs );
703 
704  template< typename MT2, bool SO2 >
705  inline DisableIf_< IsComputation<MT2>, StrictlyUpperMatrix& >
706  operator+=( const Matrix<MT2,SO2>& rhs );
707 
708  template< typename MT2, bool SO2 >
709  inline EnableIf_< IsComputation<MT2>, StrictlyUpperMatrix& >
710  operator+=( const Matrix<MT2,SO2>& rhs );
711 
712  template< typename MT2, bool SO2 >
713  inline DisableIf_< IsComputation<MT2>, StrictlyUpperMatrix& >
714  operator-=( const Matrix<MT2,SO2>& rhs );
715 
716  template< typename MT2, bool SO2 >
717  inline EnableIf_< IsComputation<MT2>, StrictlyUpperMatrix& >
718  operator-=( const Matrix<MT2,SO2>& rhs );
719 
720  template< typename MT2, bool SO2 >
721  inline StrictlyUpperMatrix& operator%=( const Matrix<MT2,SO2>& rhs );
722 
723  template< typename ST >
724  inline EnableIf_< IsNumeric<ST>, StrictlyUpperMatrix >& operator*=( ST rhs );
725 
726  template< typename ST >
727  inline EnableIf_< IsNumeric<ST>, StrictlyUpperMatrix >& operator/=( ST rhs );
729  //**********************************************************************************************
730 
731  //**Utility functions***************************************************************************
734  inline size_t rows() const noexcept;
735  inline size_t columns() const noexcept;
736  inline size_t spacing() const noexcept;
737  inline size_t capacity() const noexcept;
738  inline size_t capacity( size_t i ) const noexcept;
739  inline size_t nonZeros() const;
740  inline size_t nonZeros( size_t i ) const;
741  inline void reset();
742  inline void reset( size_t i );
743  inline void clear();
744  void resize ( size_t n, bool preserve=true );
745  inline void extend ( size_t n, bool preserve=true );
746  inline void reserve( size_t elements );
747  inline void shrinkToFit();
748  inline void swap( StrictlyUpperMatrix& m ) noexcept;
749 
750  static inline constexpr size_t maxNonZeros() noexcept;
751  static inline constexpr size_t maxNonZeros( size_t n ) noexcept;
753  //**********************************************************************************************
754 
755  //**Numeric functions***************************************************************************
758  template< typename Other > inline StrictlyUpperMatrix& scale( const Other& scalar );
760  //**********************************************************************************************
761 
762  //**Debugging functions*************************************************************************
765  inline bool isIntact() const noexcept;
767  //**********************************************************************************************
768 
769  //**Expression template evaluation functions****************************************************
772  template< typename Other > inline bool canAlias ( const Other* alias ) const noexcept;
773  template< typename Other > inline bool isAliased( const Other* alias ) const noexcept;
774 
775  inline bool isAligned () const noexcept;
776  inline bool canSMPAssign() const noexcept;
777 
778  BLAZE_ALWAYS_INLINE SIMDType load ( size_t i, size_t j ) const noexcept;
779  BLAZE_ALWAYS_INLINE SIMDType loada( size_t i, size_t j ) const noexcept;
780  BLAZE_ALWAYS_INLINE SIMDType loadu( size_t i, size_t j ) const noexcept;
782  //**********************************************************************************************
783 
784  private:
785  //**Construction functions**********************************************************************
788  inline const MT construct( size_t n , TrueType );
789  inline const MT construct( const ElementType& value, FalseType );
790 
791  template< typename MT2, bool SO2, typename T >
792  inline const MT construct( const Matrix<MT2,SO2>& m, T );
794  //**********************************************************************************************
795 
796  //**Member variables****************************************************************************
799  MT matrix_;
800 
801  //**********************************************************************************************
802 
803  //**Friend declarations*************************************************************************
804  template< typename MT2, bool SO2, bool DF2 >
805  friend MT2& derestrict( StrictlyUpperMatrix<MT2,SO2,DF2>& m );
806  //**********************************************************************************************
807 
808  //**Compile time checks*************************************************************************
821  BLAZE_STATIC_ASSERT( ( Size<MT,0UL>::value == Size<MT,1UL>::value ) );
822  //**********************************************************************************************
823 };
825 //*************************************************************************************************
826 
827 
828 
829 
830 //=================================================================================================
831 //
832 // CONSTRUCTORS
833 //
834 //=================================================================================================
835 
836 //*************************************************************************************************
840 template< typename MT // Type of the adapted dense matrix
841  , bool SO > // Storage order of the adapted dense matrix
842 inline StrictlyUpperMatrix<MT,SO,true>::StrictlyUpperMatrix()
843  : matrix_() // The adapted dense matrix
844 {
845  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly upper matrix detected" );
846  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
847 }
849 //*************************************************************************************************
850 
851 
852 //*************************************************************************************************
870 template< typename MT // Type of the adapted dense matrix
871  , bool SO > // Storage order of the adapted dense matrix
872 template< typename A1 > // Type of the constructor argument
873 inline StrictlyUpperMatrix<MT,SO,true>::StrictlyUpperMatrix( const A1& a1 )
874  : matrix_( construct( a1, typename IsResizable<MT>::Type() ) ) // The adapted dense matrix
875 {
876  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly upper matrix detected" );
877  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
878 }
880 //*************************************************************************************************
881 
882 
883 //*************************************************************************************************
890 template< typename MT // Type of the adapted dense matrix
891  , bool SO > // Storage order of the adapted dense matrix
892 inline StrictlyUpperMatrix<MT,SO,true>::StrictlyUpperMatrix( size_t n, const ElementType& init )
893  : matrix_( n, n, ElementType() ) // The adapted dense matrix
894 {
896 
897  if( SO ) {
898  for( size_t j=0UL; j<columns(); ++j ) {
899  for( size_t i=0UL; i<j; ++i )
900  matrix_(i,j) = init;
901  }
902  }
903  else {
904  for( size_t i=0UL; i<rows(); ++i ) {
905  for( size_t j=i+1UL; j<columns(); ++j )
906  matrix_(i,j) = init;
907  }
908  }
909 
910  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly upper matrix detected" );
911  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
912 }
914 //*************************************************************************************************
915 
916 
917 //*************************************************************************************************
941 template< typename MT // Type of the adapted dense matrix
942  , bool SO > // Storage order of the adapted dense matrix
943 inline StrictlyUpperMatrix<MT,SO,true>::StrictlyUpperMatrix( initializer_list< initializer_list<ElementType> > list )
944  : matrix_( list ) // The adapted dense matrix
945 {
946  if( !isStrictlyUpper( matrix_ ) ) {
947  BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of strictly upper matrix" );
948  }
949 
950  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
951 }
953 //*************************************************************************************************
954 
955 
956 //*************************************************************************************************
983 template< typename MT // Type of the adapted dense matrix
984  , bool SO > // Storage order of the adapted dense matrix
985 template< typename Other > // Data type of the initialization array
986 inline StrictlyUpperMatrix<MT,SO,true>::StrictlyUpperMatrix( size_t n, const Other* array )
987  : matrix_( n, n, array ) // The adapted dense matrix
988 {
989  if( !isStrictlyUpper( matrix_ ) ) {
990  BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of strictly upper matrix" );
991  }
992 
993  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
994 }
996 //*************************************************************************************************
997 
998 
999 //*************************************************************************************************
1022 template< typename MT // Type of the adapted dense matrix
1023  , bool SO > // Storage order of the adapted dense matrix
1024 template< typename Other // Data type of the initialization array
1025  , size_t N > // Number of columns of the initialization array
1026 inline StrictlyUpperMatrix<MT,SO,true>::StrictlyUpperMatrix( const Other (&array)[N][N] )
1027  : matrix_( array ) // The adapted dense matrix
1028 {
1029  if( !isStrictlyUpper( matrix_ ) ) {
1030  BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of strictly upper matrix" );
1031  }
1032 
1033  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1034 }
1036 //*************************************************************************************************
1037 
1038 
1039 //*************************************************************************************************
1072 template< typename MT // Type of the adapted dense matrix
1073  , bool SO > // Storage order of the adapted dense matrix
1074 inline StrictlyUpperMatrix<MT,SO,true>::StrictlyUpperMatrix( ElementType* ptr, size_t n )
1075  : matrix_( ptr, n, n ) // The adapted dense matrix
1076 {
1077  if( !isStrictlyUpper( matrix_ ) ) {
1078  BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of strictly upper matrix" );
1079  }
1080 
1081  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1082 }
1084 //*************************************************************************************************
1085 
1086 
1087 //*************************************************************************************************
1121 template< typename MT // Type of the adapted dense matrix
1122  , bool SO > // Storage order of the adapted dense matrix
1123 inline StrictlyUpperMatrix<MT,SO,true>::StrictlyUpperMatrix( ElementType* ptr, size_t n, size_t nn )
1124  : matrix_( ptr, n, n, nn ) // The adapted dense matrix
1125 {
1126  if( !isStrictlyUpper( matrix_ ) ) {
1127  BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of strictly upper matrix" );
1128  }
1129 
1130  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1131 }
1133 //*************************************************************************************************
1134 
1135 
1136 //*************************************************************************************************
1142 template< typename MT // Type of the adapted dense matrix
1143  , bool SO > // Storage order of the adapted dense matrix
1144 inline StrictlyUpperMatrix<MT,SO,true>::StrictlyUpperMatrix( const StrictlyUpperMatrix& m )
1145  : matrix_( m.matrix_ ) // The adapted dense matrix
1146 {
1147  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly upper matrix detected" );
1148  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1149 }
1151 //*************************************************************************************************
1152 
1153 
1154 //*************************************************************************************************
1160 template< typename MT // Type of the adapted dense matrix
1161  , bool SO > // Storage order of the adapted dense matrix
1162 inline StrictlyUpperMatrix<MT,SO,true>::StrictlyUpperMatrix( StrictlyUpperMatrix&& m ) noexcept
1163  : matrix_( std::move( m.matrix_ ) ) // The adapted dense matrix
1164 {
1165  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly upper matrix detected" );
1166  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1167 }
1169 //*************************************************************************************************
1170 
1171 
1172 
1173 
1174 //=================================================================================================
1175 //
1176 // DATA ACCESS FUNCTIONS
1177 //
1178 //=================================================================================================
1179 
1180 //*************************************************************************************************
1196 template< typename MT // Type of the adapted dense matrix
1197  , bool SO > // Storage order of the adapted dense matrix
1199  StrictlyUpperMatrix<MT,SO,true>::operator()( size_t i, size_t j )
1200 {
1201  BLAZE_USER_ASSERT( i<rows() , "Invalid row access index" );
1202  BLAZE_USER_ASSERT( j<columns(), "Invalid column access index" );
1203 
1204  return Reference( matrix_, i, j );
1205 }
1207 //*************************************************************************************************
1208 
1209 
1210 //*************************************************************************************************
1226 template< typename MT // Type of the adapted dense matrix
1227  , bool SO > // Storage order of the adapted dense matrix
1229  StrictlyUpperMatrix<MT,SO,true>::operator()( size_t i, size_t j ) const
1230 {
1231  BLAZE_USER_ASSERT( i<rows() , "Invalid row access index" );
1232  BLAZE_USER_ASSERT( j<columns(), "Invalid column access index" );
1233 
1234  return matrix_(i,j);
1235 }
1237 //*************************************************************************************************
1238 
1239 
1240 //*************************************************************************************************
1257 template< typename MT // Type of the adapted dense matrix
1258  , bool SO > // Storage order of the adapted dense matrix
1260  StrictlyUpperMatrix<MT,SO,true>::at( size_t i, size_t j )
1261 {
1262  if( i >= rows() ) {
1263  BLAZE_THROW_OUT_OF_RANGE( "Invalid row access index" );
1264  }
1265  if( j >= columns() ) {
1266  BLAZE_THROW_OUT_OF_RANGE( "Invalid column access index" );
1267  }
1268  return (*this)(i,j);
1269 }
1271 //*************************************************************************************************
1272 
1273 
1274 //*************************************************************************************************
1291 template< typename MT // Type of the adapted dense matrix
1292  , bool SO > // Storage order of the adapted dense matrix
1294  StrictlyUpperMatrix<MT,SO,true>::at( size_t i, size_t j ) const
1295 {
1296  if( i >= rows() ) {
1297  BLAZE_THROW_OUT_OF_RANGE( "Invalid row access index" );
1298  }
1299  if( j >= columns() ) {
1300  BLAZE_THROW_OUT_OF_RANGE( "Invalid column access index" );
1301  }
1302  return (*this)(i,j);
1303 }
1305 //*************************************************************************************************
1306 
1307 
1308 //*************************************************************************************************
1321 template< typename MT // Type of the adapted dense matrix
1322  , bool SO > // Storage order of the adapted dense matrix
1323 inline typename StrictlyUpperMatrix<MT,SO,true>::ConstPointer
1324  StrictlyUpperMatrix<MT,SO,true>::data() const noexcept
1325 {
1326  return matrix_.data();
1327 }
1329 //*************************************************************************************************
1330 
1331 
1332 //*************************************************************************************************
1341 template< typename MT // Type of the adapted dense matrix
1342  , bool SO > // Storage order of the adapted dense matrix
1343 inline typename StrictlyUpperMatrix<MT,SO,true>::ConstPointer
1344  StrictlyUpperMatrix<MT,SO,true>::data( size_t i ) const noexcept
1345 {
1346  return matrix_.data(i);
1347 }
1349 //*************************************************************************************************
1350 
1351 
1352 //*************************************************************************************************
1364 template< typename MT // Type of the adapted dense matrix
1365  , bool SO > // Storage order of the adapted dense matrix
1368 {
1369  if( SO )
1370  return Iterator( matrix_, 0UL, i );
1371  else
1372  return Iterator( matrix_, i, 0UL );
1373 }
1375 //*************************************************************************************************
1376 
1377 
1378 //*************************************************************************************************
1390 template< typename MT // Type of the adapted dense matrix
1391  , bool SO > // Storage order of the adapted dense matrix
1393  StrictlyUpperMatrix<MT,SO,true>::begin( size_t i ) const
1394 {
1395  return matrix_.begin(i);
1396 }
1398 //*************************************************************************************************
1399 
1400 
1401 //*************************************************************************************************
1413 template< typename MT // Type of the adapted dense matrix
1414  , bool SO > // Storage order of the adapted dense matrix
1416  StrictlyUpperMatrix<MT,SO,true>::cbegin( size_t i ) const
1417 {
1418  return matrix_.cbegin(i);
1419 }
1421 //*************************************************************************************************
1422 
1423 
1424 //*************************************************************************************************
1436 template< typename MT // Type of the adapted dense matrix
1437  , bool SO > // Storage order of the adapted dense matrix
1440 {
1441  if( SO )
1442  return Iterator( matrix_, rows(), i );
1443  else
1444  return Iterator( matrix_, i, columns() );
1445 }
1447 //*************************************************************************************************
1448 
1449 
1450 //*************************************************************************************************
1462 template< typename MT // Type of the adapted dense matrix
1463  , bool SO > // Storage order of the adapted dense matrix
1465  StrictlyUpperMatrix<MT,SO,true>::end( size_t i ) const
1466 {
1467  return matrix_.end(i);
1468 }
1470 //*************************************************************************************************
1471 
1472 
1473 //*************************************************************************************************
1485 template< typename MT // Type of the adapted dense matrix
1486  , bool SO > // Storage order of the adapted dense matrix
1488  StrictlyUpperMatrix<MT,SO,true>::cend( size_t i ) const
1489 {
1490  return matrix_.cend(i);
1491 }
1493 //*************************************************************************************************
1494 
1495 
1496 
1497 
1498 //=================================================================================================
1499 //
1500 // ASSIGNMENT OPERATORS
1501 //
1502 //=================================================================================================
1503 
1504 //*************************************************************************************************
1511 template< typename MT // Type of the adapted dense matrix
1512  , bool SO > // Storage order of the adapted dense matrix
1513 inline StrictlyUpperMatrix<MT,SO,true>&
1514  StrictlyUpperMatrix<MT,SO,true>::operator=( const ElementType& rhs )
1515 {
1516  if( SO ) {
1517  for( size_t j=1UL; j<columns(); ++j )
1518  for( size_t i=0UL; i<j; ++i )
1519  matrix_(i,j) = rhs;
1520  }
1521  else {
1522  for( size_t i=0UL; i<rows(); ++i )
1523  for( size_t j=i+1UL; j<columns(); ++j )
1524  matrix_(i,j) = rhs;
1525  }
1526 
1527  return *this;
1528 }
1530 //*************************************************************************************************
1531 
1532 
1533 //*************************************************************************************************
1558 template< typename MT // Type of the adapted dense matrix
1559  , bool SO > // Storage order of the adapted dense matrix
1560 inline StrictlyUpperMatrix<MT,SO,true>&
1561  StrictlyUpperMatrix<MT,SO,true>::operator=( initializer_list< initializer_list<ElementType> > list )
1562 {
1563  const InitializerMatrix<ElementType> tmp( list, list.size() );
1564 
1565  if( !isStrictlyUpper( tmp ) ) {
1566  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to strictly upper matrix" );
1567  }
1568 
1569  matrix_ = list;
1570 
1571  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly upper matrix detected" );
1572  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1573 
1574  return *this;
1575 }
1577 //*************************************************************************************************
1578 
1579 
1580 //*************************************************************************************************
1605 template< typename MT // Type of the adapted dense matrix
1606  , bool SO > // Storage order of the adapted dense matrix
1607 template< typename Other // Data type of the initialization array
1608  , size_t N > // Number of rows and columns of the initialization array
1609 inline StrictlyUpperMatrix<MT,SO,true>&
1610  StrictlyUpperMatrix<MT,SO,true>::operator=( const Other (&array)[N][N] )
1611 {
1612  MT tmp( array );
1613 
1614  if( !isStrictlyUpper( tmp ) ) {
1615  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to strictly upper matrix" );
1616  }
1617 
1618  matrix_ = std::move( tmp );
1619 
1620  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly upper matrix detected" );
1621  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1622 
1623  return *this;
1624 }
1626 //*************************************************************************************************
1627 
1628 
1629 //*************************************************************************************************
1639 template< typename MT // Type of the adapted dense matrix
1640  , bool SO > // Storage order of the adapted dense matrix
1641 inline StrictlyUpperMatrix<MT,SO,true>&
1642  StrictlyUpperMatrix<MT,SO,true>::operator=( const StrictlyUpperMatrix& rhs )
1643 {
1644  matrix_ = rhs.matrix_;
1645 
1646  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly upper matrix detected" );
1647  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1648 
1649  return *this;
1650 }
1652 //*************************************************************************************************
1653 
1654 
1655 //*************************************************************************************************
1662 template< typename MT // Type of the adapted dense matrix
1663  , bool SO > // Storage order of the adapted dense matrix
1664 inline StrictlyUpperMatrix<MT,SO,true>&
1665  StrictlyUpperMatrix<MT,SO,true>::operator=( StrictlyUpperMatrix&& rhs ) noexcept
1666 {
1667  matrix_ = std::move( rhs.matrix_ );
1668 
1669  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly upper matrix detected" );
1670  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1671 
1672  return *this;
1673 }
1675 //*************************************************************************************************
1676 
1677 
1678 //*************************************************************************************************
1691 template< typename MT // Type of the adapted dense matrix
1692  , bool SO > // Storage order of the adapted dense matrix
1693 template< typename MT2 // Type of the right-hand side matrix
1694  , bool SO2 > // Storage order of the right-hand side matrix
1695 inline DisableIf_< IsComputation<MT2>, StrictlyUpperMatrix<MT,SO,true>& >
1696  StrictlyUpperMatrix<MT,SO,true>::operator=( const Matrix<MT2,SO2>& rhs )
1697 {
1698  if( IsUniTriangular<MT2>::value ||
1699  ( !IsStrictlyUpper<MT2>::value && !isStrictlyUpper( ~rhs ) ) ) {
1700  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to strictly upper matrix" );
1701  }
1702 
1703  matrix_ = declupp( ~rhs );
1704 
1705  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly upper matrix detected" );
1706  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1707 
1708  return *this;
1709 }
1711 //*************************************************************************************************
1712 
1713 
1714 //*************************************************************************************************
1727 template< typename MT // Type of the adapted dense matrix
1728  , bool SO > // Storage order of the adapted dense matrix
1729 template< typename MT2 // Type of the right-hand side matrix
1730  , bool SO2 > // Storage order of the right-hand side matrix
1731 inline EnableIf_< IsComputation<MT2>, StrictlyUpperMatrix<MT,SO,true>& >
1732  StrictlyUpperMatrix<MT,SO,true>::operator=( const Matrix<MT2,SO2>& rhs )
1733 {
1734  if( IsUniTriangular<MT2>::value || ( !IsSquare<MT2>::value && !isSquare( ~rhs ) ) ) {
1735  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to strictly upper matrix" );
1736  }
1737 
1738  if( IsStrictlyUpper<MT2>::value ) {
1739  matrix_ = ~rhs;
1740  }
1741  else {
1742  MT tmp( ~rhs );
1743 
1744  if( !isStrictlyUpper( tmp ) ) {
1745  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to strictly upper matrix" );
1746  }
1747 
1748  matrix_ = std::move( tmp );
1749  }
1750 
1751  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly upper matrix detected" );
1752  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1753 
1754  return *this;
1755 }
1757 //*************************************************************************************************
1758 
1759 
1760 //*************************************************************************************************
1773 template< typename MT // Type of the adapted dense matrix
1774  , bool SO > // Storage order of the adapted dense matrix
1775 template< typename MT2 // Type of the right-hand side matrix
1776  , bool SO2 > // Storage order of the right-hand side matrix
1777 inline DisableIf_< IsComputation<MT2>, StrictlyUpperMatrix<MT,SO,true>& >
1778  StrictlyUpperMatrix<MT,SO,true>::operator+=( const Matrix<MT2,SO2>& rhs )
1779 {
1780  if( IsUniTriangular<MT2>::value ||
1781  ( !IsStrictlyUpper<MT2>::value && !isStrictlyUpper( ~rhs ) ) ) {
1782  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to strictly upper matrix" );
1783  }
1784 
1785  matrix_ += declupp( ~rhs );
1786 
1787  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly upper matrix detected" );
1788  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1789 
1790  return *this;
1791 }
1793 //*************************************************************************************************
1794 
1795 
1796 //*************************************************************************************************
1809 template< typename MT // Type of the adapted dense matrix
1810  , bool SO > // Storage order of the adapted dense matrix
1811 template< typename MT2 // Type of the right-hand side matrix
1812  , bool SO2 > // Storage order of the right-hand side matrix
1813 inline EnableIf_< IsComputation<MT2>, StrictlyUpperMatrix<MT,SO,true>& >
1814  StrictlyUpperMatrix<MT,SO,true>::operator+=( const Matrix<MT2,SO2>& rhs )
1815 {
1816  if( IsUniTriangular<MT2>::value || ( !IsSquare<MT2>::value && !isSquare( ~rhs ) ) ) {
1817  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to strictly upper matrix" );
1818  }
1819 
1820  if( IsStrictlyUpper<MT2>::value ) {
1821  matrix_ += ~rhs;
1822  }
1823  else {
1824  const ResultType_<MT2> tmp( ~rhs );
1825 
1826  if( !isStrictlyUpper( tmp ) ) {
1827  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to strictly upper matrix" );
1828  }
1829 
1830  matrix_ += declupp( tmp );
1831  }
1832 
1833  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly upper matrix detected" );
1834  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1835 
1836  return *this;
1837 }
1839 //*************************************************************************************************
1840 
1841 
1842 //*************************************************************************************************
1855 template< typename MT // Type of the adapted dense matrix
1856  , bool SO > // Storage order of the adapted dense matrix
1857 template< typename MT2 // Type of the right-hand side matrix
1858  , bool SO2 > // Storage order of the right-hand side matrix
1859 inline DisableIf_< IsComputation<MT2>, StrictlyUpperMatrix<MT,SO,true>& >
1860  StrictlyUpperMatrix<MT,SO,true>::operator-=( const Matrix<MT2,SO2>& rhs )
1861 {
1862  if( !IsStrictlyUpper<MT2>::value && !isStrictlyUpper( ~rhs ) ) {
1863  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to strictly upper matrix" );
1864  }
1865 
1866  matrix_ -= declupp( ~rhs );
1867 
1868  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly upper matrix detected" );
1869  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1870 
1871  return *this;
1872 }
1874 //*************************************************************************************************
1875 
1876 
1877 //*************************************************************************************************
1890 template< typename MT // Type of the adapted dense matrix
1891  , bool SO > // Storage order of the adapted dense matrix
1892 template< typename MT2 // Type of the right-hand side matrix
1893  , bool SO2 > // Storage order of the right-hand side matrix
1894 inline EnableIf_< IsComputation<MT2>, StrictlyUpperMatrix<MT,SO,true>& >
1895  StrictlyUpperMatrix<MT,SO,true>::operator-=( const Matrix<MT2,SO2>& rhs )
1896 {
1897  if( !IsSquare<MT2>::value && !isSquare( ~rhs ) ) {
1898  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to strictly upper matrix" );
1899  }
1900 
1901  if( IsStrictlyUpper<MT2>::value ) {
1902  matrix_ -= ~rhs;
1903  }
1904  else {
1905  const ResultType_<MT2> tmp( ~rhs );
1906 
1907  if( !isStrictlyUpper( tmp ) ) {
1908  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to strictly upper matrix" );
1909  }
1910 
1911  matrix_ -= declupp( tmp );
1912  }
1913 
1914  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly upper matrix detected" );
1915  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1916 
1917  return *this;
1918 }
1920 //*************************************************************************************************
1921 
1922 
1923 //*************************************************************************************************
1934 template< typename MT // Type of the adapted dense matrix
1935  , bool SO > // Storage order of the adapted dense matrix
1936 template< typename MT2 // Type of the right-hand side matrix
1937  , bool SO2 > // Storage order of the right-hand side matrix
1938 inline StrictlyUpperMatrix<MT,SO,true>&
1939  StrictlyUpperMatrix<MT,SO,true>::operator%=( const Matrix<MT2,SO2>& rhs )
1940 {
1941  if( !IsSquare<MT2>::value && !isSquare( ~rhs ) ) {
1942  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to strictly upper matrix" );
1943  }
1944 
1945  matrix_ %= ~rhs;
1946 
1947  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly upper matrix detected" );
1948  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1949 
1950  return *this;
1951 }
1953 //*************************************************************************************************
1954 
1955 
1956 //*************************************************************************************************
1964 template< typename MT // Type of the adapted dense matrix
1965  , bool SO > // Storage order of the adapted dense matrix
1966 template< typename ST > // Data type of the right-hand side scalar
1967 inline EnableIf_< IsNumeric<ST>, StrictlyUpperMatrix<MT,SO,true> >&
1969 {
1970  matrix_ *= rhs;
1971  return *this;
1972 }
1973 //*************************************************************************************************
1974 
1975 
1976 //*************************************************************************************************
1984 template< typename MT // Type of the adapted dense matrix
1985  , bool SO > // Storage order of the adapted dense matrix
1986 template< typename ST > // Data type of the right-hand side scalar
1987 inline EnableIf_< IsNumeric<ST>, StrictlyUpperMatrix<MT,SO,true> >&
1989 {
1990  BLAZE_USER_ASSERT( !isZero( rhs ), "Division by zero detected" );
1991 
1992  matrix_ /= rhs;
1993  return *this;
1994 }
1996 //*************************************************************************************************
1997 
1998 
1999 
2000 
2001 //=================================================================================================
2002 //
2003 // UTILITY FUNCTIONS
2004 //
2005 //=================================================================================================
2006 
2007 //*************************************************************************************************
2013 template< typename MT // Type of the adapted dense matrix
2014  , bool SO > // Storage order of the adapted dense matrix
2015 inline size_t StrictlyUpperMatrix<MT,SO,true>::rows() const noexcept
2016 {
2017  return matrix_.rows();
2018 }
2020 //*************************************************************************************************
2021 
2022 
2023 //*************************************************************************************************
2029 template< typename MT // Type of the adapted dense matrix
2030  , bool SO > // Storage order of the adapted dense matrix
2031 inline size_t StrictlyUpperMatrix<MT,SO,true>::columns() const noexcept
2032 {
2033  return matrix_.columns();
2034 }
2036 //*************************************************************************************************
2037 
2038 
2039 //*************************************************************************************************
2050 template< typename MT // Type of the adapted dense matrix
2051  , bool SO > // Storage order of the adapted dense matrix
2052 inline size_t StrictlyUpperMatrix<MT,SO,true>::spacing() const noexcept
2053 {
2054  return matrix_.spacing();
2055 }
2057 //*************************************************************************************************
2058 
2059 
2060 //*************************************************************************************************
2066 template< typename MT // Type of the adapted dense matrix
2067  , bool SO > // Storage order of the adapted dense matrix
2068 inline size_t StrictlyUpperMatrix<MT,SO,true>::capacity() const noexcept
2069 {
2070  return matrix_.capacity();
2071 }
2073 //*************************************************************************************************
2074 
2075 
2076 //*************************************************************************************************
2088 template< typename MT // Type of the adapted dense matrix
2089  , bool SO > // Storage order of the adapted dense matrix
2090 inline size_t StrictlyUpperMatrix<MT,SO,true>::capacity( size_t i ) const noexcept
2091 {
2092  return matrix_.capacity(i);
2093 }
2095 //*************************************************************************************************
2096 
2097 
2098 //*************************************************************************************************
2104 template< typename MT // Type of the adapted dense matrix
2105  , bool SO > // Storage order of the adapted dense matrix
2106 inline size_t StrictlyUpperMatrix<MT,SO,true>::nonZeros() const
2107 {
2108  return matrix_.nonZeros();
2109 }
2111 //*************************************************************************************************
2112 
2113 
2114 //*************************************************************************************************
2126 template< typename MT // Type of the adapted dense matrix
2127  , bool SO > // Storage order of the adapted dense matrix
2128 inline size_t StrictlyUpperMatrix<MT,SO,true>::nonZeros( size_t i ) const
2129 {
2130  return matrix_.nonZeros(i);
2131 }
2133 //*************************************************************************************************
2134 
2135 
2136 //*************************************************************************************************
2142 template< typename MT // Type of the adapted dense matrix
2143  , bool SO > // Storage order of the adapted dense matrix
2145 {
2146  using blaze::clear;
2147 
2148  if( SO ) {
2149  for( size_t j=1UL; j<columns(); ++j )
2150  for( size_t i=0UL; i<j; ++i )
2151  clear( matrix_(i,j) );
2152  }
2153  else {
2154  for( size_t i=0UL; i<rows(); ++i )
2155  for( size_t j=i+1UL; j<columns(); ++j )
2156  clear( matrix_(i,j) );
2157  }
2158 }
2160 //*************************************************************************************************
2161 
2162 
2163 //*************************************************************************************************
2176 template< typename MT // Type of the adapted dense matrix
2177  , bool SO > // Storage order of the adapted dense matrix
2178 inline void StrictlyUpperMatrix<MT,SO,true>::reset( size_t i )
2179 {
2180  using blaze::clear;
2181 
2182  if( SO ) {
2183  for( size_t j=0UL; j<i; ++j )
2184  clear( matrix_(j,i) );
2185  }
2186  else {
2187  for( size_t j=i+1UL; j<columns(); ++j )
2188  clear( matrix_(i,j) );
2189  }
2190 }
2192 //*************************************************************************************************
2193 
2194 
2195 //*************************************************************************************************
2207 template< typename MT // Type of the adapted dense matrix
2208  , bool SO > // Storage order of the adapted dense matrix
2210 {
2211  using blaze::clear;
2212 
2213  if( IsResizable<MT>::value ) {
2214  clear( matrix_ );
2215  }
2216  else {
2217  reset();
2218  }
2219 }
2221 //*************************************************************************************************
2222 
2223 
2224 //*************************************************************************************************
2260 template< typename MT // Type of the adapted dense matrix
2261  , bool SO > // Storage order of the adapted dense matrix
2262 void StrictlyUpperMatrix<MT,SO,true>::resize( size_t n, bool preserve )
2263 {
2265 
2266  UNUSED_PARAMETER( preserve );
2267 
2268  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly upper matrix detected" );
2269 
2270  const size_t oldsize( matrix_.rows() );
2271 
2272  matrix_.resize( n, n, true );
2273 
2274  if( n > oldsize )
2275  {
2276  const size_t increment( n - oldsize );
2277  submatrix( matrix_, oldsize, 0UL, increment, n ).reset();
2278  }
2279 }
2281 //*************************************************************************************************
2282 
2283 
2284 //*************************************************************************************************
2297 template< typename MT // Type of the adapted dense matrix
2298  , bool SO > // Storage order of the adapted dense matrix
2299 inline void StrictlyUpperMatrix<MT,SO,true>::extend( size_t n, bool preserve )
2300 {
2302 
2303  UNUSED_PARAMETER( preserve );
2304 
2305  resize( rows() + n, true );
2306 }
2307 //*************************************************************************************************
2308 
2309 
2310 //*************************************************************************************************
2320 template< typename MT // Type of the adapted dense matrix
2321  , bool SO > // Storage order of the adapted dense matrix
2322 inline void StrictlyUpperMatrix<MT,SO,true>::reserve( size_t elements )
2323 {
2324  matrix_.reserve( elements );
2325 }
2327 //*************************************************************************************************
2328 
2329 
2330 //*************************************************************************************************
2340 template< typename MT // Type of the adapted dense matrix
2341  , bool SO > // Storage order of the adapted dense matrix
2343 {
2344  matrix_.shrinkToFit();
2345 }
2347 //*************************************************************************************************
2348 
2349 
2350 //*************************************************************************************************
2357 template< typename MT // Type of the adapted dense matrix
2358  , bool SO > // Storage order of the adapted dense matrix
2359 inline void StrictlyUpperMatrix<MT,SO,true>::swap( StrictlyUpperMatrix& m ) noexcept
2360 {
2361  using std::swap;
2362 
2363  swap( matrix_, m.matrix_ );
2364 }
2366 //*************************************************************************************************
2367 
2368 
2369 //*************************************************************************************************
2381 template< typename MT // Type of the adapted dense matrix
2382  , bool SO > // Storage order of the adapted dense matrix
2383 inline constexpr size_t StrictlyUpperMatrix<MT,SO,true>::maxNonZeros() noexcept
2384 {
2386 
2387  return maxNonZeros( Size<MT,0UL>::value );
2388 }
2390 //*************************************************************************************************
2391 
2392 
2393 //*************************************************************************************************
2403 template< typename MT // Type of the adapted dense matrix
2404  , bool SO > // Storage order of the adapted dense matrix
2405 inline constexpr size_t StrictlyUpperMatrix<MT,SO,true>::maxNonZeros( size_t n ) noexcept
2406 {
2407  return ( ( n - 1UL ) * n ) / 2UL;
2408 }
2410 //*************************************************************************************************
2411 
2412 
2413 
2414 
2415 //=================================================================================================
2416 //
2417 // NUMERIC FUNCTIONS
2418 //
2419 //=================================================================================================
2420 
2421 //*************************************************************************************************
2439 template< typename MT // Type of the adapted dense matrix
2440  , bool SO > // Storage order of the adapted dense matrix
2441 template< typename Other > // Data type of the scalar value
2442 inline StrictlyUpperMatrix<MT,SO,true>&
2443  StrictlyUpperMatrix<MT,SO,true>::scale( const Other& scalar )
2444 {
2445  matrix_.scale( scalar );
2446  return *this;
2447 }
2449 //*************************************************************************************************
2450 
2451 
2452 
2453 
2454 //=================================================================================================
2455 //
2456 // DEBUGGING FUNCTIONS
2457 //
2458 //=================================================================================================
2459 
2460 //*************************************************************************************************
2470 template< typename MT // Type of the adapted dense matrix
2471  , bool SO > // Storage order of the adapted dense matrix
2472 inline bool StrictlyUpperMatrix<MT,SO,true>::isIntact() const noexcept
2473 {
2474  using blaze::isIntact;
2475 
2476  return ( isIntact( matrix_ ) && isStrictlyUpper( matrix_ ) );
2477 }
2479 //*************************************************************************************************
2480 
2481 
2482 
2483 
2484 //=================================================================================================
2485 //
2486 // EXPRESSION TEMPLATE EVALUATION FUNCTIONS
2487 //
2488 //=================================================================================================
2489 
2490 //*************************************************************************************************
2501 template< typename MT // Type of the adapted dense matrix
2502  , bool SO > // Storage order of the adapted dense matrix
2503 template< typename Other > // Data type of the foreign expression
2504 inline bool StrictlyUpperMatrix<MT,SO,true>::canAlias( const Other* alias ) const noexcept
2505 {
2506  return matrix_.canAlias( alias );
2507 }
2509 //*************************************************************************************************
2510 
2511 
2512 //*************************************************************************************************
2523 template< typename MT // Type of the adapted dense matrix
2524  , bool SO > // Storage order of the adapted dense matrix
2525 template< typename Other > // Data type of the foreign expression
2526 inline bool StrictlyUpperMatrix<MT,SO,true>::isAliased( const Other* alias ) const noexcept
2527 {
2528  return matrix_.isAliased( alias );
2529 }
2531 //*************************************************************************************************
2532 
2533 
2534 //*************************************************************************************************
2544 template< typename MT // Type of the adapted dense matrix
2545  , bool SO > // Storage order of the adapted dense matrix
2546 inline bool StrictlyUpperMatrix<MT,SO,true>::isAligned() const noexcept
2547 {
2548  return matrix_.isAligned();
2549 }
2551 //*************************************************************************************************
2552 
2553 
2554 //*************************************************************************************************
2565 template< typename MT // Type of the adapted dense matrix
2566  , bool SO > // Storage order of the adapted dense matrix
2567 inline bool StrictlyUpperMatrix<MT,SO,true>::canSMPAssign() const noexcept
2568 {
2569  return matrix_.canSMPAssign();
2570 }
2572 //*************************************************************************************************
2573 
2574 
2575 //*************************************************************************************************
2591 template< typename MT // Type of the adapted dense matrix
2592  , bool SO > // Storage order of the adapted dense matrix
2593 BLAZE_ALWAYS_INLINE typename StrictlyUpperMatrix<MT,SO,true>::SIMDType
2594  StrictlyUpperMatrix<MT,SO,true>::load( size_t i, size_t j ) const noexcept
2595 {
2596  return matrix_.load( i, j );
2597 }
2599 //*************************************************************************************************
2600 
2601 
2602 //*************************************************************************************************
2618 template< typename MT // Type of the adapted dense matrix
2619  , bool SO > // Storage order of the adapted dense matrix
2620 BLAZE_ALWAYS_INLINE typename StrictlyUpperMatrix<MT,SO,true>::SIMDType
2621  StrictlyUpperMatrix<MT,SO,true>::loada( size_t i, size_t j ) const noexcept
2622 {
2623  return matrix_.loada( i, j );
2624 }
2626 //*************************************************************************************************
2627 
2628 
2629 //*************************************************************************************************
2645 template< typename MT // Type of the adapted dense matrix
2646  , bool SO > // Storage order of the adapted dense matrix
2647 BLAZE_ALWAYS_INLINE typename StrictlyUpperMatrix<MT,SO,true>::SIMDType
2648  StrictlyUpperMatrix<MT,SO,true>::loadu( size_t i, size_t j ) const noexcept
2649 {
2650  return matrix_.loadu( i, j );
2651 }
2653 //*************************************************************************************************
2654 
2655 
2656 
2657 
2658 //=================================================================================================
2659 //
2660 // CONSTRUCTION FUNCTIONS
2661 //
2662 //=================================================================================================
2663 
2664 //*************************************************************************************************
2671 template< typename MT // Type of the adapted dense matrix
2672  , bool SO > // Storage order of the adapted dense matrix
2673 inline const MT StrictlyUpperMatrix<MT,SO,true>::construct( size_t n, TrueType )
2674 {
2676 
2677  return MT( n, n, ElementType() );
2678 }
2680 //*************************************************************************************************
2681 
2682 
2683 //*************************************************************************************************
2690 template< typename MT // Type of the adapted dense matrix
2691  , bool SO > // Storage order of the adapted dense matrix
2692 inline const MT StrictlyUpperMatrix<MT,SO,true>::construct( const ElementType& init, FalseType )
2693 {
2696 
2697  MT tmp;
2698 
2699  if( SO ) {
2700  for( size_t j=0UL; j<columns(); ++j ) {
2701  for( size_t i=0UL; i<j; ++i )
2702  tmp(i,j) = init;
2703  }
2704  }
2705  else {
2706  for( size_t i=0UL; i<rows(); ++i ) {
2707  for( size_t j=i+1UL; j<columns(); ++j )
2708  tmp(i,j) = init;
2709  }
2710  }
2711 
2712  return tmp;
2713 }
2715 //*************************************************************************************************
2716 
2717 
2718 //*************************************************************************************************
2729 template< typename MT // Type of the adapted dense matrix
2730  , bool SO > // Storage order of the adapted dense matrix
2731 template< typename MT2 // Type of the foreign matrix
2732  , bool SO2 // Storage order of the foreign matrix
2733  , typename T > // Type of the third argument
2734 inline const MT StrictlyUpperMatrix<MT,SO,true>::construct( const Matrix<MT2,SO2>& m, T )
2735 {
2736  const MT tmp( ~m );
2737 
2738  if( IsUniTriangular<MT2>::value ||
2739  ( !IsStrictlyUpper<MT2>::value && !isStrictlyUpper( tmp ) ) ) {
2740  BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of strictly upper matrix" );
2741  }
2742 
2743  return tmp;
2744 }
2746 //*************************************************************************************************
2747 
2748 } // namespace blaze
2749 
2750 #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.
decltype(auto) column(Matrix< MT, SO > &matrix, RCAs... args)
Creating a view on a specific column of the given matrix.
Definition: Column.h:131
CompressedMatrix< Type, false > OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: CompressedMatrix.h:3077
#define BLAZE_USER_ASSERT(expr, msg)
Run time assertion macro for user checks.In case of an invalid run time expression, the program execution is terminated. The BLAZE_USER_ASSERT macro can be disabled by setting the BLAZE_USER_ASSERT flag to zero or by defining NDEBUG during the compilation.
Definition: Assert.h:117
Header file for the UNUSED_PARAMETER function template.
BLAZE_ALWAYS_INLINE size_t capacity(const Matrix< MT, SO > &matrix) noexcept
Returns the maximum capacity of the matrix.
Definition: Matrix.h:522
Header file for basic type definitions.
Header file for the FalseType type/value trait base class.
#define BLAZE_CONSTRAINT_MUST_BE_MATRIX_WITH_STORAGE_ORDER(T, SO)
Constraint on the data type.In case the given data type T is not a dense or sparse matrix type and in...
Definition: StorageOrder.h:63
#define BLAZE_CONSTRAINT_MUST_BE_DENSE_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is not a dense, N-dimensional matrix type...
Definition: DenseMatrix.h:61
constexpr bool operator<(const NegativeAccuracy< A > &lhs, const T &rhs)
Less-than comparison between a NegativeAccuracy object and a floating point value.
Definition: Accuracy.h:329
Constraint on the data type.
This ResultType
Result type for expression template evaluations.
Definition: CompressedMatrix.h:3076
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:364
CompressedMatrix< Type, true > This
Type of this CompressedMatrix instance.
Definition: CompressedMatrix.h:3074
Constraint on the data type.
void reset(const DiagonalProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: DiagonalProxy.h:588
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:701
BLAZE_ALWAYS_INLINE void shrinkToFit(Matrix< MT, SO > &matrix)
Requesting the removal of unused capacity.
Definition: Matrix.h:775
typename DisableIf< Condition, T >::Type DisableIf_
Auxiliary type for the DisableIf class template.The DisableIf_ alias declaration provides a convenien...
Definition: DisableIf.h:224
void clear(CompressedMatrix< Type, SO > &m)
Clearing the given compressed matrix.
Definition: CompressedMatrix.h:5829
CompressedMatrix< Type, false > TransposeType
Transpose type for expression template evaluations.
Definition: CompressedMatrix.h:3078
const Type & ConstReference
Reference to a constant matrix value.
Definition: CompressedMatrix.h:3083
decltype(auto) declupp(const DenseMatrix< MT, SO > &dm)
Declares the given dense matrix expression dm as upper.
Definition: DMatDeclUppExpr.h:1026
#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:560
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:733
BoolConstant< true > TrueType
Type traits base class.The TrueType class is used as base class for type traits and value traits that...
Definition: TrueType.h:61
Element * Iterator
Iterator over non-constant elements.
Definition: CompressedMatrix.h:3084
Header file for the extended initializer_list functionality.
Constraint on the data type.
BLAZE_ALWAYS_INLINE const EnableIf_< And< IsIntegral< T >, HasSize< T, 1UL > >, If_< IsSigned< T >, SIMDint8, SIMDuint8 > > loadu(const T *address) noexcept
Loads a vector of 1-byte integral values.
Definition: Loadu.h:77
BLAZE_ALWAYS_INLINE MT::ConstIterator cend(const Matrix< MT, SO > &matrix, size_t i)
Returns an iterator just past the last element of row/column i.
Definition: Matrix.h:474
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:408
Constraint on the data type.
Constraint on the data type.
Constraint on the data type.
BLAZE_ALWAYS_INLINE size_t spacing(const DenseMatrix< MT, SO > &dm) noexcept
Returns the spacing between the beginning of two rows/columns.
Definition: DenseMatrix.h:252
#define BLAZE_CONSTRAINT_MUST_BE_SQUARE_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is not a square matrix type, a compilation error is created.
Definition: Square.h:60
Header file for the IsSquare type trait.
bool isZero(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is 0.
Definition: DiagonalProxy.h:670
Constraint on the data type.
Header file for the implementation of a matrix representation of an initializer list.
Header file for the DisableIf class template.
Header file for the IsStrictlyUpper type trait.
MatrixAccessProxy< This > Reference
Reference to a non-constant matrix value.
Definition: CompressedMatrix.h:3082
Header file for the clear shim.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58
#define BLAZE_ALWAYS_INLINE
Platform dependent setup of an enforced inline keyword.
Definition: Inline.h:85
#define BLAZE_CONSTRAINT_MUST_BE_STATIC_TYPE(T)
Constraint on the data type.In case the given data type T is not a static data type, i.e. a vector or matrix with dimensions fixed at compile time, a compilation error is created.
Definition: Static.h:61
void swap(CompressedMatrix< Type, SO > &a, CompressedMatrix< Type, SO > &b) noexcept
Swapping the contents of two compressed matrices.
Definition: CompressedMatrix.h:5908
Compile time assertion.
bool isIntact(const CompressedMatrix< Type, SO > &m)
Returns whether the invariants of the given compressed matrix are intact.
Definition: CompressedMatrix.h:5891
SparseMatrix< This, true > BaseType
Base type of this CompressedMatrix instance.
Definition: CompressedMatrix.h:3075
#define BLAZE_CONSTRAINT_MUST_NOT_BE_POINTER_TYPE(T)
Constraint on the data type.In case the given data type T is not a pointer type, a compilation error ...
Definition: Pointer.h:79
Type ElementType
Type of the compressed matrix elements.
Definition: CompressedMatrix.h:3079
#define BLAZE_THROW_OUT_OF_RANGE(MESSAGE)
Macro for the emission of a std::out_of_range exception.This macro encapsulates the default way of Bl...
Definition: Exception.h:331
Header file for the DenseMatrix base class.
constexpr bool operator>(const NegativeAccuracy< A > &lhs, const T &rhs)
Greater-than comparison between a NegativeAccuracy object and a floating point value.
Definition: Accuracy.h:367
constexpr bool operator>=(const NegativeAccuracy< A > &, const T &rhs)
Greater-or-equal-than comparison between a NegativeAccuracy object and a floating point value...
Definition: Accuracy.h:443
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:3085
Header file for the isZero shim.
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:506
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.
Constraints on the storage order of matrix types.
decltype(auto) elements(Vector< VT, TF > &vector, REAs... args)
Creating a view on a selection of elements of the given vector.
Definition: Elements.h:134
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:714
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:430
decltype(auto) operator*(const DenseMatrix< MT1, false > &lhs, const DenseMatrix< MT2, false > &rhs)
Multiplication operator for the multiplication of two row-major dense matrices ( ).
Definition: DMatDMatMultExpr.h:8893
constexpr bool operator!=(const NegativeAccuracy< A > &lhs, const T &rhs)
Inequality comparison between a NegativeAccuracy object and a floating point value.
Definition: Accuracy.h:290
decltype(auto) submatrix(Matrix< MT, SO > &, RSAs...)
Creating a view on a specific submatrix of the given matrix.
Definition: Submatrix.h:360
Header file for the EnableIf class template.
Header file for utility functions for dense matrices.
void clear(const DiagonalProxy< MT > &proxy)
Clearing the represented element.
Definition: DiagonalProxy.h:608
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:1641
BLAZE_ALWAYS_INLINE T1 & operator+=(SIMDPack< T1 > &lhs, const SIMDPack< T2 > &rhs)
Addition assignment operator for the addition of two SIMD packs.
Definition: BasicTypes.h:1357
Header file for run time assertion macros.
Constraint on the data type.
Constraint on the data type.
Constraint on the data type.
decltype(auto) row(Matrix< MT, SO > &, RRAs...)
Creating a view on a specific row of the given matrix.
Definition: Row.h:131
#define BLAZE_CONSTRAINT_MUST_NOT_BE_LOWER_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is a lower triangular matrix type...
Definition: Lower.h:81
#define BLAZE_CONSTRAINT_MUST_NOT_BE_RESIZABLE_TYPE(T)
Constraint on the data type.In case the given data type T is resizable, i.e. has a &#39;resize&#39; member fu...
Definition: Resizable.h:81
#define BLAZE_CONSTRAINT_MUST_NOT_BE_REFERENCE_TYPE(T)
Constraint on the data type.In case the given data type T is not a reference type, a compilation error is created.
Definition: Reference.h:79
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:272
Constraint on the data type.
Constraint on the data type.
constexpr bool operator<=(const NegativeAccuracy< A > &, const T &rhs)
Less-or-equal-than comparison between a NegativeAccuracy object and a floating point value...
Definition: Accuracy.h:405
typename EnableIf< Condition, T >::Type EnableIf_
Auxiliary alias declaration for the EnableIf class template.The EnableIf_ alias declaration provides ...
Definition: EnableIf.h:224
BLAZE_ALWAYS_INLINE size_t rows(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of rows of the matrix.
Definition: Matrix.h:490
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:3080
BLAZE_ALWAYS_INLINE MT::ElementType * data(DenseMatrix< MT, SO > &dm) noexcept
Low-level data access to the dense matrix elements.
Definition: DenseMatrix.h:169
EnableIf_< IsNumeric< ST >, MT &> operator/=(DenseMatrix< MT, SO > &mat, ST scalar)
Division assignment operator for the division of a dense matrix by a scalar value ( )...
Definition: DenseMatrix.h:655
#define BLAZE_CONSTRAINT_MUST_BE_RESIZABLE_TYPE(T)
Constraint on the data type.In case the given data type T is not resizable, i.e. does not have a &#39;res...
Definition: Resizable.h:61
Header file for the IsComputation type trait class.
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:3081
#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 isIntact(const DiagonalMatrix< MT, SO, DF > &m)
Returns whether the invariants of the given diagonal matrix are intact.
Definition: DiagonalMatrix.h:254
#define BLAZE_CONSTRAINT_MUST_NOT_BE_HERMITIAN_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is an Hermitian matrix type, a compilation error is created.
Definition: Hermitian.h:79
BLAZE_ALWAYS_INLINE T1 & operator-=(SIMDPack< T1 > &lhs, const SIMDPack< T2 > &rhs)
Subtraction assignment operator for the subtraction of two SIMD packs.
Definition: BasicTypes.h:1375
void UNUSED_PARAMETER(const Args &...)
Suppression of unused parameter warnings.
Definition: Unused.h:81
#define BLAZE_STATIC_ASSERT(expr)
Compile time assertion macro.In case of an invalid compile time expression, a compilation error is cr...
Definition: StaticAssert.h:112
EnableIf_< IsNumeric< ST >, MT &> operator*=(DenseMatrix< MT, SO > &mat, ST scalar)
Multiplication assignment operator for the multiplication of a dense matrix and a scalar value ( )...
Definition: DenseMatrix.h:593
BLAZE_ALWAYS_INLINE bool isSquare(const Matrix< MT, SO > &matrix) noexcept
Checks if the given matrix is a square matrix.
Definition: Matrix.h:908
Header file for the IsResizable type trait.
System settings for the inline keywords.
Header file for the Size type trait.
#define BLAZE_INTERNAL_ASSERT(expr, msg)
Run time assertion macro for internal checks.In case of an invalid run time expression, the program execution is terminated. The BLAZE_INTERNAL_ASSERT macro can be disabled by setting the BLAZE_USER_ASSERTION flag to zero or by defining NDEBUG during the compilation.
Definition: Assert.h:101
Header file for the TrueType type/value trait base class.