All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DMatScalarDivExpr.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_EXPRESSIONS_DMATSCALARDIVEXPR_H_
36 #define _BLAZE_MATH_EXPRESSIONS_DMATSCALARDIVEXPR_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
43 #include <iterator>
50 #include <blaze/math/Intrinsics.h>
70 #include <blaze/util/Assert.h>
75 #include <blaze/util/EnableIf.h>
76 #include <blaze/util/InvalidType.h>
78 #include <blaze/util/SelectType.h>
79 #include <blaze/util/Types.h>
83 
84 
85 namespace blaze {
86 
87 //=================================================================================================
88 //
89 // CLASS DMATSCALARDIVEXPR
90 //
91 //=================================================================================================
92 
93 //*************************************************************************************************
100 template< typename MT // Type of the left-hand side dense matrix
101  , typename ST // Type of the right-hand side scalar value
102  , bool SO > // Storage order
103 class DMatScalarDivExpr : public DenseMatrix< DMatScalarDivExpr<MT,ST,SO>, SO >
104  , private MatScalarDivExpr
105  , private Computation
106 {
107  private:
108  //**Type definitions****************************************************************************
109  typedef typename MT::ResultType RT;
110  typedef typename MT::ReturnType RN;
111  typedef typename MT::ElementType ET;
112  typedef typename MT::CompositeType CT;
113  //**********************************************************************************************
114 
115  //**Return type evaluation**********************************************************************
117 
122  enum { returnExpr = !IsTemporary<RN>::value };
123 
126  //**********************************************************************************************
127 
128  //**Evaluation strategy*************************************************************************
130 
136  enum { useAssign = RequiresEvaluation<MT>::value };
137 
139  template< typename MT2 >
141  struct UseAssign {
142  enum { value = useAssign };
143  };
145  //**********************************************************************************************
146 
147  public:
148  //**Type definitions****************************************************************************
155 
158 
161 
163  typedef typename SelectType< IsExpression<MT>::value, const MT, const MT& >::Type LeftOperand;
164 
166  typedef ST RightOperand;
167  //**********************************************************************************************
168 
169  //**ConstIterator class definition**************************************************************
173  {
174  public:
175  //**Type definitions*************************************************************************
176  typedef std::random_access_iterator_tag IteratorCategory;
181 
182  // STL iterator requirements
188 
190  typedef typename MT::ConstIterator IteratorType;
191  //*******************************************************************************************
192 
193  //**Constructor******************************************************************************
199  explicit inline ConstIterator( IteratorType iterator, RightOperand scalar )
200  : iterator_( iterator ) // Iterator to the current element
201  , scalar_ ( scalar ) // Scalar of the multiplication expression
202  {}
203  //*******************************************************************************************
204 
205  //**Addition assignment operator*************************************************************
211  inline ConstIterator& operator+=( size_t inc ) {
212  iterator_ += inc;
213  return *this;
214  }
215  //*******************************************************************************************
216 
217  //**Subtraction assignment operator**********************************************************
223  inline ConstIterator& operator-=( size_t dec ) {
224  iterator_ -= dec;
225  return *this;
226  }
227  //*******************************************************************************************
228 
229  //**Prefix increment operator****************************************************************
235  ++iterator_;
236  return *this;
237  }
238  //*******************************************************************************************
239 
240  //**Postfix increment operator***************************************************************
245  inline const ConstIterator operator++( int ) {
246  return ConstIterator( iterator_++ );
247  }
248  //*******************************************************************************************
249 
250  //**Prefix decrement operator****************************************************************
256  --iterator_;
257  return *this;
258  }
259  //*******************************************************************************************
260 
261  //**Postfix decrement operator***************************************************************
266  inline const ConstIterator operator--( int ) {
267  return ConstIterator( iterator_-- );
268  }
269  //*******************************************************************************************
270 
271  //**Element access operator******************************************************************
276  inline ReturnType operator*() const {
277  return *iterator_ / scalar_;
278  }
279  //*******************************************************************************************
280 
281  //**Load function****************************************************************************
286  inline IntrinsicType load() const {
287  return iterator_.load() / set( scalar_ );
288  }
289  //*******************************************************************************************
290 
291  //**Equality operator************************************************************************
297  inline bool operator==( const ConstIterator& rhs ) const {
298  return iterator_ == rhs.iterator_;
299  }
300  //*******************************************************************************************
301 
302  //**Inequality operator**********************************************************************
308  inline bool operator!=( const ConstIterator& rhs ) const {
309  return iterator_ != rhs.iterator_;
310  }
311  //*******************************************************************************************
312 
313  //**Less-than operator***********************************************************************
319  inline bool operator<( const ConstIterator& rhs ) const {
320  return iterator_ < rhs.iterator_;
321  }
322  //*******************************************************************************************
323 
324  //**Greater-than operator********************************************************************
330  inline bool operator>( const ConstIterator& rhs ) const {
331  return iterator_ > rhs.iterator_;
332  }
333  //*******************************************************************************************
334 
335  //**Less-or-equal-than operator**************************************************************
341  inline bool operator<=( const ConstIterator& rhs ) const {
342  return iterator_ <= rhs.iterator_;
343  }
344  //*******************************************************************************************
345 
346  //**Greater-or-equal-than operator***********************************************************
352  inline bool operator>=( const ConstIterator& rhs ) const {
353  return iterator_ >= rhs.iterator_;
354  }
355  //*******************************************************************************************
356 
357  //**Subtraction operator*********************************************************************
363  inline DifferenceType operator-( const ConstIterator& rhs ) const {
364  return iterator_ - rhs.iterator_;
365  }
366  //*******************************************************************************************
367 
368  //**Addition operator************************************************************************
375  friend inline const ConstIterator operator+( const ConstIterator& it, size_t inc ) {
376  return ConstIterator( it.iterator_ + inc );
377  }
378  //*******************************************************************************************
379 
380  //**Addition operator************************************************************************
387  friend inline const ConstIterator operator+( size_t inc, const ConstIterator& it ) {
388  return ConstIterator( it.iterator_ + inc );
389  }
390  //*******************************************************************************************
391 
392  //**Subtraction operator*********************************************************************
399  friend inline const ConstIterator operator-( const ConstIterator& it, size_t dec ) {
400  return ConstIterator( it.iterator_ - dec );
401  }
402  //*******************************************************************************************
403 
404  private:
405  //**Member variables*************************************************************************
408  //*******************************************************************************************
409  };
410  //**********************************************************************************************
411 
412  //**Compilation flags***************************************************************************
414  enum { vectorizable = MT::vectorizable &&
417 
419  enum { smpAssignable = MT::smpAssignable };
420  //**********************************************************************************************
421 
422  //**Constructor*********************************************************************************
428  explicit inline DMatScalarDivExpr( const MT& matrix, ST scalar )
429  : matrix_( matrix ) // Left-hand side dense matrix of the division expression
430  , scalar_( scalar ) // Right-hand side scalar of the division expression
431  {}
432  //**********************************************************************************************
433 
434  //**Access operator*****************************************************************************
441  inline ReturnType operator()( size_t i, size_t j ) const {
442  BLAZE_INTERNAL_ASSERT( i < matrix_.rows() , "Invalid row access index" );
443  BLAZE_INTERNAL_ASSERT( j < matrix_.columns(), "Invalid column access index" );
444  return matrix_(i,j) / scalar_;
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 < matrix_.rows() , "Invalid row access index" );
458  BLAZE_INTERNAL_ASSERT( j < matrix_.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  const IntrinsicType xmm1( matrix_.load(i,j) );
462  const IntrinsicType xmm2( set( scalar_ ) );
463  return xmm1 / xmm2;
464  }
465  //**********************************************************************************************
466 
467  //**Begin function******************************************************************************
473  inline ConstIterator begin( size_t i ) const {
474  return ConstIterator( matrix_.begin(i), scalar_ );
475  }
476  //**********************************************************************************************
477 
478  //**End function********************************************************************************
484  inline ConstIterator end( size_t i ) const {
485  return ConstIterator( matrix_.end(i), scalar_ );
486  }
487  //**********************************************************************************************
488 
489  //**Rows function*******************************************************************************
494  inline size_t rows() const {
495  return matrix_.rows();
496  }
497  //**********************************************************************************************
498 
499  //**Columns function****************************************************************************
504  inline size_t columns() const {
505  return matrix_.columns();
506  }
507  //**********************************************************************************************
508 
509  //**Left operand access*************************************************************************
514  inline LeftOperand leftOperand() const {
515  return matrix_;
516  }
517  //**********************************************************************************************
518 
519  //**Right operand access************************************************************************
524  inline RightOperand rightOperand() const {
525  return scalar_;
526  }
527  //**********************************************************************************************
528 
529  //**********************************************************************************************
535  template< typename T >
536  inline bool canAlias( const T* alias ) const {
537  return IsComputation<MT>::value && matrix_.canAlias( alias );
538  }
539  //**********************************************************************************************
540 
541  //**********************************************************************************************
547  template< typename T >
548  inline bool isAliased( const T* alias ) const {
549  return matrix_.isAliased( alias );
550  }
551  //**********************************************************************************************
552 
553  //**********************************************************************************************
558  inline bool isAligned() const {
559  return matrix_.isAligned();
560  }
561  //**********************************************************************************************
562 
563  //**********************************************************************************************
568  inline bool canSMPAssign() const {
569  return matrix_.canSMPAssign() ||
570  ( ( ( SO == rowMajor ) ? rows() : columns() ) > SMP_DMATSCALARMULT_THRESHOLD );
571  }
572  //**********************************************************************************************
573 
574  private:
575  //**Member variables****************************************************************************
578  //**********************************************************************************************
579 
580  //**Assignment to dense matrices****************************************************************
594  template< typename MT2 // Type of the target dense matrix
595  , bool SO2 > // Storage order of the target dense matrix
596  friend inline typename EnableIf< UseAssign<MT2> >::Type
597  assign( DenseMatrix<MT2,SO2>& lhs, const DMatScalarDivExpr& rhs )
598  {
600 
601  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
602  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
603 
604  assign( ~lhs, rhs.matrix_ );
605  (~lhs) /= rhs.scalar_;
606  }
608  //**********************************************************************************************
609 
610  //**Assignment to sparse matrices***************************************************************
624  template< typename MT2 // Type of the target sparse matrix
625  , bool SO2 > // Storage order of the target sparse matrix
626  friend inline typename EnableIf< UseAssign<MT2> >::Type
628  {
630 
631  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
632  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
633 
634  assign( ~lhs, rhs.matrix_ );
635  (~lhs) /= rhs.scalar_;
636  }
638  //**********************************************************************************************
639 
640  //**Addition assignment to dense matrices*******************************************************
654  template< typename MT2 // Type of the target dense matrix
655  , bool SO2 > // Storage order of the target dense matrix
656  friend inline typename EnableIf< UseAssign<MT2> >::Type
657  addAssign( DenseMatrix<MT2,SO2>& lhs, const DMatScalarDivExpr& rhs )
658  {
660 
664 
665  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
666  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
667 
668  const ResultType tmp( rhs );
669  smpAddAssign( ~lhs, tmp );
670  }
672  //**********************************************************************************************
673 
674  //**Addition assignment to sparse matrices******************************************************
675  // No special implementation for the addition assignment to sparse matrices.
676  //**********************************************************************************************
677 
678  //**Subtraction assignment to dense matrices****************************************************
692  template< typename MT2 // Type of the target dense matrix
693  , bool SO2 > // Storage order of the target dense matrix
694  friend inline typename EnableIf< UseAssign<MT2> >::Type
695  subAssign( DenseMatrix<MT2,SO2>& lhs, const DMatScalarDivExpr& rhs )
696  {
698 
702 
703  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
704  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
705 
706  const ResultType tmp( rhs );
707  smpSubAssign( ~lhs, tmp );
708  }
710  //**********************************************************************************************
711 
712  //**Subtraction assignment to sparse matrices***************************************************
713  // No special implementation for the subtraction assignment to sparse matrices.
714  //**********************************************************************************************
715 
716  //**Multiplication assignment to dense matrices*************************************************
717  // No special implementation for the multiplication assignment to dense matrices.
718  //**********************************************************************************************
719 
720  //**Multiplication assignment to sparse matrices************************************************
721  // No special implementation for the multiplication assignment to sparse matrices.
722  //**********************************************************************************************
723 
724  //**Compile time checks*************************************************************************
733  //**********************************************************************************************
734 };
735 //*************************************************************************************************
736 
737 
738 
739 
740 //=================================================================================================
741 //
742 // GLOBAL BINARY ARITHMETIC OPERATORS
743 //
744 //=================================================================================================
745 
746 //*************************************************************************************************
768 template< typename T1 // Type of the left-hand side dense matrix
769  , bool SO // Storage order of the left-hand side dense matrix
770  , typename T2 > // Type of the right-hand side scalar
771 inline const typename EnableIf< IsNumeric<T2>, typename DivExprTrait<T1,T2>::Type >::Type
772  operator/( const DenseMatrix<T1,SO>& mat, T2 scalar )
773 {
775 
776  BLAZE_USER_ASSERT( scalar != T2(0), "Division by zero detected" );
777 
778  typedef typename DivExprTrait<T1,T2>::Type ReturnType;
779  typedef typename ReturnType::RightOperand ScalarType;
780 
782  return ReturnType( ~mat, ScalarType(1)/ScalarType(scalar) );
783  }
784  else {
785  return ReturnType( ~mat, scalar );
786  }
787 }
788 //*************************************************************************************************
789 
790 
791 
792 
793 //=================================================================================================
794 //
795 // GLOBAL RESTRUCTURING BINARY ARITHMETIC OPERATORS
796 //
797 //=================================================================================================
798 
799 //*************************************************************************************************
812 template< typename MT // Type of the dense matrix of the left-hand side expression
813  , typename ST1 // Type of the scalar of the left-hand side expression
814  , bool SO // Storage order of the dense matrix
815  , typename ST2 > // Type of the right-hand side scalar
816 inline const typename EnableIf< IsFloatingPoint< typename DivTrait<ST2,ST1>::Type >
817  , typename MultExprTrait< DMatScalarDivExpr<MT,ST1,SO>, ST2 >::Type >::Type
818  operator*( const DMatScalarDivExpr<MT,ST1,SO>& mat, ST2 scalar )
819 {
821 
822  return mat.leftOperand() * ( scalar / mat.rightOperand() );
823 }
825 //*************************************************************************************************
826 
827 
828 //*************************************************************************************************
841 template< typename ST1 // Type of the left-hand side scalar
842  , typename MT // Type of the dense matrix of the right-hand side expression
843  , typename ST2 // Type of the scalar of the right-hand side expression
844  , bool SO > // Storage order of the dense matrix
845 inline const typename EnableIf< IsFloatingPoint< typename DivTrait<ST1,ST2>::Type >
846  , typename MultExprTrait< ST1, DMatScalarDivExpr<MT,ST2,SO> >::Type >::Type
847  operator*( ST1 scalar, const DMatScalarDivExpr<MT,ST2,SO>& mat )
848 {
850 
851  return mat.leftOperand() * ( scalar / mat.rightOperand() );
852 }
854 //*************************************************************************************************
855 
856 
857 //*************************************************************************************************
870 template< typename MT // Type of the dense matrix of the left-hand side expression
871  , typename ST1 // Type of the scalar of the left-hand side expression
872  , bool SO // Storage order of the dense matrix
873  , typename ST2 > // Type of the right-hand side scalar
874 inline const typename EnableIf< IsNumeric<ST2>
875  , typename DivExprTrait<MT,typename MultTrait<ST1,ST2>::Type>::Type >::Type
876  operator/( const DMatScalarDivExpr<MT,ST1,SO>& mat, ST2 scalar )
877 {
879 
880  BLAZE_USER_ASSERT( scalar != ST2(0), "Division by zero detected" );
881 
882  typedef typename MultTrait<ST1,ST2>::Type MultType;
883  typedef typename DivExprTrait<MT,MultType>::Type ReturnType;
884  typedef typename ReturnType::RightOperand ScalarType;
885 
886  if( IsMultExpr<ReturnType>::value ) {
887  return ReturnType( mat.leftOperand(), ScalarType(1)/( mat.rightOperand() * scalar ) );
888  }
889  else {
890  return ReturnType( mat.leftOperand(), mat.rightOperand() * scalar );
891  }
892 }
894 //*************************************************************************************************
895 
896 
897 
898 
899 //=================================================================================================
900 //
901 // DMATSCALARMULTEXPRTRAIT SPECIALIZATIONS
902 //
903 //=================================================================================================
904 
905 //*************************************************************************************************
907 template< typename MT, typename ST1, typename ST2 >
908 struct DMatScalarMultExprTrait< DMatScalarDivExpr<MT,ST1,false>, ST2 >
909 {
910  private:
911  //**********************************************************************************************
912  enum { condition = IsFloatingPoint<typename DivTrait<ST1,ST2>::Type>::value };
913  //**********************************************************************************************
914 
915  //**********************************************************************************************
916  typedef typename DMatScalarMultExprTrait<MT,typename DivTrait<ST1,ST2>::Type>::Type T1;
917  typedef DMatScalarMultExpr< DMatScalarDivExpr<MT,ST1,false>, ST2, false > T2;
918  //**********************************************************************************************
919 
920  public:
921  //**********************************************************************************************
922  typedef typename SelectType< IsDenseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
923  IsNumeric<ST1>::value && IsNumeric<ST2>::value
924  , typename SelectType<condition,T1,T2>::Type
925  , INVALID_TYPE >::Type Type;
926  //**********************************************************************************************
927 };
929 //*************************************************************************************************
930 
931 
932 
933 
934 //=================================================================================================
935 //
936 // TDMATSCALARMULTEXPRTRAIT SPECIALIZATIONS
937 //
938 //=================================================================================================
939 
940 //*************************************************************************************************
942 template< typename MT, typename ST1, typename ST2 >
943 struct TDMatScalarMultExprTrait< DMatScalarDivExpr<MT,ST1,true>, ST2 >
944 {
945  private:
946  //**********************************************************************************************
947  enum { condition = IsFloatingPoint<typename DivTrait<ST1,ST2>::Type>::value };
948  //**********************************************************************************************
949 
950  //**********************************************************************************************
951  typedef typename DMatScalarMultExprTrait<MT,typename DivTrait<ST1,ST2>::Type>::Type T1;
952  typedef DMatScalarMultExpr< DMatScalarDivExpr<MT,ST1,true>, ST2, true > T2;
953  //**********************************************************************************************
954 
955  public:
956  //**********************************************************************************************
957  typedef typename SelectType< IsDenseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
958  IsNumeric<ST1>::value && IsNumeric<ST2>::value
959  , typename SelectType<condition,T1,T2>::Type
960  , INVALID_TYPE >::Type Type;
961  //**********************************************************************************************
962 };
964 //*************************************************************************************************
965 
966 
967 
968 
969 //=================================================================================================
970 //
971 // SUBMATRIXEXPRTRAIT SPECIALIZATIONS
972 //
973 //=================================================================================================
974 
975 //*************************************************************************************************
977 template< typename MT, typename ST, bool SO, bool AF >
978 struct SubmatrixExprTrait< DMatScalarDivExpr<MT,ST,SO>, AF >
979 {
980  public:
981  //**********************************************************************************************
982  typedef typename DivExprTrait< typename SubmatrixExprTrait<const MT,AF>::Type, ST >::Type Type;
983  //**********************************************************************************************
984 };
986 //*************************************************************************************************
987 
988 
989 
990 
991 //=================================================================================================
992 //
993 // ROWEXPRTRAIT SPECIALIZATIONS
994 //
995 //=================================================================================================
996 
997 //*************************************************************************************************
999 template< typename MT, typename ST, bool SO >
1000 struct RowExprTrait< DMatScalarDivExpr<MT,ST,SO> >
1001 {
1002  public:
1003  //**********************************************************************************************
1004  typedef typename DivExprTrait< typename RowExprTrait<const MT>::Type, ST >::Type Type;
1005  //**********************************************************************************************
1006 };
1008 //*************************************************************************************************
1009 
1010 
1011 
1012 
1013 //=================================================================================================
1014 //
1015 // COLUMNEXPRTRAIT SPECIALIZATIONS
1016 //
1017 //=================================================================================================
1018 
1019 //*************************************************************************************************
1021 template< typename MT, typename ST, bool SO >
1022 struct ColumnExprTrait< DMatScalarDivExpr<MT,ST,SO> >
1023 {
1024  public:
1025  //**********************************************************************************************
1026  typedef typename DivExprTrait< typename ColumnExprTrait<const MT>::Type, ST >::Type Type;
1027  //**********************************************************************************************
1028 };
1030 //*************************************************************************************************
1031 
1032 } // namespace blaze
1033 
1034 #endif
Pointer difference type of the Blaze library.
bool canSMPAssign() const
Returns whether the expression can be used in SMP assignments.
Definition: DMatScalarDivExpr.h:568
Data type constraint.
Compile time check whether the given type is a computational expression template.This type trait clas...
Definition: IsComputation.h:89
Constraint on the data type.
#define BLAZE_USER_ASSERT(expr, msg)
Run time assertion macro for user checks.In case of an invalid run time expression, the program execution is terminated. The BLAZE_USER_ASSERT macro can be disabled by setting the BLAZE_USER_ASSERT flag to zero or by defining NDEBUG during the compilation.
Definition: Assert.h:117
RightOperand rightOperand() const
Returns the right-hand side scalar operand.
Definition: DMatScalarDivExpr.h:524
Compile time check whether the given type is a temporary vector or matrix type.This type trait class ...
Definition: IsTemporary.h:87
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:4075
const EnableIf< IsNumeric< T2 >, typename DivExprTrait< T1, T2 >::Type >::Type operator/(const DenseMatrix< T1, SO > &mat, T2 scalar)
Division operator for the division of a dense matrix by a scalar value ( ).
Definition: DMatScalarDivExpr.h:772
Compile time check whether the given type is a multiplication expression template.This type trait class tests whether or not the given type Type is a multiplication expression template (i.e. an expression representing an element-wise vector multiplication, a matrix/vector multiplication, a vector/matrix multiplication, or a matrix multiplication). In order to qualify as a valid multiplication expression template, the given type has to derive (publicly or privately) from the MultExpr base class. In case the given type is a valid multiplication expression template, the value member enumeration is set to 1, the nested type definition Type is TrueType, and the class derives from TrueType. Otherwise value is set to 0, Type is FalseType, and the class derives from FalseType.
Definition: IsMultExpr.h:90
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:151
ValueType value_type
Type of the underlying elements.
Definition: DMatScalarDivExpr.h:184
Base class for all matrix/scalar divsion expression templates.The MatScalarDivExpr class serves as a ...
Definition: MatScalarDivExpr.h:65
ConstIterator & operator--()
Pre-decrement operator.
Definition: DMatScalarDivExpr.h:255
#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:197
bool operator!=(const ConstIterator &rhs) const
Inequality comparison between two ConstIterator objects.
Definition: DMatScalarDivExpr.h:308
#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.
IntrinsicType load() const
Access to the intrinsic elements of the matrix.
Definition: DMatScalarDivExpr.h:286
Header file for the IsSame and IsStrictlySame type traits.
DMatScalarDivExpr< MT, ST, SO > This
Type of this DMatScalarDivExpr instance.
Definition: DMatScalarDivExpr.h:149
bool operator>(const ConstIterator &rhs) const
Greater-than comparison between two ConstIterator objects.
Definition: DMatScalarDivExpr.h:330
Header file for the IsColumnMajorMatrix type trait.
MT::CompositeType CT
Composite type of the dense matrix expression.
Definition: DMatScalarDivExpr.h:112
Header file for the sparse matrix SMP implementation.
Iterator over the elements of the dense matrix.
Definition: DMatScalarDivExpr.h:172
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:2384
DifferenceType operator-(const ConstIterator &rhs) const
Calculating the number of elements between two iterators.
Definition: DMatScalarDivExpr.h:363
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:249
Expression object for divisions of a dense matrix by a scalar.The DMatScalarDivExpr class represents ...
Definition: DMatScalarDivExpr.h:103
ConstIterator & operator+=(size_t inc)
Addition assignment operator.
Definition: DMatScalarDivExpr.h:211
Header file for the Computation base class.
Type relationship analysis.This class tests if the two data types A and B are equal. For this type comparison, the cv-qualifiers of both data types are ignored. If A and B are the same data type (ignoring the cv-qualifiers), then the value member enumeration is set to 1, the nested type definition Type is TrueType, and the class derives from TrueType. Otherwise value is set to 0, Type is FalseType, and the class derives from FalseType.
Definition: IsSame.h:158
bool isAliased(const T *alias) const
Returns whether the expression is aliased with the given address alias.
Definition: DMatScalarDivExpr.h:548
Header file for the RequiresEvaluation type trait.
ElementType ValueType
Type of the underlying elements.
Definition: DMatScalarDivExpr.h:177
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:104
ResultType::ElementType ElementType
Resulting element type.
Definition: DMatScalarDivExpr.h:153
Constraint on the data type.
ConstIterator & operator-=(size_t dec)
Subtraction assignment operator.
Definition: DMatScalarDivExpr.h:223
Header file for the DivExprTrait class template.
ptrdiff_t DifferenceType
Difference between two iterators.
Definition: DMatScalarDivExpr.h:180
Evaluation of the resulting expression type of a division.Via this type trait it is possible to evalu...
Definition: DivExprTrait.h:87
MT::ResultType RT
Result type of the dense matrix expression.
Definition: DMatScalarDivExpr.h:109
Constraint on the data type.
Header file for the MultExprTrait class template.
const SelectType< returnExpr, ExprReturnType, ElementType >::Type ReturnType
Return type for expression template evaluations.
Definition: DMatScalarDivExpr.h:157
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:121
Compile time check to query the requirement to evaluate an expression.Via this type trait it is possi...
Definition: RequiresEvaluation.h:90
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:251
Compile time type selection.The SelectType class template selects one of the two given types T1 and T...
Definition: SelectType.h:59
DivTrait< RT, ST >::Type ResultType
Result type for expression template evaluations.
Definition: DMatScalarDivExpr.h:150
Header file for the IsTemporary type trait class.
Header file for the multiplication trait.
ElementType & ReferenceType
Reference return type.
Definition: DMatScalarDivExpr.h:179
IntrinsicType load(size_t i, size_t j) const
Access to the intrinsic elements of the matrix.
Definition: DMatScalarDivExpr.h:455
Header file for the IsFloatingPoint type trait.
ReferenceType reference
Reference return type.
Definition: DMatScalarDivExpr.h:186
Header file for the IsMultExpr type trait class.
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2388
Header file for the dense matrix SMP implementation.
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:179
#define BLAZE_CONSTRAINT_MUST_BE_SAME_TYPE(A, B)
Data type constraint.In case the two types A and B are not the same (ignoring all cv-qualifiers of bo...
Definition: SameType.h:89
IteratorType iterator_
Iterator to the current element.
Definition: DMatScalarDivExpr.h:406
#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
const ConstIterator operator++(int)
Post-increment operator.
Definition: DMatScalarDivExpr.h:245
ResultType::OppositeType OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: DMatScalarDivExpr.h:151
const ConstIterator operator--(int)
Post-decrement operator.
Definition: DMatScalarDivExpr.h:266
Constraints on the storage order of matrix types.
MT::ElementType ET
Element type of the dense matrix expression.
Definition: DMatScalarDivExpr.h:111
PointerType pointer
Pointer return type.
Definition: DMatScalarDivExpr.h:185
ElementType * PointerType
Pointer return type.
Definition: DMatScalarDivExpr.h:178
RightOperand scalar_
Scalar of the multiplication expression.
Definition: DMatScalarDivExpr.h:407
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:2382
Header file for the SelectType class template.
Header file for the RowExprTrait class template.
Header file for all forward declarations for expression class templates.
Header file for the IsDenseMatrix type trait.
DivExprTrait< RN, ST >::Type ExprReturnType
Expression return type for the subscript operator.
Definition: DMatScalarDivExpr.h:125
Header file for the EnableIf class template.
Header file for the BaseElementType type trait.
ConstIterator & operator++()
Pre-increment operator.
Definition: DMatScalarDivExpr.h:234
Header file for the IsNumeric type trait.
DMatScalarDivExpr(const MT &matrix, ST scalar)
Constructor for the DMatScalarDivExpr class.
Definition: DMatScalarDivExpr.h:428
SelectType< IsExpression< MT >::value, const MT, const MT & >::Type LeftOperand
Composite type of the left-hand side dense matrix expression.
Definition: DMatScalarDivExpr.h:163
bool operator>=(const ConstIterator &rhs) const
Greater-than comparison between two ConstIterator objects.
Definition: DMatScalarDivExpr.h:352
LeftOperand matrix_
Left-hand side dense matrix of the division expression.
Definition: DMatScalarDivExpr.h:576
bool canAlias(const T *alias) const
Returns whether the expression can alias with the given address alias.
Definition: DMatScalarDivExpr.h:536
RightOperand scalar_
Right-hand side scalar of the division expression.
Definition: DMatScalarDivExpr.h:577
ConstIterator(IteratorType iterator, RightOperand scalar)
Constructor for the ConstIterator class.
Definition: DMatScalarDivExpr.h:199
Header file for the SubmatrixExprTrait class template.
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:2383
Intrinsic characteristics of data types.The IntrinsicTrait class template provides the intrinsic char...
Definition: IntrinsicTrait.h:748
Header file for run time assertion macros.
Utility type for generic codes.
Header file for the division trait.
friend const ConstIterator operator-(const ConstIterator &it, size_t dec)
Subtraction between a ConstIterator and an integral value.
Definition: DMatScalarDivExpr.h:399
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:209
SelectType< useAssign, const ResultType, const DMatScalarDivExpr & >::Type CompositeType
Data type for composite expression templates.
Definition: DMatScalarDivExpr.h:160
Substitution Failure Is Not An Error (SFINAE) class.The EnableIf class template is an auxiliary tool ...
Definition: EnableIf.h:184
Constraint on the data type.
#define BLAZE_CONSTRAINT_MUST_BE_NUMERIC_TYPE(T)
Constraint on the data type.In case the given data type T is not a numeric (integral or floating poin...
Definition: Numeric.h:79
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:239
size_t rows() const
Returns the current number of rows of the matrix.
Definition: DMatScalarDivExpr.h:494
IteratorCategory iterator_category
The iterator category.
Definition: DMatScalarDivExpr.h:183
ST RightOperand
Composite type of the right-hand side scalar value.
Definition: DMatScalarDivExpr.h:166
ResultType::TransposeType TransposeType
Transpose type for expression template evaluations.
Definition: DMatScalarDivExpr.h:152
ConstIterator begin(size_t i) const
Returns an iterator to the first non-zero element of row i.
Definition: DMatScalarDivExpr.h:473
Base template for the DivTrait class.
Definition: DivTrait.h:141
#define BLAZE_CONSTRAINT_MUST_NOT_BE_FLOATING_POINT_TYPE(T)
Constraint on the data type.In case the given data type T is a floating point data type...
Definition: FloatingPoint.h:118
Header file for all intrinsic functionality.
bool operator<(const ConstIterator &rhs) const
Less-than comparison between two ConstIterator objects.
Definition: DMatScalarDivExpr.h:319
std::random_access_iterator_tag IteratorCategory
The iterator category.
Definition: DMatScalarDivExpr.h:176
size_t columns() const
Returns the current number of columns of the matrix.
Definition: DMatScalarDivExpr.h:504
bool isAligned() const
Returns whether the operands of the expression are properly aligned in memory.
Definition: DMatScalarDivExpr.h:558
Header file for the IsRowMajorMatrix type trait.
bool operator<=(const ConstIterator &rhs) const
Less-than comparison between two ConstIterator objects.
Definition: DMatScalarDivExpr.h:341
const bool rowMajor
Storage order flag for row-major matrices.
Definition: StorageOrder.h:71
Header file for the IsComputation type trait class.
Base class for all compute expression templates.The Computation class serves as a tag for all computa...
Definition: Computation.h:59
ReturnType operator()(size_t i, size_t j) const
2D-access to the matrix elements.
Definition: DMatScalarDivExpr.h:441
ConstIterator end(size_t i) const
Returns an iterator just past the last non-zero element of row i.
Definition: DMatScalarDivExpr.h:484
friend const ConstIterator operator+(const ConstIterator &it, size_t inc)
Addition between a ConstIterator and an integral value.
Definition: DMatScalarDivExpr.h:375
#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
bool operator==(const ConstIterator &rhs) const
Equality comparison between two ConstIterator objects.
Definition: DMatScalarDivExpr.h:297
This ResultType
Result type for expression template evaluations.
Definition: CompressedMatrix.h:2379
Header file for basic type definitions.
friend const ConstIterator operator+(size_t inc, const ConstIterator &it)
Addition between an integral value and a ConstIterator.
Definition: DMatScalarDivExpr.h:387
MT::ConstIterator IteratorType
ConstIterator type of the dense matrix expression.
Definition: DMatScalarDivExpr.h:190
Header file for the MatScalarDivExpr base class.
LeftOperand leftOperand() const
Returns the left-hand side dense matrix operand.
Definition: DMatScalarDivExpr.h:514
MT::ReturnType RN
Return type of the dense matrix expression.
Definition: DMatScalarDivExpr.h:110
Header file for the thresholds for matrix/vector and matrix/matrix multiplications.
DifferenceType difference_type
Difference between two iterators.
Definition: DMatScalarDivExpr.h:187
#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
ReturnType operator*() const
Direct access to the element at the current iterator position.
Definition: DMatScalarDivExpr.h:276
EnableIf< IsIntegral< T >, Set< T, sizeof(T)> >::Type::Type set(T value)
Sets all values in the vector to the given integral value.
Definition: Set.h:209
IntrinsicTrait< ElementType >::Type IntrinsicType
Resulting intrinsic element type.
Definition: DMatScalarDivExpr.h:154
const size_t SMP_DMATSCALARMULT_THRESHOLD
SMP dense matrix/scalar multiplication/division threshold.This threshold represents the system-specif...
Definition: Thresholds.h:420
Header file for the IsExpression type trait class.
Header file for the FunctionTrace class.