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>
65 #include <blaze/util/Assert.h>
67 #include <blaze/util/EnableIf.h>
68 #include <blaze/util/InvalidType.h>
70 #include <blaze/util/SelectType.h>
71 #include <blaze/util/Types.h>
72 
73 
74 namespace blaze {
75 
76 //=================================================================================================
77 //
78 // CLASS DMATABSEXPR
79 //
80 //=================================================================================================
81 
82 //*************************************************************************************************
89 template< typename MT // Type of the dense matrix
90  , bool SO > // Storage order
91 class DMatAbsExpr : public DenseMatrix< DMatAbsExpr<MT,SO>, SO >
92  , private MatAbsExpr
93  , private Computation
94 {
95  private:
96  //**Type definitions****************************************************************************
97  typedef typename MT::ReturnType RN;
98  typedef typename MT::ElementType ET;
99  //**********************************************************************************************
100 
101  //**Return type evaluation**********************************************************************
103 
108  enum { returnExpr = !IsTemporary<RN>::value };
109 
112  //**********************************************************************************************
113 
114  //**Serial evaluation strategy******************************************************************
116 
122  enum { useAssign = RequiresEvaluation<MT>::value };
123 
125  template< typename MT2 >
127  struct UseAssign {
128  enum { value = useAssign };
129  };
131  //**********************************************************************************************
132 
133  //**Parallel evaluation strategy****************************************************************
135 
141  template< typename MT2 >
142  struct UseSMPAssign {
143  enum { value = ( !MT2::smpAssignable || !MT::smpAssignable ) && useAssign };
144  };
146  //**********************************************************************************************
147 
148  public:
149  //**Type definitions****************************************************************************
151  typedef typename MT::ResultType ResultType;
152  typedef typename MT::OppositeType OppositeType;
153  typedef typename MT::TransposeType TransposeType;
154  typedef typename MT::ElementType ElementType;
156 
159 
162 
164  typedef typename SelectType< IsExpression<MT>::value, const MT, const MT& >::Type Operand;
165  //**********************************************************************************************
166 
167  //**ConstIterator class definition**************************************************************
171  {
172  public:
173  //**Type definitions*************************************************************************
174  typedef std::random_access_iterator_tag IteratorCategory;
179 
180  // STL iterator requirements
186 
188  typedef typename MT::ConstIterator IteratorType;
189  //*******************************************************************************************
190 
191  //**Constructor******************************************************************************
196  explicit inline ConstIterator( IteratorType it )
197  : it_( it ) // Iterator to the current matrix element
198  {}
199  //*******************************************************************************************
200 
201  //**Addition assignment operator*************************************************************
207  inline ConstIterator& operator+=( size_t inc ) {
208  it_ += inc;
209  return *this;
210  }
211  //*******************************************************************************************
212 
213  //**Subtraction assignment operator**********************************************************
219  inline ConstIterator& operator-=( size_t dec ) {
220  it_ -= dec;
221  return *this;
222  }
223  //*******************************************************************************************
224 
225  //**Prefix increment operator****************************************************************
231  ++it_;
232  return *this;
233  }
234  //*******************************************************************************************
235 
236  //**Postfix increment operator***************************************************************
241  inline const ConstIterator operator++( int ) {
242  return ConstIterator( it_++ );
243  }
244  //*******************************************************************************************
245 
246  //**Prefix decrement operator****************************************************************
252  --it_;
253  return *this;
254  }
255  //*******************************************************************************************
256 
257  //**Postfix decrement operator***************************************************************
262  inline const ConstIterator operator--( int ) {
263  return ConstIterator( it_-- );
264  }
265  //*******************************************************************************************
266 
267  //**Element access operator******************************************************************
272  inline ReturnType operator*() const {
273  using std::abs;
274  return abs( *it_ );
275  }
276  //*******************************************************************************************
277 
278  //**Load function****************************************************************************
283  inline IntrinsicType load() const {
284  return abs( it_.load() );
285  }
286  //*******************************************************************************************
287 
288  //**Equality operator************************************************************************
294  inline bool operator==( const ConstIterator& rhs ) const {
295  return it_ == rhs.it_;
296  }
297  //*******************************************************************************************
298 
299  //**Inequality operator**********************************************************************
305  inline bool operator!=( const ConstIterator& rhs ) const {
306  return it_ != rhs.it_;
307  }
308  //*******************************************************************************************
309 
310  //**Less-than operator***********************************************************************
316  inline bool operator<( const ConstIterator& rhs ) const {
317  return it_ < rhs.it_;
318  }
319  //*******************************************************************************************
320 
321  //**Greater-than operator********************************************************************
327  inline bool operator>( const ConstIterator& rhs ) const {
328  return it_ > rhs.it_;
329  }
330  //*******************************************************************************************
331 
332  //**Less-or-equal-than operator**************************************************************
338  inline bool operator<=( const ConstIterator& rhs ) const {
339  return it_ <= rhs.it_;
340  }
341  //*******************************************************************************************
342 
343  //**Greater-or-equal-than operator***********************************************************
349  inline bool operator>=( const ConstIterator& rhs ) const {
350  return it_ >= rhs.it_;
351  }
352  //*******************************************************************************************
353 
354  //**Subtraction operator*********************************************************************
360  inline DifferenceType operator-( const ConstIterator& rhs ) const {
361  return it_ - rhs.it_;
362  }
363  //*******************************************************************************************
364 
365  //**Addition operator************************************************************************
372  friend inline const ConstIterator operator+( const ConstIterator& it, size_t inc ) {
373  return ConstIterator( it.it_ + inc );
374  }
375  //*******************************************************************************************
376 
377  //**Addition operator************************************************************************
384  friend inline const ConstIterator operator+( size_t inc, const ConstIterator& it ) {
385  return ConstIterator( it.it_ + inc );
386  }
387  //*******************************************************************************************
388 
389  //**Subtraction operator*********************************************************************
396  friend inline const ConstIterator operator-( const ConstIterator& it, size_t dec ) {
397  return ConstIterator( it.it_ - dec );
398  }
399  //*******************************************************************************************
400 
401  private:
402  //**Member variables*************************************************************************
404  //*******************************************************************************************
405  };
406  //**********************************************************************************************
407 
408  //**Compilation flags***************************************************************************
410  enum { vectorizable = MT::vectorizable &&
412 
414  enum { smpAssignable = MT::smpAssignable };
415  //**********************************************************************************************
416 
417  //**Constructor*********************************************************************************
422  explicit inline DMatAbsExpr( const MT& dm )
423  : dm_( dm ) // Dense matrix of the absolute value expression
424  {}
425  //**********************************************************************************************
426 
427  //**Access operator*****************************************************************************
434  inline ReturnType operator()( size_t i, size_t j ) const {
435  using std::abs;
436  BLAZE_INTERNAL_ASSERT( i < dm_.rows() , "Invalid row access index" );
437  BLAZE_INTERNAL_ASSERT( j < dm_.columns(), "Invalid column access index" );
438  return abs( dm_(i,j) );
439  }
440  //**********************************************************************************************
441 
442  //**Load function*******************************************************************************
449  inline IntrinsicType load( size_t i, size_t j ) const {
450  typedef IntrinsicTrait<ElementType> IT;
451  BLAZE_INTERNAL_ASSERT( i < dm_.rows() , "Invalid row access index" );
452  BLAZE_INTERNAL_ASSERT( j < dm_.columns(), "Invalid column access index" );
453  BLAZE_INTERNAL_ASSERT( !SO || ( i % IT::size == 0UL ), "Invalid row access index" );
454  BLAZE_INTERNAL_ASSERT( SO || ( j % IT::size == 0UL ), "Invalid column access index" );
455  return abs( dm_.load(i,j) );
456  }
457  //**********************************************************************************************
458 
459  //**Begin function******************************************************************************
465  inline ConstIterator begin( size_t i ) const {
466  return ConstIterator( dm_.begin(i) );
467  }
468  //**********************************************************************************************
469 
470  //**End function********************************************************************************
476  inline ConstIterator end( size_t i ) const {
477  return ConstIterator( dm_.end(i) );
478  }
479  //**********************************************************************************************
480 
481  //**Rows function*******************************************************************************
486  inline size_t rows() const {
487  return dm_.rows();
488  }
489  //**********************************************************************************************
490 
491  //**Columns function****************************************************************************
496  inline size_t columns() const {
497  return dm_.columns();
498  }
499  //**********************************************************************************************
500 
501  //**Operand access******************************************************************************
506  inline Operand operand() const {
507  return dm_;
508  }
509  //**********************************************************************************************
510 
511  //**********************************************************************************************
517  template< typename T >
518  inline bool canAlias( const T* alias ) const {
519  return IsComputation<MT>::value && dm_.canAlias( alias );
520  }
521  //**********************************************************************************************
522 
523  //**********************************************************************************************
529  template< typename T >
530  inline bool isAliased( const T* alias ) const {
531  return dm_.isAliased( alias );
532  }
533  //**********************************************************************************************
534 
535  //**********************************************************************************************
540  inline bool isAligned() const {
541  return dm_.isAligned();
542  }
543  //**********************************************************************************************
544 
545  //**********************************************************************************************
550  inline bool canSMPAssign() const {
551  return dm_.canSMPAssign();
552  }
553  //**********************************************************************************************
554 
555  private:
556  //**Member variables****************************************************************************
558  //**********************************************************************************************
559 
560  //**Assignment to dense matrices****************************************************************
574  template< typename MT2 // Type of the target dense matrix
575  , bool SO2 > // Storage order or the target dense matrix
576  friend inline typename EnableIf< UseAssign<MT2> >::Type
577  assign( DenseMatrix<MT2,SO2>& lhs, const DMatAbsExpr& rhs )
578  {
580 
581  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
582  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
583 
584  assign( ~lhs, rhs.dm_ );
585  assign( ~lhs, abs( ~lhs ) );
586  }
588  //**********************************************************************************************
589 
590  //**Assignment to sparse matrices***************************************************************
604  template< typename MT2 // Type of the target sparse matrix
605  , bool SO2 > // Storage order or the target sparse matrix
606  friend inline typename EnableIf< UseAssign<MT2> >::Type
607  assign( SparseMatrix<MT2,SO2>& lhs, const DMatAbsExpr& rhs )
608  {
610 
612 
619 
620  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
621  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
622 
623  const TmpType tmp( serial( rhs ) );
624  assign( ~lhs, tmp );
625  }
627  //**********************************************************************************************
628 
629  //**Addition assignment to dense matrices*******************************************************
643  template< typename MT2 // Type of the target dense matrix
644  , bool SO2 > // Storage order of the target dense matrix
645  friend inline typename EnableIf< UseAssign<MT2> >::Type
646  addAssign( DenseMatrix<MT2,SO2>& lhs, const DMatAbsExpr& rhs )
647  {
649 
653 
654  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
655  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
656 
657  const ResultType tmp( serial( rhs ) );
658  addAssign( ~lhs, tmp );
659  }
661  //**********************************************************************************************
662 
663  //**Addition assignment to sparse matrices******************************************************
664  // No special implementation for the addition assignment to sparse matrices.
665  //**********************************************************************************************
666 
667  //**Subtraction assignment to dense matrices****************************************************
681  template< typename MT2 // Type of the target dense matrix
682  , bool SO2 > // Storage order of the target dense matrix
683  friend inline typename EnableIf< UseAssign<MT2> >::Type
684  subAssign( DenseMatrix<MT2,SO2>& lhs, const DMatAbsExpr& rhs )
685  {
687 
691 
692  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
693  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
694 
695  const ResultType tmp( serial( rhs ) );
696  subAssign( ~lhs, tmp );
697  }
699  //**********************************************************************************************
700 
701  //**Subtraction assignment to sparse matrices***************************************************
702  // No special implementation for the subtraction assignment to sparse matrices.
703  //**********************************************************************************************
704 
705  //**Multiplication assignment to dense matrices*************************************************
706  // No special implementation for the multiplication assignment to dense matrices.
707  //**********************************************************************************************
708 
709  //**Multiplication assignment to sparse matrices************************************************
710  // No special implementation for the multiplication assignment to sparse matrices.
711  //**********************************************************************************************
712 
713  //**SMP assignment to dense matrices************************************************************
727  template< typename MT2 // Type of the target dense matrix
728  , bool SO2 > // Storage order or the target dense matrix
729  friend inline typename EnableIf< UseSMPAssign<MT2> >::Type
730  smpAssign( DenseMatrix<MT2,SO2>& lhs, const DMatAbsExpr& rhs )
731  {
733 
734  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
735  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
736 
737  smpAssign( ~lhs, rhs.dm_ );
738  smpAssign( ~lhs, abs( ~lhs ) );
739  }
741  //**********************************************************************************************
742 
743  //**SMP assignment to sparse matrices***********************************************************
757  template< typename MT2 // Type of the target sparse matrix
758  , bool SO2 > // Storage order or the target sparse matrix
759  friend inline typename EnableIf< UseSMPAssign<MT2> >::Type
760  smpAssign( SparseMatrix<MT2,SO2>& lhs, const DMatAbsExpr& rhs )
761  {
763 
764  typedef typename SelectType< SO == SO2, ResultType, OppositeType >::Type TmpType;
765 
772 
773  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
774  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
775 
776  const TmpType tmp( rhs );
777  smpAssign( ~lhs, tmp );
778  }
780  //**********************************************************************************************
781 
782  //**SMP addition assignment to dense matrices***************************************************
796  template< typename MT2 // Type of the target dense matrix
797  , bool SO2 > // Storage order of the target dense matrix
798  friend inline typename EnableIf< UseSMPAssign<MT2> >::Type
799  smpAddAssign( DenseMatrix<MT2,SO2>& lhs, const DMatAbsExpr& rhs )
800  {
802 
806 
807  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
808  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
809 
810  const ResultType tmp( rhs );
811  smpAddAssign( ~lhs, tmp );
812  }
814  //**********************************************************************************************
815 
816  //**SMP addition assignment to sparse matrices**************************************************
817  // No special implementation for the SMP addition assignment to sparse matrices.
818  //**********************************************************************************************
819 
820  //**SMP subtraction assignment to dense matrices************************************************
834  template< typename MT2 // Type of the target dense matrix
835  , bool SO2 > // Storage order of the target dense matrix
836  friend inline typename EnableIf< UseSMPAssign<MT2> >::Type
837  smpSubAssign( DenseMatrix<MT2,SO2>& lhs, const DMatAbsExpr& rhs )
838  {
840 
844 
845  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
846  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
847 
848  const ResultType tmp( rhs );
849  smpSubAssign( ~lhs, tmp );
850  }
852  //**********************************************************************************************
853 
854  //**SMP subtraction assignment to sparse matrices***********************************************
855  // No special implementation for the SMP subtraction assignment to sparse matrices.
856  //**********************************************************************************************
857 
858  //**SMP multiplication assignment to dense matrices*********************************************
859  // No special implementation for the SMP multiplication assignment to dense matrices.
860  //**********************************************************************************************
861 
862  //**SMP multiplication assignment to sparse matrices********************************************
863  // No special implementation for the SMP multiplication assignment to sparse matrices.
864  //**********************************************************************************************
865 
866  //**Compile time checks*************************************************************************
871  //**********************************************************************************************
872 };
873 //*************************************************************************************************
874 
875 
876 
877 
878 //=================================================================================================
879 //
880 // GLOBAL FUNCTIONS
881 //
882 //=================================================================================================
883 
884 //*************************************************************************************************
901 template< typename MT // Type of the dense matrix
902  , bool SO > // Storage order
903 inline const DMatAbsExpr<MT,SO> abs( const DenseMatrix<MT,SO>& dm )
904 {
906 
907  return DMatAbsExpr<MT,SO>( ~dm );
908 }
909 //*************************************************************************************************
910 
911 
912 
913 
914 //=================================================================================================
915 //
916 // GLOBAL RESTRUCTURING FUNCTIONS
917 //
918 //=================================================================================================
919 
920 //*************************************************************************************************
931 template< typename MT // Type of the dense matrix
932  , bool SO > // Storage order
933 inline const DMatAbsExpr<MT,SO>& abs( const DMatAbsExpr<MT,SO>& dm )
934 {
936 
937  return dm;
938 }
940 //*************************************************************************************************
941 
942 
943 
944 
945 //=================================================================================================
946 //
947 // EXPRESSION TRAIT SPECIALIZATIONS
948 //
949 //=================================================================================================
950 
951 //*************************************************************************************************
953 template< typename MT >
954 struct DMatAbsExprTrait< DMatAbsExpr<MT,false> >
955 {
956  public:
957  //**********************************************************************************************
958  typedef typename SelectType< IsDenseMatrix<MT>::value && IsRowMajorMatrix<MT>::value
959  , DMatAbsExpr<MT,false>
960  , INVALID_TYPE >::Type Type;
961  //**********************************************************************************************
962 };
964 //*************************************************************************************************
965 
966 
967 //*************************************************************************************************
969 template< typename MT >
970 struct TDMatAbsExprTrait< DMatAbsExpr<MT,true> >
971 {
972  public:
973  //**********************************************************************************************
974  typedef typename SelectType< IsDenseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value
975  , DMatAbsExpr<MT,true>
976  , INVALID_TYPE >::Type Type;
977  //**********************************************************************************************
978 };
980 //*************************************************************************************************
981 
982 
983 //*************************************************************************************************
985 template< typename MT, bool SO, bool AF >
986 struct SubmatrixExprTrait< DMatAbsExpr<MT,SO>, AF >
987 {
988  public:
989  //**********************************************************************************************
990  typedef typename AbsExprTrait< typename SubmatrixExprTrait<const MT,AF>::Type >::Type Type;
991  //**********************************************************************************************
992 };
994 //*************************************************************************************************
995 
996 
997 //*************************************************************************************************
999 template< typename MT, bool SO >
1000 struct RowExprTrait< DMatAbsExpr<MT,SO> >
1001 {
1002  public:
1003  //**********************************************************************************************
1004  typedef typename AbsExprTrait< typename RowExprTrait<const MT>::Type >::Type Type;
1005  //**********************************************************************************************
1006 };
1008 //*************************************************************************************************
1009 
1010 
1011 //*************************************************************************************************
1013 template< typename MT, bool SO >
1014 struct ColumnExprTrait< DMatAbsExpr<MT,SO> >
1015 {
1016  public:
1017  //**********************************************************************************************
1018  typedef typename AbsExprTrait< typename ColumnExprTrait<const MT>::Type >::Type Type;
1019  //**********************************************************************************************
1020 };
1022 //*************************************************************************************************
1023 
1024 } // namespace blaze
1025 
1026 #endif
IntrinsicTrait< ET >::Type IntrinsicType
Resulting intrinsic element type.
Definition: DMatAbsExpr.h:155
Pointer difference type of the Blaze library.
ReturnType operator*() const
Direct access to the element at the current iterator position.
Definition: DMatAbsExpr.h:272
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:164
ValueType value_type
Type of the underlying elements.
Definition: DMatAbsExpr.h:182
bool operator>(const ConstIterator &rhs) const
Greater-than comparison between two ConstIterator objects.
Definition: DMatAbsExpr.h:327
IteratorCategory iterator_category
The iterator category.
Definition: DMatAbsExpr.h:181
ConstIterator & operator+=(size_t inc)
Addition assignment operator.
Definition: DMatAbsExpr.h:207
void smpSubAssign(DenseMatrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP subtraction assignment of a matrix to dense matrix.
Definition: DenseMatrix.h:152
#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:199
#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:496
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:2408
Header file for the IsRowVector type trait.
MT::TransposeType TransposeType
Transpose type for expression template evaluations.
Definition: DMatAbsExpr.h:153
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:903
friend const ConstIterator operator-(const ConstIterator &it, size_t dec)
Subtraction between a ConstIterator and an integral value.
Definition: DMatAbsExpr.h:396
const DMatSerialExpr< MT, SO > serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:690
AbsExprTrait< RN >::Type ExprReturnType
Expression return type for the subscript operator.
Definition: DMatAbsExpr.h:111
Header file for the Computation base class.
SelectType< useAssign, const ResultType, const DMatAbsExpr & >::Type CompositeType
Data type for composite expression templates.
Definition: DMatAbsExpr.h:161
Header file for the RequiresEvaluation type trait.
ElementType * PointerType
Pointer return type.
Definition: DMatAbsExpr.h:176
Operand dm_
Dense matrix of the absolute value expression.
Definition: DMatAbsExpr.h:557
CompressedMatrix< Type, false > OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: CompressedMatrix.h:2404
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:183
Constraint on the data type.
const SelectType< returnExpr, ExprReturnType, ElementType >::Type ReturnType
Return type for expression template evaluations.
Definition: DMatAbsExpr.h:158
bool operator==(const ConstIterator &rhs) const
Equality comparison between two ConstIterator objects.
Definition: DMatAbsExpr.h:294
Expression object for the dense matrix abs() function.The DMatAbsExpr class represents the compile ti...
Definition: DMatAbsExpr.h:91
Constraint on the data type.
void smpAddAssign(DenseMatrix< 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:122
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:550
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:253
ConstIterator & operator--()
Pre-decrement operator.
Definition: DMatAbsExpr.h:251
MT::ResultType ResultType
Result type for expression template evaluations.
Definition: DMatAbsExpr.h:151
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.
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2412
Operand operand() const
Returns the dense matrix operand.
Definition: DMatAbsExpr.h:506
ReturnType operator()(size_t i, size_t j) const
2D-access to the matrix elements.
Definition: DMatAbsExpr.h:434
bool operator<=(const ConstIterator &rhs) const
Less-than comparison between two ConstIterator objects.
Definition: DMatAbsExpr.h:338
const ConstIterator operator++(int)
Post-increment operator.
Definition: DMatAbsExpr.h:241
Header file for the DenseMatrix base class.
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:271
friend const ConstIterator operator+(const ConstIterator &it, size_t inc)
Addition between a ConstIterator and an integral value.
Definition: DMatAbsExpr.h:372
friend const ConstIterator operator+(size_t inc, const ConstIterator &it)
Addition between an integral value and a ConstIterator.
Definition: DMatAbsExpr.h:384
ReferenceType reference
Reference return type.
Definition: DMatAbsExpr.h:184
Header file for the DVecAbsExprTrait class template.
Header file for the MatAbsExpr base class.
DifferenceType difference_type
Difference between two iterators.
Definition: DMatAbsExpr.h:185
#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:177
CompressedMatrix< Type, false > TransposeType
Transpose type for expression template evaluations.
Definition: CompressedMatrix.h:2405
Constraints on the storage order of matrix types.
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:2406
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:170
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:465
Header file for the serial shim.
IteratorType it_
Iterator to the current matrix element.
Definition: DMatAbsExpr.h:403
void smpAssign(DenseMatrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:92
Header file for the SubmatrixExprTrait class template.
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:2407
Intrinsic characteristics of data types.The IntrinsicTrait class template provides the intrinsic char...
Definition: IntrinsicTrait.h:748
Header file for run time assertion macros.
IntrinsicType load() const
Access to the intrinsic elements of the matrix.
Definition: DMatAbsExpr.h:283
Utility type for generic codes.
bool operator!=(const ConstIterator &rhs) const
Inequality comparison between two ConstIterator objects.
Definition: DMatAbsExpr.h:305
bool isAliased(const T *alias) const
Returns whether the expression is aliased with the given address alias.
Definition: DMatAbsExpr.h:530
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:301
size_t rows() const
Returns the current number of rows of the matrix.
Definition: DMatAbsExpr.h:486
DMatAbsExpr(const MT &dm)
Constructor for the DMatAbsExpr class.
Definition: DMatAbsExpr.h:422
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:98
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:331
bool isAligned() const
Returns whether the operands of the expression are properly aligned in memory.
Definition: DMatAbsExpr.h:540
ElementType ValueType
Type of the underlying elements.
Definition: DMatAbsExpr.h:175
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:150
ConstIterator(IteratorType it)
Constructor for the ConstIterator class.
Definition: DMatAbsExpr.h:196
std::random_access_iterator_tag IteratorCategory
The iterator category.
Definition: DMatAbsExpr.h:174
IntrinsicType load(size_t i, size_t j) const
Access to the intrinsic elements of the matrix.
Definition: DMatAbsExpr.h:449
MT::OppositeType OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: DMatAbsExpr.h:152
#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:178
Header file for all intrinsic functionality.
MT::ReturnType RN
Return type of the dense matrix expression.
Definition: DMatAbsExpr.h:97
ConstIterator & operator++()
Pre-increment operator.
Definition: DMatAbsExpr.h:230
ConstIterator end(size_t i) const
Returns an iterator just past the last non-zero element of row i.
Definition: DMatAbsExpr.h:476
const ConstIterator operator--(int)
Post-decrement operator.
Definition: DMatAbsExpr.h:262
Header file for the IsComputation type trait class.
bool operator>=(const ConstIterator &rhs) const
Greater-than comparison between two ConstIterator objects.
Definition: DMatAbsExpr.h:349
bool operator<(const ConstIterator &rhs) const
Less-than comparison between two ConstIterator objects.
Definition: DMatAbsExpr.h:316
Base class for all compute expression templates.The Computation class serves as a tag for all computa...
Definition: Computation.h:59
#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:2403
MT::ElementType ElementType
Resulting element type.
Definition: DMatAbsExpr.h:154
Header file for basic type definitions.
ConstIterator & operator-=(size_t dec)
Subtraction assignment operator.
Definition: DMatAbsExpr.h:219
DifferenceType operator-(const ConstIterator &rhs) const
Calculating the number of elements between two iterators.
Definition: DMatAbsExpr.h:360
bool canAlias(const T *alias) const
Returns whether the expression can alias with the given address alias.
Definition: DMatAbsExpr.h:518
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:86
#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.
MT::ConstIterator IteratorType
ConstIterator type of the dense matrix expression.
Definition: DMatAbsExpr.h:188