Blaze  3.6
Dense.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_ADAPTORS_UPPERMATRIX_DENSE_H_
36 #define _BLAZE_MATH_ADAPTORS_UPPERMATRIX_DENSE_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
43 #include <iterator>
44 #include <utility>
48 #include <blaze/math/Aliases.h>
63 #include <blaze/math/Exception.h>
66 #include <blaze/math/shims/Clear.h>
75 #include <blaze/system/Inline.h>
76 #include <blaze/util/Assert.h>
82 #include <blaze/util/DisableIf.h>
83 #include <blaze/util/EnableIf.h>
85 #include <blaze/util/MaybeUnused.h>
87 #include <blaze/util/Types.h>
89 
90 
91 namespace blaze {
92 
93 //=================================================================================================
94 //
95 // CLASS TEMPLATE SPECIALIZATION FOR DENSE MATRICES
96 //
97 //=================================================================================================
98 
99 //*************************************************************************************************
107 template< typename MT // Type of the adapted dense matrix
108  , bool SO > // Storage order of the adapted dense matrix
109 class UpperMatrix<MT,SO,true>
110  : public DenseMatrix< UpperMatrix<MT,SO,true>, SO >
111 {
112  private:
113  //**Type definitions****************************************************************************
114  using OT = OppositeType_t<MT>;
115  using TT = TransposeType_t<MT>;
116  using ET = ElementType_t<MT>;
117  //**********************************************************************************************
118 
119  public:
120  //**Type definitions****************************************************************************
121  using This = UpperMatrix<MT,SO,true>;
122  using BaseType = DenseMatrix<This,SO>;
123  using ResultType = This;
124  using OppositeType = UpperMatrix<OT,!SO,true>;
125  using TransposeType = LowerMatrix<TT,!SO,true>;
126  using ElementType = ET;
127  using SIMDType = SIMDType_t<MT>;
128  using ReturnType = ReturnType_t<MT>;
129  using CompositeType = const This&;
130  using Reference = UpperProxy<MT>;
131  using ConstReference = ConstReference_t<MT>;
132  using Pointer = Pointer_t<MT>;
133  using ConstPointer = ConstPointer_t<MT>;
134  using ConstIterator = ConstIterator_t<MT>;
135  //**********************************************************************************************
136 
137  //**Rebind struct definition********************************************************************
140  template< typename NewType > // Data type of the other matrix
141  struct Rebind {
143  using Other = UpperMatrix< typename MT::template Rebind<NewType>::Other >;
144  };
145  //**********************************************************************************************
146 
147  //**Resize struct definition********************************************************************
150  template< size_t NewM // Number of rows of the other matrix
151  , size_t NewN > // Number of columns of the other matrix
152  struct Resize {
154  using Other = UpperMatrix< typename MT::template Resize<NewM,NewN>::Other >;
155  };
156  //**********************************************************************************************
157 
158  //**Iterator class definition*******************************************************************
161  class Iterator
162  {
163  public:
164  //**Type definitions*************************************************************************
165  using IteratorCategory = std::random_access_iterator_tag;
166  using ValueType = ElementType_t<MT>;
167  using PointerType = UpperProxy<MT>;
168  using ReferenceType = UpperProxy<MT>;
169  using DifferenceType = ptrdiff_t;
170 
171  // STL iterator requirements
172  using iterator_category = IteratorCategory;
173  using value_type = ValueType;
174  using pointer = PointerType;
175  using reference = ReferenceType;
176  using difference_type = DifferenceType;
177  //*******************************************************************************************
178 
179  //**Constructor******************************************************************************
182  inline Iterator() noexcept
183  : matrix_( nullptr ) // Reference to the adapted dense matrix
184  , row_ ( 0UL ) // The current row index of the iterator
185  , column_( 0UL ) // The current column index of the iterator
186  {}
187  //*******************************************************************************************
188 
189  //**Constructor******************************************************************************
196  inline Iterator( MT& matrix, size_t row, size_t column ) noexcept
197  : matrix_( &matrix ) // Reference to the adapted dense matrix
198  , row_ ( row ) // The current row-index of the iterator
199  , column_( column ) // The current column-index of the iterator
200  {}
201  //*******************************************************************************************
202 
203  //**Addition assignment operator*************************************************************
209  inline Iterator& operator+=( size_t inc ) noexcept {
210  ( SO )?( row_ += inc ):( column_ += inc );
211  return *this;
212  }
213  //*******************************************************************************************
214 
215  //**Subtraction assignment operator**********************************************************
221  inline Iterator& operator-=( size_t dec ) noexcept {
222  ( SO )?( row_ -= dec ):( column_ -= dec );
223  return *this;
224  }
225  //*******************************************************************************************
226 
227  //**Prefix increment operator****************************************************************
232  inline Iterator& operator++() noexcept {
233  ( SO )?( ++row_ ):( ++column_ );
234  return *this;
235  }
236  //*******************************************************************************************
237 
238  //**Postfix increment operator***************************************************************
243  inline const Iterator operator++( int ) noexcept {
244  const Iterator tmp( *this );
245  ++(*this);
246  return tmp;
247  }
248  //*******************************************************************************************
249 
250  //**Prefix decrement operator****************************************************************
255  inline Iterator& operator--() noexcept {
256  ( SO )?( --row_ ):( --column_ );
257  return *this;
258  }
259  //*******************************************************************************************
260 
261  //**Postfix decrement operator***************************************************************
266  inline const Iterator operator--( int ) noexcept {
267  const Iterator tmp( *this );
268  --(*this);
269  return tmp;
270  }
271  //*******************************************************************************************
272 
273  //**Element access operator******************************************************************
278  inline ReferenceType operator*() const {
279  return ReferenceType( *matrix_, row_, column_ );
280  }
281  //*******************************************************************************************
282 
283  //**Element access operator******************************************************************
288  inline PointerType operator->() const {
289  return PointerType( *matrix_, row_, column_ );
290  }
291  //*******************************************************************************************
292 
293  //**Load function****************************************************************************
303  inline SIMDType load() const {
304  return (*matrix_).load(row_,column_);
305  }
306  //*******************************************************************************************
307 
308  //**Loada function***************************************************************************
318  inline SIMDType loada() const {
319  return (*matrix_).loada(row_,column_);
320  }
321  //*******************************************************************************************
322 
323  //**Loadu function***************************************************************************
333  inline SIMDType loadu() const {
334  return (*matrix_).loadu(row_,column_);
335  }
336  //*******************************************************************************************
337 
338  //**Conversion operator**********************************************************************
343  inline operator ConstIterator() const {
344  if( SO )
345  return matrix_->begin( column_ ) + row_;
346  else
347  return matrix_->begin( row_ ) + column_;
348  }
349  //*******************************************************************************************
350 
351  //**Equality operator************************************************************************
358  friend inline bool operator==( const Iterator& lhs, const Iterator& rhs ) noexcept {
359  return ( SO )?( lhs.row_ == rhs.row_ ):( lhs.column_ == rhs.column_ );
360  }
361  //*******************************************************************************************
362 
363  //**Equality operator************************************************************************
370  friend inline bool operator==( const Iterator& lhs, const ConstIterator& rhs ) {
371  return ( ConstIterator( lhs ) == rhs );
372  }
373  //*******************************************************************************************
374 
375  //**Equality operator************************************************************************
382  friend inline bool operator==( const ConstIterator& lhs, const Iterator& rhs ) {
383  return ( lhs == ConstIterator( rhs ) );
384  }
385  //*******************************************************************************************
386 
387  //**Inequality operator**********************************************************************
394  friend inline bool operator!=( const Iterator& lhs, const Iterator& rhs ) noexcept {
395  return ( SO )?( lhs.row_ != rhs.row_ ):( lhs.column_ != rhs.column_ );
396  }
397  //*******************************************************************************************
398 
399  //**Inequality operator**********************************************************************
406  friend inline bool operator!=( const Iterator& lhs, const ConstIterator& rhs ) {
407  return ( ConstIterator( lhs ) != rhs );
408  }
409  //*******************************************************************************************
410 
411  //**Inequality operator**********************************************************************
418  friend inline bool operator!=( const ConstIterator& lhs, const Iterator& rhs ) {
419  return ( lhs != ConstIterator( rhs ) );
420  }
421  //*******************************************************************************************
422 
423  //**Less-than operator***********************************************************************
430  friend inline bool operator<( const Iterator& lhs, const Iterator& rhs ) noexcept {
431  return ( SO )?( lhs.row_ < rhs.row_ ):( lhs.column_ < rhs.column_ );
432  }
433  //*******************************************************************************************
434 
435  //**Less-than operator***********************************************************************
442  friend inline bool operator<( const Iterator& lhs, const ConstIterator& rhs ) {
443  return ( ConstIterator( lhs ) < rhs );
444  }
445  //*******************************************************************************************
446 
447  //**Less-than operator***********************************************************************
454  friend inline bool operator<( const ConstIterator& lhs, const Iterator& rhs ) {
455  return ( lhs < ConstIterator( rhs ) );
456  }
457  //*******************************************************************************************
458 
459  //**Greater-than operator********************************************************************
466  friend inline bool operator>( const Iterator& lhs, const Iterator& rhs ) noexcept {
467  return ( SO )?( lhs.row_ > rhs.row_ ):( lhs.column_ > rhs.column_ );
468  }
469  //*******************************************************************************************
470 
471  //**Greater-than operator********************************************************************
478  friend inline bool operator>( const Iterator& lhs, const ConstIterator& rhs ) {
479  return ( ConstIterator( lhs ) > rhs );
480  }
481  //*******************************************************************************************
482 
483  //**Greater-than operator********************************************************************
490  friend inline bool operator>( const ConstIterator& lhs, const Iterator& rhs ) {
491  return ( lhs > ConstIterator( rhs ) );
492  }
493  //*******************************************************************************************
494 
495  //**Less-or-equal-than operator**************************************************************
502  friend inline bool operator<=( const Iterator& lhs, const Iterator& rhs ) noexcept {
503  return ( SO )?( lhs.row_ <= rhs.row_ ):( lhs.column_ <= rhs.column_ );
504  }
505  //*******************************************************************************************
506 
507  //**Less-or-equal-than operator**************************************************************
514  friend inline bool operator<=( const Iterator& lhs, const ConstIterator& rhs ) {
515  return ( ConstIterator( lhs ) <= rhs );
516  }
517  //*******************************************************************************************
518 
519  //**Less-or-equal-than operator**************************************************************
526  friend inline bool operator<=( const ConstIterator& lhs, const Iterator& rhs ) {
527  return ( lhs <= ConstIterator( rhs ) );
528  }
529  //*******************************************************************************************
530 
531  //**Greater-or-equal-than operator***********************************************************
538  friend inline bool operator>=( const Iterator& lhs, const Iterator& rhs ) noexcept {
539  return ( SO )?( lhs.row_ >= rhs.row_ ):( lhs.column_ >= rhs.column_ );
540  }
541  //*******************************************************************************************
542 
543  //**Greater-or-equal-than operator***********************************************************
550  friend inline bool operator>=( const Iterator& lhs, const ConstIterator& rhs ) {
551  return ( ConstIterator( lhs ) >= rhs );
552  }
553  //*******************************************************************************************
554 
555  //**Greater-or-equal-than operator***********************************************************
562  friend inline bool operator>=( const ConstIterator& lhs, const Iterator& rhs ) {
563  return ( lhs >= ConstIterator( rhs ) );
564  }
565  //*******************************************************************************************
566 
567  //**Subtraction operator*********************************************************************
573  inline DifferenceType operator-( const Iterator& rhs ) const noexcept {
574  return ( SO )?( row_ - rhs.row_ ):( column_ - rhs.column_ );
575  }
576  //*******************************************************************************************
577 
578  //**Addition operator************************************************************************
585  friend inline const Iterator operator+( const Iterator& it, size_t inc ) noexcept {
586  if( SO )
587  return Iterator( *it.matrix_, it.row_ + inc, it.column_ );
588  else
589  return Iterator( *it.matrix_, it.row_, it.column_ + inc );
590  }
591  //*******************************************************************************************
592 
593  //**Addition operator************************************************************************
600  friend inline const Iterator operator+( size_t inc, const Iterator& it ) noexcept {
601  if( SO )
602  return Iterator( *it.matrix_, it.row_ + inc, it.column_ );
603  else
604  return Iterator( *it.matrix_, it.row_, it.column_ + inc );
605  }
606  //*******************************************************************************************
607 
608  //**Subtraction operator*********************************************************************
615  friend inline const Iterator operator-( const Iterator& it, size_t dec ) noexcept {
616  if( SO )
617  return Iterator( *it.matrix_, it.row_ - dec, it.column_ );
618  else
619  return Iterator( *it.matrix_, it.row_, it.column_ - dec );
620  }
621  //*******************************************************************************************
622 
623  private:
624  //**Member variables*************************************************************************
625  MT* matrix_;
626  size_t row_;
627  size_t column_;
628  //*******************************************************************************************
629  };
630  //**********************************************************************************************
631 
632  //**Compilation flags***************************************************************************
634  static constexpr bool simdEnabled = MT::simdEnabled;
635 
637  static constexpr bool smpAssignable = MT::smpAssignable;
638  //**********************************************************************************************
639 
640  //**Constructors********************************************************************************
643  explicit inline UpperMatrix();
644  template< typename A1 > explicit inline UpperMatrix( const A1& a1 );
645  explicit inline UpperMatrix( size_t n, const ElementType& init );
646 
647  inline UpperMatrix( initializer_list< initializer_list<ElementType> > list );
648 
649  template< typename Other >
650  explicit inline UpperMatrix( size_t n, const Other* array );
651 
652  template< typename Other, size_t N >
653  explicit inline UpperMatrix( const Other (&array)[N][N] );
654 
655  explicit inline UpperMatrix( ElementType* ptr, size_t n );
656  explicit inline UpperMatrix( ElementType* ptr, size_t n, size_t nn );
657 
658  inline UpperMatrix( const UpperMatrix& m );
659  inline UpperMatrix( UpperMatrix&& m ) noexcept;
661  //**********************************************************************************************
662 
663  //**Destructor**********************************************************************************
666  ~UpperMatrix() = default;
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 UpperMatrix& operator=( const ElementType& rhs );
692  inline UpperMatrix& operator=( initializer_list< initializer_list<ElementType> > list );
693 
694  template< typename Other, size_t N >
695  inline UpperMatrix& operator=( const Other (&array)[N][N] );
696 
697  inline UpperMatrix& operator=( const UpperMatrix& rhs );
698  inline UpperMatrix& operator=( UpperMatrix&& rhs ) noexcept;
699 
700  template< typename MT2, bool SO2 >
701  inline auto operator=( const Matrix<MT2,SO2>& rhs )
702  -> DisableIf_t< IsComputation_v<MT2>, UpperMatrix& >;
703 
704  template< typename MT2, bool SO2 >
705  inline auto operator=( const Matrix<MT2,SO2>& rhs )
706  -> EnableIf_t< IsComputation_v<MT2>, UpperMatrix& >;
707 
708  template< typename MT2, bool SO2 >
709  inline auto operator+=( const Matrix<MT2,SO2>& rhs )
710  -> DisableIf_t< IsComputation_v<MT2>, UpperMatrix& >;
711 
712  template< typename MT2, bool SO2 >
713  inline auto operator+=( const Matrix<MT2,SO2>& rhs )
714  -> EnableIf_t< IsComputation_v<MT2>, UpperMatrix& >;
715 
716  template< typename MT2, bool SO2 >
717  inline auto operator-=( const Matrix<MT2,SO2>& rhs )
718  -> DisableIf_t< IsComputation_v<MT2>, UpperMatrix& >;
719 
720  template< typename MT2, bool SO2 >
721  inline auto operator-=( const Matrix<MT2,SO2>& rhs )
722  -> EnableIf_t< IsComputation_v<MT2>, UpperMatrix& >;
723 
724  template< typename MT2, bool SO2 >
725  inline auto operator%=( const Matrix<MT2,SO2>& rhs ) -> UpperMatrix&;
726 
727  template< typename ST >
728  inline auto operator*=( ST rhs ) -> EnableIf_t< IsNumeric_v<ST>, UpperMatrix& >;
729 
730  template< typename ST >
731  inline auto operator/=( ST rhs ) -> EnableIf_t< IsNumeric_v<ST>, UpperMatrix& >;
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 shrinkToFit();
752  inline void swap( UpperMatrix& m ) noexcept;
753 
754  static inline constexpr size_t maxNonZeros() noexcept;
755  static inline constexpr size_t maxNonZeros( size_t n ) noexcept;
757  //**********************************************************************************************
758 
759  //**Numeric functions***************************************************************************
762  template< typename Other > inline UpperMatrix& scale( const Other& scalar );
764  //**********************************************************************************************
765 
766  //**Debugging functions*************************************************************************
769  inline bool isIntact() const noexcept;
771  //**********************************************************************************************
772 
773  //**Expression template evaluation functions****************************************************
776  template< typename Other > inline bool canAlias ( const Other* alias ) const noexcept;
777  template< typename Other > inline bool isAliased( const Other* alias ) const noexcept;
778 
779  inline bool isAligned () const noexcept;
780  inline bool canSMPAssign() const noexcept;
781 
782  BLAZE_ALWAYS_INLINE SIMDType load ( size_t i, size_t j ) const noexcept;
783  BLAZE_ALWAYS_INLINE SIMDType loada( size_t i, size_t j ) const noexcept;
784  BLAZE_ALWAYS_INLINE SIMDType loadu( size_t i, size_t j ) const noexcept;
786  //**********************************************************************************************
787 
788  private:
789  //**Construction functions**********************************************************************
792  inline const MT construct( size_t n , TrueType );
793  inline const MT construct( const ElementType& value, FalseType );
794 
795  template< typename MT2, bool SO2, typename T >
796  inline const MT construct( const Matrix<MT2,SO2>& m, T );
798  //**********************************************************************************************
799 
800  //**Member variables****************************************************************************
803  MT matrix_;
804 
805  //**********************************************************************************************
806 
807  //**Friend declarations*************************************************************************
808  template< bool RF, typename MT2, bool SO2, bool DF2 >
809  friend bool isDefault( const UpperMatrix<MT2,SO2,DF2>& m );
810 
811  template< typename MT2, bool SO2, bool DF2 >
812  friend MT2& derestrict( UpperMatrix<MT2,SO2,DF2>& m );
813  //**********************************************************************************************
814 
815  //**Compile time checks*************************************************************************
830  BLAZE_STATIC_ASSERT( ( Size_v<MT,0UL> == Size_v<MT,1UL> ) );
831  //**********************************************************************************************
832 };
834 //*************************************************************************************************
835 
836 
837 
838 
839 //=================================================================================================
840 //
841 // CONSTRUCTORS
842 //
843 //=================================================================================================
844 
845 //*************************************************************************************************
849 template< typename MT // Type of the adapted dense matrix
850  , bool SO > // Storage order of the adapted dense matrix
851 inline UpperMatrix<MT,SO,true>::UpperMatrix()
852  : matrix_() // The adapted dense matrix
853 {
854  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square upper matrix detected" );
855  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
856 }
858 //*************************************************************************************************
859 
860 
861 //*************************************************************************************************
879 template< typename MT // Type of the adapted dense matrix
880  , bool SO > // Storage order of the adapted dense matrix
881 template< typename A1 > // Type of the constructor argument
882 inline UpperMatrix<MT,SO,true>::UpperMatrix( const A1& a1 )
883  : matrix_( construct( a1, typename IsResizable<MT>::Type() ) ) // The adapted dense matrix
884 {
885  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square upper matrix detected" );
886  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
887 }
889 //*************************************************************************************************
890 
891 
892 //*************************************************************************************************
899 template< typename MT // Type of the adapted dense matrix
900  , bool SO > // Storage order of the adapted dense matrix
901 inline UpperMatrix<MT,SO,true>::UpperMatrix( size_t n, const ElementType& init )
902  : matrix_( n, n, ElementType() ) // The adapted dense matrix
903 {
905 
906  if( SO ) {
907  for( size_t j=0UL; j<columns(); ++j )
908  for( size_t i=0UL; i<=j; ++i )
909  matrix_(i,j) = init;
910  }
911  else {
912  for( size_t i=0UL; i<rows(); ++i )
913  for( size_t j=i; j<columns(); ++j )
914  matrix_(i,j) = init;
915  }
916 
917  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square upper matrix detected" );
918  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
919 }
921 //*************************************************************************************************
922 
923 
924 //*************************************************************************************************
948 template< typename MT // Type of the adapted dense matrix
949  , bool SO > // Storage order of the adapted dense matrix
950 inline UpperMatrix<MT,SO,true>::UpperMatrix( initializer_list< initializer_list<ElementType> > list )
951  : matrix_( list ) // The adapted dense matrix
952 {
953  if( !isUpper( matrix_ ) ) {
954  BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of upper matrix" );
955  }
956 
957  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
958 }
960 //*************************************************************************************************
961 
962 
963 //*************************************************************************************************
989 template< typename MT // Type of the adapted dense matrix
990  , bool SO > // Storage order of the adapted dense matrix
991 template< typename Other > // Data type of the initialization array
992 inline UpperMatrix<MT,SO,true>::UpperMatrix( size_t n, const Other* array )
993  : matrix_( n, n, array ) // The adapted dense matrix
994 {
995  if( !isUpper( matrix_ ) ) {
996  BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of upper matrix" );
997  }
998 
999  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1000 }
1002 //*************************************************************************************************
1003 
1004 
1005 //*************************************************************************************************
1028 template< typename MT // Type of the adapted dense matrix
1029  , bool SO > // Storage order of the adapted dense matrix
1030 template< typename Other // Data type of the initialization array
1031  , size_t N > // Number of rows and columns of the initialization array
1032 inline UpperMatrix<MT,SO,true>::UpperMatrix( const Other (&array)[N][N] )
1033  : matrix_( array ) // The adapted dense matrix
1034 {
1035  if( !isUpper( matrix_ ) ) {
1036  BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of upper matrix" );
1037  }
1038 
1039  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1040 }
1042 //*************************************************************************************************
1043 
1044 
1045 //*************************************************************************************************
1077 template< typename MT // Type of the adapted dense matrix
1078  , bool SO > // Storage order of the adapted dense matrix
1079 inline UpperMatrix<MT,SO,true>::UpperMatrix( ElementType* ptr, size_t n )
1080  : matrix_( ptr, n, n ) // The adapted dense matrix
1081 {
1082  if( !isUpper( matrix_ ) ) {
1083  BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of upper matrix" );
1084  }
1085 
1086  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1087 }
1089 //*************************************************************************************************
1090 
1091 
1092 //*************************************************************************************************
1126 template< typename MT // Type of the adapted dense matrix
1127  , bool SO > // Storage order of the adapted dense matrix
1128 inline UpperMatrix<MT,SO,true>::UpperMatrix( ElementType* ptr, size_t n, size_t nn )
1129  : matrix_( ptr, n, n, nn ) // The adapted dense matrix
1130 {
1131  if( !isUpper( matrix_ ) ) {
1132  BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of upper matrix" );
1133  }
1134 
1135  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1136 }
1138 //*************************************************************************************************
1139 
1140 
1141 //*************************************************************************************************
1147 template< typename MT // Type of the adapted dense matrix
1148  , bool SO > // Storage order of the adapted dense matrix
1149 inline UpperMatrix<MT,SO,true>::UpperMatrix( const UpperMatrix& m )
1150  : matrix_( m.matrix_ ) // The adapted dense matrix
1151 {
1152  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square upper matrix detected" );
1153  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1154 }
1156 //*************************************************************************************************
1157 
1158 
1159 //*************************************************************************************************
1165 template< typename MT // Type of the adapted dense matrix
1166  , bool SO > // Storage order of the adapted dense matrix
1167 inline UpperMatrix<MT,SO,true>::UpperMatrix( UpperMatrix&& m ) noexcept
1168  : matrix_( std::move( m.matrix_ ) ) // The adapted dense matrix
1169 {
1170  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square upper matrix detected" );
1171  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1172 }
1174 //*************************************************************************************************
1175 
1176 
1177 
1178 
1179 //=================================================================================================
1180 //
1181 // DATA ACCESS FUNCTIONS
1182 //
1183 //=================================================================================================
1184 
1185 //*************************************************************************************************
1201 template< typename MT // Type of the adapted dense matrix
1202  , bool SO > // Storage order of the adapted dense matrix
1203 inline typename UpperMatrix<MT,SO,true>::Reference
1204  UpperMatrix<MT,SO,true>::operator()( size_t i, size_t j )
1205 {
1206  BLAZE_USER_ASSERT( i<rows() , "Invalid row access index" );
1207  BLAZE_USER_ASSERT( j<columns(), "Invalid column access index" );
1208 
1209  return Reference( matrix_, i, j );
1210 }
1212 //*************************************************************************************************
1213 
1214 
1215 //*************************************************************************************************
1231 template< typename MT // Type of the adapted dense matrix
1232  , bool SO > // Storage order of the adapted dense matrix
1233 inline typename UpperMatrix<MT,SO,true>::ConstReference
1234  UpperMatrix<MT,SO,true>::operator()( size_t i, size_t j ) const
1235 {
1236  BLAZE_USER_ASSERT( i<rows() , "Invalid row access index" );
1237  BLAZE_USER_ASSERT( j<columns(), "Invalid column access index" );
1238 
1239  return matrix_(i,j);
1240 }
1242 //*************************************************************************************************
1243 
1244 
1245 //*************************************************************************************************
1262 template< typename MT // Type of the adapted dense matrix
1263  , bool SO > // Storage order of the adapted dense matrix
1264 inline typename UpperMatrix<MT,SO,true>::Reference
1265  UpperMatrix<MT,SO,true>::at( size_t i, size_t j )
1266 {
1267  if( i >= rows() ) {
1268  BLAZE_THROW_OUT_OF_RANGE( "Invalid row access index" );
1269  }
1270  if( j >= columns() ) {
1271  BLAZE_THROW_OUT_OF_RANGE( "Invalid column access index" );
1272  }
1273  return (*this)(i,j);
1274 }
1276 //*************************************************************************************************
1277 
1278 
1279 //*************************************************************************************************
1296 template< typename MT // Type of the adapted dense matrix
1297  , bool SO > // Storage order of the adapted dense matrix
1298 inline typename UpperMatrix<MT,SO,true>::ConstReference
1299  UpperMatrix<MT,SO,true>::at( size_t i, size_t j ) const
1300 {
1301  if( i >= rows() ) {
1302  BLAZE_THROW_OUT_OF_RANGE( "Invalid row access index" );
1303  }
1304  if( j >= columns() ) {
1305  BLAZE_THROW_OUT_OF_RANGE( "Invalid column access index" );
1306  }
1307  return (*this)(i,j);
1308 }
1310 //*************************************************************************************************
1311 
1312 
1313 //*************************************************************************************************
1326 template< typename MT // Type of the adapted dense matrix
1327  , bool SO > // Storage order of the adapted dense matrix
1328 inline typename UpperMatrix<MT,SO,true>::ConstPointer
1329  UpperMatrix<MT,SO,true>::data() const noexcept
1330 {
1331  return matrix_.data();
1332 }
1334 //*************************************************************************************************
1335 
1336 
1337 //*************************************************************************************************
1346 template< typename MT // Type of the adapted dense matrix
1347  , bool SO > // Storage order of the adapted dense matrix
1348 inline typename UpperMatrix<MT,SO,true>::ConstPointer
1349  UpperMatrix<MT,SO,true>::data( size_t i ) const noexcept
1350 {
1351  return matrix_.data(i);
1352 }
1354 //*************************************************************************************************
1355 
1356 
1357 //*************************************************************************************************
1369 template< typename MT // Type of the adapted dense matrix
1370  , bool SO > // Storage order of the adapted dense matrix
1371 inline typename UpperMatrix<MT,SO,true>::Iterator
1372  UpperMatrix<MT,SO,true>::begin( size_t i )
1373 {
1374  if( SO )
1375  return Iterator( matrix_, 0UL, i );
1376  else
1377  return Iterator( matrix_, i, 0UL );
1378 }
1380 //*************************************************************************************************
1381 
1382 
1383 //*************************************************************************************************
1395 template< typename MT // Type of the adapted dense matrix
1396  , bool SO > // Storage order of the adapted dense matrix
1397 inline typename UpperMatrix<MT,SO,true>::ConstIterator
1398  UpperMatrix<MT,SO,true>::begin( size_t i ) const
1399 {
1400  return matrix_.begin(i);
1401 }
1403 //*************************************************************************************************
1404 
1405 
1406 //*************************************************************************************************
1418 template< typename MT // Type of the adapted dense matrix
1419  , bool SO > // Storage order of the adapted dense matrix
1420 inline typename UpperMatrix<MT,SO,true>::ConstIterator
1421  UpperMatrix<MT,SO,true>::cbegin( size_t i ) const
1422 {
1423  return matrix_.cbegin(i);
1424 }
1426 //*************************************************************************************************
1427 
1428 
1429 //*************************************************************************************************
1441 template< typename MT // Type of the adapted dense matrix
1442  , bool SO > // Storage order of the adapted dense matrix
1443 inline typename UpperMatrix<MT,SO,true>::Iterator
1444  UpperMatrix<MT,SO,true>::end( size_t i )
1445 {
1446  if( SO )
1447  return Iterator( matrix_, rows(), i );
1448  else
1449  return Iterator( matrix_, i, columns() );
1450 }
1452 //*************************************************************************************************
1453 
1454 
1455 //*************************************************************************************************
1467 template< typename MT // Type of the adapted dense matrix
1468  , bool SO > // Storage order of the adapted dense matrix
1469 inline typename UpperMatrix<MT,SO,true>::ConstIterator
1470  UpperMatrix<MT,SO,true>::end( size_t i ) const
1471 {
1472  return matrix_.end(i);
1473 }
1475 //*************************************************************************************************
1476 
1477 
1478 //*************************************************************************************************
1490 template< typename MT // Type of the adapted dense matrix
1491  , bool SO > // Storage order of the adapted dense matrix
1492 inline typename UpperMatrix<MT,SO,true>::ConstIterator
1493  UpperMatrix<MT,SO,true>::cend( size_t i ) const
1494 {
1495  return matrix_.cend(i);
1496 }
1498 //*************************************************************************************************
1499 
1500 
1501 
1502 
1503 //=================================================================================================
1504 //
1505 // ASSIGNMENT OPERATORS
1506 //
1507 //=================================================================================================
1508 
1509 //*************************************************************************************************
1516 template< typename MT // Type of the adapted dense matrix
1517  , bool SO > // Storage order of the adapted dense matrix
1518 inline UpperMatrix<MT,SO,true>&
1519  UpperMatrix<MT,SO,true>::operator=( const ElementType& rhs )
1520 {
1521  if( SO ) {
1522  for( size_t j=0UL; j<columns(); ++j )
1523  for( size_t i=0UL; i<=j; ++i )
1524  matrix_(i,j) = rhs;
1525  }
1526  else {
1527  for( size_t i=0UL; i<rows(); ++i )
1528  for( size_t j=i; j<columns(); ++j )
1529  matrix_(i,j) = rhs;
1530  }
1531 
1532  return *this;
1533 }
1535 //*************************************************************************************************
1536 
1537 
1538 //*************************************************************************************************
1563 template< typename MT // Type of the adapted dense matrix
1564  , bool SO > // Storage order of the adapted dense matrix
1565 inline UpperMatrix<MT,SO,true>&
1566  UpperMatrix<MT,SO,true>::operator=( initializer_list< initializer_list<ElementType> > list )
1567 {
1568  const InitializerMatrix<ElementType> tmp( list, list.size() );
1569 
1570  if( !isUpper( tmp ) ) {
1571  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to upper matrix" );
1572  }
1573 
1574  matrix_ = list;
1575 
1576  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square upper matrix detected" );
1577  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1578 
1579  return *this;
1580 }
1582 //*************************************************************************************************
1583 
1584 
1585 //*************************************************************************************************
1609 template< typename MT // Type of the adapted dense matrix
1610  , bool SO > // Storage order of the adapted dense matrix
1611 template< typename Other // Data type of the initialization array
1612  , size_t N > // Number of rows and columns of the initialization array
1613 inline UpperMatrix<MT,SO,true>&
1614  UpperMatrix<MT,SO,true>::operator=( const Other (&array)[N][N] )
1615 {
1616  MT tmp( array );
1617 
1618  if( !isUpper( tmp ) ) {
1619  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to upper matrix" );
1620  }
1621 
1622  matrix_ = std::move( tmp );
1623 
1624  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square upper matrix detected" );
1625  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1626 
1627  return *this;
1628 }
1630 //*************************************************************************************************
1631 
1632 
1633 //*************************************************************************************************
1643 template< typename MT // Type of the adapted dense matrix
1644  , bool SO > // Storage order of the adapted dense matrix
1645 inline UpperMatrix<MT,SO,true>&
1646  UpperMatrix<MT,SO,true>::operator=( const UpperMatrix& rhs )
1647 {
1648  matrix_ = rhs.matrix_;
1649 
1650  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square upper matrix detected" );
1651  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1652 
1653  return *this;
1654 }
1656 //*************************************************************************************************
1657 
1658 
1659 //*************************************************************************************************
1666 template< typename MT // Type of the adapted dense matrix
1667  , bool SO > // Storage order of the adapted dense matrix
1668 inline UpperMatrix<MT,SO,true>&
1669  UpperMatrix<MT,SO,true>::operator=( UpperMatrix&& rhs ) noexcept
1670 {
1671  matrix_ = std::move( rhs.matrix_ );
1672 
1673  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square upper matrix detected" );
1674  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1675 
1676  return *this;
1677 }
1679 //*************************************************************************************************
1680 
1681 
1682 //*************************************************************************************************
1695 template< typename MT // Type of the adapted dense matrix
1696  , bool SO > // Storage order of the adapted dense matrix
1697 template< typename MT2 // Type of the right-hand side matrix
1698  , bool SO2 > // Storage order of the right-hand side matrix
1699 inline auto UpperMatrix<MT,SO,true>::operator=( const Matrix<MT2,SO2>& rhs )
1700  -> DisableIf_t< IsComputation_v<MT2>, UpperMatrix& >
1701 {
1702  if( !IsUpper_v<MT2> && !isUpper( ~rhs ) ) {
1703  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to upper matrix" );
1704  }
1705 
1706  matrix_ = declupp( ~rhs );
1707 
1708  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square upper matrix detected" );
1709  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1710 
1711  return *this;
1712 }
1714 //*************************************************************************************************
1715 
1716 
1717 //*************************************************************************************************
1730 template< typename MT // Type of the adapted dense matrix
1731  , bool SO > // Storage order of the adapted dense matrix
1732 template< typename MT2 // Type of the right-hand side matrix
1733  , bool SO2 > // Storage order of the right-hand side matrix
1734 inline auto UpperMatrix<MT,SO,true>::operator=( const Matrix<MT2,SO2>& rhs )
1735  -> EnableIf_t< IsComputation_v<MT2>, UpperMatrix& >
1736 {
1737  if( !IsSquare_v<MT2> && !isSquare( ~rhs ) ) {
1738  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to upper matrix" );
1739  }
1740 
1741  if( IsUpper_v<MT2> ) {
1742  matrix_ = ~rhs;
1743  }
1744  else {
1745  MT tmp( ~rhs );
1746 
1747  if( !isUpper( tmp ) ) {
1748  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to upper matrix" );
1749  }
1750 
1751  matrix_ = std::move( tmp );
1752  }
1753 
1754  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square upper matrix detected" );
1755  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1756 
1757  return *this;
1758 }
1760 //*************************************************************************************************
1761 
1762 
1763 //*************************************************************************************************
1776 template< typename MT // Type of the adapted dense matrix
1777  , bool SO > // Storage order of the adapted dense matrix
1778 template< typename MT2 // Type of the right-hand side matrix
1779  , bool SO2 > // Storage order of the right-hand side matrix
1780 inline auto UpperMatrix<MT,SO,true>::operator+=( const Matrix<MT2,SO2>& rhs )
1781  -> DisableIf_t< IsComputation_v<MT2>, UpperMatrix& >
1782 {
1783  if( !IsUpper_v<MT2> && !isUpper( ~rhs ) ) {
1784  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to upper matrix" );
1785  }
1786 
1787  matrix_ += declupp( ~rhs );
1788 
1789  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square upper matrix detected" );
1790  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1791 
1792  return *this;
1793 }
1795 //*************************************************************************************************
1796 
1797 
1798 //*************************************************************************************************
1811 template< typename MT // Type of the adapted dense matrix
1812  , bool SO > // Storage order of the adapted dense matrix
1813 template< typename MT2 // Type of the right-hand side matrix
1814  , bool SO2 > // Storage order of the right-hand side matrix
1815 inline auto UpperMatrix<MT,SO,true>::operator+=( const Matrix<MT2,SO2>& rhs )
1816  -> EnableIf_t< IsComputation_v<MT2>, UpperMatrix& >
1817 {
1818  if( !IsSquare_v<MT2> && !isSquare( ~rhs ) ) {
1819  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to upper matrix" );
1820  }
1821 
1822  if( IsUpper_v<MT2> ) {
1823  matrix_ += ~rhs;
1824  }
1825  else {
1826  const ResultType_t<MT2> tmp( ~rhs );
1827 
1828  if( !isUpper( tmp ) ) {
1829  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to upper matrix" );
1830  }
1831 
1832  matrix_ += declupp( tmp );
1833  }
1834 
1835  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square upper matrix detected" );
1836  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1837 
1838  return *this;
1839 }
1841 //*************************************************************************************************
1842 
1843 
1844 //*************************************************************************************************
1857 template< typename MT // Type of the adapted dense matrix
1858  , bool SO > // Storage order of the adapted dense matrix
1859 template< typename MT2 // Type of the right-hand side matrix
1860  , bool SO2 > // Storage order of the right-hand side matrix
1861 inline auto UpperMatrix<MT,SO,true>::operator-=( const Matrix<MT2,SO2>& rhs )
1862  -> DisableIf_t< IsComputation_v<MT2>, UpperMatrix& >
1863 {
1864  if( !IsUpper_v<MT2> && !isUpper( ~rhs ) ) {
1865  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to upper matrix" );
1866  }
1867 
1868  matrix_ -= declupp( ~rhs );
1869 
1870  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square upper matrix detected" );
1871  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1872 
1873  return *this;
1874 }
1876 //*************************************************************************************************
1877 
1878 
1879 //*************************************************************************************************
1892 template< typename MT // Type of the adapted dense matrix
1893  , bool SO > // Storage order of the adapted dense matrix
1894 template< typename MT2 // Type of the right-hand side matrix
1895  , bool SO2 > // Storage order of the right-hand side matrix
1896 inline auto UpperMatrix<MT,SO,true>::operator-=( const Matrix<MT2,SO2>& rhs )
1897  -> EnableIf_t< IsComputation_v<MT2>, UpperMatrix& >
1898 {
1899  if( !IsSquare_v<MT2> && !isSquare( ~rhs ) ) {
1900  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to upper matrix" );
1901  }
1902 
1903  if( IsUpper_v<MT2> ) {
1904  matrix_ -= ~rhs;
1905  }
1906  else {
1907  const ResultType_t<MT2> tmp( ~rhs );
1908 
1909  if( !isUpper( tmp ) ) {
1910  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to upper matrix" );
1911  }
1912 
1913  matrix_ -= declupp( tmp );
1914  }
1915 
1916  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square upper matrix detected" );
1917  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1918 
1919  return *this;
1920 }
1922 //*************************************************************************************************
1923 
1924 
1925 //*************************************************************************************************
1936 template< typename MT // Type of the adapted dense matrix
1937  , bool SO > // Storage order of the adapted dense matrix
1938 template< typename MT2 // Type of the right-hand side matrix
1939  , bool SO2 > // Storage order of the right-hand side matrix
1940 inline auto UpperMatrix<MT,SO,true>::operator%=( const Matrix<MT2,SO2>& rhs )
1941  -> UpperMatrix&
1942 {
1943  if( !IsSquare_v<MT2> && !isSquare( ~rhs ) ) {
1944  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to upper matrix" );
1945  }
1946 
1947  matrix_ %= ~rhs;
1948 
1949  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square upper matrix detected" );
1950  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1951 
1952  return *this;
1953 }
1955 //*************************************************************************************************
1956 
1957 
1958 //*************************************************************************************************
1966 template< typename MT // Type of the adapted dense matrix
1967  , bool SO > // Storage order of the adapted dense matrix
1968 template< typename ST > // Data type of the right-hand side scalar
1969 inline auto UpperMatrix<MT,SO,true>::operator*=( ST rhs )
1970  -> EnableIf_t< IsNumeric_v<ST>, UpperMatrix& >
1971 {
1972  matrix_ *= rhs;
1973  return *this;
1974 }
1975 //*************************************************************************************************
1976 
1977 
1978 //*************************************************************************************************
1986 template< typename MT // Type of the adapted dense matrix
1987  , bool SO > // Storage order of the adapted dense matrix
1988 template< typename ST > // Data type of the right-hand side scalar
1989 inline auto UpperMatrix<MT,SO,true>::operator/=( ST rhs )
1990  -> EnableIf_t< IsNumeric_v<ST>, UpperMatrix& >
1991 {
1992  BLAZE_USER_ASSERT( !isZero( rhs ), "Division by zero detected" );
1993 
1994  matrix_ /= rhs;
1995  return *this;
1996 }
1998 //*************************************************************************************************
1999 
2000 
2001 
2002 
2003 //=================================================================================================
2004 //
2005 // UTILITY FUNCTIONS
2006 //
2007 //=================================================================================================
2008 
2009 //*************************************************************************************************
2015 template< typename MT // Type of the adapted dense matrix
2016  , bool SO > // Storage order of the adapted dense matrix
2017 inline size_t UpperMatrix<MT,SO,true>::rows() const noexcept
2018 {
2019  return matrix_.rows();
2020 }
2022 //*************************************************************************************************
2023 
2024 
2025 //*************************************************************************************************
2031 template< typename MT // Type of the adapted dense matrix
2032  , bool SO > // Storage order of the adapted dense matrix
2033 inline size_t UpperMatrix<MT,SO,true>::columns() const noexcept
2034 {
2035  return matrix_.columns();
2036 }
2038 //*************************************************************************************************
2039 
2040 
2041 //*************************************************************************************************
2052 template< typename MT // Type of the adapted dense matrix
2053  , bool SO > // Storage order of the adapted dense matrix
2054 inline size_t UpperMatrix<MT,SO,true>::spacing() const noexcept
2055 {
2056  return matrix_.spacing();
2057 }
2059 //*************************************************************************************************
2060 
2061 
2062 //*************************************************************************************************
2068 template< typename MT // Type of the adapted dense matrix
2069  , bool SO > // Storage order of the adapted dense matrix
2070 inline size_t UpperMatrix<MT,SO,true>::capacity() const noexcept
2071 {
2072  return matrix_.capacity();
2073 }
2075 //*************************************************************************************************
2076 
2077 
2078 //*************************************************************************************************
2090 template< typename MT // Type of the adapted dense matrix
2091  , bool SO > // Storage order of the adapted dense matrix
2092 inline size_t UpperMatrix<MT,SO,true>::capacity( size_t i ) const noexcept
2093 {
2094  return matrix_.capacity(i);
2095 }
2097 //*************************************************************************************************
2098 
2099 
2100 //*************************************************************************************************
2106 template< typename MT // Type of the adapted dense matrix
2107  , bool SO > // Storage order of the adapted dense matrix
2108 inline size_t UpperMatrix<MT,SO,true>::nonZeros() const
2109 {
2110  return matrix_.nonZeros();
2111 }
2113 //*************************************************************************************************
2114 
2115 
2116 //*************************************************************************************************
2128 template< typename MT // Type of the adapted dense matrix
2129  , bool SO > // Storage order of the adapted dense matrix
2130 inline size_t UpperMatrix<MT,SO,true>::nonZeros( size_t i ) const
2131 {
2132  return matrix_.nonZeros(i);
2133 }
2135 //*************************************************************************************************
2136 
2137 
2138 //*************************************************************************************************
2144 template< typename MT // Type of the adapted dense matrix
2145  , bool SO > // Storage order of the adapted dense matrix
2146 inline void UpperMatrix<MT,SO,true>::reset()
2147 {
2148  using blaze::clear;
2149 
2150  if( SO ) {
2151  for( size_t j=0UL; j<columns(); ++j )
2152  for( size_t i=0UL; i<=j; ++i )
2153  clear( matrix_(i,j) );
2154  }
2155  else {
2156  for( size_t i=0UL; i<rows(); ++i )
2157  for( size_t j=i; j<columns(); ++j )
2158  clear( matrix_(i,j) );
2159  }
2160 }
2162 //*************************************************************************************************
2163 
2164 
2165 //*************************************************************************************************
2178 template< typename MT // Type of the adapted dense matrix
2179  , bool SO > // Storage order of the adapted dense matrix
2180 inline void UpperMatrix<MT,SO,true>::reset( size_t i )
2181 {
2182  using blaze::clear;
2183 
2184  if( SO ) {
2185  for( size_t j=0UL; j<=i; ++j )
2186  clear( matrix_(j,i) );
2187  }
2188  else {
2189  for( size_t j=i; j<columns(); ++j )
2190  clear( matrix_(i,j) );
2191  }
2192 }
2194 //*************************************************************************************************
2195 
2196 
2197 //*************************************************************************************************
2209 template< typename MT // Type of the adapted dense matrix
2210  , bool SO > // Storage order of the adapted dense matrix
2211 inline void UpperMatrix<MT,SO,true>::clear()
2212 {
2213  using blaze::clear;
2214 
2215  if( IsResizable_v<MT> ) {
2216  clear( matrix_ );
2217  }
2218  else {
2219  reset();
2220  }
2221 }
2223 //*************************************************************************************************
2224 
2225 
2226 //*************************************************************************************************
2262 template< typename MT // Type of the adapted dense matrix
2263  , bool SO > // Storage order of the adapted dense matrix
2264 void UpperMatrix<MT,SO,true>::resize( size_t n, bool preserve )
2265 {
2267 
2268  MAYBE_UNUSED( preserve );
2269 
2270  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square upper matrix detected" );
2271 
2272  const size_t oldsize( matrix_.rows() );
2273 
2274  matrix_.resize( n, n, true );
2275 
2276  if( n > oldsize ) {
2277  const size_t increment( n - oldsize );
2278  submatrix( matrix_, oldsize, 0UL, increment, n-1 ).reset();
2279  }
2280 }
2282 //*************************************************************************************************
2283 
2284 
2285 //*************************************************************************************************
2298 template< typename MT // Type of the adapted dense matrix
2299  , bool SO > // Storage order of the adapted dense matrix
2300 inline void UpperMatrix<MT,SO,true>::extend( size_t n, bool preserve )
2301 {
2303 
2304  MAYBE_UNUSED( preserve );
2305 
2306  resize( rows() + n, true );
2307 }
2308 //*************************************************************************************************
2309 
2310 
2311 //*************************************************************************************************
2321 template< typename MT // Type of the adapted dense matrix
2322  , bool SO > // Storage order of the adapted dense matrix
2323 inline void UpperMatrix<MT,SO,true>::reserve( size_t elements )
2324 {
2325  matrix_.reserve( elements );
2326 }
2328 //*************************************************************************************************
2329 
2330 
2331 //*************************************************************************************************
2341 template< typename MT // Type of the adapted dense matrix
2342  , bool SO > // Storage order of the adapted dense matrix
2344 {
2345  matrix_.shrinkToFit();
2346 }
2348 //*************************************************************************************************
2349 
2350 
2351 //*************************************************************************************************
2358 template< typename MT // Type of the adapted dense matrix
2359  , bool SO > // Storage order of the adapted dense matrix
2360 inline void UpperMatrix<MT,SO,true>::swap( UpperMatrix& m ) noexcept
2361 {
2362  using std::swap;
2363 
2364  swap( matrix_, m.matrix_ );
2365 }
2367 //*************************************************************************************************
2368 
2369 
2370 //*************************************************************************************************
2382 template< typename MT // Type of the adapted dense matrix
2383  , bool SO > // Storage order of the adapted dense matrix
2384 inline constexpr size_t UpperMatrix<MT,SO,true>::maxNonZeros() noexcept
2385 {
2387 
2388  return maxNonZeros( Size_v<MT,0UL> );
2389 }
2391 //*************************************************************************************************
2392 
2393 
2394 //*************************************************************************************************
2404 template< typename MT // Type of the adapted dense matrix
2405  , bool SO > // Storage order of the adapted dense matrix
2406 inline constexpr size_t UpperMatrix<MT,SO,true>::maxNonZeros( size_t n ) noexcept
2407 {
2408  return ( ( n + 1UL ) * n ) / 2UL;
2409 }
2411 //*************************************************************************************************
2412 
2413 
2414 
2415 
2416 //=================================================================================================
2417 //
2418 // NUMERIC FUNCTIONS
2419 //
2420 //=================================================================================================
2421 
2422 //*************************************************************************************************
2440 template< typename MT // Type of the adapted dense matrix
2441  , bool SO > // Storage order of the adapted dense matrix
2442 template< typename Other > // Data type of the scalar value
2443 inline UpperMatrix<MT,SO,true>& UpperMatrix<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 UpperMatrix<MT,SO,true>::isIntact() const noexcept
2473 {
2474  using blaze::isIntact;
2475 
2476  return ( isIntact( matrix_ ) && isUpper( 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 UpperMatrix<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 UpperMatrix<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 UpperMatrix<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 UpperMatrix<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 UpperMatrix<MT,SO,true>::SIMDType
2594  UpperMatrix<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 UpperMatrix<MT,SO,true>::SIMDType
2621  UpperMatrix<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 UpperMatrix<MT,SO,true>::SIMDType
2648  UpperMatrix<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 UpperMatrix<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 UpperMatrix<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  else {
2705  for( size_t i=0UL; i<rows(); ++i )
2706  for( size_t j=i; j<columns(); ++j )
2707  tmp(i,j) = init;
2708  }
2709 
2710  return tmp;
2711 }
2713 //*************************************************************************************************
2714 
2715 
2716 //*************************************************************************************************
2727 template< typename MT // Type of the adapted dense matrix
2728  , bool SO > // Storage order of the adapted dense matrix
2729 template< typename MT2 // Type of the foreign matrix
2730  , bool SO2 // Storage order of the foreign matrix
2731  , typename T > // Type of the third argument
2732 inline const MT UpperMatrix<MT,SO,true>::construct( const Matrix<MT2,SO2>& m, T )
2733 {
2734  const MT tmp( ~m );
2735 
2736  if( !IsUpper_v<MT2> && !isUpper( tmp ) ) {
2737  BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of upper matrix" );
2738  }
2739 
2740  return tmp;
2741 }
2743 //*************************************************************************************************
2744 
2745 } // namespace blaze
2746 
2747 #endif
#define BLAZE_CONSTRAINT_MUST_NOT_BE_TRANSFORMATION_TYPE(T)
Constraint on the data type.In case the given data type T is a transformation expression (i....
Definition: Transformation.h:81
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,...
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: IntegralConstant.h:121
#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
Constraint on the data type.
Header file for auxiliary alias declarations.
decltype(auto) column(Matrix< MT, SO > &matrix, RCAs... args)
Creating a view on a specific column of the given matrix.
Definition: Column.h:133
auto operator-=(DenseMatrix< MT, SO > &mat, ST scalar) -> EnableIf_t< IsNumeric_v< ST >, MT & >
Subtraction assignment operator for the subtraction of a dense matrix and a scalar value ( ).
Definition: DenseMatrix.h:432
constexpr ptrdiff_t Size_v
Auxiliary variable template for the Size type trait.The Size_v variable template provides a convenien...
Definition: Size.h:176
bool isUpper(const DenseMatrix< MT, SO > &dm)
Checks if the given dense matrix is an upper triangular matrix.
Definition: DenseMatrix.h:2060
Constraint on the data type.
#define BLAZE_USER_ASSERT(expr, msg)
Run time assertion macro for user checks.In case of an invalid run time expression,...
Definition: Assert.h:117
size_t capacity(const Matrix< MT, SO > &matrix) noexcept
Returns the maximum capacity of the matrix.
Definition: Matrix.h:546
Header file for basic type definitions.
constexpr const DenseIterator< Type, AF > operator-(const DenseIterator< Type, AF > &it, ptrdiff_t inc) noexcept
Subtraction between a DenseIterator and an integral value.
Definition: DenseIterator.h:750
MT::ElementType * data(DenseMatrix< MT, SO > &dm) noexcept
Low-level data access to the dense matrix elements.
Definition: DenseMatrix.h:170
decltype(auto) submatrix(Matrix< MT, SO > &, RSAs...)
Creating a view on a specific submatrix of the given matrix.
Definition: Submatrix.h:178
#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
Header file for the isZero shim.
#define BLAZE_CONSTRAINT_MUST_NOT_BE_COMPUTATION_TYPE(T)
Constraint on the data type.In case the given data type T is a computational expression (i....
Definition: Computation.h:81
#define BLAZE_CONSTRAINT_MUST_BE_DENSE_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is not a dense, N-dimensional matrix type,...
Definition: DenseMatrix.h:61
constexpr bool operator<(const NegativeAccuracy< A > &lhs, const T &rhs)
Less-than comparison between a NegativeAccuracy object and a floating point value.
Definition: Accuracy.h:332
BLAZE_ALWAYS_INLINE const EnableIf_t< IsIntegral_v< T > &&HasSize_v< T, 1UL >, If_t< IsSigned_v< T >, SIMDint8, SIMDuint8 > > loadu(const T *address) noexcept
Loads a vector of 1-byte integral values.
Definition: Loadu.h:76
Constraint on the data type.
MT::Iterator begin(Matrix< MT, SO > &matrix, size_t i)
Returns an iterator to the first element of row/column i.
Definition: Matrix.h:372
void reset(const DiagonalProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: DiagonalProxy.h:595
void shrinkToFit(Matrix< MT, SO > &matrix)
Requesting the removal of unused capacity.
Definition: Matrix.h:799
Header file for the MAYBE_UNUSED function template.
Header file for all adaptor forward declarations.
decltype(auto) declupp(const DenseMatrix< MT, SO > &dm)
Declares the given dense matrix expression dm as upper.
Definition: DMatDeclUppExpr.h:1001
#define BLAZE_CONSTRAINT_MUST_NOT_BE_VOLATILE(T)
Constraint on the data type.In case the given data type is a volatile-qualified type,...
Definition: Volatile.h:79
size_t nonZeros(const Matrix< MT, SO > &matrix)
Returns the total number of non-zero elements in the matrix.
Definition: Matrix.h:584
BoolConstant< true > TrueType
Type traits base class.The TrueType class is used as base class for type traits and value traits that...
Definition: IntegralConstant.h:132
Header file for the extended initializer_list functionality.
Constraint on the data type.
constexpr size_t columns(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of columns of the matrix.
Definition: Matrix.h:514
MT::ConstIterator cend(const Matrix< MT, SO > &matrix, size_t i)
Returns an iterator just past the last element of row/column i.
Definition: Matrix.h:482
MT::ConstIterator cbegin(const Matrix< MT, SO > &matrix, size_t i)
Returns an iterator to the first element of row/column i.
Definition: Matrix.h:416
Constraint on the data type.
Constraint on the data type.
Constraint on the data type.
size_t spacing(const DenseMatrix< MT, SO > &dm) noexcept
Returns the spacing between the beginning of two rows/columns.
Definition: DenseMatrix.h:253
#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,...
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:677
Constraint on the data type.
Header file for the implementation of a matrix representation of an initializer list.
typename EnableIf< Condition, T >::Type EnableIf_t
Auxiliary type for the EnableIf class template.The EnableIf_t alias declaration provides a convenient...
Definition: EnableIf.h:138
Header file for the DisableIf class template.
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,...
Definition: Static.h:61
Compile time assertion.
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:9091
#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.
constexpr bool operator>(const NegativeAccuracy< A > &lhs, const T &rhs)
Greater-than comparison between a NegativeAccuracy object and a floating point value.
Definition: Accuracy.h:370
constexpr bool operator>=(const NegativeAccuracy< A > &, const T &rhs)
Greater-or-equal-than comparison between a NegativeAccuracy object and a floating point value.
Definition: Accuracy.h:446
auto operator+=(DenseMatrix< MT, SO > &mat, ST scalar) -> EnableIf_t< IsNumeric_v< ST >, MT & >
Addition assignment operator for the addition of a dense matrix and a scalar value ( ).
Definition: DenseMatrix.h:370
constexpr bool operator==(const NegativeAccuracy< A > &lhs, const T &rhs)
Equality comparison between a NegativeAccuracy object and a floating point value.
Definition: Accuracy.h:253
constexpr bool IsNumeric_v
Auxiliary variable template for the IsNumeric type trait.The IsNumeric_v variable template provides a...
Definition: IsNumeric.h:143
Constraint on the data type.
constexpr void MAYBE_UNUSED(const Args &...)
Suppression of unused parameter warnings.
Definition: MaybeUnused.h:81
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:139
Header file for the exception macros of the math module.
#define BLAZE_CONSTRAINT_MUST_NOT_BE_UPPER_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is a upper triangular matrix type,...
Definition: Upper.h:81
void resize(Matrix< MT, SO > &matrix, size_t rows, size_t columns, bool preserve=true)
Changing the size of the matrix.
Definition: Matrix.h:738
MT::Iterator end(Matrix< MT, SO > &matrix, size_t i)
Returns an iterator just past the last element of row/column i.
Definition: Matrix.h:438
constexpr bool operator!=(const NegativeAccuracy< A > &lhs, const T &rhs)
Inequality comparison between a NegativeAccuracy object and a floating point value.
Definition: Accuracy.h:293
Header file for the UpperProxy class.
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:615
constexpr bool IsComputation_v
Auxiliary variable template for the IsComputation type trait.The IsComputation_v variable template pr...
Definition: IsComputation.h:90
Header file for the IsNumeric type trait.
auto operator/=(DenseMatrix< MT, SO > &mat, ST scalar) -> EnableIf_t< IsNumeric_v< ST >, MT & >
Division assignment operator for the division of a dense matrix by a scalar value ( ).
Definition: DenseMatrix.h:558
#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,...
Definition: Symmetric.h:79
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:133
#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 'resize' 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,...
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:282
Constraint on the data type.
Constraint on the data type.
constexpr bool operator<=(const NegativeAccuracy< A > &, const T &rhs)
Less-or-equal-than comparison between a NegativeAccuracy object and a floating point value.
Definition: Accuracy.h:408
#define BLAZE_CONSTRAINT_MUST_NOT_BE_VIEW_TYPE(T)
Constraint on the data type.In case the given data type T is a view type (i.e. a subvector,...
Definition: View.h:81
constexpr size_t rows(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of rows of the matrix.
Definition: Matrix.h:498
constexpr const DenseIterator< Type, AF > operator+(const DenseIterator< Type, AF > &it, ptrdiff_t inc) noexcept
Addition between a DenseIterator and an integral value.
Definition: DenseIterator.h:718
BLAZE_ALWAYS_INLINE const EnableIf_t< IsIntegral_v< T > &&HasSize_v< T, 1UL >, If_t< IsSigned_v< T >, SIMDint8, SIMDuint8 > > loada(const T *address) noexcept
Loads a vector of 1-byte integral values.
Definition: Loada.h:79
#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 'res...
Definition: Resizable.h:61
Header file for the IsComputation type trait class.
Header file for the IntegralConstant class template.
bool isIntact(const DiagonalMatrix< MT, SO, DF > &m)
Returns whether the invariants of the given diagonal matrix are intact.
Definition: DiagonalMatrix.h:264
auto operator *=(DenseMatrix< MT, SO > &mat, ST scalar) -> EnableIf_t< IsNumeric_v< ST >, MT & >
Multiplication assignment operator for the multiplication of a dense matrix and a scalar value ( ).
Definition: DenseMatrix.h:494
bool isDefault(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is in default state.
Definition: DiagonalProxy.h:635
#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,...
Definition: Hermitian.h:79
Header file for the IsUpper type trait.
typename DisableIf< Condition, T >::Type DisableIf_t
Auxiliary type for the DisableIf class template.The DisableIf_t alias declaration provides a convenie...
Definition: DisableIf.h:138
#define BLAZE_STATIC_ASSERT(expr)
Compile time assertion macro.In case of an invalid compile time expression, a compilation error is cr...
Definition: StaticAssert.h:112
Header file for the implementation of the base template of the UpperMatrix.
bool isSquare(const Matrix< MT, SO > &matrix) noexcept
Checks if the given matrix is a square matrix.
Definition: Matrix.h:951
Header file for the IsResizable type trait.
Constraint on the data type.
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,...
Definition: Assert.h:101
Header file for the clear shim.