Dense.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_ADAPTORS_UNIUPPERMATRIX_DENSE_H_
36 #define _BLAZE_MATH_ADAPTORS_UNIUPPERMATRIX_DENSE_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
43 #include <iterator>
44 #include <utility>
58 #include <blaze/math/Exception.h>
61 #include <blaze/math/shims/Clear.h>
74 #include <blaze/system/Inline.h>
75 #include <blaze/util/Assert.h>
82 #include <blaze/util/DisableIf.h>
83 #include <blaze/util/EnableIf.h>
84 #include <blaze/util/FalseType.h>
86 #include <blaze/util/TrueType.h>
87 #include <blaze/util/Types.h>
88 #include <blaze/util/Unused.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 UniUpperMatrix<MT,SO,true>
110  : public DenseMatrix< UniUpperMatrix<MT,SO,true>, SO >
111 {
112  private:
113  //**Type definitions****************************************************************************
114  typedef OppositeType_<MT> OT;
115  typedef TransposeType_<MT> TT;
116  typedef ElementType_<MT> ET;
117  //**********************************************************************************************
118 
119  public:
120  //**Type definitions****************************************************************************
121  typedef UniUpperMatrix<MT,SO,true> This;
122  typedef DenseMatrix<This,SO> BaseType;
123  typedef This ResultType;
124  typedef UniUpperMatrix<OT,!SO,true> OppositeType;
125  typedef UniLowerMatrix<TT,!SO,true> TransposeType;
126  typedef ET ElementType;
127  typedef SIMDType_<MT> SIMDType;
128  typedef ReturnType_<MT> ReturnType;
129  typedef const This& CompositeType;
130  typedef UniUpperProxy<MT> Reference;
131  typedef ConstReference_<MT> ConstReference;
132  typedef Pointer_<MT> Pointer;
133  typedef ConstPointer_<MT> ConstPointer;
134  typedef ConstIterator_<MT> ConstIterator;
135  //**********************************************************************************************
136 
137  //**Rebind struct definition********************************************************************
140  template< typename ET > // Data type of the other matrix
141  struct Rebind {
143  typedef UniUpperMatrix< typename MT::template Rebind<ET>::Other > Other;
144  };
145  //**********************************************************************************************
146 
147  //**Iterator class definition*******************************************************************
150  class Iterator
151  {
152  public:
153  //**Type definitions*************************************************************************
154  typedef std::random_access_iterator_tag IteratorCategory;
155  typedef ElementType_<MT> ValueType;
156  typedef UniUpperProxy<MT> PointerType;
157  typedef UniUpperProxy<MT> ReferenceType;
158  typedef ptrdiff_t DifferenceType;
159 
160  // STL iterator requirements
161  typedef IteratorCategory iterator_category;
162  typedef ValueType value_type;
163  typedef PointerType pointer;
164  typedef ReferenceType reference;
165  typedef DifferenceType difference_type;
166  //*******************************************************************************************
167 
168  //**Constructor******************************************************************************
171  inline Iterator() noexcept
172  : matrix_( nullptr ) // Reference to the adapted dense matrix
173  , row_ ( 0UL ) // The current row index of the iterator
174  , column_( 0UL ) // The current column index of the iterator
175  {}
176  //*******************************************************************************************
177 
178  //**Constructor******************************************************************************
185  inline Iterator( MT& matrix, size_t row, size_t column ) noexcept
186  : matrix_( &matrix ) // Reference to the adapted dense matrix
187  , row_ ( row ) // The current row-index of the iterator
188  , column_( column ) // The current column-index of the iterator
189  {}
190  //*******************************************************************************************
191 
192  //**Addition assignment operator*************************************************************
198  inline Iterator& operator+=( size_t inc ) noexcept {
199  ( SO )?( row_ += inc ):( column_ += inc );
200  return *this;
201  }
202  //*******************************************************************************************
203 
204  //**Subtraction assignment operator**********************************************************
210  inline Iterator& operator-=( size_t dec ) noexcept {
211  ( SO )?( row_ -= dec ):( column_ -= dec );
212  return *this;
213  }
214  //*******************************************************************************************
215 
216  //**Prefix increment operator****************************************************************
221  inline Iterator& operator++() noexcept {
222  ( SO )?( ++row_ ):( ++column_ );
223  return *this;
224  }
225  //*******************************************************************************************
226 
227  //**Postfix increment operator***************************************************************
232  inline const Iterator operator++( int ) noexcept {
233  const Iterator tmp( *this );
234  ++(*this);
235  return tmp;
236  }
237  //*******************************************************************************************
238 
239  //**Prefix decrement operator****************************************************************
244  inline Iterator& operator--() noexcept {
245  ( SO )?( --row_ ):( --column_ );
246  return *this;
247  }
248  //*******************************************************************************************
249 
250  //**Postfix decrement operator***************************************************************
255  inline const Iterator operator--( int ) {
256  const Iterator tmp( *this );
257  --(*this);
258  return tmp;
259  }
260  //*******************************************************************************************
261 
262  //**Element access operator******************************************************************
267  inline ReferenceType operator*() const {
268  return ReferenceType( *matrix_, row_, column_ );
269  }
270  //*******************************************************************************************
271 
272  //**Element access operator******************************************************************
277  inline PointerType operator->() const {
278  return PointerType( *matrix_, row_, column_ );
279  }
280  //*******************************************************************************************
281 
282  //**Load function****************************************************************************
292  inline SIMDType load() const {
293  return (*matrix_).load(row_,column_);
294  }
295  //*******************************************************************************************
296 
297  //**Loada function***************************************************************************
307  inline SIMDType loada() const {
308  return (*matrix_).loada(row_,column_);
309  }
310  //*******************************************************************************************
311 
312  //**Loadu function***************************************************************************
322  inline SIMDType loadu() const {
323  return (*matrix_).loadu(row_,column_);
324  }
325  //*******************************************************************************************
326 
327  //**Conversion operator**********************************************************************
332  inline operator ConstIterator() const {
333  if( SO )
334  return matrix_->begin( column_ ) + row_;
335  else
336  return matrix_->begin( row_ ) + column_;
337  }
338  //*******************************************************************************************
339 
340  //**Equality operator************************************************************************
347  friend inline bool operator==( const Iterator& lhs, const Iterator& rhs ) noexcept {
348  return ( SO )?( lhs.row_ == rhs.row_ ):( lhs.column_ == rhs.column_ );
349  }
350  //*******************************************************************************************
351 
352  //**Equality operator************************************************************************
359  friend inline bool operator==( const Iterator& lhs, const ConstIterator& rhs ) {
360  return ( ConstIterator( lhs ) == rhs );
361  }
362  //*******************************************************************************************
363 
364  //**Equality operator************************************************************************
371  friend inline bool operator==( const ConstIterator& lhs, const Iterator& rhs ) {
372  return ( lhs == ConstIterator( rhs ) );
373  }
374  //*******************************************************************************************
375 
376  //**Inequality operator**********************************************************************
383  friend inline bool operator!=( const Iterator& lhs, const Iterator& rhs ) noexcept {
384  return ( SO )?( lhs.row_ != rhs.row_ ):( lhs.column_ != rhs.column_ );
385  }
386  //*******************************************************************************************
387 
388  //**Inequality operator**********************************************************************
395  friend inline bool operator!=( const Iterator& lhs, const ConstIterator& rhs ) {
396  return ( ConstIterator( lhs ) != rhs );
397  }
398  //*******************************************************************************************
399 
400  //**Inequality operator**********************************************************************
407  friend inline bool operator!=( const ConstIterator& lhs, const Iterator& rhs ) {
408  return ( lhs != ConstIterator( rhs ) );
409  }
410  //*******************************************************************************************
411 
412  //**Less-than operator***********************************************************************
419  friend inline bool operator<( const Iterator& lhs, const Iterator& rhs ) noexcept {
420  return ( SO )?( lhs.row_ < rhs.row_ ):( lhs.column_ < rhs.column_ );
421  }
422  //*******************************************************************************************
423 
424  //**Less-than operator***********************************************************************
431  friend inline bool operator<( const Iterator& lhs, const ConstIterator& rhs ) {
432  return ( ConstIterator( lhs ) < rhs );
433  }
434  //*******************************************************************************************
435 
436  //**Less-than operator***********************************************************************
443  friend inline bool operator<( const ConstIterator& lhs, const Iterator& rhs ) {
444  return ( lhs < ConstIterator( rhs ) );
445  }
446  //*******************************************************************************************
447 
448  //**Greater-than operator********************************************************************
455  friend inline bool operator>( const Iterator& lhs, const Iterator& rhs ) noexcept {
456  return ( SO )?( lhs.row_ > rhs.row_ ):( lhs.column_ > rhs.column_ );
457  }
458  //*******************************************************************************************
459 
460  //**Greater-than operator********************************************************************
467  friend inline bool operator>( const Iterator& lhs, const ConstIterator& rhs ) {
468  return ( ConstIterator( lhs ) > rhs );
469  }
470  //*******************************************************************************************
471 
472  //**Greater-than operator********************************************************************
479  friend inline bool operator>( const ConstIterator& lhs, const Iterator& rhs ) {
480  return ( lhs > ConstIterator( rhs ) );
481  }
482  //*******************************************************************************************
483 
484  //**Less-or-equal-than operator**************************************************************
491  friend inline bool operator<=( const Iterator& lhs, const Iterator& rhs ) noexcept {
492  return ( SO )?( lhs.row_ <= rhs.row_ ):( lhs.column_ <= rhs.column_ );
493  }
494  //*******************************************************************************************
495 
496  //**Less-or-equal-than operator**************************************************************
503  friend inline bool operator<=( const Iterator& lhs, const ConstIterator& rhs ) {
504  return ( ConstIterator( lhs ) <= rhs );
505  }
506  //*******************************************************************************************
507 
508  //**Less-or-equal-than operator**************************************************************
515  friend inline bool operator<=( const ConstIterator& lhs, const Iterator& rhs ) {
516  return ( lhs <= ConstIterator( rhs ) );
517  }
518  //*******************************************************************************************
519 
520  //**Greater-or-equal-than operator***********************************************************
527  friend inline bool operator>=( const Iterator& lhs, const Iterator& rhs ) noexcept {
528  return ( SO )?( lhs.row_ >= rhs.row_ ):( lhs.column_ >= rhs.column_ );
529  }
530  //*******************************************************************************************
531 
532  //**Greater-or-equal-than operator***********************************************************
539  friend inline bool operator>=( const Iterator& lhs, const ConstIterator& rhs ) {
540  return ( ConstIterator( lhs ) >= rhs );
541  }
542  //*******************************************************************************************
543 
544  //**Greater-or-equal-than operator***********************************************************
551  friend inline bool operator>=( const ConstIterator& lhs, const Iterator& rhs ) {
552  return ( lhs >= ConstIterator( rhs ) );
553  }
554  //*******************************************************************************************
555 
556  //**Subtraction operator*********************************************************************
562  inline DifferenceType operator-( const Iterator& rhs ) const noexcept {
563  return ( SO )?( row_ - rhs.row_ ):( column_ - rhs.column_ );
564  }
565  //*******************************************************************************************
566 
567  //**Addition operator************************************************************************
574  friend inline const Iterator operator+( const Iterator& it, size_t inc ) noexcept {
575  if( SO )
576  return Iterator( *it.matrix_, it.row_ + inc, it.column_ );
577  else
578  return Iterator( *it.matrix_, it.row_, it.column_ + inc );
579  }
580  //*******************************************************************************************
581 
582  //**Addition operator************************************************************************
589  friend inline const Iterator operator+( size_t inc, const Iterator& it ) noexcept {
590  if( SO )
591  return Iterator( *it.matrix_, it.row_ + inc, it.column_ );
592  else
593  return Iterator( *it.matrix_, it.row_, it.column_ + inc );
594  }
595  //*******************************************************************************************
596 
597  //**Subtraction operator*********************************************************************
604  friend inline const Iterator operator-( const Iterator& it, size_t dec ) noexcept {
605  if( SO )
606  return Iterator( *it.matrix_, it.row_ - dec, it.column_ );
607  else
608  return Iterator( *it.matrix_, it.row_, it.column_ - dec );
609  }
610  //*******************************************************************************************
611 
612  private:
613  //**Member variables*************************************************************************
614  MT* matrix_;
615  size_t row_;
616  size_t column_;
617  //*******************************************************************************************
618  };
619  //**********************************************************************************************
620 
621  //**Compilation flags***************************************************************************
623  enum : bool { simdEnabled = MT::simdEnabled };
624 
626  enum : bool { smpAssignable = MT::smpAssignable };
627  //**********************************************************************************************
628 
629  //**Constructors********************************************************************************
632  explicit inline UniUpperMatrix();
633  template< typename A1 > explicit inline UniUpperMatrix( const A1& a1 );
634  explicit inline UniUpperMatrix( size_t n, const ElementType& init );
635 
636  explicit inline UniUpperMatrix( initializer_list< initializer_list<ElementType> > list );
637 
638  template< typename Other >
639  explicit inline UniUpperMatrix( size_t n, const Other* array );
640 
641  template< typename Other, size_t N >
642  explicit inline UniUpperMatrix( const Other (&array)[N][N] );
643 
644  explicit inline UniUpperMatrix( ElementType* ptr, size_t n );
645  explicit inline UniUpperMatrix( ElementType* ptr, size_t n, size_t nn );
646 
647  template< typename Deleter >
648  explicit inline UniUpperMatrix( ElementType* ptr, size_t n, Deleter d );
649 
650  template< typename Deleter >
651  explicit inline UniUpperMatrix( ElementType* ptr, size_t n, size_t nn, Deleter d );
652 
653  inline UniUpperMatrix( const UniUpperMatrix& m );
654  inline UniUpperMatrix( UniUpperMatrix&& m ) noexcept;
656  //**********************************************************************************************
657 
658  //**Destructor**********************************************************************************
659  // No explicitly declared destructor.
660  //**********************************************************************************************
661 
662  //**Data access functions***********************************************************************
665  inline Reference operator()( size_t i, size_t j );
666  inline ConstReference operator()( size_t i, size_t j ) const;
667  inline Reference at( size_t i, size_t j );
668  inline ConstReference at( size_t i, size_t j ) const;
669  inline ConstPointer data () const noexcept;
670  inline ConstPointer data ( size_t i ) const noexcept;
671  inline Iterator begin ( size_t i );
672  inline ConstIterator begin ( size_t i ) const;
673  inline ConstIterator cbegin( size_t i ) const;
674  inline Iterator end ( size_t i );
675  inline ConstIterator end ( size_t i ) const;
676  inline ConstIterator cend ( size_t i ) const;
678  //**********************************************************************************************
679 
680  //**Assignment operators************************************************************************
683  inline UniUpperMatrix& operator=( const ElementType& rhs );
684  inline UniUpperMatrix& operator=( initializer_list< initializer_list<ElementType> > list );
685 
686  template< typename Other, size_t N >
687  inline UniUpperMatrix& operator=( const Other (&array)[N][N] );
688 
689  inline UniUpperMatrix& operator=( const UniUpperMatrix& rhs );
690  inline UniUpperMatrix& operator=( UniUpperMatrix&& rhs ) noexcept;
691 
692  template< typename MT2, bool SO2 >
693  inline DisableIf_< IsComputation<MT2>, UniUpperMatrix& > operator=( const Matrix<MT2,SO2>& rhs );
694 
695  template< typename MT2, bool SO2 >
696  inline EnableIf_< IsComputation<MT2>, UniUpperMatrix& > operator=( const Matrix<MT2,SO2>& rhs );
697 
698  template< typename MT2, bool SO2 >
699  inline DisableIf_< IsComputation<MT2>, UniUpperMatrix& > operator+=( const Matrix<MT2,SO2>& rhs );
700 
701  template< typename MT2, bool SO2 >
702  inline EnableIf_< IsComputation<MT2>, UniUpperMatrix& > operator+=( const Matrix<MT2,SO2>& rhs );
703 
704  template< typename MT2, bool SO2 >
705  inline DisableIf_< IsComputation<MT2>, UniUpperMatrix& > operator-=( const Matrix<MT2,SO2>& rhs );
706 
707  template< typename MT2, bool SO2 >
708  inline EnableIf_< IsComputation<MT2>, UniUpperMatrix& > operator-=( const Matrix<MT2,SO2>& rhs );
709 
710  template< typename MT2, bool SO2 >
711  inline UniUpperMatrix& operator*=( const Matrix<MT2,SO2>& rhs );
713  //**********************************************************************************************
714 
715  //**Utility functions***************************************************************************
718  inline size_t rows() const noexcept;
719  inline size_t columns() const noexcept;
720  inline size_t spacing() const noexcept;
721  inline size_t capacity() const noexcept;
722  inline size_t capacity( size_t i ) const noexcept;
723  inline size_t nonZeros() const;
724  inline size_t nonZeros( size_t i ) const;
725  inline void reset();
726  inline void reset( size_t i );
727  inline void clear();
728  void resize ( size_t n, bool preserve=true );
729  inline void extend ( size_t n, bool preserve=true );
730  inline void reserve( size_t elements );
731  inline void swap( UniUpperMatrix& m ) noexcept;
732 
733  static inline constexpr size_t maxNonZeros() noexcept;
734  static inline constexpr size_t maxNonZeros( size_t n ) noexcept;
736  //**********************************************************************************************
737 
738  //**Debugging functions*************************************************************************
741  inline bool isIntact() const noexcept;
743  //**********************************************************************************************
744 
745  //**Expression template evaluation functions****************************************************
748  template< typename Other > inline bool canAlias ( const Other* alias ) const noexcept;
749  template< typename Other > inline bool isAliased( const Other* alias ) const noexcept;
750 
751  inline bool isAligned () const noexcept;
752  inline bool canSMPAssign() const noexcept;
753 
754  BLAZE_ALWAYS_INLINE SIMDType load ( size_t i, size_t j ) const noexcept;
755  BLAZE_ALWAYS_INLINE SIMDType loada( size_t i, size_t j ) const noexcept;
756  BLAZE_ALWAYS_INLINE SIMDType loadu( size_t i, size_t j ) const noexcept;
758  //**********************************************************************************************
759 
760  private:
761  //**Construction functions**********************************************************************
764  inline const MT construct( size_t n , TrueType );
765  inline const MT construct( const ElementType& value, FalseType );
766 
767  template< typename MT2, bool SO2, typename T >
768  inline const MT construct( const Matrix<MT2,SO2>& m, T );
770  //**********************************************************************************************
771 
772  //**Member variables****************************************************************************
775  MT matrix_;
776 
777  //**********************************************************************************************
778 
779  //**Friend declarations*************************************************************************
780  template< typename MT2, bool SO2, bool DF2 >
781  friend MT2& derestrict( UniUpperMatrix<MT2,SO2,DF2>& m );
782  //**********************************************************************************************
783 
784  //**Compile time checks*************************************************************************
798  BLAZE_STATIC_ASSERT( Rows<MT>::value == Columns<MT>::value );
799  //**********************************************************************************************
800 };
802 //*************************************************************************************************
803 
804 
805 
806 
807 //=================================================================================================
808 //
809 // CONSTRUCTORS
810 //
811 //=================================================================================================
812 
813 //*************************************************************************************************
817 template< typename MT // Type of the adapted dense matrix
818  , bool SO > // Storage order of the adapted dense matrix
819 inline UniUpperMatrix<MT,SO,true>::UniUpperMatrix()
820  : matrix_() // The adapted dense matrix
821 {
822  for( size_t i=0UL; i<Rows<MT>::value; ++i )
823  matrix_(i,i) = ElementType(1);
824 
825  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square uniupper matrix detected" );
826  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
827 }
829 //*************************************************************************************************
830 
831 
832 //*************************************************************************************************
850 template< typename MT // Type of the adapted dense matrix
851  , bool SO > // Storage order of the adapted dense matrix
852 template< typename A1 > // Type of the constructor argument
853 inline UniUpperMatrix<MT,SO,true>::UniUpperMatrix( const A1& a1 )
854  : matrix_( construct( a1, typename IsResizable<MT>::Type() ) ) // The adapted dense matrix
855 {
856  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square uniupper matrix detected" );
857  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
858 }
860 //*************************************************************************************************
861 
862 
863 //*************************************************************************************************
870 template< typename MT // Type of the adapted dense matrix
871  , bool SO > // Storage order of the adapted dense matrix
872 inline UniUpperMatrix<MT,SO,true>::UniUpperMatrix( size_t n, const ElementType& init )
873  : matrix_( n, n, ElementType() ) // The adapted dense matrix
874 {
876 
877  if( SO ) {
878  for( size_t j=0UL; j<columns(); ++j ) {
879  for( size_t i=0UL; i<j; ++i )
880  matrix_(i,j) = init;
881  matrix_(j,j) = ElementType(1);
882  }
883  }
884  else {
885  for( size_t i=0UL; i<rows(); ++i ) {
886  matrix_(i,i) = ElementType(1);
887  for( size_t j=i+1UL; j<columns(); ++j )
888  matrix_(i,j) = init;
889  }
890  }
891 
892  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square uniupper matrix detected" );
893  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
894 }
896 //*************************************************************************************************
897 
898 
899 //*************************************************************************************************
922 template< typename MT // Type of the adapted dense matrix
923  , bool SO > // Storage order of the adapted dense matrix
924 inline UniUpperMatrix<MT,SO,true>::UniUpperMatrix( initializer_list< initializer_list<ElementType> > list )
925  : matrix_( list ) // The adapted dense matrix
926 {
927  if( !isUniUpper( matrix_ ) ) {
928  BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of uniupper matrix" );
929  }
930 
931  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
932 }
934 //*************************************************************************************************
935 
936 
937 //*************************************************************************************************
963 template< typename MT // Type of the adapted dense matrix
964  , bool SO > // Storage order of the adapted dense matrix
965 template< typename Other > // Data type of the initialization array
966 inline UniUpperMatrix<MT,SO,true>::UniUpperMatrix( size_t n, const Other* array )
967  : matrix_( n, n, array ) // The adapted dense matrix
968 {
969  if( !isUniUpper( matrix_ ) ) {
970  BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of uniupper matrix" );
971  }
972 
973  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
974 }
976 //*************************************************************************************************
977 
978 
979 //*************************************************************************************************
1002 template< typename MT // Type of the adapted dense matrix
1003  , bool SO > // Storage order of the adapted dense matrix
1004 template< typename Other // Data type of the initialization array
1005  , size_t N > // Number of rows and columns of the initialization array
1006 inline UniUpperMatrix<MT,SO,true>::UniUpperMatrix( const Other (&array)[N][N] )
1007  : matrix_( array ) // The adapted dense matrix
1008 {
1009  if( !isUniUpper( matrix_ ) ) {
1010  BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of uniupper matrix" );
1011  }
1012 
1013  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1014 }
1016 //*************************************************************************************************
1017 
1018 
1019 //*************************************************************************************************
1040 template< typename MT // Type of the adapted dense matrix
1041  , bool SO > // Storage order of the adapted dense matrix
1042 inline UniUpperMatrix<MT,SO,true>::UniUpperMatrix( ElementType* ptr, size_t n )
1043  : matrix_( ptr, n, n ) // The adapted dense matrix
1044 {
1045  if( !isUniUpper( matrix_ ) ) {
1046  BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of uniupper matrix" );
1047  }
1048 
1049  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1050 }
1052 //*************************************************************************************************
1053 
1054 
1055 //*************************************************************************************************
1078 template< typename MT // Type of the adapted dense matrix
1079  , bool SO > // Storage order of the adapted dense matrix
1080 inline UniUpperMatrix<MT,SO,true>::UniUpperMatrix( ElementType* ptr, size_t n, size_t nn )
1081  : matrix_( ptr, n, n, nn ) // The adapted dense matrix
1082 {
1083  if( !isUniUpper( matrix_ ) ) {
1084  BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of uniupper matrix" );
1085  }
1086 
1087  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1088 }
1090 //*************************************************************************************************
1091 
1092 
1093 //*************************************************************************************************
1114 template< typename MT // Type of the adapted dense matrix
1115  , bool SO > // Storage order of the adapted dense matrix
1116 template< typename Deleter > // Type of the custom deleter
1117 inline UniUpperMatrix<MT,SO,true>::UniUpperMatrix( ElementType* ptr, size_t n, Deleter d )
1118  : matrix_( ptr, n, n, d ) // The adapted dense matrix
1119 {
1120  if( !isUniUpper( matrix_ ) ) {
1121  BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of uniupper matrix" );
1122  }
1123 
1124  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1125 }
1127 //*************************************************************************************************
1128 
1129 
1130 //*************************************************************************************************
1152 template< typename MT // Type of the adapted dense matrix
1153  , bool SO > // Storage order of the adapted dense matrix
1154 template< typename Deleter > // Type of the custom deleter
1155 inline UniUpperMatrix<MT,SO,true>::UniUpperMatrix( ElementType* ptr, size_t n, size_t nn, Deleter d )
1156  : matrix_( ptr, n, n, nn, d ) // The adapted dense matrix
1157 {
1158  if( !isUniUpper( matrix_ ) ) {
1159  BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of uniupper matrix" );
1160  }
1161 
1162  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1163 }
1165 //*************************************************************************************************
1166 
1167 
1168 //*************************************************************************************************
1174 template< typename MT // Type of the adapted dense matrix
1175  , bool SO > // Storage order of the adapted dense matrix
1176 inline UniUpperMatrix<MT,SO,true>::UniUpperMatrix( const UniUpperMatrix& m )
1177  : matrix_( m.matrix_ ) // The adapted dense matrix
1178 {
1179  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square uniupper matrix detected" );
1180  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1181 }
1183 //*************************************************************************************************
1184 
1185 
1186 //*************************************************************************************************
1192 template< typename MT // Type of the adapted dense matrix
1193  , bool SO > // Storage order of the adapted dense matrix
1194 inline UniUpperMatrix<MT,SO,true>::UniUpperMatrix( UniUpperMatrix&& m ) noexcept
1195  : matrix_( std::move( m.matrix_ ) ) // The adapted dense matrix
1196 {
1197  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square uniupper matrix detected" );
1198  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1199 }
1201 //*************************************************************************************************
1202 
1203 
1204 
1205 
1206 //=================================================================================================
1207 //
1208 // DATA ACCESS FUNCTIONS
1209 //
1210 //=================================================================================================
1211 
1212 //*************************************************************************************************
1228 template< typename MT // Type of the adapted dense matrix
1229  , bool SO > // Storage order of the adapted dense matrix
1231  UniUpperMatrix<MT,SO,true>::operator()( size_t i, size_t j )
1232 {
1233  BLAZE_USER_ASSERT( i<rows() , "Invalid row access index" );
1234  BLAZE_USER_ASSERT( j<columns(), "Invalid column access index" );
1235 
1236  return Reference( matrix_, i, j );
1237 }
1239 //*************************************************************************************************
1240 
1241 
1242 //*************************************************************************************************
1258 template< typename MT // Type of the adapted dense matrix
1259  , bool SO > // Storage order of the adapted dense matrix
1261  UniUpperMatrix<MT,SO,true>::operator()( size_t i, size_t j ) const
1262 {
1263  BLAZE_USER_ASSERT( i<rows() , "Invalid row access index" );
1264  BLAZE_USER_ASSERT( j<columns(), "Invalid column access index" );
1265 
1266  return matrix_(i,j);
1267 }
1269 //*************************************************************************************************
1270 
1271 
1272 //*************************************************************************************************
1289 template< typename MT // Type of the adapted dense matrix
1290  , bool SO > // Storage order of the adapted dense matrix
1292  UniUpperMatrix<MT,SO,true>::at( size_t i, size_t j )
1293 {
1294  if( i >= rows() ) {
1295  BLAZE_THROW_OUT_OF_RANGE( "Invalid row access index" );
1296  }
1297  if( j >= columns() ) {
1298  BLAZE_THROW_OUT_OF_RANGE( "Invalid column access index" );
1299  }
1300  return (*this)(i,j);
1301 }
1303 //*************************************************************************************************
1304 
1305 
1306 //*************************************************************************************************
1323 template< typename MT // Type of the adapted dense matrix
1324  , bool SO > // Storage order of the adapted dense matrix
1326  UniUpperMatrix<MT,SO,true>::at( size_t i, size_t j ) const
1327 {
1328  if( i >= rows() ) {
1329  BLAZE_THROW_OUT_OF_RANGE( "Invalid row access index" );
1330  }
1331  if( j >= columns() ) {
1332  BLAZE_THROW_OUT_OF_RANGE( "Invalid column access index" );
1333  }
1334  return (*this)(i,j);
1335 }
1337 //*************************************************************************************************
1338 
1339 
1340 //*************************************************************************************************
1353 template< typename MT // Type of the adapted dense matrix
1354  , bool SO > // Storage order of the adapted dense matrix
1355 inline typename UniUpperMatrix<MT,SO,true>::ConstPointer
1356  UniUpperMatrix<MT,SO,true>::data() const noexcept
1357 {
1358  return matrix_.data();
1359 }
1361 //*************************************************************************************************
1362 
1363 
1364 //*************************************************************************************************
1373 template< typename MT // Type of the adapted dense matrix
1374  , bool SO > // Storage order of the adapted dense matrix
1375 inline typename UniUpperMatrix<MT,SO,true>::ConstPointer
1376  UniUpperMatrix<MT,SO,true>::data( size_t i ) const noexcept
1377 {
1378  return matrix_.data(i);
1379 }
1381 //*************************************************************************************************
1382 
1383 
1384 //*************************************************************************************************
1396 template< typename MT // Type of the adapted dense matrix
1397  , bool SO > // Storage order of the adapted dense matrix
1400 {
1401  if( SO )
1402  return Iterator( matrix_, 0UL, i );
1403  else
1404  return Iterator( matrix_, i, 0UL );
1405 }
1407 //*************************************************************************************************
1408 
1409 
1410 //*************************************************************************************************
1422 template< typename MT // Type of the adapted dense matrix
1423  , bool SO > // Storage order of the adapted dense matrix
1425  UniUpperMatrix<MT,SO,true>::begin( size_t i ) const
1426 {
1427  return matrix_.begin(i);
1428 }
1430 //*************************************************************************************************
1431 
1432 
1433 //*************************************************************************************************
1445 template< typename MT // Type of the adapted dense matrix
1446  , bool SO > // Storage order of the adapted dense matrix
1448  UniUpperMatrix<MT,SO,true>::cbegin( size_t i ) const
1449 {
1450  return matrix_.cbegin(i);
1451 }
1453 //*************************************************************************************************
1454 
1455 
1456 //*************************************************************************************************
1468 template< typename MT // Type of the adapted dense matrix
1469  , bool SO > // Storage order of the adapted dense matrix
1472 {
1473  if( SO )
1474  return Iterator( matrix_, rows(), i );
1475  else
1476  return Iterator( matrix_, i, columns() );
1477 }
1479 //*************************************************************************************************
1480 
1481 
1482 //*************************************************************************************************
1494 template< typename MT // Type of the adapted dense matrix
1495  , bool SO > // Storage order of the adapted dense matrix
1497  UniUpperMatrix<MT,SO,true>::end( size_t i ) const
1498 {
1499  return matrix_.end(i);
1500 }
1502 //*************************************************************************************************
1503 
1504 
1505 //*************************************************************************************************
1517 template< typename MT // Type of the adapted dense matrix
1518  , bool SO > // Storage order of the adapted dense matrix
1520  UniUpperMatrix<MT,SO,true>::cend( size_t i ) const
1521 {
1522  return matrix_.cend(i);
1523 }
1525 //*************************************************************************************************
1526 
1527 
1528 
1529 
1530 //=================================================================================================
1531 //
1532 // ASSIGNMENT OPERATORS
1533 //
1534 //=================================================================================================
1535 
1536 //*************************************************************************************************
1543 template< typename MT // Type of the adapted dense matrix
1544  , bool SO > // Storage order of the adapted dense matrix
1545 inline UniUpperMatrix<MT,SO,true>&
1546  UniUpperMatrix<MT,SO,true>::operator=( const ElementType& rhs )
1547 {
1548  if( SO ) {
1549  for( size_t j=1UL; j<columns(); ++j )
1550  for( size_t i=0UL; i<j; ++i )
1551  matrix_(i,j) = rhs;
1552  }
1553  else {
1554  for( size_t i=0UL; i<rows(); ++i )
1555  for( size_t j=i+1UL; j<columns(); ++j )
1556  matrix_(i,j) = rhs;
1557  }
1558 
1559  return *this;
1560 }
1562 //*************************************************************************************************
1563 
1564 
1565 //*************************************************************************************************
1589 template< typename MT // Type of the adapted dense matrix
1590  , bool SO > // Storage order of the adapted dense matrix
1591 inline UniUpperMatrix<MT,SO,true>&
1592  UniUpperMatrix<MT,SO,true>::operator=( initializer_list< initializer_list<ElementType> > list )
1593 {
1594  MT tmp( list );
1595 
1596  if( !isUniUpper( tmp ) ) {
1597  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to uniupper matrix" );
1598  }
1599 
1600  matrix_ = std::move( tmp );
1601 
1602  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square uniupper matrix detected" );
1603  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1604 
1605  return *this;
1606 }
1608 //*************************************************************************************************
1609 
1610 
1611 //*************************************************************************************************
1635 template< typename MT // Type of the adapted dense matrix
1636  , bool SO > // Storage order of the adapted dense matrix
1637 template< typename Other // Data type of the initialization array
1638  , size_t N > // Number of rows and columns of the initialization array
1639 inline UniUpperMatrix<MT,SO,true>&
1640  UniUpperMatrix<MT,SO,true>::operator=( const Other (&array)[N][N] )
1641 {
1642  MT tmp( array );
1643 
1644  if( !isUniUpper( tmp ) ) {
1645  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to uniupper matrix" );
1646  }
1647 
1648  matrix_ = std::move( tmp );
1649 
1650  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square uniupper matrix detected" );
1651  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1652 
1653  return *this;
1654 }
1656 //*************************************************************************************************
1657 
1658 
1659 //*************************************************************************************************
1669 template< typename MT // Type of the adapted dense matrix
1670  , bool SO > // Storage order of the adapted dense matrix
1671 inline UniUpperMatrix<MT,SO,true>&
1672  UniUpperMatrix<MT,SO,true>::operator=( const UniUpperMatrix& rhs )
1673 {
1674  matrix_ = rhs.matrix_;
1675 
1676  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square uniupper matrix detected" );
1677  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1678 
1679  return *this;
1680 }
1682 //*************************************************************************************************
1683 
1684 
1685 //*************************************************************************************************
1692 template< typename MT // Type of the adapted dense matrix
1693  , bool SO > // Storage order of the adapted dense matrix
1694 inline UniUpperMatrix<MT,SO,true>&
1695  UniUpperMatrix<MT,SO,true>::operator=( UniUpperMatrix&& rhs ) noexcept
1696 {
1697  matrix_ = std::move( rhs.matrix_ );
1698 
1699  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square uniupper matrix detected" );
1700  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1701 
1702  return *this;
1703 }
1705 //*************************************************************************************************
1706 
1707 
1708 //*************************************************************************************************
1721 template< typename MT // Type of the adapted dense matrix
1722  , bool SO > // Storage order of the adapted dense matrix
1723 template< typename MT2 // Type of the right-hand side matrix
1724  , bool SO2 > // Storage order of the right-hand side matrix
1725 inline DisableIf_< IsComputation<MT2>, UniUpperMatrix<MT,SO,true>& >
1726  UniUpperMatrix<MT,SO,true>::operator=( const Matrix<MT2,SO2>& rhs )
1727 {
1728  if( IsStrictlyTriangular<MT2>::value || ( !IsUniUpper<MT2>::value && !isUniUpper( ~rhs ) ) ) {
1729  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to uniupper matrix" );
1730  }
1731 
1732  matrix_ = ~rhs;
1733 
1734  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square uniupper matrix detected" );
1735  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1736 
1737  return *this;
1738 }
1740 //*************************************************************************************************
1741 
1742 
1743 //*************************************************************************************************
1756 template< typename MT // Type of the adapted dense matrix
1757  , bool SO > // Storage order of the adapted dense matrix
1758 template< typename MT2 // Type of the right-hand side matrix
1759  , bool SO2 > // Storage order of the right-hand side matrix
1760 inline EnableIf_< IsComputation<MT2>, UniUpperMatrix<MT,SO,true>& >
1761  UniUpperMatrix<MT,SO,true>::operator=( const Matrix<MT2,SO2>& rhs )
1762 {
1763  if( IsStrictlyTriangular<MT2>::value || ( !IsSquare<MT2>::value && !isSquare( ~rhs ) ) ) {
1764  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to uniupper matrix" );
1765  }
1766 
1767  if( IsUniUpper<MT2>::value ) {
1768  matrix_ = ~rhs;
1769  }
1770  else {
1771  MT tmp( ~rhs );
1772 
1773  if( !isUniUpper( tmp ) ) {
1774  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to uniupper matrix" );
1775  }
1776 
1777  matrix_ = std::move( tmp );
1778  }
1779 
1780  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square uniupper matrix detected" );
1781  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1782 
1783  return *this;
1784 }
1786 //*************************************************************************************************
1787 
1788 
1789 //*************************************************************************************************
1802 template< typename MT // Type of the adapted dense matrix
1803  , bool SO > // Storage order of the adapted dense matrix
1804 template< typename MT2 // Type of the right-hand side matrix
1805  , bool SO2 > // Storage order of the right-hand side matrix
1806 inline DisableIf_< IsComputation<MT2>, UniUpperMatrix<MT,SO,true>& >
1807  UniUpperMatrix<MT,SO,true>::operator+=( const Matrix<MT2,SO2>& rhs )
1808 {
1809  if( IsLower<MT2>::value || IsUniTriangular<MT2>::value ||
1810  ( !IsStrictlyUpper<MT2>::value && !isStrictlyUpper( ~rhs ) ) ) {
1811  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to uniupper matrix" );
1812  }
1813 
1814  matrix_ += ~rhs;
1815 
1816  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square uniupper matrix detected" );
1817  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1818 
1819  return *this;
1820 }
1822 //*************************************************************************************************
1823 
1824 
1825 //*************************************************************************************************
1838 template< typename MT // Type of the adapted dense matrix
1839  , bool SO > // Storage order of the adapted dense matrix
1840 template< typename MT2 // Type of the right-hand side matrix
1841  , bool SO2 > // Storage order of the right-hand side matrix
1842 inline EnableIf_< IsComputation<MT2>, UniUpperMatrix<MT,SO,true>& >
1843  UniUpperMatrix<MT,SO,true>::operator+=( const Matrix<MT2,SO2>& rhs )
1844 {
1845  if( IsLower<MT2>::value || IsUniTriangular<MT2>::value ||
1846  ( !IsSquare<MT2>::value && !isSquare( ~rhs ) ) ) {
1847  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to uniupper matrix" );
1848  }
1849 
1850  if( IsStrictlyUpper<MT2>::value ) {
1851  matrix_ += ~rhs;
1852  }
1853  else {
1854  const ResultType_<MT2> tmp( ~rhs );
1855 
1856  if( !isStrictlyUpper( tmp ) ) {
1857  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to uniupper matrix" );
1858  }
1859 
1860  matrix_ += tmp;
1861  }
1862 
1863  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square uniupper matrix detected" );
1864  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1865 
1866  return *this;
1867 }
1869 //*************************************************************************************************
1870 
1871 
1872 //*************************************************************************************************
1885 template< typename MT // Type of the adapted dense matrix
1886  , bool SO > // Storage order of the adapted dense matrix
1887 template< typename MT2 // Type of the right-hand side matrix
1888  , bool SO2 > // Storage order of the right-hand side matrix
1889 inline DisableIf_< IsComputation<MT2>, UniUpperMatrix<MT,SO,true>& >
1890  UniUpperMatrix<MT,SO,true>::operator-=( const Matrix<MT2,SO2>& rhs )
1891 {
1892  if( IsLower<MT2>::value || IsUniTriangular<MT2>::value ||
1893  ( !IsStrictlyUpper<MT2>::value && !isStrictlyUpper( ~rhs ) ) ) {
1894  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to uniupper matrix" );
1895  }
1896 
1897  matrix_ -= ~rhs;
1898 
1899  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square uniupper matrix detected" );
1900  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1901 
1902  return *this;
1903 }
1905 //*************************************************************************************************
1906 
1907 
1908 //*************************************************************************************************
1921 template< typename MT // Type of the adapted dense matrix
1922  , bool SO > // Storage order of the adapted dense matrix
1923 template< typename MT2 // Type of the right-hand side matrix
1924  , bool SO2 > // Storage order of the right-hand side matrix
1925 inline EnableIf_< IsComputation<MT2>, UniUpperMatrix<MT,SO,true>& >
1926  UniUpperMatrix<MT,SO,true>::operator-=( const Matrix<MT2,SO2>& rhs )
1927 {
1928  if( IsLower<MT2>::value || IsUniTriangular<MT2>::value ||
1929  ( !IsSquare<MT2>::value && !isSquare( ~rhs ) ) ) {
1930  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to uniupper matrix" );
1931  }
1932 
1933  if( IsStrictlyUpper<MT2>::value ) {
1934  matrix_ -= ~rhs;
1935  }
1936  else {
1937  const ResultType_<MT2> tmp( ~rhs );
1938 
1939  if( !isStrictlyUpper( tmp ) ) {
1940  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to uniupper matrix" );
1941  }
1942 
1943  matrix_ -= tmp;
1944  }
1945 
1946  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square uniupper matrix detected" );
1947  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1948 
1949  return *this;
1950 }
1952 //*************************************************************************************************
1953 
1954 
1955 //*************************************************************************************************
1967 template< typename MT // Type of the adapted dense matrix
1968  , bool SO > // Storage order of the adapted dense matrix
1969 template< typename MT2 // Type of the right-hand side matrix
1970  , bool SO2 > // Storage order of the right-hand side matrix
1971 inline UniUpperMatrix<MT,SO,true>&
1972  UniUpperMatrix<MT,SO,true>::operator*=( const Matrix<MT2,SO2>& rhs )
1973 {
1974  if( matrix_.rows() != (~rhs).columns() ) {
1975  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to uniupper matrix" );
1976  }
1977 
1978  MT tmp( matrix_ * ~rhs );
1979 
1980  if( !isUniUpper( tmp ) ) {
1981  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to uniupper matrix" );
1982  }
1983 
1984  matrix_ = std::move( tmp );
1985 
1986  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square uniupper matrix detected" );
1987  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1988 
1989  return *this;
1990 }
1992 //*************************************************************************************************
1993 
1994 
1995 
1996 
1997 //=================================================================================================
1998 //
1999 // UTILITY FUNCTIONS
2000 //
2001 //=================================================================================================
2002 
2003 //*************************************************************************************************
2009 template< typename MT // Type of the adapted dense matrix
2010  , bool SO > // Storage order of the adapted dense matrix
2011 inline size_t UniUpperMatrix<MT,SO,true>::rows() const noexcept
2012 {
2013  return matrix_.rows();
2014 }
2016 //*************************************************************************************************
2017 
2018 
2019 //*************************************************************************************************
2025 template< typename MT // Type of the adapted dense matrix
2026  , bool SO > // Storage order of the adapted dense matrix
2027 inline size_t UniUpperMatrix<MT,SO,true>::columns() const noexcept
2028 {
2029  return matrix_.columns();
2030 }
2032 //*************************************************************************************************
2033 
2034 
2035 //*************************************************************************************************
2046 template< typename MT // Type of the adapted dense matrix
2047  , bool SO > // Storage order of the adapted dense matrix
2048 inline size_t UniUpperMatrix<MT,SO,true>::spacing() const noexcept
2049 {
2050  return matrix_.spacing();
2051 }
2053 //*************************************************************************************************
2054 
2055 
2056 //*************************************************************************************************
2062 template< typename MT // Type of the adapted dense matrix
2063  , bool SO > // Storage order of the adapted dense matrix
2064 inline size_t UniUpperMatrix<MT,SO,true>::capacity() const noexcept
2065 {
2066  return matrix_.capacity();
2067 }
2069 //*************************************************************************************************
2070 
2071 
2072 //*************************************************************************************************
2084 template< typename MT // Type of the adapted dense matrix
2085  , bool SO > // Storage order of the adapted dense matrix
2086 inline size_t UniUpperMatrix<MT,SO,true>::capacity( size_t i ) const noexcept
2087 {
2088  return matrix_.capacity(i);
2089 }
2091 //*************************************************************************************************
2092 
2093 
2094 //*************************************************************************************************
2100 template< typename MT // Type of the adapted dense matrix
2101  , bool SO > // Storage order of the adapted dense matrix
2102 inline size_t UniUpperMatrix<MT,SO,true>::nonZeros() const
2103 {
2104  return matrix_.nonZeros();
2105 }
2107 //*************************************************************************************************
2108 
2109 
2110 //*************************************************************************************************
2122 template< typename MT // Type of the adapted dense matrix
2123  , bool SO > // Storage order of the adapted dense matrix
2124 inline size_t UniUpperMatrix<MT,SO,true>::nonZeros( size_t i ) const
2125 {
2126  return matrix_.nonZeros(i);
2127 }
2129 //*************************************************************************************************
2130 
2131 
2132 //*************************************************************************************************
2138 template< typename MT // Type of the adapted dense matrix
2139  , bool SO > // Storage order of the adapted dense matrix
2141 {
2142  using blaze::clear;
2143 
2144  if( SO ) {
2145  for( size_t j=1UL; j<columns(); ++j )
2146  for( size_t i=0UL; i<j; ++i )
2147  clear( matrix_(i,j) );
2148  }
2149  else {
2150  for( size_t i=0UL; i<rows(); ++i )
2151  for( size_t j=i+1UL; j<columns(); ++j )
2152  clear( matrix_(i,j) );
2153  }
2154 }
2156 //*************************************************************************************************
2157 
2158 
2159 //*************************************************************************************************
2172 template< typename MT // Type of the adapted dense matrix
2173  , bool SO > // Storage order of the adapted dense matrix
2174 inline void UniUpperMatrix<MT,SO,true>::reset( size_t i )
2175 {
2176  using blaze::clear;
2177 
2178  if( SO ) {
2179  for( size_t j=0UL; j<i; ++j )
2180  clear( matrix_(j,i) );
2181  }
2182  else {
2183  for( size_t j=i+1UL; j<columns(); ++j )
2184  clear( matrix_(i,j) );
2185  }
2186 }
2188 //*************************************************************************************************
2189 
2190 
2191 //*************************************************************************************************
2203 template< typename MT // Type of the adapted dense matrix
2204  , bool SO > // Storage order of the adapted dense matrix
2206 {
2207  using blaze::clear;
2208 
2209  if( IsResizable<MT>::value ) {
2210  clear( matrix_ );
2211  }
2212  else {
2213  reset();
2214  }
2215 }
2217 //*************************************************************************************************
2218 
2219 
2220 //*************************************************************************************************
2256 template< typename MT // Type of the adapted dense matrix
2257  , bool SO > // Storage order of the adapted dense matrix
2258 void UniUpperMatrix<MT,SO,true>::resize( size_t n, bool preserve )
2259 {
2261 
2262  UNUSED_PARAMETER( preserve );
2263 
2264  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square uniupper matrix detected" );
2265 
2266  const size_t oldsize( matrix_.rows() );
2267 
2268  matrix_.resize( n, n, true );
2269 
2270  if( n > oldsize )
2271  {
2272  const size_t increment( n - oldsize );
2273  submatrix( matrix_, oldsize, 0UL, increment, n-1UL ).reset();
2274 
2275  for( size_t i=oldsize; i<n; ++i )
2276  matrix_(i,i) = ElementType(1);
2277  }
2278 }
2280 //*************************************************************************************************
2281 
2282 
2283 //*************************************************************************************************
2296 template< typename MT // Type of the adapted dense matrix
2297  , bool SO > // Storage order of the adapted dense matrix
2298 inline void UniUpperMatrix<MT,SO,true>::extend( size_t n, bool preserve )
2299 {
2301 
2302  UNUSED_PARAMETER( preserve );
2303 
2304  resize( rows() + n, true );
2305 }
2306 //*************************************************************************************************
2307 
2308 
2309 //*************************************************************************************************
2319 template< typename MT // Type of the adapted dense matrix
2320  , bool SO > // Storage order of the adapted dense matrix
2321 inline void UniUpperMatrix<MT,SO,true>::reserve( size_t elements )
2322 {
2323  matrix_.reserve( elements );
2324 }
2326 //*************************************************************************************************
2327 
2328 
2329 //*************************************************************************************************
2336 template< typename MT // Type of the adapted dense matrix
2337  , bool SO > // Storage order of the adapted dense matrix
2338 inline void UniUpperMatrix<MT,SO,true>::swap( UniUpperMatrix& m ) noexcept
2339 {
2340  using std::swap;
2341 
2342  swap( matrix_, m.matrix_ );
2343 }
2345 //*************************************************************************************************
2346 
2347 
2348 //*************************************************************************************************
2360 template< typename MT // Type of the adapted dense matrix
2361  , bool SO > // Storage order of the adapted dense matrix
2362 inline constexpr size_t UniUpperMatrix<MT,SO,true>::maxNonZeros() noexcept
2363 {
2365 
2366  return maxNonZeros( Rows<MT>::value );
2367 }
2369 //*************************************************************************************************
2370 
2371 
2372 //*************************************************************************************************
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 UniUpperMatrix<MT,SO,true>::maxNonZeros( size_t n ) noexcept
2385 {
2386  return ( ( n + 1UL ) * n ) / 2UL;
2387 }
2389 //*************************************************************************************************
2390 
2391 
2392 
2393 
2394 //=================================================================================================
2395 //
2396 // DEBUGGING FUNCTIONS
2397 //
2398 //=================================================================================================
2399 
2400 //*************************************************************************************************
2410 template< typename MT // Type of the adapted dense matrix
2411  , bool SO > // Storage order of the adapted dense matrix
2412 inline bool UniUpperMatrix<MT,SO,true>::isIntact() const noexcept
2413 {
2414  using blaze::isIntact;
2415 
2416  return ( isIntact( matrix_ ) && isUniUpper( matrix_ ) );
2417 }
2419 //*************************************************************************************************
2420 
2421 
2422 
2423 
2424 //=================================================================================================
2425 //
2426 // EXPRESSION TEMPLATE EVALUATION FUNCTIONS
2427 //
2428 //=================================================================================================
2429 
2430 //*************************************************************************************************
2441 template< typename MT // Type of the adapted dense matrix
2442  , bool SO > // Storage order of the adapted dense matrix
2443 template< typename Other > // Data type of the foreign expression
2444 inline bool UniUpperMatrix<MT,SO,true>::canAlias( const Other* alias ) const noexcept
2445 {
2446  return matrix_.canAlias( alias );
2447 }
2449 //*************************************************************************************************
2450 
2451 
2452 //*************************************************************************************************
2463 template< typename MT // Type of the adapted dense matrix
2464  , bool SO > // Storage order of the adapted dense matrix
2465 template< typename Other > // Data type of the foreign expression
2466 inline bool UniUpperMatrix<MT,SO,true>::isAliased( const Other* alias ) const noexcept
2467 {
2468  return matrix_.isAliased( alias );
2469 }
2471 //*************************************************************************************************
2472 
2473 
2474 //*************************************************************************************************
2484 template< typename MT // Type of the adapted dense matrix
2485  , bool SO > // Storage order of the adapted dense matrix
2486 inline bool UniUpperMatrix<MT,SO,true>::isAligned() const noexcept
2487 {
2488  return matrix_.isAligned();
2489 }
2491 //*************************************************************************************************
2492 
2493 
2494 //*************************************************************************************************
2505 template< typename MT // Type of the adapted dense matrix
2506  , bool SO > // Storage order of the adapted dense matrix
2507 inline bool UniUpperMatrix<MT,SO,true>::canSMPAssign() const noexcept
2508 {
2509  return matrix_.canSMPAssign();
2510 }
2512 //*************************************************************************************************
2513 
2514 
2515 //*************************************************************************************************
2531 template< typename MT // Type of the adapted dense matrix
2532  , bool SO > // Storage order of the adapted dense matrix
2533 BLAZE_ALWAYS_INLINE typename UniUpperMatrix<MT,SO,true>::SIMDType
2534  UniUpperMatrix<MT,SO,true>::load( size_t i, size_t j ) const noexcept
2535 {
2536  return matrix_.load( i, j );
2537 }
2539 //*************************************************************************************************
2540 
2541 
2542 //*************************************************************************************************
2558 template< typename MT // Type of the adapted dense matrix
2559  , bool SO > // Storage order of the adapted dense matrix
2560 BLAZE_ALWAYS_INLINE typename UniUpperMatrix<MT,SO,true>::SIMDType
2561  UniUpperMatrix<MT,SO,true>::loada( size_t i, size_t j ) const noexcept
2562 {
2563  return matrix_.loada( i, j );
2564 }
2566 //*************************************************************************************************
2567 
2568 
2569 //*************************************************************************************************
2585 template< typename MT // Type of the adapted dense matrix
2586  , bool SO > // Storage order of the adapted dense matrix
2587 BLAZE_ALWAYS_INLINE typename UniUpperMatrix<MT,SO,true>::SIMDType
2588  UniUpperMatrix<MT,SO,true>::loadu( size_t i, size_t j ) const noexcept
2589 {
2590  return matrix_.loadu( i, j );
2591 }
2593 //*************************************************************************************************
2594 
2595 
2596 
2597 
2598 //=================================================================================================
2599 //
2600 // CONSTRUCTION FUNCTIONS
2601 //
2602 //=================================================================================================
2603 
2604 //*************************************************************************************************
2611 template< typename MT // Type of the adapted dense matrix
2612  , bool SO > // Storage order of the adapted dense matrix
2613 inline const MT UniUpperMatrix<MT,SO,true>::construct( size_t n, TrueType )
2614 {
2616 
2617  MT tmp( n, n, ElementType() );
2618 
2619  for( size_t i=0UL; i<n; ++i )
2620  tmp(i,i) = ElementType(1);
2621 
2622  return tmp;
2623 }
2625 //*************************************************************************************************
2626 
2627 
2628 //*************************************************************************************************
2635 template< typename MT // Type of the adapted dense matrix
2636  , bool SO > // Storage order of the adapted dense matrix
2637 inline const MT UniUpperMatrix<MT,SO,true>::construct( const ElementType& init, FalseType )
2638 {
2641 
2642  MT tmp;
2643 
2644  if( SO ) {
2645  for( size_t j=0UL; j<columns(); ++j ) {
2646  for( size_t i=0UL; i<j; ++i )
2647  tmp(i,j) = init;
2648  tmp(j,j) = ElementType(1);
2649  }
2650  }
2651  else {
2652  for( size_t i=0UL; i<rows(); ++i ) {
2653  tmp(i,i) = ElementType(1);
2654  for( size_t j=i+1UL; j<columns(); ++j )
2655  tmp(i,j) = init;
2656  }
2657  }
2658 
2659  return tmp;
2660 }
2662 //*************************************************************************************************
2663 
2664 
2665 //*************************************************************************************************
2676 template< typename MT // Type of the adapted dense matrix
2677  , bool SO > // Storage order of the adapted dense matrix
2678 template< typename MT2 // Type of the foreign matrix
2679  , bool SO2 // Storage order of the foreign matrix
2680  , typename T > // Type of the third argument
2681 inline const MT UniUpperMatrix<MT,SO,true>::construct( const Matrix<MT2,SO2>& m, T )
2682 {
2683  const MT tmp( ~m );
2684 
2685  if( IsStrictlyTriangular<MT2>::value || ( !IsUniUpper<MT2>::value && !isUniUpper( tmp ) ) ) {
2686  BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of uniupper matrix" );
2687  }
2688 
2689  return tmp;
2690 }
2692 //*************************************************************************************************
2693 
2694 } // namespace blaze
2695 
2696 #endif
Constraint on the data type.
Header file for the implementation of the Submatrix view.
#define BLAZE_CONSTRAINT_MUST_NOT_BE_CONST(T)
Constraint on the data type.In case the given data type is a const-qualified type, a compilation error is created.
Definition: Const.h:79
BoolConstant< false > FalseType
Type/value traits base class.The FalseType class is used as base class for type traits and value trai...
Definition: FalseType.h:61
#define BLAZE_THROW_INVALID_ARGUMENT(MESSAGE)
Macro for the emission of a std::invalid_argument exception.This macro encapsulates the default way o...
Definition: Exception.h:235
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, the program execution is terminated. The BLAZE_USER_ASSERT macro can be disabled by setting the BLAZE_USER_ASSERT flag to zero or by defining NDEBUG during the compilation.
Definition: Assert.h:117
Header file for the Rows type trait.
Header file for the UNUSED_PARAMETER function template.
Header file for the IsUniUpper type trait.
const DMatDMatMultExpr< T1, T2 > operator*(const DenseMatrix< T1, false > &lhs, const DenseMatrix< T2, false > &rhs)
Multiplication operator for the multiplication of two row-major dense matrices ( ).
Definition: DMatDMatMultExpr.h:7800
BLAZE_ALWAYS_INLINE size_t capacity(const Matrix< MT, SO > &matrix) noexcept
Returns the maximum capacity of the matrix.
Definition: Matrix.h:346
Header file for basic type definitions.
bool operator<=(const NegativeAccuracy< A > &, const T &rhs)
Less-or-equal-than comparison between a NegativeAccuracy object and a floating point value...
Definition: Accuracy.h:404
bool isStrictlyUpper(const DenseMatrix< MT, SO > &dm)
Checks if the given dense matrix is a strictly upper triangular matrix.
Definition: DenseMatrix.h:1423
Header file for the FalseType type/value trait base class.
#define BLAZE_CONSTRAINT_MUST_BE_MATRIX_WITH_STORAGE_ORDER(T, SO)
Constraint on the data type.In case the given data type T is not a dense or sparse matrix type and in...
Definition: StorageOrder.h:63
#define BLAZE_CONSTRAINT_MUST_BE_DENSE_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is not a dense, N-dimensional matrix type...
Definition: DenseMatrix.h:61
Constraint on the data type.
BLAZE_ALWAYS_INLINE MT::Iterator begin(Matrix< MT, SO > &matrix, size_t i)
Returns an iterator to the first element of row/column i.
Definition: Matrix.h:188
Constraint on the data type.
void reset(const DiagonalProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: DiagonalProxy.h:533
const DenseIterator< Type, AF > operator+(const DenseIterator< Type, AF > &it, ptrdiff_t inc) noexcept
Addition between a DenseIterator and an integral value.
Definition: DenseIterator.h:699
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:2643
typename DisableIf< Condition, T >::Type DisableIf_
Auxiliary type for the DisableIf class template.The DisableIf_ alias declaration provides a convenien...
Definition: DisableIf.h:223
void clear(CompressedMatrix< Type, SO > &m)
Clearing the given compressed matrix.
Definition: CompressedMatrix.h:5077
bool operator>(const NegativeAccuracy< A > &lhs, const T &rhs)
Greater-than comparison between a NegativeAccuracy object and a floating point value.
Definition: Accuracy.h:366
CompressedMatrix< Type, true > This
Type of this CompressedMatrix instance.
Definition: CompressedMatrix.h:2636
bool operator>=(const NegativeAccuracy< A > &, const T &rhs)
Greater-or-equal-than comparison between a NegativeAccuracy object and a floating point value...
Definition: Accuracy.h:442
#define BLAZE_CONSTRAINT_MUST_NOT_BE_VOLATILE(T)
Constraint on the data type.In case the given data type is a volatile-qualified type, a compilation error is created.
Definition: Volatile.h:79
BLAZE_ALWAYS_INLINE size_t nonZeros(const Matrix< MT, SO > &matrix)
Returns the total number of non-zero elements in the matrix.
Definition: Matrix.h:384
#define BLAZE_CONSTRAINT_MUST_BE_SQUARE(T)
Constraint on the data type.In case the given data type T is not a square matrix type, a compilation error is created.
Definition: Square.h:60
const DenseIterator< Type, AF > operator-(const DenseIterator< Type, AF > &it, ptrdiff_t inc) noexcept
Subtraction between a DenseIterator and an integral value.
Definition: DenseIterator.h:731
BoolConstant< true > TrueType
Type traits base class.The TrueType class is used as base class for type traits and value traits that...
Definition: TrueType.h:61
BLAZE_ALWAYS_INLINE T1 & operator*=(SIMDPack< T1 > &lhs, const SIMDPack< T2 > &rhs)
Multiplication assignment operator for the multiplication of two SIMD packs.
Definition: BasicTypes.h:1321
Constraint on the data type.
STL namespace.
BLAZE_ALWAYS_INLINE const EnableIf_< And< IsIntegral< T >, HasSize< T, 1UL > >, If_< IsSigned< T >, SIMDint8, SIMDuint8 > > loadu(const T *address) noexcept
Loads a vector of 1-byte integral values.
Definition: Loadu.h:77
CompressedMatrix< Type, false > OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: CompressedMatrix.h:2639
DisableIf_< Or< IsComputation< MT >, IsTransExpr< MT > >, ColumnExprTrait_< MT > > column(Matrix< MT, SO > &matrix, size_t index)
Creating a view on a specific column of the given matrix.
Definition: Column.h:126
BLAZE_ALWAYS_INLINE MT::ConstIterator cend(const Matrix< MT, SO > &matrix, size_t i)
Returns an iterator just past the last element of row/column i.
Definition: Matrix.h:298
BLAZE_ALWAYS_INLINE MT::ConstIterator cbegin(const Matrix< MT, SO > &matrix, size_t i)
Returns an iterator to the first element of row/column i.
Definition: Matrix.h:232
Constraint on the data type.
Constraint on the data type.
constexpr bool spacing
Adding an additional spacing line between two log messages.This setting gives the opportunity to add ...
Definition: Logging.h:70
Header file for the std::initializer_list aliases.
Header file for the IsSquare type trait.
Constraint on the data type.
Constraint on the data type.
Header file for the DisableIf class template.
Header file for the IsStrictlyUpper type trait.
Header file for the clear shim.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
#define BLAZE_ALWAYS_INLINE
Platform dependent setup of an enforced inline keyword.
Definition: Inline.h:85
void swap(CompressedMatrix< Type, SO > &a, CompressedMatrix< Type, SO > &b) noexcept
Swapping the contents of two compressed matrices.
Definition: CompressedMatrix.h:5148
Compile time assertion.
bool isIntact(const CompressedMatrix< Type, SO > &m)
Returns whether the invariants of the given compressed matrix are intact.
Definition: CompressedMatrix.h:5131
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2647
#define BLAZE_CONSTRAINT_MUST_NOT_BE_POINTER_TYPE(T)
Constraint on the data type.In case the given data type T is not a pointer type, a compilation error ...
Definition: Pointer.h:79
#define BLAZE_THROW_OUT_OF_RANGE(MESSAGE)
Macro for the emission of a std::out_of_range exception.This macro encapsulates the default way of Bl...
Definition: Exception.h:331
Header file for the DenseMatrix base class.
Header file for the Columns type trait.
Constraint on the data type.
Header file for the IsLower type trait.
Header file for the UniUpperProxy class.
BLAZE_ALWAYS_INLINE size_t columns(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of columns of the matrix.
Definition: Matrix.h:330
BLAZE_ALWAYS_INLINE const EnableIf_< And< IsIntegral< T >, HasSize< T, 1UL > >, If_< IsSigned< T >, SIMDint8, SIMDuint8 > > loada(const T *address) noexcept
Loads a vector of 1-byte integral values.
Definition: Loada.h:80
Header file for the IsUniTriangular type trait.
Header file for the IsStrictlyTriangular type trait.
CompressedMatrix< Type, false > TransposeType
Transpose type for expression template evaluations.
Definition: CompressedMatrix.h:2640
Constraints on the storage order of matrix types.
Header file for the exception macros of the math module.
#define BLAZE_CONSTRAINT_MUST_NOT_BE_UPPER_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is a upper triangular matrix type...
Definition: Upper.h:81
BLAZE_ALWAYS_INLINE void resize(Matrix< MT, SO > &matrix, size_t rows, size_t columns, bool preserve=true)
Changing the size of the matrix.
Definition: Matrix.h:538
BLAZE_ALWAYS_INLINE MT::Iterator end(Matrix< MT, SO > &matrix, size_t i)
Returns an iterator just past the last element of row/column i.
Definition: Matrix.h:254
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:2641
const Type & ConstReference
Reference to a constant matrix value.
Definition: CompressedMatrix.h:2645
Header file for the EnableIf class template.
Header file for utility functions for dense matrices.
void clear(const DiagonalProxy< MT > &proxy)
Clearing the represented element.
Definition: DiagonalProxy.h:553
Header file for all adaptor forward declarations.
DisableIf_< Or< IsComputation< MT >, IsTransExpr< MT > >, RowExprTrait_< MT > > row(Matrix< MT, SO > &matrix, size_t index)
Creating a view on a specific row of the given matrix.
Definition: Row.h:126
#define BLAZE_CONSTRAINT_MUST_NOT_BE_SYMMETRIC_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is a symmetric matrix type, a compilation error is created.
Definition: Symmetric.h:79
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:2642
BLAZE_ALWAYS_INLINE T1 & operator+=(SIMDPack< T1 > &lhs, const SIMDPack< T2 > &rhs)
Addition assignment operator for the addition of two SIMD packs.
Definition: BasicTypes.h:1285
Header file for run time assertion macros.
Constraint on the data type.
Constraint on the data type.
#define BLAZE_CONSTRAINT_MUST_BE_NUMERIC_TYPE(T)
Constraint on the data type.In case the given data type T is not a numeric (integral or floating poin...
Definition: Numeric.h:61
#define BLAZE_CONSTRAINT_MUST_NOT_BE_LOWER_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is a lower triangular matrix type...
Definition: Lower.h:81
#define BLAZE_CONSTRAINT_MUST_NOT_BE_REFERENCE_TYPE(T)
Constraint on the data type.In case the given data type T is not a reference type, a compilation error is created.
Definition: Reference.h:79
Element * Iterator
Iterator over non-constant elements.
Definition: CompressedMatrix.h:2646
Header file for the isDefault shim.
void swap(DiagonalMatrix< MT, SO, DF > &a, DiagonalMatrix< MT, SO, DF > &b) noexcept
Swapping the contents of two matrices.
Definition: DiagonalMatrix.h:258
Constraint on the data type.
Constraint on the data type.
#define BLAZE_CONSTRAINT_MUST_NOT_BE_RESIZABLE(T)
Constraint on the data type.In case the given data type T is resizable, i.e. has a 'resize' member fu...
Definition: Resizable.h:81
typename EnableIf< Condition, T >::Type EnableIf_
Auxiliary alias declaration for the EnableIf class template.The EnableIf_ alias declaration provides ...
Definition: EnableIf.h:223
BLAZE_ALWAYS_INLINE size_t rows(const Matrix< MT, SO > &matrix) noexcept
Returns the current number of rows of the matrix.
Definition: Matrix.h:314
SparseMatrix< This, true > BaseType
Base type of this CompressedMatrix instance.
Definition: CompressedMatrix.h:2637
bool operator<(const NegativeAccuracy< A > &lhs, const T &rhs)
Less-than comparison between a NegativeAccuracy object and a floating point value.
Definition: Accuracy.h:328
#define BLAZE_CONSTRAINT_MUST_BE_RESIZABLE(T)
Constraint on the data type.In case the given data type T is not resizable, i.e. does not have a 'res...
Definition: Resizable.h:61
Header file for the IsComputation type trait class.
#define BLAZE_CONSTRAINT_MUST_NOT_BE_EXPRESSION_TYPE(T)
Constraint on the data type.In case the given data type T is an expression (i.e. a type derived from ...
Definition: Expression.h:81
bool operator==(const NegativeAccuracy< A > &lhs, const T &rhs)
Equality comparison between a NegativeAccuracy object and a floating point value. ...
Definition: Accuracy.h:249
This ResultType
Result type for expression template evaluations.
Definition: CompressedMatrix.h:2638
bool operator!=(const NegativeAccuracy< A > &lhs, const T &rhs)
Inequality comparison between a NegativeAccuracy object and a floating point value.
Definition: Accuracy.h:289
bool isIntact(const DiagonalMatrix< MT, SO, DF > &m)
Returns whether the invariants of the given diagonal matrix are intact.
Definition: DiagonalMatrix.h:240
bool isUniUpper(const DenseMatrix< MT, SO > &dm)
Checks if the given dense matrix is an upper unitriangular matrix.
Definition: DenseMatrix.h:1344
MatrixAccessProxy< This > Reference
Reference to a non-constant matrix value.
Definition: CompressedMatrix.h:2644
#define BLAZE_CONSTRAINT_MUST_NOT_BE_HERMITIAN_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is an Hermitian matrix type, a compilation error is created.
Definition: Hermitian.h:79
BLAZE_ALWAYS_INLINE T1 & operator-=(SIMDPack< T1 > &lhs, const SIMDPack< T2 > &rhs)
Subtraction assignment operator for the subtraction of two SIMD packs.
Definition: BasicTypes.h:1303
void UNUSED_PARAMETER(const Args &...)
Suppression of unused parameter warnings.
Definition: Unused.h:81
#define BLAZE_STATIC_ASSERT(expr)
Compile time assertion macro.In case of an invalid compile time expression, a compilation error is cr...
Definition: StaticAssert.h:112
SubmatrixExprTrait_< MT, unaligned > submatrix(Matrix< MT, SO > &matrix, size_t row, size_t column, size_t m, size_t n)
Creating a view on a specific submatrix of the given matrix.
Definition: Submatrix.h:167
BLAZE_ALWAYS_INLINE bool isSquare(const Matrix< MT, SO > &matrix) noexcept
Checks if the given matrix is a square matrix.
Definition: Matrix.h:609
Header file for the IsResizable type trait.
System settings for the inline keywords.
#define BLAZE_INTERNAL_ASSERT(expr, msg)
Run time assertion macro for internal checks.In case of an invalid run time expression, the program execution is terminated. The BLAZE_INTERNAL_ASSERT macro can be disabled by setting the BLAZE_USER_ASSERTION flag to zero or by defining NDEBUG during the compilation.
Definition: Assert.h:101
Header file for the implementation of the base template of the UniUpperMatrix.
Header file for the TrueType type/value trait base class.