Dense.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_ADAPTORS_STRICTLYLOWERMATRIX_DENSE_H_
36 #define _BLAZE_MATH_ADAPTORS_STRICTLYLOWERMATRIX_DENSE_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
43 #include <stdexcept>
57 #include <blaze/math/Intrinsics.h>
58 #include <blaze/math/shims/Clear.h>
60 #include <blaze/math/shims/Move.h>
69 #include <blaze/system/Inline.h>
70 #include <blaze/util/Assert.h>
76 #include <blaze/util/DisableIf.h>
77 #include <blaze/util/EnableIf.h>
78 #include <blaze/util/FalseType.h>
80 #include <blaze/util/TrueType.h>
81 #include <blaze/util/Types.h>
82 #include <blaze/util/Unused.h>
83 
84 
85 namespace blaze {
86 
87 //=================================================================================================
88 //
89 // CLASS TEMPLATE SPECIALIZATION FOR DENSE MATRICES
90 //
91 //=================================================================================================
92 
93 //*************************************************************************************************
101 template< typename MT // Type of the adapted dense matrix
102  , bool SO > // Storage order of the adapted dense matrix
103 class StrictlyLowerMatrix<MT,SO,true>
104  : public DenseMatrix< StrictlyLowerMatrix<MT,SO,true>, SO >
105 {
106  private:
107  //**Type definitions****************************************************************************
108  typedef typename MT::OppositeType OT;
109  typedef typename MT::TransposeType TT;
110  typedef typename MT::ElementType ET;
111  typedef IntrinsicTrait<ET> IT;
112  //**********************************************************************************************
113 
114  public:
115  //**Type definitions****************************************************************************
116  typedef StrictlyLowerMatrix<MT,SO,true> This;
117  typedef This ResultType;
118  typedef StrictlyLowerMatrix<OT,!SO,true> OppositeType;
119  typedef StrictlyUpperMatrix<TT,!SO,true> TransposeType;
120  typedef ET ElementType;
121  typedef typename MT::IntrinsicType IntrinsicType;
122  typedef typename MT::ReturnType ReturnType;
123  typedef const This& CompositeType;
124  typedef StrictlyLowerProxy<MT> Reference;
125  typedef typename MT::ConstReference ConstReference;
126  typedef typename MT::Pointer Pointer;
127  typedef typename MT::ConstPointer ConstPointer;
128  typedef typename MT::ConstIterator ConstIterator;
129  //**********************************************************************************************
130 
131  //**Rebind struct definition********************************************************************
134  template< typename ET > // Data type of the other matrix
135  struct Rebind {
137  typedef StrictlyLowerMatrix< typename MT::template Rebind<ET>::Other > Other;
138  };
139  //**********************************************************************************************
140 
141  //**Iterator class definition*******************************************************************
144  class Iterator
145  {
146  public:
147  //**Type definitions*************************************************************************
148  typedef std::random_access_iterator_tag IteratorCategory;
149  typedef typename MT::ElementType ValueType;
150  typedef StrictlyLowerProxy<MT> PointerType;
151  typedef StrictlyLowerProxy<MT> ReferenceType;
152  typedef ptrdiff_t DifferenceType;
153 
154  // STL iterator requirements
155  typedef IteratorCategory iterator_category;
156  typedef ValueType value_type;
157  typedef PointerType pointer;
158  typedef ReferenceType reference;
159  typedef DifferenceType difference_type;
160  //*******************************************************************************************
161 
162  //**Constructor******************************************************************************
165  inline Iterator()
166  : matrix_( NULL ) // Reference to the adapted dense matrix
167  , row_ ( 0UL ) // The current row index of the iterator
168  , column_( 0UL ) // The current column index of the iterator
169  {}
170  //*******************************************************************************************
171 
172  //**Constructor******************************************************************************
179  inline Iterator( MT& matrix, size_t row, size_t column )
180  : matrix_( &matrix ) // Reference to the adapted dense matrix
181  , row_ ( row ) // The current row-index of the iterator
182  , column_( column ) // The current column-index of the iterator
183  {}
184  //*******************************************************************************************
185 
186  //**Addition assignment operator*************************************************************
192  inline Iterator& operator+=( size_t inc ) {
193  ( SO )?( row_ += inc ):( column_ += inc );
194  return *this;
195  }
196  //*******************************************************************************************
197 
198  //**Subtraction assignment operator**********************************************************
204  inline Iterator& operator-=( size_t dec ) {
205  ( SO )?( row_ -= dec ):( column_ -= dec );
206  return *this;
207  }
208  //*******************************************************************************************
209 
210  //**Prefix increment operator****************************************************************
215  inline Iterator& operator++() {
216  ( SO )?( ++row_ ):( ++column_ );
217  return *this;
218  }
219  //*******************************************************************************************
220 
221  //**Postfix increment operator***************************************************************
226  inline const Iterator operator++( int ) {
227  const Iterator tmp( *this );
228  ++(*this);
229  return tmp;
230  }
231  //*******************************************************************************************
232 
233  //**Prefix decrement operator****************************************************************
238  inline Iterator& operator--() {
239  ( SO )?( --row_ ):( --column_ );
240  return *this;
241  }
242  //*******************************************************************************************
243 
244  //**Postfix decrement operator***************************************************************
249  inline const Iterator operator--( int ) {
250  const Iterator tmp( *this );
251  --(*this);
252  return tmp;
253  }
254  //*******************************************************************************************
255 
256  //**Element access operator******************************************************************
261  inline ReferenceType operator*() const {
262  return ReferenceType( *matrix_, row_, column_ );
263  }
264  //*******************************************************************************************
265 
266  //**Element access operator******************************************************************
271  inline PointerType operator->() const {
272  return PointerType( *matrix_, row_, column_ );
273  }
274  //*******************************************************************************************
275 
276  //**Conversion operator**********************************************************************
281  inline operator ConstIterator() const {
282  if( SO )
283  return matrix_->begin( column_ ) + row_;
284  else
285  return matrix_->begin( row_ ) + column_;
286  }
287  //*******************************************************************************************
288 
289  //**Equality operator************************************************************************
296  friend inline bool operator==( const Iterator& lhs, const Iterator& rhs ) {
297  return ( SO )?( lhs.row_ == rhs.row_ ):( lhs.column_ == rhs.column_ );
298  }
299  //*******************************************************************************************
300 
301  //**Equality operator************************************************************************
308  friend inline bool operator==( const Iterator& lhs, const ConstIterator& rhs ) {
309  return ( ConstIterator( lhs ) == rhs );
310  }
311  //*******************************************************************************************
312 
313  //**Equality operator************************************************************************
320  friend inline bool operator==( const ConstIterator& lhs, const Iterator& rhs ) {
321  return ( lhs == ConstIterator( rhs ) );
322  }
323  //*******************************************************************************************
324 
325  //**Inequality operator**********************************************************************
332  friend inline bool operator!=( const Iterator& lhs, const Iterator& rhs ) {
333  return ( SO )?( lhs.row_ != rhs.row_ ):( lhs.column_ != rhs.column_ );
334  }
335  //*******************************************************************************************
336 
337  //**Inequality operator**********************************************************************
344  friend inline bool operator!=( const Iterator& lhs, const ConstIterator& rhs ) {
345  return ( ConstIterator( lhs ) != rhs );
346  }
347  //*******************************************************************************************
348 
349  //**Inequality operator**********************************************************************
356  friend inline bool operator!=( const ConstIterator& lhs, const Iterator& rhs ) {
357  return ( lhs != ConstIterator( rhs ) );
358  }
359  //*******************************************************************************************
360 
361  //**Less-than operator***********************************************************************
368  friend inline bool operator<( const Iterator& lhs, const Iterator& rhs ) {
369  return ( SO )?( lhs.row_ < rhs.row_ ):( lhs.column_ < rhs.column_ );
370  }
371  //*******************************************************************************************
372 
373  //**Less-than operator***********************************************************************
380  friend inline bool operator<( const Iterator& lhs, const ConstIterator& rhs ) {
381  return ( ConstIterator( lhs ) < rhs );
382  }
383  //*******************************************************************************************
384 
385  //**Less-than operator***********************************************************************
392  friend inline bool operator<( const ConstIterator& lhs, const Iterator& rhs ) {
393  return ( lhs < ConstIterator( rhs ) );
394  }
395  //*******************************************************************************************
396 
397  //**Greater-than operator********************************************************************
404  friend inline bool operator>( const Iterator& lhs, const Iterator& rhs ) {
405  return ( SO )?( lhs.row_ > rhs.row_ ):( lhs.column_ > rhs.column_ );
406  }
407  //*******************************************************************************************
408 
409  //**Greater-than operator********************************************************************
416  friend inline bool operator>( const Iterator& lhs, const ConstIterator& rhs ) {
417  return ( ConstIterator( lhs ) > rhs );
418  }
419  //*******************************************************************************************
420 
421  //**Greater-than operator********************************************************************
428  friend inline bool operator>( const ConstIterator& lhs, const Iterator& rhs ) {
429  return ( lhs > ConstIterator( rhs ) );
430  }
431  //*******************************************************************************************
432 
433  //**Less-or-equal-than operator**************************************************************
440  friend inline bool operator<=( const Iterator& lhs, const Iterator& rhs ) {
441  return ( SO )?( lhs.row_ <= rhs.row_ ):( lhs.column_ <= rhs.column_ );
442  }
443  //*******************************************************************************************
444 
445  //**Less-or-equal-than operator**************************************************************
452  friend inline bool operator<=( const Iterator& lhs, const ConstIterator& rhs ) {
453  return ( ConstIterator( lhs ) <= rhs );
454  }
455  //*******************************************************************************************
456 
457  //**Less-or-equal-than operator**************************************************************
464  friend inline bool operator<=( const ConstIterator& lhs, const Iterator& rhs ) {
465  return ( lhs <= ConstIterator( rhs ) );
466  }
467  //*******************************************************************************************
468 
469  //**Greater-or-equal-than operator***********************************************************
476  friend inline bool operator>=( const Iterator& lhs, const Iterator& rhs ) {
477  return ( SO )?( lhs.row_ >= rhs.row_ ):( lhs.column_ >= rhs.column_ );
478  }
479  //*******************************************************************************************
480 
481  //**Greater-or-equal-than operator***********************************************************
488  friend inline bool operator>=( const Iterator& lhs, const ConstIterator& rhs ) {
489  return ( ConstIterator( lhs ) >= rhs );
490  }
491  //*******************************************************************************************
492 
493  //**Greater-or-equal-than operator***********************************************************
500  friend inline bool operator>=( const ConstIterator& lhs, const Iterator& rhs ) {
501  return ( lhs >= ConstIterator( rhs ) );
502  }
503  //*******************************************************************************************
504 
505  //**Subtraction operator*********************************************************************
511  inline DifferenceType operator-( const Iterator& rhs ) const {
512  return ( SO )?( row_ - rhs.row_ ):( column_ - rhs.column_ );
513  }
514  //*******************************************************************************************
515 
516  //**Addition operator************************************************************************
523  friend inline const Iterator operator+( const Iterator& it, size_t inc ) {
524  if( SO )
525  return Iterator( *it.matrix_, it.row_ + inc, it.column_ );
526  else
527  return Iterator( *it.matrix_, it.row_, it.column_ + inc );
528  }
529  //*******************************************************************************************
530 
531  //**Addition operator************************************************************************
538  friend inline const Iterator operator+( size_t inc, const Iterator& it ) {
539  if( SO )
540  return Iterator( *it.matrix_, it.row_ + inc, it.column_ );
541  else
542  return Iterator( *it.matrix_, it.row_, it.column_ + inc );
543  }
544  //*******************************************************************************************
545 
546  //**Subtraction operator*********************************************************************
553  friend inline const Iterator operator-( const Iterator& it, size_t dec ) {
554  if( SO )
555  return Iterator( *it.matrix_, it.row_ - dec, it.column_ );
556  else
557  return Iterator( *it.matrix_, it.row_, it.column_ - dec );
558  }
559  //*******************************************************************************************
560 
561  private:
562  //**Member variables*************************************************************************
563  MT* matrix_;
564  size_t row_;
565  size_t column_;
566  //*******************************************************************************************
567  };
568  //**********************************************************************************************
569 
570  //**Compilation flags***************************************************************************
572  enum { vectorizable = MT::vectorizable };
573 
575  enum { smpAssignable = MT::smpAssignable };
576  //**********************************************************************************************
577 
578  //**Constructors********************************************************************************
581  explicit inline StrictlyLowerMatrix();
582  template< typename A1 > explicit inline StrictlyLowerMatrix( const A1& a1 );
583  explicit inline StrictlyLowerMatrix( size_t n, const ElementType& init );
584  inline StrictlyLowerMatrix( const StrictlyLowerMatrix& m );
586  //**********************************************************************************************
587 
588  //**Destructor**********************************************************************************
589  // No explicitly declared destructor.
590  //**********************************************************************************************
591 
592  //**Data access functions***********************************************************************
595  inline Reference operator()( size_t i, size_t j );
596  inline ConstReference operator()( size_t i, size_t j ) const;
597  inline ConstPointer data () const;
598  inline ConstPointer data ( size_t i ) const;
599  inline Iterator begin ( size_t i );
600  inline ConstIterator begin ( size_t i ) const;
601  inline ConstIterator cbegin( size_t i ) const;
602  inline Iterator end ( size_t i );
603  inline ConstIterator end ( size_t i ) const;
604  inline ConstIterator cend ( size_t i ) const;
606  //**********************************************************************************************
607 
608  //**Assignment operators************************************************************************
611  inline StrictlyLowerMatrix& operator=( const ElementType& rhs );
612  inline StrictlyLowerMatrix& operator=( const StrictlyLowerMatrix& rhs );
613 
614  template< typename MT2, bool SO2 >
615  inline typename DisableIf< IsComputation<MT2>, StrictlyLowerMatrix& >::Type
616  operator=( const Matrix<MT2,SO2>& rhs );
617 
618  template< typename MT2, bool SO2 >
619  inline typename EnableIf< IsComputation<MT2>, StrictlyLowerMatrix& >::Type
620  operator=( const Matrix<MT2,SO2>& rhs );
621 
622  template< typename MT2, bool SO2 >
623  inline typename DisableIf< IsComputation<MT2>, StrictlyLowerMatrix& >::Type
624  operator+=( const Matrix<MT2,SO2>& rhs );
625 
626  template< typename MT2, bool SO2 >
627  inline typename EnableIf< IsComputation<MT2>, StrictlyLowerMatrix& >::Type
628  operator+=( const Matrix<MT2,SO2>& rhs );
629 
630  template< typename MT2, bool SO2 >
631  inline typename DisableIf< IsComputation<MT2>, StrictlyLowerMatrix& >::Type
632  operator-=( const Matrix<MT2,SO2>& rhs );
633 
634  template< typename MT2, bool SO2 >
635  inline typename EnableIf< IsComputation<MT2>, StrictlyLowerMatrix& >::Type
636  operator-=( const Matrix<MT2,SO2>& rhs );
637 
638  template< typename MT2, bool SO2 >
639  inline StrictlyLowerMatrix& operator*=( const Matrix<MT2,SO2>& rhs );
640 
641  template< typename Other >
642  inline typename EnableIf< IsNumeric<Other>, StrictlyLowerMatrix >::Type&
643  operator*=( Other rhs );
644 
645  template< typename Other >
646  inline typename EnableIf< IsNumeric<Other>, StrictlyLowerMatrix >::Type&
647  operator/=( Other rhs );
649  //**********************************************************************************************
650 
651  //**Utility functions***************************************************************************
654  inline size_t rows() const;
655  inline size_t columns() const;
656  inline size_t spacing() const;
657  inline size_t capacity() const;
658  inline size_t capacity( size_t i ) const;
659  inline size_t nonZeros() const;
660  inline size_t nonZeros( size_t i ) const;
661  inline void reset();
662  inline void reset( size_t i );
663  inline void clear();
664  void resize ( size_t n, bool preserve=true );
665  inline void extend ( size_t n, bool preserve=true );
666  inline void reserve( size_t elements );
667 
668  template< typename Other > inline StrictlyLowerMatrix& scale( const Other& scalar );
669 
670  inline void swap( StrictlyLowerMatrix& m ) /* throw() */;
671 
672  static inline size_t maxNonZeros();
673  static inline size_t maxNonZeros( size_t n );
675  //**********************************************************************************************
676 
677  //**Expression template evaluation functions****************************************************
680  template< typename Other > inline bool canAlias ( const Other* alias ) const;
681  template< typename Other > inline bool isAliased( const Other* alias ) const;
682 
683  inline bool isAligned () const;
684  inline bool canSMPAssign() const;
685 
686  BLAZE_ALWAYS_INLINE IntrinsicType load ( size_t i, size_t j ) const;
687  BLAZE_ALWAYS_INLINE IntrinsicType loadu( size_t i, size_t j ) const;
689  //**********************************************************************************************
690 
691  private:
692  //**Construction functions**********************************************************************
695  inline const MT construct( size_t n , TrueType );
696  inline const MT construct( const ElementType& value, FalseType );
697 
698  template< typename MT2, bool SO2, typename T >
699  inline const MT construct( const Matrix<MT2,SO2>& m, T );
701  //**********************************************************************************************
702 
703  //**Member variables****************************************************************************
706  MT matrix_;
707 
708  //**********************************************************************************************
709 
710  //**Friend declarations*************************************************************************
711  template< typename MT2, bool SO2, bool DF2 >
712  friend MT2& derestrict( StrictlyLowerMatrix<MT2,SO2,DF2>& m );
713  //**********************************************************************************************
714 
715  //**Compile time checks*************************************************************************
727  BLAZE_STATIC_ASSERT( IsResizable<MT>::value || IsSquare<MT>::value );
728  //**********************************************************************************************
729 };
731 //*************************************************************************************************
732 
733 
734 
735 
736 //=================================================================================================
737 //
738 // CONSTRUCTORS
739 //
740 //=================================================================================================
741 
742 //*************************************************************************************************
746 template< typename MT // Type of the adapted dense matrix
747  , bool SO > // Storage order of the adapted dense matrix
748 inline StrictlyLowerMatrix<MT,SO,true>::StrictlyLowerMatrix()
749  : matrix_() // The adapted dense matrix
750 {
751  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly lower matrix detected" );
752 }
754 //*************************************************************************************************
755 
756 
757 //*************************************************************************************************
775 template< typename MT // Type of the adapted dense matrix
776  , bool SO > // Storage order of the adapted dense matrix
777 template< typename A1 > // Type of the constructor argument
778 inline StrictlyLowerMatrix<MT,SO,true>::StrictlyLowerMatrix( const A1& a1 )
779  : matrix_( construct( a1, typename IsResizable<MT>::Type() ) ) // The adapted dense matrix
780 {
781  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly lower matrix detected" );
782 }
784 //*************************************************************************************************
785 
786 
787 //*************************************************************************************************
794 template< typename MT // Type of the adapted dense matrix
795  , bool SO > // Storage order of the adapted dense matrix
796 inline StrictlyLowerMatrix<MT,SO,true>::StrictlyLowerMatrix( size_t n, const ElementType& init )
797  : matrix_( n, n, ElementType() ) // The adapted dense matrix
798 {
800 
801  if( SO ) {
802  for( size_t j=0UL; j<columns(); ++j ) {
803  for( size_t i=j+1UL; i<rows(); ++i )
804  matrix_(i,j) = init;
805  }
806  }
807  else {
808  for( size_t i=0UL; i<rows(); ++i ) {
809  for( size_t j=0UL; j<i; ++j )
810  matrix_(i,j) = init;
811  }
812  }
813 
814  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly lower matrix detected" );
815 }
817 //*************************************************************************************************
818 
819 
820 //*************************************************************************************************
826 template< typename MT // Type of the adapted dense matrix
827  , bool SO > // Storage order of the adapted dense matrix
828 inline StrictlyLowerMatrix<MT,SO,true>::StrictlyLowerMatrix( const StrictlyLowerMatrix& m )
829  : matrix_( m.matrix_ ) // The adapted dense matrix
830 {
831  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly lower matrix detected" );
832 }
834 //*************************************************************************************************
835 
836 
837 
838 
839 //=================================================================================================
840 //
841 // DATA ACCESS FUNCTIONS
842 //
843 //=================================================================================================
844 
845 //*************************************************************************************************
858 template< typename MT // Type of the adapted dense matrix
859  , bool SO > // Storage order of the adapted dense matrix
861  StrictlyLowerMatrix<MT,SO,true>::operator()( size_t i, size_t j )
862 {
863  BLAZE_USER_ASSERT( i<rows() , "Invalid row access index" );
864  BLAZE_USER_ASSERT( j<columns(), "Invalid column access index" );
865 
866  return Reference( matrix_, i, j );
867 }
869 //*************************************************************************************************
870 
871 
872 //*************************************************************************************************
885 template< typename MT // Type of the adapted dense matrix
886  , bool SO > // Storage order of the adapted dense matrix
888  StrictlyLowerMatrix<MT,SO,true>::operator()( size_t i, size_t j ) const
889 {
890  BLAZE_USER_ASSERT( i<rows() , "Invalid row access index" );
891  BLAZE_USER_ASSERT( j<columns(), "Invalid column access index" );
892 
893  return matrix_(i,j);
894 }
896 //*************************************************************************************************
897 
898 
899 //*************************************************************************************************
912 template< typename MT // Type of the adapted dense matrix
913  , bool SO > // Storage order of the adapted dense matrix
914 inline typename StrictlyLowerMatrix<MT,SO,true>::ConstPointer
915  StrictlyLowerMatrix<MT,SO,true>::data() const
916 {
917  return matrix_.data();
918 }
920 //*************************************************************************************************
921 
922 
923 //*************************************************************************************************
932 template< typename MT // Type of the adapted dense matrix
933  , bool SO > // Storage order of the adapted dense matrix
934 inline typename StrictlyLowerMatrix<MT,SO,true>::ConstPointer
935  StrictlyLowerMatrix<MT,SO,true>::data( size_t i ) const
936 {
937  return matrix_.data(i);
938 }
940 //*************************************************************************************************
941 
942 
943 //*************************************************************************************************
955 template< typename MT // Type of the adapted dense matrix
956  , bool SO > // Storage order of the adapted dense matrix
959 {
960  if( SO )
961  return Iterator( matrix_, 0UL, i );
962  else
963  return Iterator( matrix_, i, 0UL );
964 }
966 //*************************************************************************************************
967 
968 
969 //*************************************************************************************************
981 template< typename MT // Type of the adapted dense matrix
982  , bool SO > // Storage order of the adapted dense matrix
985 {
986  return matrix_.begin(i);
987 }
989 //*************************************************************************************************
990 
991 
992 //*************************************************************************************************
1004 template< typename MT // Type of the adapted dense matrix
1005  , bool SO > // Storage order of the adapted dense matrix
1007  StrictlyLowerMatrix<MT,SO,true>::cbegin( size_t i ) const
1008 {
1009  return matrix_.cbegin(i);
1010 }
1012 //*************************************************************************************************
1013 
1014 
1015 //*************************************************************************************************
1027 template< typename MT // Type of the adapted dense matrix
1028  , bool SO > // Storage order of the adapted dense matrix
1031 {
1032  if( SO )
1033  return Iterator( matrix_, rows(), i );
1034  else
1035  return Iterator( matrix_, i, columns() );
1036 }
1038 //*************************************************************************************************
1039 
1040 
1041 //*************************************************************************************************
1053 template< typename MT // Type of the adapted dense matrix
1054  , bool SO > // Storage order of the adapted dense matrix
1056  StrictlyLowerMatrix<MT,SO,true>::end( size_t i ) const
1057 {
1058  return matrix_.end(i);
1059 }
1061 //*************************************************************************************************
1062 
1063 
1064 //*************************************************************************************************
1076 template< typename MT // Type of the adapted dense matrix
1077  , bool SO > // Storage order of the adapted dense matrix
1079  StrictlyLowerMatrix<MT,SO,true>::cend( size_t i ) const
1080 {
1081  return matrix_.cend(i);
1082 }
1084 //*************************************************************************************************
1085 
1086 
1087 
1088 
1089 //=================================================================================================
1090 //
1091 // ASSIGNMENT OPERATORS
1092 //
1093 //=================================================================================================
1094 
1095 //*************************************************************************************************
1102 template< typename MT // Type of the adapted dense matrix
1103  , bool SO > // Storage order of the adapted dense matrix
1104 inline StrictlyLowerMatrix<MT,SO,true>&
1105  StrictlyLowerMatrix<MT,SO,true>::operator=( const ElementType& rhs )
1106 {
1107  if( SO ) {
1108  for( size_t j=0UL; j<columns(); ++j )
1109  for( size_t i=j+1UL; i<rows(); ++i )
1110  matrix_(i,j) = rhs;
1111  }
1112  else {
1113  for( size_t i=1UL; i<rows(); ++i )
1114  for( size_t j=0UL; j<i; ++j )
1115  matrix_(i,j) = rhs;
1116  }
1117 
1118  return *this;
1119 }
1121 //*************************************************************************************************
1122 
1123 
1124 //*************************************************************************************************
1134 template< typename MT // Type of the adapted dense matrix
1135  , bool SO > // Storage order of the adapted dense matrix
1136 inline StrictlyLowerMatrix<MT,SO,true>&
1137  StrictlyLowerMatrix<MT,SO,true>::operator=( const StrictlyLowerMatrix& rhs )
1138 {
1139  matrix_ = rhs.matrix_;
1140 
1141  return *this;
1142 }
1144 //*************************************************************************************************
1145 
1146 
1147 //*************************************************************************************************
1160 template< typename MT // Type of the adapted dense matrix
1161  , bool SO > // Storage order of the adapted dense matrix
1162 template< typename MT2 // Type of the right-hand side matrix
1163  , bool SO2 > // Storage order of the right-hand side matrix
1164 inline typename DisableIf< IsComputation<MT2>, StrictlyLowerMatrix<MT,SO,true>& >::Type
1165  StrictlyLowerMatrix<MT,SO,true>::operator=( const Matrix<MT2,SO2>& rhs )
1166 {
1167  if( IsUniTriangular<MT2>::value ||
1168  ( !IsStrictlyLower<MT2>::value && !isStrictlyLower( ~rhs ) ) )
1169  throw std::invalid_argument( "Invalid assignment to strictly lower matrix" );
1170 
1171  matrix_ = ~rhs;
1172 
1173  return *this;
1174 }
1176 //*************************************************************************************************
1177 
1178 
1179 //*************************************************************************************************
1192 template< typename MT // Type of the adapted dense matrix
1193  , bool SO > // Storage order of the adapted dense matrix
1194 template< typename MT2 // Type of the right-hand side matrix
1195  , bool SO2 > // Storage order of the right-hand side matrix
1196 inline typename EnableIf< IsComputation<MT2>, StrictlyLowerMatrix<MT,SO,true>& >::Type
1197  StrictlyLowerMatrix<MT,SO,true>::operator=( const Matrix<MT2,SO2>& rhs )
1198 {
1199  if( IsUniTriangular<MT2>::value || ( !IsSquare<MT2>::value && !isSquare( ~rhs ) ) )
1200  throw std::invalid_argument( "Invalid assignment to strictly lower matrix" );
1201 
1202  if( IsStrictlyLower<MT2>::value ) {
1203  matrix_ = ~rhs;
1204  }
1205  else {
1206  MT tmp( ~rhs );
1207 
1208  if( !isStrictlyLower( tmp ) )
1209  throw std::invalid_argument( "Invalid assignment to strictly lower matrix" );
1210 
1211  move( matrix_, tmp );
1212  }
1213 
1214  return *this;
1215 }
1217 //*************************************************************************************************
1218 
1219 
1220 //*************************************************************************************************
1233 template< typename MT // Type of the adapted dense matrix
1234  , bool SO > // Storage order of the adapted dense matrix
1235 template< typename MT2 // Type of the right-hand side matrix
1236  , bool SO2 > // Storage order of the right-hand side matrix
1237 inline typename DisableIf< IsComputation<MT2>, StrictlyLowerMatrix<MT,SO,true>& >::Type
1238  StrictlyLowerMatrix<MT,SO,true>::operator+=( const Matrix<MT2,SO2>& rhs )
1239 {
1240  if( IsUniTriangular<MT2>::value ||
1241  ( !IsStrictlyLower<MT2>::value && !isStrictlyLower( ~rhs ) ) )
1242  throw std::invalid_argument( "Invalid assignment to strictly lower matrix" );
1243 
1244  matrix_ += ~rhs;
1245 
1246  return *this;
1247 }
1249 //*************************************************************************************************
1250 
1251 
1252 //*************************************************************************************************
1265 template< typename MT // Type of the adapted dense matrix
1266  , bool SO > // Storage order of the adapted dense matrix
1267 template< typename MT2 // Type of the right-hand side matrix
1268  , bool SO2 > // Storage order of the right-hand side matrix
1269 inline typename EnableIf< IsComputation<MT2>, StrictlyLowerMatrix<MT,SO,true>& >::Type
1270  StrictlyLowerMatrix<MT,SO,true>::operator+=( const Matrix<MT2,SO2>& rhs )
1271 {
1272  if( IsUniTriangular<MT2>::value || ( !IsSquare<MT2>::value && !isSquare( ~rhs ) ) )
1273  throw std::invalid_argument( "Invalid assignment to strictly lower matrix" );
1274 
1275  if( IsStrictlyLower<MT2>::value ) {
1276  matrix_ += ~rhs;
1277  }
1278  else {
1279  typename MT2::ResultType tmp( ~rhs );
1280 
1281  if( !isStrictlyLower( tmp ) )
1282  throw std::invalid_argument( "Invalid assignment to strictly lower matrix" );
1283 
1284  matrix_ += tmp;
1285  }
1286 
1287  return *this;
1288 }
1290 //*************************************************************************************************
1291 
1292 
1293 //*************************************************************************************************
1306 template< typename MT // Type of the adapted dense matrix
1307  , bool SO > // Storage order of the adapted dense matrix
1308 template< typename MT2 // Type of the right-hand side matrix
1309  , bool SO2 > // Storage order of the right-hand side matrix
1310 inline typename DisableIf< IsComputation<MT2>, StrictlyLowerMatrix<MT,SO,true>& >::Type
1311  StrictlyLowerMatrix<MT,SO,true>::operator-=( const Matrix<MT2,SO2>& rhs )
1312 {
1313  if( IsUniTriangular<MT2>::value ||
1314  ( !IsStrictlyLower<MT2>::value && !isStrictlyLower( ~rhs ) ) )
1315  throw std::invalid_argument( "Invalid assignment to strictly lower matrix" );
1316 
1317  matrix_ -= ~rhs;
1318 
1319  return *this;
1320 }
1322 //*************************************************************************************************
1323 
1324 
1325 //*************************************************************************************************
1338 template< typename MT // Type of the adapted dense matrix
1339  , bool SO > // Storage order of the adapted dense matrix
1340 template< typename MT2 // Type of the right-hand side matrix
1341  , bool SO2 > // Storage order of the right-hand side matrix
1342 inline typename EnableIf< IsComputation<MT2>, StrictlyLowerMatrix<MT,SO,true>& >::Type
1343  StrictlyLowerMatrix<MT,SO,true>::operator-=( const Matrix<MT2,SO2>& rhs )
1344 {
1345  if( IsUniTriangular<MT2>::value || ( !IsSquare<MT2>::value && !isSquare( ~rhs ) ) )
1346  throw std::invalid_argument( "Invalid assignment to strictly lower matrix" );
1347 
1348  if( IsStrictlyLower<MT2>::value ) {
1349  matrix_ -= ~rhs;
1350  }
1351  else {
1352  typename MT2::ResultType tmp( ~rhs );
1353 
1354  if( !isStrictlyLower( tmp ) )
1355  throw std::invalid_argument( "Invalid assignment to strictly lower matrix" );
1356 
1357  matrix_ -= tmp;
1358  }
1359 
1360  return *this;
1361 }
1363 //*************************************************************************************************
1364 
1365 
1366 //*************************************************************************************************
1378 template< typename MT // Type of the adapted dense matrix
1379  , bool SO > // Storage order of the adapted dense matrix
1380 template< typename MT2 // Type of the right-hand side matrix
1381  , bool SO2 > // Storage order of the right-hand side matrix
1382 inline StrictlyLowerMatrix<MT,SO,true>&
1383  StrictlyLowerMatrix<MT,SO,true>::operator*=( const Matrix<MT2,SO2>& rhs )
1384 {
1385  if( matrix_.rows() != (~rhs).columns() )
1386  throw std::invalid_argument( "Invalid assignment to strictly lower matrix" );
1387 
1388  MT tmp( matrix_ * ~rhs );
1389 
1390  if( !isStrictlyLower( tmp ) )
1391  throw std::invalid_argument( "Invalid assignment to strictly lower matrix" );
1392 
1393  move( matrix_, tmp );
1394 
1395  return *this;
1396 }
1398 //*************************************************************************************************
1399 
1400 
1401 //*************************************************************************************************
1409 template< typename MT // Type of the adapted dense matrix
1410  , bool SO > // Storage order of the adapted dense matrix
1411 template< typename Other > // Data type of the right-hand side scalar
1412 inline typename EnableIf< IsNumeric<Other>, StrictlyLowerMatrix<MT,SO,true> >::Type&
1413  StrictlyLowerMatrix<MT,SO,true>::operator*=( Other rhs )
1414 {
1415  matrix_ *= rhs;
1416  return *this;
1417 }
1418 //*************************************************************************************************
1419 
1420 
1421 //*************************************************************************************************
1429 template< typename MT // Type of the adapted dense matrix
1430  , bool SO > // Storage order of the adapted dense matrix
1431 template< typename Other > // Data type of the right-hand side scalar
1432 inline typename EnableIf< IsNumeric<Other>, StrictlyLowerMatrix<MT,SO,true> >::Type&
1433  StrictlyLowerMatrix<MT,SO,true>::operator/=( Other rhs )
1434 {
1435  BLAZE_USER_ASSERT( rhs != Other(0), "Division by zero detected" );
1436 
1437  matrix_ /= rhs;
1438  return *this;
1439 }
1441 //*************************************************************************************************
1442 
1443 
1444 
1445 
1446 //=================================================================================================
1447 //
1448 // UTILITY FUNCTIONS
1449 //
1450 //=================================================================================================
1451 
1452 //*************************************************************************************************
1458 template< typename MT // Type of the adapted dense matrix
1459  , bool SO > // Storage order of the adapted dense matrix
1460 inline size_t StrictlyLowerMatrix<MT,SO,true>::rows() const
1461 {
1462  return matrix_.rows();
1463 }
1465 //*************************************************************************************************
1466 
1467 
1468 //*************************************************************************************************
1474 template< typename MT // Type of the adapted dense matrix
1475  , bool SO > // Storage order of the adapted dense matrix
1476 inline size_t StrictlyLowerMatrix<MT,SO,true>::columns() const
1477 {
1478  return matrix_.columns();
1479 }
1481 //*************************************************************************************************
1482 
1483 
1484 //*************************************************************************************************
1495 template< typename MT // Type of the adapted dense matrix
1496  , bool SO > // Storage order of the adapted dense matrix
1497 inline size_t StrictlyLowerMatrix<MT,SO,true>::spacing() const
1498 {
1499  return matrix_.spacing();
1500 }
1502 //*************************************************************************************************
1503 
1504 
1505 //*************************************************************************************************
1511 template< typename MT // Type of the adapted dense matrix
1512  , bool SO > // Storage order of the adapted dense matrix
1513 inline size_t StrictlyLowerMatrix<MT,SO,true>::capacity() const
1514 {
1515  return matrix_.capacity();
1516 }
1518 //*************************************************************************************************
1519 
1520 
1521 //*************************************************************************************************
1533 template< typename MT // Type of the adapted dense matrix
1534  , bool SO > // Storage order of the adapted dense matrix
1535 inline size_t StrictlyLowerMatrix<MT,SO,true>::capacity( size_t i ) const
1536 {
1537  return matrix_.capacity(i);
1538 }
1540 //*************************************************************************************************
1541 
1542 
1543 //*************************************************************************************************
1549 template< typename MT // Type of the adapted dense matrix
1550  , bool SO > // Storage order of the adapted dense matrix
1551 inline size_t StrictlyLowerMatrix<MT,SO,true>::nonZeros() const
1552 {
1553  return matrix_.nonZeros();
1554 }
1556 //*************************************************************************************************
1557 
1558 
1559 //*************************************************************************************************
1571 template< typename MT // Type of the adapted dense matrix
1572  , bool SO > // Storage order of the adapted dense matrix
1573 inline size_t StrictlyLowerMatrix<MT,SO,true>::nonZeros( size_t i ) const
1574 {
1575  return matrix_.nonZeros(i);
1576 }
1578 //*************************************************************************************************
1579 
1580 
1581 //*************************************************************************************************
1587 template< typename MT // Type of the adapted dense matrix
1588  , bool SO > // Storage order of the adapted dense matrix
1590 {
1591  using blaze::clear;
1592 
1593  if( SO ) {
1594  for( size_t j=0UL; j<columns(); ++j )
1595  for( size_t i=j+1UL; i<rows(); ++i )
1596  clear( matrix_(i,j) );
1597  }
1598  else {
1599  for( size_t i=1UL; i<rows(); ++i )
1600  for( size_t j=0UL; j<i; ++j )
1601  clear( matrix_(i,j) );
1602  }
1603 }
1605 //*************************************************************************************************
1606 
1607 
1608 //*************************************************************************************************
1621 template< typename MT // Type of the adapted dense matrix
1622  , bool SO > // Storage order of the adapted dense matrix
1623 inline void StrictlyLowerMatrix<MT,SO,true>::reset( size_t i )
1624 {
1625  using blaze::clear;
1626 
1627  if( SO ) {
1628  for( size_t j=i+1UL; j<rows(); ++j )
1629  clear( matrix_(j,i) );
1630  }
1631  else {
1632  for( size_t j=0UL; j<i; ++j )
1633  clear( matrix_(i,j) );
1634  }
1635 }
1637 //*************************************************************************************************
1638 
1639 
1640 //*************************************************************************************************
1652 template< typename MT // Type of the adapted dense matrix
1653  , bool SO > // Storage order of the adapted dense matrix
1655 {
1656  using blaze::clear;
1657 
1658  if( IsResizable<MT>::value ) {
1659  clear( matrix_ );
1660  }
1661  else {
1662  reset();
1663  }
1664 }
1666 //*************************************************************************************************
1667 
1668 
1669 //*************************************************************************************************
1705 template< typename MT // Type of the adapted dense matrix
1706  , bool SO > // Storage order of the adapted dense matrix
1707 void StrictlyLowerMatrix<MT,SO,true>::resize( size_t n, bool preserve )
1708 {
1710 
1711  UNUSED_PARAMETER( preserve );
1712 
1713  BLAZE_INTERNAL_ASSERT( isSquare( matrix_ ), "Non-square strictly lower matrix detected" );
1714 
1715  const size_t oldsize( matrix_.rows() );
1716 
1717  matrix_.resize( n, n, true );
1718 
1719  if( n > oldsize )
1720  {
1721  const size_t increment( n - oldsize );
1722  submatrix( matrix_, 0UL, oldsize, n, increment ).reset();
1723  }
1724 }
1726 //*************************************************************************************************
1727 
1728 
1729 //*************************************************************************************************
1742 template< typename MT // Type of the adapted dense matrix
1743  , bool SO > // Storage order of the adapted dense matrix
1744 inline void StrictlyLowerMatrix<MT,SO,true>::extend( size_t n, bool preserve )
1745 {
1747 
1748  UNUSED_PARAMETER( preserve );
1749 
1750  resize( rows() + n, true );
1751 }
1752 //*************************************************************************************************
1753 
1754 
1755 //*************************************************************************************************
1765 template< typename MT // Type of the adapted dense matrix
1766  , bool SO > // Storage order of the adapted dense matrix
1767 inline void StrictlyLowerMatrix<MT,SO,true>::reserve( size_t elements )
1768 {
1769  matrix_.reserve( elements );
1770 }
1772 //*************************************************************************************************
1773 
1774 
1775 //*************************************************************************************************
1782 template< typename MT // Type of the adapted dense matrix
1783  , bool SO > // Storage order of the adapted dense matrix
1784 template< typename Other > // Data type of the scalar value
1785 inline StrictlyLowerMatrix<MT,SO,true>&
1786  StrictlyLowerMatrix<MT,SO,true>::scale( const Other& scalar )
1787 {
1788  matrix_.scale( scalar );
1789  return *this;
1790 }
1792 //*************************************************************************************************
1793 
1794 
1795 //*************************************************************************************************
1803 template< typename MT // Type of the adapted dense matrix
1804  , bool SO > // Storage order of the adapted dense matrix
1805 inline void StrictlyLowerMatrix<MT,SO,true>::swap( StrictlyLowerMatrix& m ) /* throw() */
1806 {
1807  using std::swap;
1808 
1809  swap( matrix_, m.matrix_ );
1810 }
1812 //*************************************************************************************************
1813 
1814 
1815 //*************************************************************************************************
1827 template< typename MT // Type of the adapted dense matrix
1828  , bool SO > // Storage order of the adapted dense matrix
1829 inline size_t StrictlyLowerMatrix<MT,SO,true>::maxNonZeros()
1830 {
1832 
1833  return maxNonZeros( Rows<MT>::value );
1834 }
1836 //*************************************************************************************************
1837 
1838 
1839 //*************************************************************************************************
1849 template< typename MT // Type of the adapted dense matrix
1850  , bool SO > // Storage order of the adapted dense matrix
1851 inline size_t StrictlyLowerMatrix<MT,SO,true>::maxNonZeros( size_t n )
1852 {
1853  return ( ( n - 1UL ) * n ) / 2UL;
1854 }
1856 //*************************************************************************************************
1857 
1858 
1859 
1860 
1861 //=================================================================================================
1862 //
1863 // EXPRESSION TEMPLATE EVALUATION FUNCTIONS
1864 //
1865 //=================================================================================================
1866 
1867 //*************************************************************************************************
1878 template< typename MT // Type of the adapted dense matrix
1879  , bool SO > // Storage order of the adapted dense matrix
1880 template< typename Other > // Data type of the foreign expression
1881 inline bool StrictlyLowerMatrix<MT,SO,true>::canAlias( const Other* alias ) const
1882 {
1883  return matrix_.canAlias( alias );
1884 }
1886 //*************************************************************************************************
1887 
1888 
1889 //*************************************************************************************************
1900 template< typename MT // Type of the adapted dense matrix
1901  , bool SO > // Storage order of the adapted dense matrix
1902 template< typename Other > // Data type of the foreign expression
1903 inline bool StrictlyLowerMatrix<MT,SO,true>::isAliased( const Other* alias ) const
1904 {
1905  return matrix_.isAliased( alias );
1906 }
1908 //*************************************************************************************************
1909 
1910 
1911 //*************************************************************************************************
1921 template< typename MT // Type of the adapted dense matrix
1922  , bool SO > // Storage order of the adapted dense matrix
1923 inline bool StrictlyLowerMatrix<MT,SO,true>::isAligned() const
1924 {
1925  return matrix_.isAligned();
1926 }
1928 //*************************************************************************************************
1929 
1930 
1931 //*************************************************************************************************
1942 template< typename MT // Type of the adapted dense matrix
1943  , bool SO > // Storage order of the adapted dense matrix
1944 inline bool StrictlyLowerMatrix<MT,SO,true>::canSMPAssign() const
1945 {
1946  return matrix_.canSMPAssign();
1947 }
1949 //*************************************************************************************************
1950 
1951 
1952 //*************************************************************************************************
1968 template< typename MT // Type of the adapted dense matrix
1969  , bool SO > // Storage order of the adapted dense matrix
1970 BLAZE_ALWAYS_INLINE typename StrictlyLowerMatrix<MT,SO,true>::IntrinsicType
1971  StrictlyLowerMatrix<MT,SO,true>::load( size_t i, size_t j ) const
1972 {
1973  return matrix_.load( i, j );
1974 }
1976 //*************************************************************************************************
1977 
1978 
1979 //*************************************************************************************************
1995 template< typename MT // Type of the adapted dense matrix
1996  , bool SO > // Storage order of the adapted dense matrix
1997 BLAZE_ALWAYS_INLINE typename StrictlyLowerMatrix<MT,SO,true>::IntrinsicType
1998  StrictlyLowerMatrix<MT,SO,true>::loadu( size_t i, size_t j ) const
1999 {
2000  return matrix_.loadu( i, j );
2001 }
2003 //*************************************************************************************************
2004 
2005 
2006 
2007 
2008 //=================================================================================================
2009 //
2010 // CONSTRUCTION FUNCTIONS
2011 //
2012 //=================================================================================================
2013 
2014 //*************************************************************************************************
2021 template< typename MT // Type of the adapted dense matrix
2022  , bool SO > // Storage order of the adapted dense matrix
2023 inline const MT StrictlyLowerMatrix<MT,SO,true>::construct( size_t n, TrueType )
2024 {
2026 
2027  return MT( n, n, ElementType() );
2028 }
2030 //*************************************************************************************************
2031 
2032 
2033 //*************************************************************************************************
2040 template< typename MT // Type of the adapted dense matrix
2041  , bool SO > // Storage order of the adapted dense matrix
2042 inline const MT StrictlyLowerMatrix<MT,SO,true>::construct( const ElementType& init, FalseType )
2043 {
2046 
2047  MT tmp;
2048 
2049  if( SO ) {
2050  for( size_t j=0UL; j<tmp.columns(); ++j ) {
2051  for( size_t i=j+1UL; i<tmp.rows(); ++i )
2052  tmp(i,j) = init;
2053  }
2054  }
2055  else {
2056  for( size_t i=0UL; i<tmp.rows(); ++i ) {
2057  for( size_t j=0UL; j<i; ++j )
2058  tmp(i,j) = init;
2059  }
2060  }
2061 
2062  return tmp;
2063 }
2065 //*************************************************************************************************
2066 
2067 
2068 //*************************************************************************************************
2079 template< typename MT // Type of the adapted dense matrix
2080  , bool SO > // Storage order of the adapted dense matrix
2081 template< typename MT2 // Type of the foreign matrix
2082  , bool SO2 // Storage order of the foreign matrix
2083  , typename T > // Type of the third argument
2084 inline const MT StrictlyLowerMatrix<MT,SO,true>::construct( const Matrix<MT2,SO2>& m, T )
2085 {
2086  const MT tmp( ~m );
2087 
2088  if( IsUniTriangular<MT2>::value ||
2089  ( !IsStrictlyLower<MT2>::value && !isStrictlyLower( tmp ) ) )
2090  throw std::invalid_argument( "Invalid setup of strictly lower matrix" );
2091 
2092  return tmp;
2093 }
2095 //*************************************************************************************************
2096 
2097 } // namespace blaze
2098 
2099 #endif
Constraint on the data type.
Header file for all restructuring submatrix functions.
#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:116
#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.
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:8247
Header file for basic type definitions.
BLAZE_ALWAYS_INLINE bool isSquare(const Matrix< MT, SO > &matrix)
Checks if the given matrix is a square matrix.
Definition: Matrix.h:902
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:237
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:300
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
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:258
bool isStrictlyLower(const DenseMatrix< MT, SO > &dm)
Checks if the given dense matrix is a strictly lower triangular matrix.
Definition: DenseMatrix.h:1121
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:242
#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:79
Constraint on the data type.
Constraint on the data type.
void reset(const DiagonalProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: DiagonalProxy.h:821
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:2507
BLAZE_ALWAYS_INLINE size_t capacity(const Matrix< MT, SO > &matrix)
Returns the maximum capacity of the matrix.
Definition: Matrix.h:348
BLAZE_ALWAYS_INLINE size_t rows(const Matrix< MT, SO > &matrix)
Returns the current number of rows of the matrix.
Definition: Matrix.h:316
void clear(CompressedMatrix< Type, SO > &m)
Clearing the given compressed matrix.
Definition: CompressedMatrix.h:4762
DisableIf< Or< IsComputation< MT >, IsTransExpr< MT > >, typename ColumnExprTrait< MT >::Type >::Type column(Matrix< MT, SO > &matrix, size_t index)
Creating a view on a specific column of the given matrix.
Definition: Column.h:103
void UNUSED_PARAMETER(const T1 &)
Suppression of unused parameter warnings.
Definition: Unused.h:81
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:2501
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:116
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:386
#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:78
Constraint on the data type.
CompressedMatrix< Type, false > OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: CompressedMatrix.h:2503
Constraint on the data type.
Header file for the IsSquare type trait.
Constraint on the data type.
Constraint on the data type.
Header file for the DenseSubmatrix class template.
Header file for the DisableIf class template.
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
BLAZE_ALWAYS_INLINE EnableIf< And< IsIntegral< T >, HasSize< T, 2UL > >, sse_int16_t >::Type loadu(const T *address)
Loads a vector of 2-byte integral values.
Definition: Loadu.h:76
Compile time assertion.
void swap(CompressedMatrix< Type, SO > &a, CompressedMatrix< Type, SO > &b)
Swapping the contents of two compressed matrices.
Definition: CompressedMatrix.h:4807
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2511
#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:116
Header file for the DenseMatrix base class.
Constraint on the data type.
const DenseIterator< Type > operator+(const DenseIterator< Type > &it, ptrdiff_t inc)
Addition between a DenseIterator and an integral value.
Definition: DenseIterator.h:556
Header file for the IsUniTriangular type trait.
CompressedMatrix< Type, false > TransposeType
Transpose type for expression template evaluations.
Definition: CompressedMatrix.h:2504
Constraints on the storage order of matrix types.
#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:118
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:195
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:535
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:2505
const Type & ConstReference
Reference to a constant matrix value.
Definition: CompressedMatrix.h:2509
Header file for the EnableIf class template.
Header file for the IsStrictlyLower type trait.
Header file for utility functions for dense matrices.
void clear(const DiagonalProxy< MT > &proxy)
Clearing the represented element.
Definition: DiagonalProxy.h:841
BLAZE_ALWAYS_INLINE EnableIf< And< IsIntegral< T >, HasSize< T, 2UL > >, sse_int16_t >::Type load(const T *address)
Loads a vector of 2-byte integral values.
Definition: Load.h:79
Header file for all adaptor forward declarations.
const bool spacing
Adding an additional spacing line between two log messages.This setting gives the opportunity to add ...
Definition: Logging.h:70
DisableIf< Or< IsComputation< MT >, IsTransExpr< MT > >, typename RowExprTrait< MT >::Type >::Type row(Matrix< MT, SO > &matrix, size_t index)
Creating a view on a specific row of the given matrix.
Definition: Row.h:103
#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:116
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:2506
Header file for run time assertion macros.
Constraint on the data type.
Constraint on the data type.
const DenseIterator< Type > operator-(const DenseIterator< Type > &it, ptrdiff_t inc)
Subtraction between a DenseIterator and an integral value.
Definition: DenseIterator.h:585
#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:118
void move(DynamicMatrix< Type, SO > &dst, DynamicMatrix< Type, SO > &src)
Moving the contents of one dynamic matrix to another.
Definition: DynamicMatrix.h:4934
#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:116
Element * Iterator
Iterator over non-constant elements.
Definition: CompressedMatrix.h:2510
Header file for the isDefault shim.
Constraint on the data type.
Constraint on the data type.
Header file for the StrictlyLowerProxy class.
#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:118
void swap(DiagonalMatrix< MT, SO, DF > &a, DiagonalMatrix< MT, SO, DF > &b)
Swapping the contents of two matrices.
Definition: DiagonalMatrix.h:200
Header file for all intrinsic functionality.
Header file for the move shim.
SubmatrixExprTrait< MT, unaligned >::Type 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:143
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:79
Header file for the IsComputation type trait class.
boost::false_type 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_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:118
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:2502
BLAZE_ALWAYS_INLINE size_t columns(const Matrix< MT, SO > &matrix)
Returns the current number of columns of the matrix.
Definition: Matrix.h:332
bool operator!=(const NegativeAccuracy< A > &lhs, const T &rhs)
Inequality comparison between a NegativeAccuracy object and a floating point value.
Definition: Accuracy.h:289
MatrixAccessProxy< This > Reference
Reference to a non-constant matrix value.
Definition: CompressedMatrix.h:2508
boost::true_type TrueType
Type traits base class.The TrueType class is used as base class for type traits and value traits that...
Definition: TrueType.h:61
#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:143
Header file for the IsResizable type trait.
Header file for the implementation of the base template of the StrictlyLowerMatrix.
System settings for the inline keywords.
#define BLAZE_INTERNAL_ASSERT(expr, msg)
Run time assertion macro for internal checks.In case of an invalid run time expression, the program execution is terminated. The BLAZE_INTERNAL_ASSERT macro can be disabled by setting the BLAZE_USER_ASSERTION flag to zero or by defining NDEBUG during the compilation.
Definition: Assert.h:101
Header file for the TrueType type/value trait base class.