Dense.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_ADAPTORS_STRICTLYUPPERMATRIX_DENSE_H_
36 #define _BLAZE_MATH_ADAPTORS_STRICTLYUPPERMATRIX_DENSE_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
43 #include <iterator>
44 #include <utility>
48 #include <blaze/math/Aliases.h>
61 #include <blaze/math/Exception.h>
64 #include <blaze/math/shims/Clear.h>
74 #include <blaze/system/Inline.h>
75 #include <blaze/util/Assert.h>
81 #include <blaze/util/DisableIf.h>
82 #include <blaze/util/EnableIf.h>
83 #include <blaze/util/FalseType.h>
85 #include <blaze/util/TrueType.h>
86 #include <blaze/util/Types.h>
87 #include <blaze/util/Unused.h>
88 
89 
90 namespace blaze {
91 
92 //=================================================================================================
93 //
94 // CLASS TEMPLATE SPECIALIZATION FOR DENSE MATRICES
95 //
96 //=================================================================================================
97 
98 //*************************************************************************************************
106 template< typename MT // Type of the adapted dense matrix
107  , bool SO > // Storage order of the adapted dense matrix
108 class StrictlyUpperMatrix<MT,SO,true>
109  : public DenseMatrix< StrictlyUpperMatrix<MT,SO,true>, SO >
110 {
111  private:
112  //**Type definitions****************************************************************************
113  using OT = OppositeType_t<MT>;
114  using TT = TransposeType_t<MT>;
115  using ET = ElementType_t<MT>;
116  //**********************************************************************************************
117 
118  public:
119  //**Type definitions****************************************************************************
120  using This = StrictlyUpperMatrix<MT,SO,true>;
121  using BaseType = DenseMatrix<This,SO>;
122  using ResultType = This;
123  using OppositeType = StrictlyUpperMatrix<OT,!SO,true>;
124  using TransposeType = StrictlyLowerMatrix<TT,!SO,true>;
125  using ElementType = ET;
126  using SIMDType = SIMDType_t<MT>;
127  using ReturnType = ReturnType_t<MT>;
128  using CompositeType = const This&;
129  using Reference = StrictlyUpperProxy<MT>;
130  using ConstReference = ConstReference_t<MT>;
131  using Pointer = Pointer_t<MT>;
132  using ConstPointer = ConstPointer_t<MT>;
133  using ConstIterator = ConstIterator_t<MT>;
134  //**********************************************************************************************
135 
136  //**Rebind struct definition********************************************************************
139  template< typename NewType > // Data type of the other matrix
140  struct Rebind {
142  using Other = StrictlyUpperMatrix< typename MT::template Rebind<NewType>::Other >;
143  };
144  //**********************************************************************************************
145 
146  //**Resize struct definition********************************************************************
149  template< size_t NewM // Number of rows of the other matrix
150  , size_t NewN > // Number of columns of the other matrix
151  struct Resize {
153  using Other = StrictlyUpperMatrix< typename MT::template Resize<NewM,NewN>::Other >;
154  };
155  //**********************************************************************************************
156 
157  //**Iterator class definition*******************************************************************
160  class Iterator
161  {
162  public:
163  //**Type definitions*************************************************************************
164  using IteratorCategory = std::random_access_iterator_tag;
165  using ValueType = ElementType_t<MT>;
166  using PointerType = StrictlyUpperProxy<MT>;
167  using ReferenceType = StrictlyUpperProxy<MT>;
168  using DifferenceType = ptrdiff_t;
169 
170  // STL iterator requirements
171  using iterator_category = IteratorCategory;
172  using value_type = ValueType;
173  using pointer = PointerType;
174  using reference = ReferenceType;
175  using difference_type = DifferenceType;
176  //*******************************************************************************************
177 
178  //**Constructor******************************************************************************
181  inline Iterator() noexcept
182  : matrix_( nullptr ) // Reference to the adapted dense matrix
183  , row_ ( 0UL ) // The current row index of the iterator
184  , column_( 0UL ) // The current column index of the iterator
185  {}
186  //*******************************************************************************************
187 
188  //**Constructor******************************************************************************
195  inline Iterator( MT& matrix, size_t row, size_t column ) noexcept
196  : matrix_( &matrix ) // Reference to the adapted dense matrix
197  , row_ ( row ) // The current row-index of the iterator
198  , column_( column ) // The current column-index of the iterator
199  {}
200  //*******************************************************************************************
201 
202  //**Addition assignment operator*************************************************************
208  inline Iterator& operator+=( size_t inc ) noexcept {
209  ( SO )?( row_ += inc ):( column_ += inc );
210  return *this;
211  }
212  //*******************************************************************************************
213 
214  //**Subtraction assignment operator**********************************************************
220  inline Iterator& operator-=( size_t dec ) noexcept {
221  ( SO )?( row_ -= dec ):( column_ -= dec );
222  return *this;
223  }
224  //*******************************************************************************************
225 
226  //**Prefix increment operator****************************************************************
231  inline Iterator& operator++() noexcept {
232  ( SO )?( ++row_ ):( ++column_ );
233  return *this;
234  }
235  //*******************************************************************************************
236 
237  //**Postfix increment operator***************************************************************
242  inline const Iterator operator++( int ) noexcept {
243  const Iterator tmp( *this );
244  ++(*this);
245  return tmp;
246  }
247  //*******************************************************************************************
248 
249  //**Prefix decrement operator****************************************************************
254  inline Iterator& operator--() noexcept {
255  ( SO )?( --row_ ):( --column_ );
256  return *this;
257  }
258  //*******************************************************************************************
259 
260  //**Postfix decrement operator***************************************************************
265  inline const Iterator operator--( int ) noexcept {
266  const Iterator tmp( *this );
267  --(*this);
268  return tmp;
269  }
270  //*******************************************************************************************
271 
272  //**Element access operator******************************************************************
277  inline ReferenceType operator*() const {
278  return ReferenceType( *matrix_, row_, column_ );
279  }
280  //*******************************************************************************************
281 
282  //**Element access operator******************************************************************
287  inline PointerType operator->() const {
288  return PointerType( *matrix_, row_, column_ );
289  }
290  //*******************************************************************************************
291 
292  //**Load function****************************************************************************
302  inline SIMDType load() const {
303  return (*matrix_).load(row_,column_);
304  }
305  //*******************************************************************************************
306 
307  //**Loada function***************************************************************************
317  inline SIMDType loada() const {
318  return (*matrix_).loada(row_,column_);
319  }
320  //*******************************************************************************************
321 
322  //**Loadu function***************************************************************************
332  inline SIMDType loadu() const {
333  return (*matrix_).loadu(row_,column_);
334  }
335  //*******************************************************************************************
336 
337  //**Conversion operator**********************************************************************
342  inline operator ConstIterator() const {
343  if( SO )
344  return matrix_->begin( column_ ) + row_;
345  else
346  return matrix_->begin( row_ ) + column_;
347  }
348  //*******************************************************************************************
349 
350  //**Equality operator************************************************************************
357  friend inline bool operator==( const Iterator& lhs, const Iterator& rhs ) noexcept {
358  return ( SO )?( lhs.row_ == rhs.row_ ):( lhs.column_ == rhs.column_ );
359  }
360  //*******************************************************************************************
361 
362  //**Equality operator************************************************************************
369  friend inline bool operator==( const Iterator& lhs, const ConstIterator& rhs ) {
370  return ( ConstIterator( lhs ) == rhs );
371  }
372  //*******************************************************************************************
373 
374  //**Equality operator************************************************************************
381  friend inline bool operator==( const ConstIterator& lhs, const Iterator& rhs ) {
382  return ( lhs == ConstIterator( rhs ) );
383  }
384  //*******************************************************************************************
385 
386  //**Inequality operator**********************************************************************
393  friend inline bool operator!=( const Iterator& lhs, const Iterator& rhs ) noexcept {
394  return ( SO )?( lhs.row_ != rhs.row_ ):( lhs.column_ != rhs.column_ );
395  }
396  //*******************************************************************************************
397 
398  //**Inequality operator**********************************************************************
405  friend inline bool operator!=( const Iterator& lhs, const ConstIterator& rhs ) {
406  return ( ConstIterator( lhs ) != rhs );
407  }
408  //*******************************************************************************************
409 
410  //**Inequality operator**********************************************************************
417  friend inline bool operator!=( const ConstIterator& lhs, const Iterator& rhs ) {
418  return ( lhs != ConstIterator( rhs ) );
419  }
420  //*******************************************************************************************
421 
422  //**Less-than operator***********************************************************************
429  friend inline bool operator<( const Iterator& lhs, const Iterator& rhs ) noexcept {
430  return ( SO )?( lhs.row_ < rhs.row_ ):( lhs.column_ < rhs.column_ );
431  }
432  //*******************************************************************************************
433 
434  //**Less-than operator***********************************************************************
441  friend inline bool operator<( const Iterator& lhs, const ConstIterator& rhs ) {
442  return ( ConstIterator( lhs ) < rhs );
443  }
444  //*******************************************************************************************
445 
446  //**Less-than operator***********************************************************************
453  friend inline bool operator<( const ConstIterator& lhs, const Iterator& rhs ) {
454  return ( lhs < ConstIterator( rhs ) );
455  }
456  //*******************************************************************************************
457 
458  //**Greater-than operator********************************************************************
465  friend inline bool operator>( const Iterator& lhs, const Iterator& rhs ) noexcept {
466  return ( SO )?( lhs.row_ > rhs.row_ ):( lhs.column_ > rhs.column_ );
467  }
468  //*******************************************************************************************
469 
470  //**Greater-than operator********************************************************************
477  friend inline bool operator>( const Iterator& lhs, const ConstIterator& rhs ) {
478  return ( ConstIterator( lhs ) > rhs );
479  }
480  //*******************************************************************************************
481 
482  //**Greater-than operator********************************************************************
489  friend inline bool operator>( const ConstIterator& lhs, const Iterator& rhs ) {
490  return ( lhs > ConstIterator( rhs ) );
491  }
492  //*******************************************************************************************
493 
494  //**Less-or-equal-than operator**************************************************************
501  friend inline bool operator<=( const Iterator& lhs, const Iterator& rhs ) noexcept {
502  return ( SO )?( lhs.row_ <= rhs.row_ ):( lhs.column_ <= rhs.column_ );
503  }
504  //*******************************************************************************************
505 
506  //**Less-or-equal-than operator**************************************************************
513  friend inline bool operator<=( const Iterator& lhs, const ConstIterator& rhs ) {
514  return ( ConstIterator( lhs ) <= rhs );
515  }
516  //*******************************************************************************************
517 
518  //**Less-or-equal-than operator**************************************************************
525  friend inline bool operator<=( const ConstIterator& lhs, const Iterator& rhs ) {
526  return ( lhs <= ConstIterator( rhs ) );
527  }
528  //*******************************************************************************************
529 
530  //**Greater-or-equal-than operator***********************************************************
537  friend inline bool operator>=( const Iterator& lhs, const Iterator& rhs ) noexcept {
538  return ( SO )?( lhs.row_ >= rhs.row_ ):( lhs.column_ >= rhs.column_ );
539  }
540  //*******************************************************************************************
541 
542  //**Greater-or-equal-than operator***********************************************************
549  friend inline bool operator>=( const Iterator& lhs, const ConstIterator& rhs ) {
550  return ( ConstIterator( lhs ) >= rhs );
551  }
552  //*******************************************************************************************
553 
554  //**Greater-or-equal-than operator***********************************************************
561  friend inline bool operator>=( const ConstIterator& lhs, const Iterator& rhs ) {
562  return ( lhs >= ConstIterator( rhs ) );
563  }
564  //*******************************************************************************************
565 
566  //**Subtraction operator*********************************************************************
572  inline DifferenceType operator-( const Iterator& rhs ) const noexcept {
573  return ( SO )?( row_ - rhs.row_ ):( column_ - rhs.column_ );
574  }
575  //*******************************************************************************************
576 
577  //**Addition operator************************************************************************
584  friend inline const Iterator operator+( const Iterator& it, size_t inc ) noexcept {
585  if( SO )
586  return Iterator( *it.matrix_, it.row_ + inc, it.column_ );
587  else
588  return Iterator( *it.matrix_, it.row_, it.column_ + inc );
589  }
590  //*******************************************************************************************
591 
592  //**Addition operator************************************************************************
599  friend inline const Iterator operator+( size_t inc, const Iterator& it ) noexcept {
600  if( SO )
601  return Iterator( *it.matrix_, it.row_ + inc, it.column_ );
602  else
603  return Iterator( *it.matrix_, it.row_, it.column_ + inc );
604  }
605  //*******************************************************************************************
606 
607  //**Subtraction operator*********************************************************************
614  friend inline const Iterator operator-( const Iterator& it, size_t dec ) noexcept {
615  if( SO )
616  return Iterator( *it.matrix_, it.row_ - dec, it.column_ );
617  else
618  return Iterator( *it.matrix_, it.row_, it.column_ - dec );
619  }
620  //*******************************************************************************************
621 
622  private:
623  //**Member variables*************************************************************************
624  MT* matrix_;
625  size_t row_;
626  size_t column_;
627  //*******************************************************************************************
628  };
629  //**********************************************************************************************
630 
631  //**Compilation flags***************************************************************************
633  static constexpr bool simdEnabled = MT::simdEnabled;
634 
636  static constexpr bool smpAssignable = MT::smpAssignable;
637  //**********************************************************************************************
638 
639  //**Constructors********************************************************************************
642  explicit inline StrictlyUpperMatrix();
643  template< typename A1 > explicit inline StrictlyUpperMatrix( const A1& a1 );
644  explicit inline StrictlyUpperMatrix( size_t n, const ElementType& init );
645 
646  explicit inline StrictlyUpperMatrix( initializer_list< initializer_list<ElementType> > list );
647 
648  template< typename Other >
649  explicit inline StrictlyUpperMatrix( size_t n, const Other* array );
650 
651  template< typename Other, size_t N >
652  explicit inline StrictlyUpperMatrix( const Other (&array)[N][N] );
653 
654  explicit inline StrictlyUpperMatrix( ElementType* ptr, size_t n );
655  explicit inline StrictlyUpperMatrix( ElementType* ptr, size_t n, size_t nn );
656 
657  inline StrictlyUpperMatrix( const StrictlyUpperMatrix& m );
658  inline StrictlyUpperMatrix( StrictlyUpperMatrix&& m ) noexcept;
660  //**********************************************************************************************
661 
662  //**Destructor**********************************************************************************
665  ~StrictlyUpperMatrix() = default;
667  //**********************************************************************************************
668 
669  //**Data access functions***********************************************************************
672  inline Reference operator()( size_t i, size_t j );
673  inline ConstReference operator()( size_t i, size_t j ) const;
674  inline Reference at( size_t i, size_t j );
675  inline ConstReference at( size_t i, size_t j ) const;
676  inline ConstPointer data () const noexcept;
677  inline ConstPointer data ( size_t i ) const noexcept;
678  inline Iterator begin ( size_t i );
679  inline ConstIterator begin ( size_t i ) const;
680  inline ConstIterator cbegin( size_t i ) const;
681  inline Iterator end ( size_t i );
682  inline ConstIterator end ( size_t i ) const;
683  inline ConstIterator cend ( size_t i ) const;
685  //**********************************************************************************************
686 
687  //**Assignment operators************************************************************************
690  inline StrictlyUpperMatrix& operator=( initializer_list< initializer_list<ElementType> > list );
691 
692  template< typename Other, size_t N >
693  inline StrictlyUpperMatrix& operator=( const Other (&array)[N][N] );
694 
695  inline StrictlyUpperMatrix& operator=( const ElementType& rhs );
696  inline StrictlyUpperMatrix& operator=( const StrictlyUpperMatrix& rhs );
697  inline StrictlyUpperMatrix& operator=( StrictlyUpperMatrix&& rhs ) noexcept;
698 
699  template< typename MT2, bool SO2 >
700  inline auto operator=( const Matrix<MT2,SO2>& rhs )
701  -> DisableIf_t< IsComputation_v<MT2>, StrictlyUpperMatrix& >;
702 
703  template< typename MT2, bool SO2 >
704  inline auto operator=( const Matrix<MT2,SO2>& rhs )
705  -> EnableIf_t< IsComputation_v<MT2>, StrictlyUpperMatrix& >;
706 
707  template< typename MT2, bool SO2 >
708  inline auto operator+=( const Matrix<MT2,SO2>& rhs )
709  -> DisableIf_t< IsComputation_v<MT2>, StrictlyUpperMatrix& >;
710 
711  template< typename MT2, bool SO2 >
712  inline auto operator+=( const Matrix<MT2,SO2>& rhs )
713  -> EnableIf_t< IsComputation_v<MT2>, StrictlyUpperMatrix& >;
714 
715  template< typename MT2, bool SO2 >
716  inline auto operator-=( const Matrix<MT2,SO2>& rhs )
717  -> DisableIf_t< IsComputation_v<MT2>, StrictlyUpperMatrix& >;
718 
719  template< typename MT2, bool SO2 >
720  inline auto operator-=( const Matrix<MT2,SO2>& rhs )
721  -> EnableIf_t< IsComputation_v<MT2>, StrictlyUpperMatrix& >;
722 
723  template< typename MT2, bool SO2 >
724  inline auto operator%=( const Matrix<MT2,SO2>& rhs ) -> StrictlyUpperMatrix&;
725 
726  template< typename ST >
727  inline auto operator*=( ST rhs ) -> EnableIf_t< IsNumeric_v<ST>, StrictlyUpperMatrix& >;
728 
729  template< typename ST >
730  inline auto operator/=( ST rhs ) -> EnableIf_t< IsNumeric_v<ST>, StrictlyUpperMatrix& >;
732  //**********************************************************************************************
733 
734  //**Utility functions***************************************************************************
737  inline size_t rows() const noexcept;
738  inline size_t columns() const noexcept;
739  inline size_t spacing() const noexcept;
740  inline size_t capacity() const noexcept;
741  inline size_t capacity( size_t i ) const noexcept;
742  inline size_t nonZeros() const;
743  inline size_t nonZeros( size_t i ) const;
744  inline void reset();
745  inline void reset( size_t i );
746  inline void clear();
747  void resize ( size_t n, bool preserve=true );
748  inline void extend ( size_t n, bool preserve=true );
749  inline void reserve( size_t elements );
750  inline void shrinkToFit();
751  inline void swap( StrictlyUpperMatrix& m ) noexcept;
752 
753  static inline constexpr size_t maxNonZeros() noexcept;
754  static inline constexpr size_t maxNonZeros( size_t n ) noexcept;
756  //**********************************************************************************************
757 
758  //**Numeric functions***************************************************************************
761  template< typename Other > inline StrictlyUpperMatrix& scale( const Other& scalar );
763  //**********************************************************************************************
764 
765  //**Debugging functions*************************************************************************
768  inline bool isIntact() const noexcept;
770  //**********************************************************************************************
771 
772  //**Expression template evaluation functions****************************************************
775  template< typename Other > inline bool canAlias ( const Other* alias ) const noexcept;
776  template< typename Other > inline bool isAliased( const Other* alias ) const noexcept;
777 
778  inline bool isAligned () const noexcept;
779  inline bool canSMPAssign() const noexcept;
780 
781  BLAZE_ALWAYS_INLINE SIMDType load ( size_t i, size_t j ) const noexcept;
782  BLAZE_ALWAYS_INLINE SIMDType loada( size_t i, size_t j ) const noexcept;
783  BLAZE_ALWAYS_INLINE SIMDType loadu( size_t i, size_t j ) const noexcept;
785  //**********************************************************************************************
786 
787  private:
788  //**Construction functions**********************************************************************
791  inline const MT construct( size_t n , TrueType );
792  inline const MT construct( const ElementType& value, FalseType );
793 
794  template< typename MT2, bool SO2, typename T >
795  inline const MT construct( const Matrix<MT2,SO2>& m, T );
797  //**********************************************************************************************
798 
799  //**Member variables****************************************************************************
802  MT matrix_;
803 
804  //**********************************************************************************************
805 
806  //**Friend declarations*************************************************************************
807  template< typename MT2, bool SO2, bool DF2 >
808  friend MT2& derestrict( StrictlyUpperMatrix<MT2,SO2,DF2>& m );
809  //**********************************************************************************************
810 
811  //**Compile time checks*************************************************************************
824  BLAZE_STATIC_ASSERT( ( Size_v<MT,0UL> == Size_v<MT,1UL> ) );
825  //**********************************************************************************************
826 };
828 //*************************************************************************************************
829 
830 
831 
832 
833 //=================================================================================================
834 //
835 // CONSTRUCTORS
836 //
837 //=================================================================================================
838 
839 //*************************************************************************************************
843 template< typename MT // Type of the adapted dense matrix
844  , bool SO > // Storage order of the adapted dense matrix
845 inline StrictlyUpperMatrix<MT,SO,true>::StrictlyUpperMatrix()
846  : matrix_() // The adapted dense matrix
847 {
848  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly upper matrix detected" );
849  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
850 }
852 //*************************************************************************************************
853 
854 
855 //*************************************************************************************************
873 template< typename MT // Type of the adapted dense matrix
874  , bool SO > // Storage order of the adapted dense matrix
875 template< typename A1 > // Type of the constructor argument
876 inline StrictlyUpperMatrix<MT,SO,true>::StrictlyUpperMatrix( const A1& a1 )
877  : matrix_( construct( a1, typename IsResizable<MT>::Type() ) ) // The adapted dense matrix
878 {
879  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly upper matrix detected" );
880  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
881 }
883 //*************************************************************************************************
884 
885 
886 //*************************************************************************************************
893 template< typename MT // Type of the adapted dense matrix
894  , bool SO > // Storage order of the adapted dense matrix
895 inline StrictlyUpperMatrix<MT,SO,true>::StrictlyUpperMatrix( size_t n, const ElementType& init )
896  : matrix_( n, n, ElementType() ) // The adapted dense matrix
897 {
899 
900  if( SO ) {
901  for( size_t j=0UL; j<columns(); ++j ) {
902  for( size_t i=0UL; i<j; ++i )
903  matrix_(i,j) = init;
904  }
905  }
906  else {
907  for( size_t i=0UL; i<rows(); ++i ) {
908  for( size_t j=i+1UL; j<columns(); ++j )
909  matrix_(i,j) = init;
910  }
911  }
912 
913  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly upper matrix detected" );
914  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
915 }
917 //*************************************************************************************************
918 
919 
920 //*************************************************************************************************
944 template< typename MT // Type of the adapted dense matrix
945  , bool SO > // Storage order of the adapted dense matrix
946 inline StrictlyUpperMatrix<MT,SO,true>::StrictlyUpperMatrix( initializer_list< initializer_list<ElementType> > list )
947  : matrix_( list ) // The adapted dense matrix
948 {
949  if( !isStrictlyUpper( matrix_ ) ) {
950  BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of strictly upper matrix" );
951  }
952 
953  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
954 }
956 //*************************************************************************************************
957 
958 
959 //*************************************************************************************************
986 template< typename MT // Type of the adapted dense matrix
987  , bool SO > // Storage order of the adapted dense matrix
988 template< typename Other > // Data type of the initialization array
989 inline StrictlyUpperMatrix<MT,SO,true>::StrictlyUpperMatrix( size_t n, const Other* array )
990  : matrix_( n, n, array ) // The adapted dense matrix
991 {
992  if( !isStrictlyUpper( matrix_ ) ) {
993  BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of strictly upper matrix" );
994  }
995 
996  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
997 }
999 //*************************************************************************************************
1000 
1001 
1002 //*************************************************************************************************
1025 template< typename MT // Type of the adapted dense matrix
1026  , bool SO > // Storage order of the adapted dense matrix
1027 template< typename Other // Data type of the initialization array
1028  , size_t N > // Number of columns of the initialization array
1029 inline StrictlyUpperMatrix<MT,SO,true>::StrictlyUpperMatrix( const Other (&array)[N][N] )
1030  : matrix_( array ) // The adapted dense matrix
1031 {
1032  if( !isStrictlyUpper( matrix_ ) ) {
1033  BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of strictly upper matrix" );
1034  }
1035 
1036  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1037 }
1039 //*************************************************************************************************
1040 
1041 
1042 //*************************************************************************************************
1075 template< typename MT // Type of the adapted dense matrix
1076  , bool SO > // Storage order of the adapted dense matrix
1077 inline StrictlyUpperMatrix<MT,SO,true>::StrictlyUpperMatrix( ElementType* ptr, size_t n )
1078  : matrix_( ptr, n, n ) // The adapted dense matrix
1079 {
1080  if( !isStrictlyUpper( matrix_ ) ) {
1081  BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of strictly upper matrix" );
1082  }
1083 
1084  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1085 }
1087 //*************************************************************************************************
1088 
1089 
1090 //*************************************************************************************************
1124 template< typename MT // Type of the adapted dense matrix
1125  , bool SO > // Storage order of the adapted dense matrix
1126 inline StrictlyUpperMatrix<MT,SO,true>::StrictlyUpperMatrix( ElementType* ptr, size_t n, size_t nn )
1127  : matrix_( ptr, n, n, nn ) // The adapted dense matrix
1128 {
1129  if( !isStrictlyUpper( matrix_ ) ) {
1130  BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of strictly upper matrix" );
1131  }
1132 
1133  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1134 }
1136 //*************************************************************************************************
1137 
1138 
1139 //*************************************************************************************************
1145 template< typename MT // Type of the adapted dense matrix
1146  , bool SO > // Storage order of the adapted dense matrix
1147 inline StrictlyUpperMatrix<MT,SO,true>::StrictlyUpperMatrix( const StrictlyUpperMatrix& m )
1148  : matrix_( m.matrix_ ) // The adapted dense matrix
1149 {
1150  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly upper matrix detected" );
1151  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1152 }
1154 //*************************************************************************************************
1155 
1156 
1157 //*************************************************************************************************
1163 template< typename MT // Type of the adapted dense matrix
1164  , bool SO > // Storage order of the adapted dense matrix
1165 inline StrictlyUpperMatrix<MT,SO,true>::StrictlyUpperMatrix( StrictlyUpperMatrix&& m ) noexcept
1166  : matrix_( std::move( m.matrix_ ) ) // The adapted dense matrix
1167 {
1168  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly upper matrix detected" );
1169  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1170 }
1172 //*************************************************************************************************
1173 
1174 
1175 
1176 
1177 //=================================================================================================
1178 //
1179 // DATA ACCESS FUNCTIONS
1180 //
1181 //=================================================================================================
1182 
1183 //*************************************************************************************************
1199 template< typename MT // Type of the adapted dense matrix
1200  , bool SO > // Storage order of the adapted dense matrix
1202  StrictlyUpperMatrix<MT,SO,true>::operator()( size_t i, size_t j )
1203 {
1204  BLAZE_USER_ASSERT( i<rows() , "Invalid row access index" );
1205  BLAZE_USER_ASSERT( j<columns(), "Invalid column access index" );
1206 
1207  return Reference( matrix_, i, j );
1208 }
1210 //*************************************************************************************************
1211 
1212 
1213 //*************************************************************************************************
1229 template< typename MT // Type of the adapted dense matrix
1230  , bool SO > // Storage order of the adapted dense matrix
1232  StrictlyUpperMatrix<MT,SO,true>::operator()( size_t i, size_t j ) const
1233 {
1234  BLAZE_USER_ASSERT( i<rows() , "Invalid row access index" );
1235  BLAZE_USER_ASSERT( j<columns(), "Invalid column access index" );
1236 
1237  return matrix_(i,j);
1238 }
1240 //*************************************************************************************************
1241 
1242 
1243 //*************************************************************************************************
1260 template< typename MT // Type of the adapted dense matrix
1261  , bool SO > // Storage order of the adapted dense matrix
1263  StrictlyUpperMatrix<MT,SO,true>::at( size_t i, size_t j )
1264 {
1265  if( i >= rows() ) {
1266  BLAZE_THROW_OUT_OF_RANGE( "Invalid row access index" );
1267  }
1268  if( j >= columns() ) {
1269  BLAZE_THROW_OUT_OF_RANGE( "Invalid column access index" );
1270  }
1271  return (*this)(i,j);
1272 }
1274 //*************************************************************************************************
1275 
1276 
1277 //*************************************************************************************************
1294 template< typename MT // Type of the adapted dense matrix
1295  , bool SO > // Storage order of the adapted dense matrix
1297  StrictlyUpperMatrix<MT,SO,true>::at( size_t i, size_t j ) const
1298 {
1299  if( i >= rows() ) {
1300  BLAZE_THROW_OUT_OF_RANGE( "Invalid row access index" );
1301  }
1302  if( j >= columns() ) {
1303  BLAZE_THROW_OUT_OF_RANGE( "Invalid column access index" );
1304  }
1305  return (*this)(i,j);
1306 }
1308 //*************************************************************************************************
1309 
1310 
1311 //*************************************************************************************************
1324 template< typename MT // Type of the adapted dense matrix
1325  , bool SO > // Storage order of the adapted dense matrix
1326 inline typename StrictlyUpperMatrix<MT,SO,true>::ConstPointer
1327  StrictlyUpperMatrix<MT,SO,true>::data() const noexcept
1328 {
1329  return matrix_.data();
1330 }
1332 //*************************************************************************************************
1333 
1334 
1335 //*************************************************************************************************
1344 template< typename MT // Type of the adapted dense matrix
1345  , bool SO > // Storage order of the adapted dense matrix
1346 inline typename StrictlyUpperMatrix<MT,SO,true>::ConstPointer
1347  StrictlyUpperMatrix<MT,SO,true>::data( size_t i ) const noexcept
1348 {
1349  return matrix_.data(i);
1350 }
1352 //*************************************************************************************************
1353 
1354 
1355 //*************************************************************************************************
1367 template< typename MT // Type of the adapted dense matrix
1368  , bool SO > // Storage order of the adapted dense matrix
1371 {
1372  if( SO )
1373  return Iterator( matrix_, 0UL, i );
1374  else
1375  return Iterator( matrix_, i, 0UL );
1376 }
1378 //*************************************************************************************************
1379 
1380 
1381 //*************************************************************************************************
1393 template< typename MT // Type of the adapted dense matrix
1394  , bool SO > // Storage order of the adapted dense matrix
1396  StrictlyUpperMatrix<MT,SO,true>::begin( size_t i ) const
1397 {
1398  return matrix_.begin(i);
1399 }
1401 //*************************************************************************************************
1402 
1403 
1404 //*************************************************************************************************
1416 template< typename MT // Type of the adapted dense matrix
1417  , bool SO > // Storage order of the adapted dense matrix
1419  StrictlyUpperMatrix<MT,SO,true>::cbegin( size_t i ) const
1420 {
1421  return matrix_.cbegin(i);
1422 }
1424 //*************************************************************************************************
1425 
1426 
1427 //*************************************************************************************************
1439 template< typename MT // Type of the adapted dense matrix
1440  , bool SO > // Storage order of the adapted dense matrix
1443 {
1444  if( SO )
1445  return Iterator( matrix_, rows(), i );
1446  else
1447  return Iterator( matrix_, i, columns() );
1448 }
1450 //*************************************************************************************************
1451 
1452 
1453 //*************************************************************************************************
1465 template< typename MT // Type of the adapted dense matrix
1466  , bool SO > // Storage order of the adapted dense matrix
1468  StrictlyUpperMatrix<MT,SO,true>::end( size_t i ) const
1469 {
1470  return matrix_.end(i);
1471 }
1473 //*************************************************************************************************
1474 
1475 
1476 //*************************************************************************************************
1488 template< typename MT // Type of the adapted dense matrix
1489  , bool SO > // Storage order of the adapted dense matrix
1491  StrictlyUpperMatrix<MT,SO,true>::cend( size_t i ) const
1492 {
1493  return matrix_.cend(i);
1494 }
1496 //*************************************************************************************************
1497 
1498 
1499 
1500 
1501 //=================================================================================================
1502 //
1503 // ASSIGNMENT OPERATORS
1504 //
1505 //=================================================================================================
1506 
1507 //*************************************************************************************************
1514 template< typename MT // Type of the adapted dense matrix
1515  , bool SO > // Storage order of the adapted dense matrix
1516 inline StrictlyUpperMatrix<MT,SO,true>&
1517  StrictlyUpperMatrix<MT,SO,true>::operator=( const ElementType& rhs )
1518 {
1519  if( SO ) {
1520  for( size_t j=1UL; j<columns(); ++j )
1521  for( size_t i=0UL; i<j; ++i )
1522  matrix_(i,j) = rhs;
1523  }
1524  else {
1525  for( size_t i=0UL; i<rows(); ++i )
1526  for( size_t j=i+1UL; j<columns(); ++j )
1527  matrix_(i,j) = rhs;
1528  }
1529 
1530  return *this;
1531 }
1533 //*************************************************************************************************
1534 
1535 
1536 //*************************************************************************************************
1561 template< typename MT // Type of the adapted dense matrix
1562  , bool SO > // Storage order of the adapted dense matrix
1563 inline StrictlyUpperMatrix<MT,SO,true>&
1564  StrictlyUpperMatrix<MT,SO,true>::operator=( initializer_list< initializer_list<ElementType> > list )
1565 {
1566  const InitializerMatrix<ElementType> tmp( list, list.size() );
1567 
1568  if( !isStrictlyUpper( tmp ) ) {
1569  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to strictly upper matrix" );
1570  }
1571 
1572  matrix_ = list;
1573 
1574  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly upper matrix detected" );
1575  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1576 
1577  return *this;
1578 }
1580 //*************************************************************************************************
1581 
1582 
1583 //*************************************************************************************************
1608 template< typename MT // Type of the adapted dense matrix
1609  , bool SO > // Storage order of the adapted dense matrix
1610 template< typename Other // Data type of the initialization array
1611  , size_t N > // Number of rows and columns of the initialization array
1612 inline StrictlyUpperMatrix<MT,SO,true>&
1613  StrictlyUpperMatrix<MT,SO,true>::operator=( const Other (&array)[N][N] )
1614 {
1615  MT tmp( array );
1616 
1617  if( !isStrictlyUpper( tmp ) ) {
1618  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to strictly upper matrix" );
1619  }
1620 
1621  matrix_ = std::move( tmp );
1622 
1623  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly upper matrix detected" );
1624  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1625 
1626  return *this;
1627 }
1629 //*************************************************************************************************
1630 
1631 
1632 //*************************************************************************************************
1642 template< typename MT // Type of the adapted dense matrix
1643  , bool SO > // Storage order of the adapted dense matrix
1644 inline StrictlyUpperMatrix<MT,SO,true>&
1645  StrictlyUpperMatrix<MT,SO,true>::operator=( const StrictlyUpperMatrix& rhs )
1646 {
1647  matrix_ = rhs.matrix_;
1648 
1649  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly upper matrix detected" );
1650  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1651 
1652  return *this;
1653 }
1655 //*************************************************************************************************
1656 
1657 
1658 //*************************************************************************************************
1665 template< typename MT // Type of the adapted dense matrix
1666  , bool SO > // Storage order of the adapted dense matrix
1667 inline StrictlyUpperMatrix<MT,SO,true>&
1668  StrictlyUpperMatrix<MT,SO,true>::operator=( StrictlyUpperMatrix&& rhs ) noexcept
1669 {
1670  matrix_ = std::move( rhs.matrix_ );
1671 
1672  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly upper matrix detected" );
1673  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1674 
1675  return *this;
1676 }
1678 //*************************************************************************************************
1679 
1680 
1681 //*************************************************************************************************
1694 template< typename MT // Type of the adapted dense matrix
1695  , bool SO > // Storage order of the adapted dense matrix
1696 template< typename MT2 // Type of the right-hand side matrix
1697  , bool SO2 > // Storage order of the right-hand side matrix
1698 inline auto StrictlyUpperMatrix<MT,SO,true>::operator=( const Matrix<MT2,SO2>& rhs )
1699  -> DisableIf_t< IsComputation_v<MT2>, StrictlyUpperMatrix& >
1700 {
1701  if( IsUniTriangular_v<MT2> ||
1702  ( !IsStrictlyUpper_v<MT2> && !isStrictlyUpper( ~rhs ) ) ) {
1703  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to strictly upper matrix" );
1704  }
1705 
1706  matrix_ = declupp( ~rhs );
1707 
1708  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly upper matrix detected" );
1709  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1710 
1711  return *this;
1712 }
1714 //*************************************************************************************************
1715 
1716 
1717 //*************************************************************************************************
1730 template< typename MT // Type of the adapted dense matrix
1731  , bool SO > // Storage order of the adapted dense matrix
1732 template< typename MT2 // Type of the right-hand side matrix
1733  , bool SO2 > // Storage order of the right-hand side matrix
1734 inline auto StrictlyUpperMatrix<MT,SO,true>::operator=( const Matrix<MT2,SO2>& rhs )
1735  -> EnableIf_t< IsComputation_v<MT2>, StrictlyUpperMatrix& >
1736 {
1737  if( IsUniTriangular_v<MT2> || ( !IsSquare_v<MT2> && !isSquare( ~rhs ) ) ) {
1738  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to strictly upper matrix" );
1739  }
1740 
1741  if( IsStrictlyUpper_v<MT2> ) {
1742  matrix_ = ~rhs;
1743  }
1744  else {
1745  MT tmp( ~rhs );
1746 
1747  if( !isStrictlyUpper( tmp ) ) {
1748  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to strictly upper matrix" );
1749  }
1750 
1751  matrix_ = std::move( tmp );
1752  }
1753 
1754  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly 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 StrictlyUpperMatrix<MT,SO,true>::operator+=( const Matrix<MT2,SO2>& rhs )
1781  -> DisableIf_t< IsComputation_v<MT2>, StrictlyUpperMatrix& >
1782 {
1783  if( IsUniTriangular_v<MT2> ||
1784  ( !IsStrictlyUpper_v<MT2> && !isStrictlyUpper( ~rhs ) ) ) {
1785  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to strictly upper matrix" );
1786  }
1787 
1788  matrix_ += declupp( ~rhs );
1789 
1790  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly upper matrix detected" );
1791  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1792 
1793  return *this;
1794 }
1796 //*************************************************************************************************
1797 
1798 
1799 //*************************************************************************************************
1812 template< typename MT // Type of the adapted dense matrix
1813  , bool SO > // Storage order of the adapted dense matrix
1814 template< typename MT2 // Type of the right-hand side matrix
1815  , bool SO2 > // Storage order of the right-hand side matrix
1816 inline auto StrictlyUpperMatrix<MT,SO,true>::operator+=( const Matrix<MT2,SO2>& rhs )
1817  -> EnableIf_t< IsComputation_v<MT2>, StrictlyUpperMatrix& >
1818 {
1819  if( IsUniTriangular_v<MT2> || ( !IsSquare_v<MT2> && !isSquare( ~rhs ) ) ) {
1820  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to strictly upper matrix" );
1821  }
1822 
1823  if( IsStrictlyUpper_v<MT2> ) {
1824  matrix_ += ~rhs;
1825  }
1826  else {
1827  const ResultType_t<MT2> tmp( ~rhs );
1828 
1829  if( !isStrictlyUpper( tmp ) ) {
1830  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to strictly upper matrix" );
1831  }
1832 
1833  matrix_ += declupp( tmp );
1834  }
1835 
1836  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly upper matrix detected" );
1837  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1838 
1839  return *this;
1840 }
1842 //*************************************************************************************************
1843 
1844 
1845 //*************************************************************************************************
1858 template< typename MT // Type of the adapted dense matrix
1859  , bool SO > // Storage order of the adapted dense matrix
1860 template< typename MT2 // Type of the right-hand side matrix
1861  , bool SO2 > // Storage order of the right-hand side matrix
1862 inline auto StrictlyUpperMatrix<MT,SO,true>::operator-=( const Matrix<MT2,SO2>& rhs )
1863  -> DisableIf_t< IsComputation_v<MT2>, StrictlyUpperMatrix& >
1864 {
1865  if( !IsStrictlyUpper_v<MT2> && !isStrictlyUpper( ~rhs ) ) {
1866  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to strictly upper matrix" );
1867  }
1868 
1869  matrix_ -= declupp( ~rhs );
1870 
1871  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly upper matrix detected" );
1872  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1873 
1874  return *this;
1875 }
1877 //*************************************************************************************************
1878 
1879 
1880 //*************************************************************************************************
1893 template< typename MT // Type of the adapted dense matrix
1894  , bool SO > // Storage order of the adapted dense matrix
1895 template< typename MT2 // Type of the right-hand side matrix
1896  , bool SO2 > // Storage order of the right-hand side matrix
1897 inline auto StrictlyUpperMatrix<MT,SO,true>::operator-=( const Matrix<MT2,SO2>& rhs )
1898  -> EnableIf_t< IsComputation_v<MT2>, StrictlyUpperMatrix& >
1899 {
1900  if( !IsSquare_v<MT2> && !isSquare( ~rhs ) ) {
1901  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to strictly upper matrix" );
1902  }
1903 
1904  if( IsStrictlyUpper_v<MT2> ) {
1905  matrix_ -= ~rhs;
1906  }
1907  else {
1908  const ResultType_t<MT2> tmp( ~rhs );
1909 
1910  if( !isStrictlyUpper( tmp ) ) {
1911  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to strictly upper matrix" );
1912  }
1913 
1914  matrix_ -= declupp( tmp );
1915  }
1916 
1917  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly upper matrix detected" );
1918  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1919 
1920  return *this;
1921 }
1923 //*************************************************************************************************
1924 
1925 
1926 //*************************************************************************************************
1937 template< typename MT // Type of the adapted dense matrix
1938  , bool SO > // Storage order of the adapted dense matrix
1939 template< typename MT2 // Type of the right-hand side matrix
1940  , bool SO2 > // Storage order of the right-hand side matrix
1941 inline auto StrictlyUpperMatrix<MT,SO,true>::operator%=( const Matrix<MT2,SO2>& rhs )
1942  -> StrictlyUpperMatrix&
1943 {
1944  if( !IsSquare_v<MT2> && !isSquare( ~rhs ) ) {
1945  BLAZE_THROW_INVALID_ARGUMENT( "Invalid assignment to strictly upper matrix" );
1946  }
1947 
1948  matrix_ %= ~rhs;
1949 
1950  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly upper matrix detected" );
1951  BLAZE_INTERNAL_ASSERT( isIntact(), "Broken invariant detected" );
1952 
1953  return *this;
1954 }
1956 //*************************************************************************************************
1957 
1958 
1959 //*************************************************************************************************
1967 template< typename MT // Type of the adapted dense matrix
1968  , bool SO > // Storage order of the adapted dense matrix
1969 template< typename ST > // Data type of the right-hand side scalar
1970 inline auto StrictlyUpperMatrix<MT,SO,true>::operator*=( ST rhs )
1971  -> EnableIf_t< IsNumeric_v<ST>, StrictlyUpperMatrix& >
1972 {
1973  matrix_ *= rhs;
1974  return *this;
1975 }
1976 //*************************************************************************************************
1977 
1978 
1979 //*************************************************************************************************
1987 template< typename MT // Type of the adapted dense matrix
1988  , bool SO > // Storage order of the adapted dense matrix
1989 template< typename ST > // Data type of the right-hand side scalar
1990 inline auto StrictlyUpperMatrix<MT,SO,true>::operator/=( ST rhs )
1991  -> EnableIf_t< IsNumeric_v<ST>, StrictlyUpperMatrix& >
1992 {
1993  BLAZE_USER_ASSERT( !isZero( rhs ), "Division by zero detected" );
1994 
1995  matrix_ /= rhs;
1996  return *this;
1997 }
1999 //*************************************************************************************************
2000 
2001 
2002 
2003 
2004 //=================================================================================================
2005 //
2006 // UTILITY FUNCTIONS
2007 //
2008 //=================================================================================================
2009 
2010 //*************************************************************************************************
2016 template< typename MT // Type of the adapted dense matrix
2017  , bool SO > // Storage order of the adapted dense matrix
2018 inline size_t StrictlyUpperMatrix<MT,SO,true>::rows() const noexcept
2019 {
2020  return matrix_.rows();
2021 }
2023 //*************************************************************************************************
2024 
2025 
2026 //*************************************************************************************************
2032 template< typename MT // Type of the adapted dense matrix
2033  , bool SO > // Storage order of the adapted dense matrix
2034 inline size_t StrictlyUpperMatrix<MT,SO,true>::columns() const noexcept
2035 {
2036  return matrix_.columns();
2037 }
2039 //*************************************************************************************************
2040 
2041 
2042 //*************************************************************************************************
2053 template< typename MT // Type of the adapted dense matrix
2054  , bool SO > // Storage order of the adapted dense matrix
2055 inline size_t StrictlyUpperMatrix<MT,SO,true>::spacing() const noexcept
2056 {
2057  return matrix_.spacing();
2058 }
2060 //*************************************************************************************************
2061 
2062 
2063 //*************************************************************************************************
2069 template< typename MT // Type of the adapted dense matrix
2070  , bool SO > // Storage order of the adapted dense matrix
2071 inline size_t StrictlyUpperMatrix<MT,SO,true>::capacity() const noexcept
2072 {
2073  return matrix_.capacity();
2074 }
2076 //*************************************************************************************************
2077 
2078 
2079 //*************************************************************************************************
2091 template< typename MT // Type of the adapted dense matrix
2092  , bool SO > // Storage order of the adapted dense matrix
2093 inline size_t StrictlyUpperMatrix<MT,SO,true>::capacity( size_t i ) const noexcept
2094 {
2095  return matrix_.capacity(i);
2096 }
2098 //*************************************************************************************************
2099 
2100 
2101 //*************************************************************************************************
2107 template< typename MT // Type of the adapted dense matrix
2108  , bool SO > // Storage order of the adapted dense matrix
2109 inline size_t StrictlyUpperMatrix<MT,SO,true>::nonZeros() const
2110 {
2111  return matrix_.nonZeros();
2112 }
2114 //*************************************************************************************************
2115 
2116 
2117 //*************************************************************************************************
2129 template< typename MT // Type of the adapted dense matrix
2130  , bool SO > // Storage order of the adapted dense matrix
2131 inline size_t StrictlyUpperMatrix<MT,SO,true>::nonZeros( size_t i ) const
2132 {
2133  return matrix_.nonZeros(i);
2134 }
2136 //*************************************************************************************************
2137 
2138 
2139 //*************************************************************************************************
2145 template< typename MT // Type of the adapted dense matrix
2146  , bool SO > // Storage order of the adapted dense matrix
2148 {
2149  using blaze::clear;
2150 
2151  if( SO ) {
2152  for( size_t j=1UL; j<columns(); ++j )
2153  for( size_t i=0UL; i<j; ++i )
2154  clear( matrix_(i,j) );
2155  }
2156  else {
2157  for( size_t i=0UL; i<rows(); ++i )
2158  for( size_t j=i+1UL; j<columns(); ++j )
2159  clear( matrix_(i,j) );
2160  }
2161 }
2163 //*************************************************************************************************
2164 
2165 
2166 //*************************************************************************************************
2179 template< typename MT // Type of the adapted dense matrix
2180  , bool SO > // Storage order of the adapted dense matrix
2181 inline void StrictlyUpperMatrix<MT,SO,true>::reset( size_t i )
2182 {
2183  using blaze::clear;
2184 
2185  if( SO ) {
2186  for( size_t j=0UL; j<i; ++j )
2187  clear( matrix_(j,i) );
2188  }
2189  else {
2190  for( size_t j=i+1UL; j<columns(); ++j )
2191  clear( matrix_(i,j) );
2192  }
2193 }
2195 //*************************************************************************************************
2196 
2197 
2198 //*************************************************************************************************
2210 template< typename MT // Type of the adapted dense matrix
2211  , bool SO > // Storage order of the adapted dense matrix
2213 {
2214  using blaze::clear;
2215 
2216  if( IsResizable_v<MT> ) {
2217  clear( matrix_ );
2218  }
2219  else {
2220  reset();
2221  }
2222 }
2224 //*************************************************************************************************
2225 
2226 
2227 //*************************************************************************************************
2263 template< typename MT // Type of the adapted dense matrix
2264  , bool SO > // Storage order of the adapted dense matrix
2265 void StrictlyUpperMatrix<MT,SO,true>::resize( size_t n, bool preserve )
2266 {
2268 
2269  UNUSED_PARAMETER( preserve );
2270 
2271  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly upper matrix detected" );
2272 
2273  const size_t oldsize( matrix_.rows() );
2274 
2275  matrix_.resize( n, n, true );
2276 
2277  if( n > oldsize )
2278  {
2279  const size_t increment( n - oldsize );
2280  submatrix( matrix_, oldsize, 0UL, increment, n ).reset();
2281  }
2282 }
2284 //*************************************************************************************************
2285 
2286 
2287 //*************************************************************************************************
2300 template< typename MT // Type of the adapted dense matrix
2301  , bool SO > // Storage order of the adapted dense matrix
2302 inline void StrictlyUpperMatrix<MT,SO,true>::extend( size_t n, bool preserve )
2303 {
2305 
2306  UNUSED_PARAMETER( preserve );
2307 
2308  resize( rows() + n, true );
2309 }
2310 //*************************************************************************************************
2311 
2312 
2313 //*************************************************************************************************
2323 template< typename MT // Type of the adapted dense matrix
2324  , bool SO > // Storage order of the adapted dense matrix
2325 inline void StrictlyUpperMatrix<MT,SO,true>::reserve( size_t elements )
2326 {
2327  matrix_.reserve( elements );
2328 }
2330 //*************************************************************************************************
2331 
2332 
2333 //*************************************************************************************************
2343 template< typename MT // Type of the adapted dense matrix
2344  , bool SO > // Storage order of the adapted dense matrix
2346 {
2347  matrix_.shrinkToFit();
2348 }
2350 //*************************************************************************************************
2351 
2352 
2353 //*************************************************************************************************
2360 template< typename MT // Type of the adapted dense matrix
2361  , bool SO > // Storage order of the adapted dense matrix
2362 inline void StrictlyUpperMatrix<MT,SO,true>::swap( StrictlyUpperMatrix& m ) noexcept
2363 {
2364  using std::swap;
2365 
2366  swap( matrix_, m.matrix_ );
2367 }
2369 //*************************************************************************************************
2370 
2371 
2372 //*************************************************************************************************
2384 template< typename MT // Type of the adapted dense matrix
2385  , bool SO > // Storage order of the adapted dense matrix
2386 inline constexpr size_t StrictlyUpperMatrix<MT,SO,true>::maxNonZeros() noexcept
2387 {
2389 
2390  return maxNonZeros( Size_v<MT,0UL> );
2391 }
2393 //*************************************************************************************************
2394 
2395 
2396 //*************************************************************************************************
2406 template< typename MT // Type of the adapted dense matrix
2407  , bool SO > // Storage order of the adapted dense matrix
2408 inline constexpr size_t StrictlyUpperMatrix<MT,SO,true>::maxNonZeros( size_t n ) noexcept
2409 {
2410  return ( ( n - 1UL ) * n ) / 2UL;
2411 }
2413 //*************************************************************************************************
2414 
2415 
2416 
2417 
2418 //=================================================================================================
2419 //
2420 // NUMERIC FUNCTIONS
2421 //
2422 //=================================================================================================
2423 
2424 //*************************************************************************************************
2442 template< typename MT // Type of the adapted dense matrix
2443  , bool SO > // Storage order of the adapted dense matrix
2444 template< typename Other > // Data type of the scalar value
2445 inline StrictlyUpperMatrix<MT,SO,true>&
2446  StrictlyUpperMatrix<MT,SO,true>::scale( const Other& scalar )
2447 {
2448  matrix_.scale( scalar );
2449  return *this;
2450 }
2452 //*************************************************************************************************
2453 
2454 
2455 
2456 
2457 //=================================================================================================
2458 //
2459 // DEBUGGING FUNCTIONS
2460 //
2461 //=================================================================================================
2462 
2463 //*************************************************************************************************
2473 template< typename MT // Type of the adapted dense matrix
2474  , bool SO > // Storage order of the adapted dense matrix
2475 inline bool StrictlyUpperMatrix<MT,SO,true>::isIntact() const noexcept
2476 {
2477  using blaze::isIntact;
2478 
2479  return ( isIntact( matrix_ ) && isStrictlyUpper( matrix_ ) );
2480 }
2482 //*************************************************************************************************
2483 
2484 
2485 
2486 
2487 //=================================================================================================
2488 //
2489 // EXPRESSION TEMPLATE EVALUATION FUNCTIONS
2490 //
2491 //=================================================================================================
2492 
2493 //*************************************************************************************************
2504 template< typename MT // Type of the adapted dense matrix
2505  , bool SO > // Storage order of the adapted dense matrix
2506 template< typename Other > // Data type of the foreign expression
2507 inline bool StrictlyUpperMatrix<MT,SO,true>::canAlias( const Other* alias ) const noexcept
2508 {
2509  return matrix_.canAlias( alias );
2510 }
2512 //*************************************************************************************************
2513 
2514 
2515 //*************************************************************************************************
2526 template< typename MT // Type of the adapted dense matrix
2527  , bool SO > // Storage order of the adapted dense matrix
2528 template< typename Other > // Data type of the foreign expression
2529 inline bool StrictlyUpperMatrix<MT,SO,true>::isAliased( const Other* alias ) const noexcept
2530 {
2531  return matrix_.isAliased( alias );
2532 }
2534 //*************************************************************************************************
2535 
2536 
2537 //*************************************************************************************************
2547 template< typename MT // Type of the adapted dense matrix
2548  , bool SO > // Storage order of the adapted dense matrix
2549 inline bool StrictlyUpperMatrix<MT,SO,true>::isAligned() const noexcept
2550 {
2551  return matrix_.isAligned();
2552 }
2554 //*************************************************************************************************
2555 
2556 
2557 //*************************************************************************************************
2568 template< typename MT // Type of the adapted dense matrix
2569  , bool SO > // Storage order of the adapted dense matrix
2570 inline bool StrictlyUpperMatrix<MT,SO,true>::canSMPAssign() const noexcept
2571 {
2572  return matrix_.canSMPAssign();
2573 }
2575 //*************************************************************************************************
2576 
2577 
2578 //*************************************************************************************************
2594 template< typename MT // Type of the adapted dense matrix
2595  , bool SO > // Storage order of the adapted dense matrix
2596 BLAZE_ALWAYS_INLINE typename StrictlyUpperMatrix<MT,SO,true>::SIMDType
2597  StrictlyUpperMatrix<MT,SO,true>::load( size_t i, size_t j ) const noexcept
2598 {
2599  return matrix_.load( i, j );
2600 }
2602 //*************************************************************************************************
2603 
2604 
2605 //*************************************************************************************************
2621 template< typename MT // Type of the adapted dense matrix
2622  , bool SO > // Storage order of the adapted dense matrix
2623 BLAZE_ALWAYS_INLINE typename StrictlyUpperMatrix<MT,SO,true>::SIMDType
2624  StrictlyUpperMatrix<MT,SO,true>::loada( size_t i, size_t j ) const noexcept
2625 {
2626  return matrix_.loada( i, j );
2627 }
2629 //*************************************************************************************************
2630 
2631 
2632 //*************************************************************************************************
2648 template< typename MT // Type of the adapted dense matrix
2649  , bool SO > // Storage order of the adapted dense matrix
2650 BLAZE_ALWAYS_INLINE typename StrictlyUpperMatrix<MT,SO,true>::SIMDType
2651  StrictlyUpperMatrix<MT,SO,true>::loadu( size_t i, size_t j ) const noexcept
2652 {
2653  return matrix_.loadu( i, j );
2654 }
2656 //*************************************************************************************************
2657 
2658 
2659 
2660 
2661 //=================================================================================================
2662 //
2663 // CONSTRUCTION FUNCTIONS
2664 //
2665 //=================================================================================================
2666 
2667 //*************************************************************************************************
2674 template< typename MT // Type of the adapted dense matrix
2675  , bool SO > // Storage order of the adapted dense matrix
2676 inline const MT StrictlyUpperMatrix<MT,SO,true>::construct( size_t n, TrueType )
2677 {
2679 
2680  return MT( n, n, ElementType() );
2681 }
2683 //*************************************************************************************************
2684 
2685 
2686 //*************************************************************************************************
2693 template< typename MT // Type of the adapted dense matrix
2694  , bool SO > // Storage order of the adapted dense matrix
2695 inline const MT StrictlyUpperMatrix<MT,SO,true>::construct( const ElementType& init, FalseType )
2696 {
2699 
2700  MT tmp;
2701 
2702  if( SO ) {
2703  for( size_t j=0UL; j<columns(); ++j ) {
2704  for( size_t i=0UL; i<j; ++i )
2705  tmp(i,j) = init;
2706  }
2707  }
2708  else {
2709  for( size_t i=0UL; i<rows(); ++i ) {
2710  for( size_t j=i+1UL; j<columns(); ++j )
2711  tmp(i,j) = init;
2712  }
2713  }
2714 
2715  return tmp;
2716 }
2718 //*************************************************************************************************
2719 
2720 
2721 //*************************************************************************************************
2732 template< typename MT // Type of the adapted dense matrix
2733  , bool SO > // Storage order of the adapted dense matrix
2734 template< typename MT2 // Type of the foreign matrix
2735  , bool SO2 // Storage order of the foreign matrix
2736  , typename T > // Type of the third argument
2737 inline const MT StrictlyUpperMatrix<MT,SO,true>::construct( const Matrix<MT2,SO2>& m, T )
2738 {
2739  const MT tmp( ~m );
2740 
2741  if( IsUniTriangular_v<MT2> ||
2742  ( !IsStrictlyUpper_v<MT2> && !isStrictlyUpper( tmp ) ) ) {
2743  BLAZE_THROW_INVALID_ARGUMENT( "Invalid setup of strictly upper matrix" );
2744  }
2745 
2746  return tmp;
2747 }
2749 //*************************************************************************************************
2750 
2751 } // namespace blaze
2752 
2753 #endif
Header file for the StrictlyUpperProxy class.
Constraint on the data type.
Header file for the implementation of the Submatrix view.
#define BLAZE_CONSTRAINT_MUST_NOT_BE_CONST(T)
Constraint on the data type.In case the given data type is a const-qualified type, a compilation error is created.
Definition: Const.h:79
BoolConstant< false > FalseType
Type/value traits base class.The FalseType class is used as base class for type traits and value trai...
Definition: FalseType.h:61
#define BLAZE_THROW_INVALID_ARGUMENT(MESSAGE)
Macro for the emission of a std::invalid_argument exception.This macro encapsulates the default way o...
Definition: Exception.h:235
Header file for auxiliary alias declarations.
decltype(auto) column(Matrix< MT, SO > &matrix, RCAs... args)
Creating a view on a specific column of the given matrix.
Definition: Column.h:133
CompressedMatrix< Type, false > OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: CompressedMatrix.h:3078
#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
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:354
Header file for the UNUSED_PARAMETER function template.
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:169
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
Header file for the isZero shim.
#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.
This ResultType
Result type for expression template evaluations.
Definition: CompressedMatrix.h:3077
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
CompressedMatrix< Type, true > This
Type of this CompressedMatrix instance.
Definition: CompressedMatrix.h:3075
Constraint on the data type.
void reset(const DiagonalProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: DiagonalProxy.h:591
static constexpr bool smpAssignable
Compilation flag for SMP assignments.
Definition: CompressedMatrix.h:3113
void shrinkToFit(Matrix< MT, SO > &matrix)
Requesting the removal of unused capacity.
Definition: Matrix.h:799
void clear(CompressedMatrix< Type, SO > &m)
Clearing the given compressed matrix.
Definition: CompressedMatrix.h:5828
CompressedMatrix< Type, false > TransposeType
Transpose type for expression template evaluations.
Definition: CompressedMatrix.h:3079
const Type & ConstReference
Reference to a constant matrix value.
Definition: CompressedMatrix.h:3084
decltype(auto) declupp(const DenseMatrix< MT, SO > &dm)
Declares the given dense matrix expression dm as upper.
Definition: DMatDeclUppExpr.h:1002
#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
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: TrueType.h:61
Element * Iterator
Iterator over non-constant elements.
Definition: CompressedMatrix.h:3085
Header file for the extended initializer_list functionality.
constexpr void UNUSED_PARAMETER(const Args &...)
Suppression of unused parameter warnings.
Definition: Unused.h:81
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:252
#define BLAZE_CONSTRAINT_MUST_BE_SQUARE_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is not a square matrix type, a compilation error is created.
Definition: Square.h:60
Header file for the IsSquare type trait.
bool isZero(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is 0.
Definition: DiagonalProxy.h:673
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.
Header file for the IsStrictlyUpper type trait.
MatrixAccessProxy< This > Reference
Reference to a non-constant matrix value.
Definition: CompressedMatrix.h:3083
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58
#define BLAZE_ALWAYS_INLINE
Platform dependent setup of an enforced inline keyword.
Definition: Inline.h:85
#define BLAZE_CONSTRAINT_MUST_BE_STATIC_TYPE(T)
Constraint on the data type.In case the given data type T is not a static data type, i.e. a vector or matrix with dimensions fixed at compile time, a compilation error is created.
Definition: Static.h:61
void swap(CompressedMatrix< Type, SO > &a, CompressedMatrix< Type, SO > &b) noexcept
Swapping the contents of two compressed matrices.
Definition: CompressedMatrix.h:5907
Compile time assertion.
bool isIntact(const CompressedMatrix< Type, SO > &m)
Returns whether the invariants of the given compressed matrix are intact.
Definition: CompressedMatrix.h:5890
SparseMatrix< This, true > BaseType
Base type of this CompressedMatrix instance.
Definition: CompressedMatrix.h:3076
#define BLAZE_CONSTRAINT_MUST_NOT_BE_POINTER_TYPE(T)
Constraint on the data type.In case the given data type T is not a pointer type, a compilation error ...
Definition: Pointer.h:79
Type ElementType
Type of the compressed matrix elements.
Definition: CompressedMatrix.h:3080
#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
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:3086
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.
Header file for the IsUniTriangular type trait.
Constraints on the storage order of matrix types.
decltype(auto) elements(Vector< VT, TF > &vector, REAs... args)
Creating a view on a selection of elements of the given vector.
Definition: Elements.h:135
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
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:8908
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
decltype(auto) submatrix(Matrix< MT, SO > &, RSAs...)
Creating a view on a specific submatrix of the given matrix.
Definition: Submatrix.h:360
Header file for the EnableIf class template.
Header file for utility functions for dense matrices.
void clear(const DiagonalProxy< MT > &proxy)
Clearing the represented element.
Definition: DiagonalProxy.h:611
Header file for the implementation of the base template of the StrictlyUpperMatrix.
Header file for all adaptor forward declarations.
#define BLAZE_CONSTRAINT_MUST_NOT_BE_SYMMETRIC_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is a symmetric matrix type, a compilation error is created.
Definition: Symmetric.h:79
bool isStrictlyUpper(const DenseMatrix< MT, SO > &dm)
Checks if the given dense matrix is a strictly upper triangular matrix.
Definition: DenseMatrix.h:1446
BLAZE_ALWAYS_INLINE T1 & operator+=(SIMDPack< T1 > &lhs, const SIMDPack< T2 > &rhs)
Addition assignment operator for the addition of two SIMD packs.
Definition: BasicTypes.h:1357
Header file for run time assertion macros.
Constraint on the data type.
Constraint on the data type.
Constraint on the data type.
decltype(auto) row(Matrix< MT, SO > &, RRAs...)
Creating a view on a specific row of the given matrix.
Definition: Row.h: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 &#39;resize&#39; member fu...
Definition: Resizable.h:81
#define BLAZE_CONSTRAINT_MUST_NOT_BE_REFERENCE_TYPE(T)
Constraint on the data type.In case the given data type T is not a reference type, a compilation error is created.
Definition: Reference.h:79
Header file for the isDefault shim.
void swap(DiagonalMatrix< MT, SO, DF > &a, DiagonalMatrix< MT, SO, DF > &b) noexcept
Swapping the contents of two matrices.
Definition: DiagonalMatrix.h:281
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
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
constexpr bool IsComputation_v
Auxiliary variable template for the IsComputation type trait.The IsComputation_v variable template pr...
Definition: IsComputation.h:90
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:3081
#define BLAZE_CONSTRAINT_MUST_BE_RESIZABLE_TYPE(T)
Constraint on the data type.In case the given data type T is not resizable, i.e. does not have a &#39;res...
Definition: Resizable.h:61
Header file for the IsComputation type trait class.
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:3082
#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
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:290
bool isIntact(const DiagonalMatrix< MT, SO, DF > &m)
Returns whether the invariants of the given diagonal matrix are intact.
Definition: DiagonalMatrix.h:263
#define BLAZE_CONSTRAINT_MUST_NOT_BE_HERMITIAN_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is an Hermitian matrix type, a compilation error is created.
Definition: Hermitian.h:79
BLAZE_ALWAYS_INLINE T1 & operator-=(SIMDPack< T1 > &lhs, const SIMDPack< T2 > &rhs)
Subtraction assignment operator for the subtraction of two SIMD packs.
Definition: BasicTypes.h:1375
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
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.
System settings for the inline keywords.
Header file for the Size type trait.
#define BLAZE_INTERNAL_ASSERT(expr, msg)
Run time assertion macro for internal checks.In case of an invalid run time expression, the program execution is terminated. The BLAZE_INTERNAL_ASSERT macro can be disabled by setting the BLAZE_USER_ASSERTION flag to zero or by defining NDEBUG during the compilation.
Definition: Assert.h:101
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
Header file for the TrueType type/value trait base class.
Header file for the clear shim.