All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DMatAbsExpr.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_EXPRESSIONS_DMATABSEXPR_H_
36 #define _BLAZE_MATH_EXPRESSIONS_DMATABSEXPR_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
43 #include <cmath>
50 #include <blaze/math/Intrinsics.h>
70 #include <blaze/util/Assert.h>
72 #include <blaze/util/EnableIf.h>
73 #include <blaze/util/InvalidType.h>
75 #include <blaze/util/SelectType.h>
76 #include <blaze/util/Types.h>
78 
79 
80 namespace blaze {
81 
82 //=================================================================================================
83 //
84 // CLASS DMATABSEXPR
85 //
86 //=================================================================================================
87 
88 //*************************************************************************************************
95 template< typename MT // Type of the dense matrix
96  , bool SO > // Storage order
97 class DMatAbsExpr : public DenseMatrix< DMatAbsExpr<MT,SO>, SO >
98  , private MatAbsExpr
99  , private Computation
100 {
101  private:
102  //**Type definitions****************************************************************************
103  typedef typename MT::ReturnType RN;
104  typedef typename MT::ElementType ET;
105  //**********************************************************************************************
106 
107  //**Return type evaluation**********************************************************************
109 
114  enum { returnExpr = !IsTemporary<RN>::value };
115 
118  //**********************************************************************************************
119 
120  //**Serial evaluation strategy******************************************************************
122 
128  enum { useAssign = RequiresEvaluation<MT>::value };
129 
131  template< typename MT2 >
133  struct UseAssign {
134  enum { value = useAssign };
135  };
137  //**********************************************************************************************
138 
139  //**Parallel evaluation strategy****************************************************************
141 
147  template< typename MT2 >
148  struct UseSMPAssign {
149  enum { value = ( !MT2::smpAssignable || !MT::smpAssignable ) && useAssign };
150  };
152  //**********************************************************************************************
153 
154  public:
155  //**Type definitions****************************************************************************
157  typedef typename MT::ResultType ResultType;
158  typedef typename MT::OppositeType OppositeType;
159  typedef typename MT::TransposeType TransposeType;
160  typedef typename MT::ElementType ElementType;
162 
165 
168 
170  typedef typename SelectType< IsExpression<MT>::value, const MT, const MT& >::Type Operand;
171  //**********************************************************************************************
172 
173  //**ConstIterator class definition**************************************************************
177  {
178  public:
179  //**Type definitions*************************************************************************
180  typedef std::random_access_iterator_tag IteratorCategory;
185 
186  // STL iterator requirements
192 
194  typedef typename MT::ConstIterator IteratorType;
195  //*******************************************************************************************
196 
197  //**Constructor******************************************************************************
202  explicit inline ConstIterator( IteratorType it )
203  : it_( it ) // Iterator to the current matrix element
204  {}
205  //*******************************************************************************************
206 
207  //**Addition assignment operator*************************************************************
213  inline ConstIterator& operator+=( size_t inc ) {
214  it_ += inc;
215  return *this;
216  }
217  //*******************************************************************************************
218 
219  //**Subtraction assignment operator**********************************************************
225  inline ConstIterator& operator-=( size_t dec ) {
226  it_ -= dec;
227  return *this;
228  }
229  //*******************************************************************************************
230 
231  //**Prefix increment operator****************************************************************
237  ++it_;
238  return *this;
239  }
240  //*******************************************************************************************
241 
242  //**Postfix increment operator***************************************************************
247  inline const ConstIterator operator++( int ) {
248  return ConstIterator( it_++ );
249  }
250  //*******************************************************************************************
251 
252  //**Prefix decrement operator****************************************************************
258  --it_;
259  return *this;
260  }
261  //*******************************************************************************************
262 
263  //**Postfix decrement operator***************************************************************
268  inline const ConstIterator operator--( int ) {
269  return ConstIterator( it_-- );
270  }
271  //*******************************************************************************************
272 
273  //**Element access operator******************************************************************
278  inline ReturnType operator*() const {
279  using std::abs;
280  return abs( *it_ );
281  }
282  //*******************************************************************************************
283 
284  //**Load function****************************************************************************
289  inline IntrinsicType load() const {
290  return abs( it_.load() );
291  }
292  //*******************************************************************************************
293 
294  //**Equality operator************************************************************************
300  inline bool operator==( const ConstIterator& rhs ) const {
301  return it_ == rhs.it_;
302  }
303  //*******************************************************************************************
304 
305  //**Inequality operator**********************************************************************
311  inline bool operator!=( const ConstIterator& rhs ) const {
312  return it_ != rhs.it_;
313  }
314  //*******************************************************************************************
315 
316  //**Less-than operator***********************************************************************
322  inline bool operator<( const ConstIterator& rhs ) const {
323  return it_ < rhs.it_;
324  }
325  //*******************************************************************************************
326 
327  //**Greater-than operator********************************************************************
333  inline bool operator>( const ConstIterator& rhs ) const {
334  return it_ > rhs.it_;
335  }
336  //*******************************************************************************************
337 
338  //**Less-or-equal-than operator**************************************************************
344  inline bool operator<=( const ConstIterator& rhs ) const {
345  return it_ <= rhs.it_;
346  }
347  //*******************************************************************************************
348 
349  //**Greater-or-equal-than operator***********************************************************
355  inline bool operator>=( const ConstIterator& rhs ) const {
356  return it_ >= rhs.it_;
357  }
358  //*******************************************************************************************
359 
360  //**Subtraction operator*********************************************************************
366  inline DifferenceType operator-( const ConstIterator& rhs ) const {
367  return it_ - rhs.it_;
368  }
369  //*******************************************************************************************
370 
371  //**Addition operator************************************************************************
378  friend inline const ConstIterator operator+( const ConstIterator& it, size_t inc ) {
379  return ConstIterator( it.it_ + inc );
380  }
381  //*******************************************************************************************
382 
383  //**Addition operator************************************************************************
390  friend inline const ConstIterator operator+( size_t inc, const ConstIterator& it ) {
391  return ConstIterator( it.it_ + inc );
392  }
393  //*******************************************************************************************
394 
395  //**Subtraction operator*********************************************************************
402  friend inline const ConstIterator operator-( const ConstIterator& it, size_t dec ) {
403  return ConstIterator( it.it_ - dec );
404  }
405  //*******************************************************************************************
406 
407  private:
408  //**Member variables*************************************************************************
410  //*******************************************************************************************
411  };
412  //**********************************************************************************************
413 
414  //**Compilation flags***************************************************************************
416  enum { vectorizable = MT::vectorizable &&
418 
420  enum { smpAssignable = MT::smpAssignable };
421  //**********************************************************************************************
422 
423  //**Constructor*********************************************************************************
428  explicit inline DMatAbsExpr( const MT& dm )
429  : dm_( dm ) // Dense matrix of the absolute value expression
430  {}
431  //**********************************************************************************************
432 
433  //**Access operator*****************************************************************************
440  inline ReturnType operator()( size_t i, size_t j ) const {
441  using std::abs;
442  BLAZE_INTERNAL_ASSERT( i < dm_.rows() , "Invalid row access index" );
443  BLAZE_INTERNAL_ASSERT( j < dm_.columns(), "Invalid column access index" );
444  return abs( dm_(i,j) );
445  }
446  //**********************************************************************************************
447 
448  //**Load function*******************************************************************************
455  inline IntrinsicType load( size_t i, size_t j ) const {
456  typedef IntrinsicTrait<ElementType> IT;
457  BLAZE_INTERNAL_ASSERT( i < dm_.rows() , "Invalid row access index" );
458  BLAZE_INTERNAL_ASSERT( j < dm_.columns(), "Invalid column access index" );
459  BLAZE_INTERNAL_ASSERT( !SO || ( i % IT::size == 0UL ), "Invalid row access index" );
460  BLAZE_INTERNAL_ASSERT( SO || ( j % IT::size == 0UL ), "Invalid column access index" );
461  return abs( dm_.load(i,j) );
462  }
463  //**********************************************************************************************
464 
465  //**Begin function******************************************************************************
471  inline ConstIterator begin( size_t i ) const {
472  return ConstIterator( dm_.begin(i) );
473  }
474  //**********************************************************************************************
475 
476  //**End function********************************************************************************
482  inline ConstIterator end( size_t i ) const {
483  return ConstIterator( dm_.end(i) );
484  }
485  //**********************************************************************************************
486 
487  //**Rows function*******************************************************************************
492  inline size_t rows() const {
493  return dm_.rows();
494  }
495  //**********************************************************************************************
496 
497  //**Columns function****************************************************************************
502  inline size_t columns() const {
503  return dm_.columns();
504  }
505  //**********************************************************************************************
506 
507  //**Operand access******************************************************************************
512  inline Operand operand() const {
513  return dm_;
514  }
515  //**********************************************************************************************
516 
517  //**********************************************************************************************
523  template< typename T >
524  inline bool canAlias( const T* alias ) const {
525  return IsComputation<MT>::value && dm_.canAlias( alias );
526  }
527  //**********************************************************************************************
528 
529  //**********************************************************************************************
535  template< typename T >
536  inline bool isAliased( const T* alias ) const {
537  return dm_.isAliased( alias );
538  }
539  //**********************************************************************************************
540 
541  //**********************************************************************************************
546  inline bool isAligned() const {
547  return dm_.isAligned();
548  }
549  //**********************************************************************************************
550 
551  //**********************************************************************************************
556  inline bool canSMPAssign() const {
557  return dm_.canSMPAssign();
558  }
559  //**********************************************************************************************
560 
561  private:
562  //**Member variables****************************************************************************
564  //**********************************************************************************************
565 
566  //**Assignment to dense matrices****************************************************************
580  template< typename MT2 // Type of the target dense matrix
581  , bool SO2 > // Storage order or the target dense matrix
582  friend inline typename EnableIf< UseAssign<MT2> >::Type
583  assign( DenseMatrix<MT2,SO2>& lhs, const DMatAbsExpr& rhs )
584  {
586 
587  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
588  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
589 
590  assign( ~lhs, rhs.dm_ );
591  assign( ~lhs, abs( ~lhs ) );
592  }
594  //**********************************************************************************************
595 
596  //**Assignment to sparse matrices***************************************************************
610  template< typename MT2 // Type of the target sparse matrix
611  , bool SO2 > // Storage order or the target sparse matrix
612  friend inline typename EnableIf< UseAssign<MT2> >::Type
613  assign( SparseMatrix<MT2,SO2>& lhs, const DMatAbsExpr& rhs )
614  {
616 
618 
625 
626  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
627  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
628 
629  const TmpType tmp( serial( rhs ) );
630  assign( ~lhs, tmp );
631  }
633  //**********************************************************************************************
634 
635  //**Addition assignment to dense matrices*******************************************************
649  template< typename MT2 // Type of the target dense matrix
650  , bool SO2 > // Storage order of the target dense matrix
651  friend inline typename EnableIf< UseAssign<MT2> >::Type
652  addAssign( DenseMatrix<MT2,SO2>& lhs, const DMatAbsExpr& rhs )
653  {
655 
659 
660  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
661  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
662 
663  const ResultType tmp( serial( rhs ) );
664  addAssign( ~lhs, tmp );
665  }
667  //**********************************************************************************************
668 
669  //**Addition assignment to sparse matrices******************************************************
670  // No special implementation for the addition assignment to sparse matrices.
671  //**********************************************************************************************
672 
673  //**Subtraction assignment to dense matrices****************************************************
687  template< typename MT2 // Type of the target dense matrix
688  , bool SO2 > // Storage order of the target dense matrix
689  friend inline typename EnableIf< UseAssign<MT2> >::Type
690  subAssign( DenseMatrix<MT2,SO2>& lhs, const DMatAbsExpr& rhs )
691  {
693 
697 
698  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
699  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
700 
701  const ResultType tmp( serial( rhs ) );
702  subAssign( ~lhs, tmp );
703  }
705  //**********************************************************************************************
706 
707  //**Subtraction assignment to sparse matrices***************************************************
708  // No special implementation for the subtraction assignment to sparse matrices.
709  //**********************************************************************************************
710 
711  //**Multiplication assignment to dense matrices*************************************************
712  // No special implementation for the multiplication assignment to dense matrices.
713  //**********************************************************************************************
714 
715  //**Multiplication assignment to sparse matrices************************************************
716  // No special implementation for the multiplication assignment to sparse matrices.
717  //**********************************************************************************************
718 
719  //**SMP assignment to dense matrices************************************************************
733  template< typename MT2 // Type of the target dense matrix
734  , bool SO2 > // Storage order or the target dense matrix
735  friend inline typename EnableIf< UseSMPAssign<MT2> >::Type
736  smpAssign( DenseMatrix<MT2,SO2>& lhs, const DMatAbsExpr& rhs )
737  {
739 
740  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
741  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
742 
743  smpAssign( ~lhs, rhs.dm_ );
744  smpAssign( ~lhs, abs( ~lhs ) );
745  }
747  //**********************************************************************************************
748 
749  //**SMP assignment to sparse matrices***********************************************************
763  template< typename MT2 // Type of the target sparse matrix
764  , bool SO2 > // Storage order or the target sparse matrix
765  friend inline typename EnableIf< UseSMPAssign<MT2> >::Type
766  smpAssign( SparseMatrix<MT2,SO2>& lhs, const DMatAbsExpr& rhs )
767  {
769 
770  typedef typename SelectType< SO == SO2, ResultType, OppositeType >::Type TmpType;
771 
778 
779  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
780  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
781 
782  const TmpType tmp( rhs );
783  smpAssign( ~lhs, tmp );
784  }
786  //**********************************************************************************************
787 
788  //**SMP addition assignment to dense matrices***************************************************
802  template< typename MT2 // Type of the target dense matrix
803  , bool SO2 > // Storage order of the target dense matrix
804  friend inline typename EnableIf< UseSMPAssign<MT2> >::Type
805  smpAddAssign( DenseMatrix<MT2,SO2>& lhs, const DMatAbsExpr& rhs )
806  {
808 
812 
813  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
814  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
815 
816  const ResultType tmp( rhs );
817  smpAddAssign( ~lhs, tmp );
818  }
820  //**********************************************************************************************
821 
822  //**SMP addition assignment to sparse matrices**************************************************
823  // No special implementation for the SMP addition assignment to sparse matrices.
824  //**********************************************************************************************
825 
826  //**SMP subtraction assignment to dense matrices************************************************
840  template< typename MT2 // Type of the target dense matrix
841  , bool SO2 > // Storage order of the target dense matrix
842  friend inline typename EnableIf< UseSMPAssign<MT2> >::Type
843  smpSubAssign( DenseMatrix<MT2,SO2>& lhs, const DMatAbsExpr& rhs )
844  {
846 
850 
851  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
852  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
853 
854  const ResultType tmp( rhs );
855  smpSubAssign( ~lhs, tmp );
856  }
858  //**********************************************************************************************
859 
860  //**SMP subtraction assignment to sparse matrices***********************************************
861  // No special implementation for the SMP subtraction assignment to sparse matrices.
862  //**********************************************************************************************
863 
864  //**SMP multiplication assignment to dense matrices*********************************************
865  // No special implementation for the SMP multiplication assignment to dense matrices.
866  //**********************************************************************************************
867 
868  //**SMP multiplication assignment to sparse matrices********************************************
869  // No special implementation for the SMP multiplication assignment to sparse matrices.
870  //**********************************************************************************************
871 
872  //**Compile time checks*************************************************************************
877  //**********************************************************************************************
878 };
879 //*************************************************************************************************
880 
881 
882 
883 
884 //=================================================================================================
885 //
886 // GLOBAL FUNCTIONS
887 //
888 //=================================================================================================
889 
890 //*************************************************************************************************
907 template< typename MT // Type of the dense matrix
908  , bool SO > // Storage order
909 inline const DMatAbsExpr<MT,SO> abs( const DenseMatrix<MT,SO>& dm )
910 {
912 
913  return DMatAbsExpr<MT,SO>( ~dm );
914 }
915 //*************************************************************************************************
916 
917 
918 
919 
920 //=================================================================================================
921 //
922 // GLOBAL RESTRUCTURING FUNCTIONS
923 //
924 //=================================================================================================
925 
926 //*************************************************************************************************
937 template< typename MT // Type of the dense matrix
938  , bool SO > // Storage order
939 inline const DMatAbsExpr<MT,SO>& abs( const DMatAbsExpr<MT,SO>& dm )
940 {
942 
943  return dm;
944 }
946 //*************************************************************************************************
947 
948 
949 
950 
951 //=================================================================================================
952 //
953 // ROWS SPECIALIZATIONS
954 //
955 //=================================================================================================
956 
957 //*************************************************************************************************
959 template< typename MT, bool SO >
960 struct Rows< DMatAbsExpr<MT,SO> > : public Rows<MT>
961 {};
963 //*************************************************************************************************
964 
965 
966 
967 
968 //=================================================================================================
969 //
970 // COLUMNS SPECIALIZATIONS
971 //
972 //=================================================================================================
973 
974 //*************************************************************************************************
976 template< typename MT, bool SO >
977 struct Columns< DMatAbsExpr<MT,SO> > : public Columns<MT>
978 {};
980 //*************************************************************************************************
981 
982 
983 
984 
985 //=================================================================================================
986 //
987 // ISSYMMETRIC SPECIALIZATIONS
988 //
989 //=================================================================================================
990 
991 //*************************************************************************************************
993 template< typename MT, bool SO >
994 struct IsSymmetric< DMatAbsExpr<MT,SO> > : public IsTrue< IsSymmetric<MT>::value >
995 {};
997 //*************************************************************************************************
998 
999 
1000 
1001 
1002 //=================================================================================================
1003 //
1004 // ISLOWER SPECIALIZATIONS
1005 //
1006 //=================================================================================================
1007 
1008 //*************************************************************************************************
1010 template< typename MT, bool SO >
1011 struct IsLower< DMatAbsExpr<MT,SO> > : public IsTrue< IsLower<MT>::value >
1012 {};
1014 //*************************************************************************************************
1015 
1016 
1017 
1018 
1019 //=================================================================================================
1020 //
1021 // ISUPPER SPECIALIZATIONS
1022 //
1023 //=================================================================================================
1024 
1025 //*************************************************************************************************
1027 template< typename MT, bool SO >
1028 struct IsUpper< DMatAbsExpr<MT,SO> > : public IsTrue< IsUpper<MT>::value >
1029 {};
1031 //*************************************************************************************************
1032 
1033 
1034 
1035 
1036 //=================================================================================================
1037 //
1038 // EXPRESSION TRAIT SPECIALIZATIONS
1039 //
1040 //=================================================================================================
1041 
1042 //*************************************************************************************************
1044 template< typename MT >
1045 struct DMatAbsExprTrait< DMatAbsExpr<MT,false> >
1046 {
1047  public:
1048  //**********************************************************************************************
1049  typedef typename SelectType< IsDenseMatrix<MT>::value && IsRowMajorMatrix<MT>::value
1050  , DMatAbsExpr<MT,false>
1051  , INVALID_TYPE >::Type Type;
1052  //**********************************************************************************************
1053 };
1055 //*************************************************************************************************
1056 
1057 
1058 //*************************************************************************************************
1060 template< typename MT >
1061 struct TDMatAbsExprTrait< DMatAbsExpr<MT,true> >
1062 {
1063  public:
1064  //**********************************************************************************************
1065  typedef typename SelectType< IsDenseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value
1066  , DMatAbsExpr<MT,true>
1067  , INVALID_TYPE >::Type Type;
1068  //**********************************************************************************************
1069 };
1071 //*************************************************************************************************
1072 
1073 
1074 //*************************************************************************************************
1076 template< typename MT, bool SO, bool AF >
1077 struct SubmatrixExprTrait< DMatAbsExpr<MT,SO>, AF >
1078 {
1079  public:
1080  //**********************************************************************************************
1081  typedef typename AbsExprTrait< typename SubmatrixExprTrait<const MT,AF>::Type >::Type Type;
1082  //**********************************************************************************************
1083 };
1085 //*************************************************************************************************
1086 
1087 
1088 //*************************************************************************************************
1090 template< typename MT, bool SO >
1091 struct RowExprTrait< DMatAbsExpr<MT,SO> >
1092 {
1093  public:
1094  //**********************************************************************************************
1095  typedef typename AbsExprTrait< typename RowExprTrait<const MT>::Type >::Type Type;
1096  //**********************************************************************************************
1097 };
1099 //*************************************************************************************************
1100 
1101 
1102 //*************************************************************************************************
1104 template< typename MT, bool SO >
1105 struct ColumnExprTrait< DMatAbsExpr<MT,SO> >
1106 {
1107  public:
1108  //**********************************************************************************************
1109  typedef typename AbsExprTrait< typename ColumnExprTrait<const MT>::Type >::Type Type;
1110  //**********************************************************************************************
1111 };
1113 //*************************************************************************************************
1114 
1115 } // namespace blaze
1116 
1117 #endif
IntrinsicTrait< ET >::Type IntrinsicType
Resulting intrinsic element type.
Definition: DMatAbsExpr.h:161
Pointer difference type of the Blaze library.
ReturnType operator*() const
Direct access to the element at the current iterator position.
Definition: DMatAbsExpr.h:278
Compile time check whether the given type is a computational expression template.This type trait clas...
Definition: IsComputation.h:89
Compile time check whether the given type is a temporary vector or matrix type.This type trait class ...
Definition: IsTemporary.h:87
SelectType< IsExpression< MT >::value, const MT, const MT & >::Type Operand
Composite data type of the dense matrix expression.
Definition: DMatAbsExpr.h:170
Header file for the Rows type trait.
ValueType value_type
Type of the underlying elements.
Definition: DMatAbsExpr.h:188
bool operator>(const ConstIterator &rhs) const
Greater-than comparison between two ConstIterator objects.
Definition: DMatAbsExpr.h:333
IteratorCategory iterator_category
The iterator category.
Definition: DMatAbsExpr.h:187
BLAZE_ALWAYS_INLINE size_t size(const Vector< VT, TF > &vector)
Returns the current size/dimension of the vector.
Definition: Vector.h:258
ConstIterator & operator+=(size_t inc)
Addition assignment operator.
Definition: DMatAbsExpr.h:213
#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
Efficient implementation of a compressed matrix.The CompressedMatrix class template is the represent...
Definition: CompressedMatrix.h:205
#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
Header file for the ColumnExprTrait class template.
size_t columns() const
Returns the current number of columns of the matrix.
Definition: DMatAbsExpr.h:502
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:2478
Header file for the IsRowVector type trait.
MT::TransposeType TransposeType
Transpose type for expression template evaluations.
Definition: DMatAbsExpr.h:159
const DMatAbsExpr< MT, SO > abs(const DenseMatrix< MT, SO > &dm)
Returns a matrix containing the absolute values of each single element of dm.
Definition: DMatAbsExpr.h:909
friend const ConstIterator operator-(const ConstIterator &it, size_t dec)
Subtraction between a ConstIterator and an integral value.
Definition: DMatAbsExpr.h:402
const DMatSerialExpr< MT, SO > serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:695
AbsExprTrait< RN >::Type ExprReturnType
Expression return type for the subscript operator.
Definition: DMatAbsExpr.h:117
Header file for the Computation base class.
SelectType< useAssign, const ResultType, const DMatAbsExpr & >::Type CompositeType
Data type for composite expression templates.
Definition: DMatAbsExpr.h:167
Header file for the RequiresEvaluation type trait.
ElementType * PointerType
Pointer return type.
Definition: DMatAbsExpr.h:182
Operand dm_
Dense matrix of the absolute value expression.
Definition: DMatAbsExpr.h:563
CompressedMatrix< Type, false > OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: CompressedMatrix.h:2474
Base class for dense matrices.The DenseMatrix class is a base class for all dense matrix classes...
Definition: DenseMatrix.h:70
Base class for sparse matrices.The SparseMatrix class is a base class for all sparse matrix classes...
Definition: Forward.h:107
Header file for the TDVecAbsExprTrait class template.
PointerType pointer
Pointer return type.
Definition: DMatAbsExpr.h:189
Constraint on the data type.
const SelectType< returnExpr, ExprReturnType, ElementType >::Type ReturnType
Return type for expression template evaluations.
Definition: DMatAbsExpr.h:164
bool operator==(const ConstIterator &rhs) const
Equality comparison between two ConstIterator objects.
Definition: DMatAbsExpr.h:300
Expression object for the dense matrix abs() function.The DMatAbsExpr class represents the compile ti...
Definition: DMatAbsExpr.h:97
Constraint on the data type.
Compile time check to query the requirement to evaluate an expression.Via this type trait it is possi...
Definition: RequiresEvaluation.h:90
bool canSMPAssign() const
Returns whether the expression can be used in SMP assignments.
Definition: DMatAbsExpr.h:556
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:259
ConstIterator & operator--()
Pre-decrement operator.
Definition: DMatAbsExpr.h:257
MT::ResultType ResultType
Result type for expression template evaluations.
Definition: DMatAbsExpr.h:157
Compile time type selection.The SelectType class template selects one of the two given types T1 and T...
Definition: SelectType.h:59
Header file for the IsTemporary type trait class.
Header file for the IsSymmetric type trait.
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2482
Operand operand() const
Returns the dense matrix operand.
Definition: DMatAbsExpr.h:512
ReturnType operator()(size_t i, size_t j) const
2D-access to the matrix elements.
Definition: DMatAbsExpr.h:440
bool operator<=(const ConstIterator &rhs) const
Less-than comparison between two ConstIterator objects.
Definition: DMatAbsExpr.h:344
const ConstIterator operator++(int)
Post-increment operator.
Definition: DMatAbsExpr.h:247
Header file for the DenseMatrix base class.
BLAZE_ALWAYS_INLINE void assign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the assignment of a matrix to a matrix.
Definition: Matrix.h:635
Header file for the Columns type trait.
friend const ConstIterator operator+(const ConstIterator &it, size_t inc)
Addition between a ConstIterator and an integral value.
Definition: DMatAbsExpr.h:378
friend const ConstIterator operator+(size_t inc, const ConstIterator &it)
Addition between an integral value and a ConstIterator.
Definition: DMatAbsExpr.h:390
ReferenceType reference
Reference return type.
Definition: DMatAbsExpr.h:190
Header file for the DVecAbsExprTrait class template.
Header file for the MatAbsExpr base class.
Header file for the IsLower type trait.
DifferenceType difference_type
Difference between two iterators.
Definition: DMatAbsExpr.h:191
#define BLAZE_CONSTRAINT_MUST_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:78
ElementType & ReferenceType
Reference return type.
Definition: DMatAbsExpr.h:183
CompressedMatrix< Type, false > TransposeType
Transpose type for expression template evaluations.
Definition: CompressedMatrix.h:2475
Constraints on the storage order of matrix types.
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:2476
Header file for the SelectType class template.
Header file for the RowExprTrait class template.
Iterator over the elements of the dense matrix.
Definition: DMatAbsExpr.h:176
Header file for all forward declarations for expression class templates.
Header file for the EnableIf class template.
ConstIterator begin(size_t i) const
Returns an iterator to the first non-zero element of row i.
Definition: DMatAbsExpr.h:471
Header file for the serial shim.
IteratorType it_
Iterator to the current matrix element.
Definition: DMatAbsExpr.h:409
EnableIf< IsDenseMatrix< MT1 > >::Type smpSubAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP subtraction assignment of a matrix to dense matrix.
Definition: DenseMatrix.h:160
Header file for the SubmatrixExprTrait class template.
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:2477
Intrinsic characteristics of data types.The IntrinsicTrait class template provides the intrinsic char...
Definition: IntrinsicTrait.h:749
Header file for run time assertion macros.
EnableIf< IsDenseMatrix< MT1 > >::Type smpAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:98
IntrinsicType load() const
Access to the intrinsic elements of the matrix.
Definition: DMatAbsExpr.h:289
Utility type for generic codes.
bool operator!=(const ConstIterator &rhs) const
Inequality comparison between two ConstIterator objects.
Definition: DMatAbsExpr.h:311
bool isAliased(const T *alias) const
Returns whether the expression is aliased with the given address alias.
Definition: DMatAbsExpr.h:536
BLAZE_ALWAYS_INLINE void addAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the addition assignment of a matrix to a matrix.
Definition: Matrix.h:742
size_t rows() const
Returns the current number of rows of the matrix.
Definition: DMatAbsExpr.h:492
DMatAbsExpr(const MT &dm)
Constructor for the DMatAbsExpr class.
Definition: DMatAbsExpr.h:428
Substitution Failure Is Not An Error (SFINAE) class.The EnableIf class template is an auxiliary tool ...
Definition: EnableIf.h:184
MT::ElementType ET
Element type of the dense matrix expression.
Definition: DMatAbsExpr.h:104
bool isAligned() const
Returns whether the operands of the expression are properly aligned in memory.
Definition: DMatAbsExpr.h:546
ElementType ValueType
Type of the underlying elements.
Definition: DMatAbsExpr.h:181
Base class for all matrix absolute value expression templates.The MatAbsExpr class serves as a tag fo...
Definition: MatAbsExpr.h:65
DMatAbsExpr< MT, SO > This
Type of this DMatAbsExpr instance.
Definition: DMatAbsExpr.h:156
ConstIterator(IteratorType it)
Constructor for the ConstIterator class.
Definition: DMatAbsExpr.h:202
std::random_access_iterator_tag IteratorCategory
The iterator category.
Definition: DMatAbsExpr.h:180
IntrinsicType load(size_t i, size_t j) const
Access to the intrinsic elements of the matrix.
Definition: DMatAbsExpr.h:455
MT::OppositeType OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: DMatAbsExpr.h:158
#define BLAZE_CONSTRAINT_MATRICES_MUST_HAVE_SAME_STORAGE_ORDER(T1, T2)
Constraint on the data type.In case either of the two given data types T1 or T2 is not a matrix type ...
Definition: StorageOrder.h:283
Header file for the IsDenseVector type trait.
ptrdiff_t DifferenceType
Difference between two iterators.
Definition: DMatAbsExpr.h:184
Header file for all intrinsic functionality.
MT::ReturnType RN
Return type of the dense matrix expression.
Definition: DMatAbsExpr.h:103
ConstIterator & operator++()
Pre-increment operator.
Definition: DMatAbsExpr.h:236
ConstIterator end(size_t i) const
Returns an iterator just past the last non-zero element of row i.
Definition: DMatAbsExpr.h:482
const ConstIterator operator--(int)
Post-decrement operator.
Definition: DMatAbsExpr.h:268
Header file for the IsComputation type trait class.
bool operator>=(const ConstIterator &rhs) const
Greater-than comparison between two ConstIterator objects.
Definition: DMatAbsExpr.h:355
bool operator<(const ConstIterator &rhs) const
Less-than comparison between two ConstIterator objects.
Definition: DMatAbsExpr.h:322
Base class for all compute expression templates.The Computation class serves as a tag for all computa...
Definition: Computation.h:59
EnableIf< IsDenseMatrix< MT1 > >::Type smpAddAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP addition assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:129
#define BLAZE_FUNCTION_TRACE
Function trace macro.This macro can be used to reliably trace function calls. In case function tracin...
Definition: FunctionTrace.h:157
This ResultType
Result type for expression template evaluations.
Definition: CompressedMatrix.h:2473
Header file for the IsTrue value trait.
MT::ElementType ElementType
Resulting element type.
Definition: DMatAbsExpr.h:160
Header file for basic type definitions.
ConstIterator & operator-=(size_t dec)
Subtraction assignment operator.
Definition: DMatAbsExpr.h:225
DifferenceType operator-(const ConstIterator &rhs) const
Calculating the number of elements between two iterators.
Definition: DMatAbsExpr.h:366
Header file for the IsUpper type trait.
bool canAlias(const T *alias) const
Returns whether the expression can alias with the given address alias.
Definition: DMatAbsExpr.h:524
Header file for the AbsExprTrait class template.
Header file for the IsColumnVector type trait.
Evaluation of the return type of an absolute value expression.Via this type trait it is possible to e...
Definition: AbsExprTrait.h:87
#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 IsExpression type trait class.
Header file for the FunctionTrace class.
BLAZE_ALWAYS_INLINE void subAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the subtraction assignment of a matrix to matrix.
Definition: Matrix.h:849
MT::ConstIterator IteratorType
ConstIterator type of the dense matrix expression.
Definition: DMatAbsExpr.h:194