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>
67 #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>
80 
81 
82 namespace blaze {
83 
84 //=================================================================================================
85 //
86 // CLASS DMATSCALARDIVEXPR
87 //
88 //=================================================================================================
89 
90 //*************************************************************************************************
97 template< typename MT // Type of the left-hand side dense matrix
98  , typename ST // Type of the right-hand side scalar value
99  , bool SO > // Storage order
100 class DMatScalarDivExpr : public DenseMatrix< DMatScalarDivExpr<MT,ST,SO>, SO >
101  , private MatScalarDivExpr
102  , private Computation
103 {
104  private:
105  //**Type definitions****************************************************************************
106  typedef typename MT::ResultType RT;
107  typedef typename MT::ReturnType RN;
108  typedef typename MT::ElementType ET;
109  typedef typename MT::CompositeType CT;
110  //**********************************************************************************************
111 
112  //**Return type evaluation**********************************************************************
114 
119  enum { returnExpr = !IsTemporary<RN>::value };
120 
123  //**********************************************************************************************
124 
125  //**Evaluation strategy*************************************************************************
127 
133  enum { useAssign = RequiresEvaluation<MT>::value };
134 
136  template< typename MT2 >
138  struct UseAssign {
139  enum { value = useAssign };
140  };
142  //**********************************************************************************************
143 
144  public:
145  //**Type definitions****************************************************************************
152 
155 
158 
160  typedef typename SelectType< IsExpression<MT>::value, const MT, const MT& >::Type LeftOperand;
161 
163  typedef ST RightOperand;
164  //**********************************************************************************************
165 
166  //**ConstIterator class definition**************************************************************
170  {
171  public:
172  //**Type definitions*************************************************************************
173  typedef std::random_access_iterator_tag IteratorCategory;
178 
179  // STL iterator requirements
185 
187  typedef typename MT::ConstIterator IteratorType;
188  //*******************************************************************************************
189 
190  //**Constructor******************************************************************************
196  explicit inline ConstIterator( IteratorType iterator, RightOperand scalar )
197  : iterator_( iterator ) // Iterator to the current element
198  , scalar_ ( scalar ) // Scalar of the multiplication expression
199  {}
200  //*******************************************************************************************
201 
202  //**Addition assignment operator*************************************************************
208  inline ConstIterator& operator+=( size_t inc ) {
209  iterator_ += inc;
210  return *this;
211  }
212  //*******************************************************************************************
213 
214  //**Subtraction assignment operator**********************************************************
220  inline ConstIterator& operator-=( size_t dec ) {
221  iterator_ -= dec;
222  return *this;
223  }
224  //*******************************************************************************************
225 
226  //**Prefix increment operator****************************************************************
232  ++iterator_;
233  return *this;
234  }
235  //*******************************************************************************************
236 
237  //**Postfix increment operator***************************************************************
242  inline const ConstIterator operator++( int ) {
243  return ConstIterator( iterator_++ );
244  }
245  //*******************************************************************************************
246 
247  //**Prefix decrement operator****************************************************************
253  --iterator_;
254  return *this;
255  }
256  //*******************************************************************************************
257 
258  //**Postfix decrement operator***************************************************************
263  inline const ConstIterator operator--( int ) {
264  return ConstIterator( iterator_-- );
265  }
266  //*******************************************************************************************
267 
268  //**Element access operator******************************************************************
273  inline ReturnType operator*() const {
274  return *iterator_ / scalar_;
275  }
276  //*******************************************************************************************
277 
278  //**Load function****************************************************************************
283  inline IntrinsicType load() const {
284  return iterator_.load() / set( scalar_ );
285  }
286  //*******************************************************************************************
287 
288  //**Equality operator************************************************************************
294  inline bool operator==( const ConstIterator& rhs ) const {
295  return iterator_ == rhs.iterator_;
296  }
297  //*******************************************************************************************
298 
299  //**Inequality operator**********************************************************************
305  inline bool operator!=( const ConstIterator& rhs ) const {
306  return iterator_ != rhs.iterator_;
307  }
308  //*******************************************************************************************
309 
310  //**Less-than operator***********************************************************************
316  inline bool operator<( const ConstIterator& rhs ) const {
317  return iterator_ < rhs.iterator_;
318  }
319  //*******************************************************************************************
320 
321  //**Greater-than operator********************************************************************
327  inline bool operator>( const ConstIterator& rhs ) const {
328  return iterator_ > rhs.iterator_;
329  }
330  //*******************************************************************************************
331 
332  //**Less-or-equal-than operator**************************************************************
338  inline bool operator<=( const ConstIterator& rhs ) const {
339  return iterator_ <= rhs.iterator_;
340  }
341  //*******************************************************************************************
342 
343  //**Greater-or-equal-than operator***********************************************************
349  inline bool operator>=( const ConstIterator& rhs ) const {
350  return iterator_ >= rhs.iterator_;
351  }
352  //*******************************************************************************************
353 
354  //**Subtraction operator*********************************************************************
360  inline DifferenceType operator-( const ConstIterator& rhs ) const {
361  return iterator_ - rhs.iterator_;
362  }
363  //*******************************************************************************************
364 
365  //**Addition operator************************************************************************
372  friend inline const ConstIterator operator+( const ConstIterator& it, size_t inc ) {
373  return ConstIterator( it.iterator_ + inc );
374  }
375  //*******************************************************************************************
376 
377  //**Addition operator************************************************************************
384  friend inline const ConstIterator operator+( size_t inc, const ConstIterator& it ) {
385  return ConstIterator( it.iterator_ + inc );
386  }
387  //*******************************************************************************************
388 
389  //**Subtraction operator*********************************************************************
396  friend inline const ConstIterator operator-( const ConstIterator& it, size_t dec ) {
397  return ConstIterator( it.iterator_ - dec );
398  }
399  //*******************************************************************************************
400 
401  private:
402  //**Member variables*************************************************************************
405  //*******************************************************************************************
406  };
407  //**********************************************************************************************
408 
409  //**Compilation flags***************************************************************************
411  enum { vectorizable = MT::vectorizable &&
414  //**********************************************************************************************
415 
416  //**Constructor*********************************************************************************
422  explicit inline DMatScalarDivExpr( const MT& matrix, ST scalar )
423  : matrix_( matrix ) // Left-hand side dense matrix of the division expression
424  , scalar_( scalar ) // Right-hand side scalar of the division expression
425  {}
426  //**********************************************************************************************
427 
428  //**Access operator*****************************************************************************
435  inline ReturnType operator()( size_t i, size_t j ) const {
436  BLAZE_INTERNAL_ASSERT( i < matrix_.rows() , "Invalid row access index" );
437  BLAZE_INTERNAL_ASSERT( j < matrix_.columns(), "Invalid column access index" );
438  return matrix_(i,j) / scalar_;
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 < matrix_.rows() , "Invalid row access index" );
452  BLAZE_INTERNAL_ASSERT( j < matrix_.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  const IntrinsicType xmm1( matrix_.load(i,j) );
456  const IntrinsicType xmm2( set( scalar_ ) );
457  return xmm1 / xmm2;
458  }
459  //**********************************************************************************************
460 
461  //**Begin function******************************************************************************
467  inline ConstIterator begin( size_t i ) const {
468  return ConstIterator( matrix_.begin(i), scalar_ );
469  }
470  //**********************************************************************************************
471 
472  //**End function********************************************************************************
478  inline ConstIterator end( size_t i ) const {
479  return ConstIterator( matrix_.end(i), scalar_ );
480  }
481  //**********************************************************************************************
482 
483  //**Rows function*******************************************************************************
488  inline size_t rows() const {
489  return matrix_.rows();
490  }
491  //**********************************************************************************************
492 
493  //**Columns function****************************************************************************
498  inline size_t columns() const {
499  return matrix_.columns();
500  }
501  //**********************************************************************************************
502 
503  //**Left operand access*************************************************************************
508  inline LeftOperand leftOperand() const {
509  return matrix_;
510  }
511  //**********************************************************************************************
512 
513  //**Right operand access************************************************************************
518  inline RightOperand rightOperand() const {
519  return scalar_;
520  }
521  //**********************************************************************************************
522 
523  //**********************************************************************************************
529  template< typename T >
530  inline bool canAlias( const T* alias ) const {
531  return IsComputation<MT>::value && matrix_.canAlias( alias );
532  }
533  //**********************************************************************************************
534 
535  //**********************************************************************************************
541  template< typename T >
542  inline bool isAliased( const T* alias ) const {
543  return matrix_.isAliased( alias );
544  }
545  //**********************************************************************************************
546 
547  private:
548  //**Member variables****************************************************************************
551  //**********************************************************************************************
552 
553  //**Assignment to dense matrices****************************************************************
567  template< typename MT2 // Type of the target dense matrix
568  , bool SO2 > // Storage order of the target dense matrix
569  friend inline typename EnableIf< UseAssign<MT2> >::Type
570  assign( DenseMatrix<MT2,SO2>& lhs, const DMatScalarDivExpr& rhs )
571  {
573 
574  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
575  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
576 
577  assign( ~lhs, rhs.matrix_ );
578  (~lhs) /= rhs.scalar_;
579  }
581  //**********************************************************************************************
582 
583  //**Assignment to sparse matrices***************************************************************
597  template< typename MT2 // Type of the target sparse matrix
598  , bool SO2 > // Storage order of the target sparse matrix
599  friend inline typename EnableIf< UseAssign<MT2> >::Type
601  {
603 
604  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
605  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
606 
607  assign( ~lhs, rhs.matrix_ );
608  (~lhs) /= rhs.scalar_;
609  }
611  //**********************************************************************************************
612 
613  //**Addition assignment to dense matrices*******************************************************
627  template< typename MT2 // Type of the target dense matrix
628  , bool SO2 > // Storage order of the target dense matrix
629  friend inline typename EnableIf< UseAssign<MT2> >::Type
630  addAssign( DenseMatrix<MT2,SO2>& lhs, const DMatScalarDivExpr& rhs )
631  {
633 
637 
638  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
639  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
640 
641  const ResultType tmp( rhs );
642  addAssign( ~lhs, tmp );
643  }
645  //**********************************************************************************************
646 
647  //**Addition assignment to sparse matrices******************************************************
648  // No special implementation for the addition assignment to sparse matrices.
649  //**********************************************************************************************
650 
651  //**Subtraction assignment to dense matrices****************************************************
665  template< typename MT2 // Type of the target dense matrix
666  , bool SO2 > // Storage order of the target dense matrix
667  friend inline typename EnableIf< UseAssign<MT2> >::Type
668  subAssign( DenseMatrix<MT2,SO2>& lhs, const DMatScalarDivExpr& rhs )
669  {
671 
675 
676  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
677  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
678 
679  const ResultType tmp( rhs );
680  subAssign( ~lhs, tmp );
681  }
683  //**********************************************************************************************
684 
685  //**Subtraction assignment to sparse matrices***************************************************
686  // No special implementation for the subtraction assignment to sparse matrices.
687  //**********************************************************************************************
688 
689  //**Multiplication assignment to dense matrices*************************************************
690  // No special implementation for the multiplication assignment to dense matrices.
691  //**********************************************************************************************
692 
693  //**Multiplication assignment to sparse matrices************************************************
694  // No special implementation for the multiplication assignment to sparse matrices.
695  //**********************************************************************************************
696 
697  //**Compile time checks*************************************************************************
706  //**********************************************************************************************
707 };
708 //*************************************************************************************************
709 
710 
711 
712 
713 //=================================================================================================
714 //
715 // GLOBAL BINARY ARITHMETIC OPERATORS
716 //
717 //=================================================================================================
718 
719 //*************************************************************************************************
741 template< typename T1 // Type of the left-hand side dense matrix
742  , bool SO // Storage order of the left-hand side dense matrix
743  , typename T2 > // Type of the right-hand side scalar
744 inline const typename EnableIf< IsNumeric<T2>, typename DivExprTrait<T1,T2>::Type >::Type
745  operator/( const DenseMatrix<T1,SO>& mat, T2 scalar )
746 {
748 
749  BLAZE_USER_ASSERT( scalar != T2(0), "Division by zero detected" );
750 
751  typedef typename DivExprTrait<T1,T2>::Type ReturnType;
752  typedef typename ReturnType::RightOperand ScalarType;
753 
755  return ReturnType( ~mat, ScalarType(1)/ScalarType(scalar) );
756  }
757  else {
758  return ReturnType( ~mat, scalar );
759  }
760 }
761 //*************************************************************************************************
762 
763 
764 
765 
766 //=================================================================================================
767 //
768 // GLOBAL RESTRUCTURING BINARY ARITHMETIC OPERATORS
769 //
770 //=================================================================================================
771 
772 //*************************************************************************************************
785 template< typename MT // Type of the dense matrix of the left-hand side expression
786  , typename ST1 // Type of the scalar of the left-hand side expression
787  , bool SO // Storage order of the dense matrix
788  , typename ST2 > // Type of the right-hand side scalar
789 inline const typename EnableIf< IsFloatingPoint< typename DivTrait<ST2,ST1>::Type >
790  , typename MultExprTrait< DMatScalarDivExpr<MT,ST1,SO>, ST2 >::Type >::Type
791  operator*( const DMatScalarDivExpr<MT,ST1,SO>& mat, ST2 scalar )
792 {
794 
795  return mat.leftOperand() * ( scalar / mat.rightOperand() );
796 }
798 //*************************************************************************************************
799 
800 
801 //*************************************************************************************************
814 template< typename ST1 // Type of the left-hand side scalar
815  , typename MT // Type of the dense matrix of the right-hand side expression
816  , typename ST2 // Type of the scalar of the right-hand side expression
817  , bool SO > // Storage order of the dense matrix
818 inline const typename EnableIf< IsFloatingPoint< typename DivTrait<ST1,ST2>::Type >
819  , typename MultExprTrait< ST1, DMatScalarDivExpr<MT,ST2,SO> >::Type >::Type
820  operator*( ST1 scalar, const DMatScalarDivExpr<MT,ST2,SO>& mat )
821 {
823 
824  return mat.leftOperand() * ( scalar / mat.rightOperand() );
825 }
827 //*************************************************************************************************
828 
829 
830 //*************************************************************************************************
843 template< typename MT // Type of the dense matrix of the left-hand side expression
844  , typename ST1 // Type of the scalar of the left-hand side expression
845  , bool SO // Storage order of the dense matrix
846  , typename ST2 > // Type of the right-hand side scalar
847 inline const typename EnableIf< IsNumeric<ST2>
848  , typename DivExprTrait<MT,typename MultTrait<ST1,ST2>::Type>::Type >::Type
849  operator/( const DMatScalarDivExpr<MT,ST1,SO>& mat, ST2 scalar )
850 {
852 
853  BLAZE_USER_ASSERT( scalar != ST2(0), "Division by zero detected" );
854 
855  typedef typename MultTrait<ST1,ST2>::Type MultType;
856  typedef typename DivExprTrait<MT,MultType>::Type ReturnType;
857  typedef typename ReturnType::RightOperand ScalarType;
858 
859  if( IsMultExpr<ReturnType>::value ) {
860  return ReturnType( mat.leftOperand(), ScalarType(1)/( mat.rightOperand() * scalar ) );
861  }
862  else {
863  return ReturnType( mat.leftOperand(), mat.rightOperand() * scalar );
864  }
865 }
867 //*************************************************************************************************
868 
869 
870 
871 
872 //=================================================================================================
873 //
874 // DMATSCALARMULTEXPRTRAIT SPECIALIZATIONS
875 //
876 //=================================================================================================
877 
878 //*************************************************************************************************
880 template< typename MT, typename ST1, typename ST2 >
881 struct DMatScalarMultExprTrait< DMatScalarDivExpr<MT,ST1,false>, ST2 >
882 {
883  private:
884  //**********************************************************************************************
885  enum { condition = IsFloatingPoint<typename DivTrait<ST1,ST2>::Type>::value };
886  //**********************************************************************************************
887 
888  //**********************************************************************************************
889  typedef typename DMatScalarMultExprTrait<MT,typename DivTrait<ST1,ST2>::Type>::Type T1;
890  typedef DMatScalarMultExpr< DMatScalarDivExpr<MT,ST1,false>, ST2, false > T2;
891  //**********************************************************************************************
892 
893  public:
894  //**********************************************************************************************
895  typedef typename SelectType< IsDenseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
896  IsNumeric<ST1>::value && IsNumeric<ST2>::value
897  , typename SelectType<condition,T1,T2>::Type
898  , INVALID_TYPE >::Type Type;
899  //**********************************************************************************************
900 };
902 //*************************************************************************************************
903 
904 
905 
906 
907 //=================================================================================================
908 //
909 // TDMATSCALARMULTEXPRTRAIT SPECIALIZATIONS
910 //
911 //=================================================================================================
912 
913 //*************************************************************************************************
915 template< typename MT, typename ST1, typename ST2 >
916 struct TDMatScalarMultExprTrait< DMatScalarDivExpr<MT,ST1,true>, ST2 >
917 {
918  private:
919  //**********************************************************************************************
920  enum { condition = IsFloatingPoint<typename DivTrait<ST1,ST2>::Type>::value };
921  //**********************************************************************************************
922 
923  //**********************************************************************************************
924  typedef typename DMatScalarMultExprTrait<MT,typename DivTrait<ST1,ST2>::Type>::Type T1;
925  typedef DMatScalarMultExpr< DMatScalarDivExpr<MT,ST1,true>, ST2, true > T2;
926  //**********************************************************************************************
927 
928  public:
929  //**********************************************************************************************
930  typedef typename SelectType< IsDenseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
931  IsNumeric<ST1>::value && IsNumeric<ST2>::value
932  , typename SelectType<condition,T1,T2>::Type
933  , INVALID_TYPE >::Type Type;
934  //**********************************************************************************************
935 };
937 //*************************************************************************************************
938 
939 
940 
941 
942 //=================================================================================================
943 //
944 // SUBMATRIXEXPRTRAIT SPECIALIZATIONS
945 //
946 //=================================================================================================
947 
948 //*************************************************************************************************
950 template< typename MT, typename ST, bool SO >
951 struct SubmatrixExprTrait< DMatScalarDivExpr<MT,ST,SO> >
952 {
953  public:
954  //**********************************************************************************************
955  typedef typename DivExprTrait< typename SubmatrixExprTrait<const MT>::Type, ST >::Type Type;
956  //**********************************************************************************************
957 };
959 //*************************************************************************************************
960 
961 
962 
963 
964 //=================================================================================================
965 //
966 // ROWEXPRTRAIT SPECIALIZATIONS
967 //
968 //=================================================================================================
969 
970 //*************************************************************************************************
972 template< typename MT, typename ST, bool SO >
973 struct RowExprTrait< DMatScalarDivExpr<MT,ST,SO> >
974 {
975  public:
976  //**********************************************************************************************
977  typedef typename DivExprTrait< typename RowExprTrait<const MT>::Type, ST >::Type Type;
978  //**********************************************************************************************
979 };
981 //*************************************************************************************************
982 
983 
984 
985 
986 //=================================================================================================
987 //
988 // COLUMNEXPRTRAIT SPECIALIZATIONS
989 //
990 //=================================================================================================
991 
992 //*************************************************************************************************
994 template< typename MT, typename ST, bool SO >
995 struct ColumnExprTrait< DMatScalarDivExpr<MT,ST,SO> >
996 {
997  public:
998  //**********************************************************************************************
999  typedef typename DivExprTrait< typename ColumnExprTrait<const MT>::Type, ST >::Type Type;
1000  //**********************************************************************************************
1001 };
1003 //*************************************************************************************************
1004 
1005 } // namespace blaze
1006 
1007 #endif
Pointer difference type of the Blaze library.
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:518
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:3703
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:745
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
ValueType value_type
Type of the underlying elements.
Definition: DMatScalarDivExpr.h:181
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:252
#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:196
bool operator!=(const ConstIterator &rhs) const
Inequality comparison between two ConstIterator objects.
Definition: DMatScalarDivExpr.h:305
#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:283
Header file for the IsSame and IsStrictlySame type traits.
DMatScalarDivExpr< MT, ST, SO > This
Type of this DMatScalarDivExpr instance.
Definition: DMatScalarDivExpr.h:146
bool operator>(const ConstIterator &rhs) const
Greater-than comparison between two ConstIterator objects.
Definition: DMatScalarDivExpr.h:327
Header file for the IsColumnMajorMatrix type trait.
MT::CompositeType CT
Composite type of the dense matrix expression.
Definition: DMatScalarDivExpr.h:109
Iterator over the elements of the dense matrix.
Definition: DMatScalarDivExpr.h:169
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:2375
DifferenceType operator-(const ConstIterator &rhs) const
Calculating the number of elements between two iterators.
Definition: DMatScalarDivExpr.h:360
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:248
Expression object for divisions of a dense matrix by a scalar.The DMatScalarDivExpr class represents ...
Definition: DMatScalarDivExpr.h:100
ConstIterator & operator+=(size_t inc)
Addition assignment operator.
Definition: DMatScalarDivExpr.h:208
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:542
Header file for the RequiresEvaluation type trait.
ElementType ValueType
Type of the underlying elements.
Definition: DMatScalarDivExpr.h:174
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:150
Constraint on the data type.
ConstIterator & operator-=(size_t dec)
Subtraction assignment operator.
Definition: DMatScalarDivExpr.h:220
Header file for the DivExprTrait class template.
ptrdiff_t DifferenceType
Difference between two iterators.
Definition: DMatScalarDivExpr.h:177
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:106
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:154
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:250
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:147
Header file for the IsTemporary type trait class.
Header file for the multiplication trait.
ElementType & ReferenceType
Reference return type.
Definition: DMatScalarDivExpr.h:176
IntrinsicType load(size_t i, size_t j) const
Access to the intrinsic elements of the matrix.
Definition: DMatScalarDivExpr.h:449
Header file for the IsFloatingPoint type trait.
ReferenceType reference
Reference return type.
Definition: DMatScalarDivExpr.h:183
Header file for the IsMultExpr type trait class.
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2379
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:403
#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:242
ResultType::OppositeType OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: DMatScalarDivExpr.h:148
const ConstIterator operator--(int)
Post-decrement operator.
Definition: DMatScalarDivExpr.h:263
Constraints on the storage order of matrix types.
MT::ElementType ET
Element type of the dense matrix expression.
Definition: DMatScalarDivExpr.h:108
PointerType pointer
Pointer return type.
Definition: DMatScalarDivExpr.h:182
ElementType * PointerType
Pointer return type.
Definition: DMatScalarDivExpr.h:175
RightOperand scalar_
Scalar of the multiplication expression.
Definition: DMatScalarDivExpr.h:404
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:2373
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:122
Header file for the EnableIf class template.
Header file for the BaseElementType type trait.
ConstIterator & operator++()
Pre-increment operator.
Definition: DMatScalarDivExpr.h:231
Header file for the IsNumeric type trait.
DMatScalarDivExpr(const MT &matrix, ST scalar)
Constructor for the DMatScalarDivExpr class.
Definition: DMatScalarDivExpr.h:422
SelectType< IsExpression< MT >::value, const MT, const MT & >::Type LeftOperand
Composite type of the left-hand side dense matrix expression.
Definition: DMatScalarDivExpr.h:160
bool operator>=(const ConstIterator &rhs) const
Greater-than comparison between two ConstIterator objects.
Definition: DMatScalarDivExpr.h:349
LeftOperand matrix_
Left-hand side dense matrix of the division expression.
Definition: DMatScalarDivExpr.h:549
bool canAlias(const T *alias) const
Returns whether the expression can alias with the given address alias.
Definition: DMatScalarDivExpr.h:530
RightOperand scalar_
Right-hand side scalar of the division expression.
Definition: DMatScalarDivExpr.h:550
ConstIterator(IteratorType iterator, RightOperand scalar)
Constructor for the ConstIterator class.
Definition: DMatScalarDivExpr.h:196
Header file for the SubmatrixExprTrait class template.
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:2374
Intrinsic characteristics of data types.The IntrinsicTrait class template provides the intrinsic char...
Definition: IntrinsicTrait.h:648
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:396
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:157
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:488
IteratorCategory iterator_category
The iterator category.
Definition: DMatScalarDivExpr.h:180
ST RightOperand
Composite type of the right-hand side scalar value.
Definition: DMatScalarDivExpr.h:163
ResultType::TransposeType TransposeType
Transpose type for expression template evaluations.
Definition: DMatScalarDivExpr.h:149
ConstIterator begin(size_t i) const
Returns an iterator to the first non-zero element of row i.
Definition: DMatScalarDivExpr.h:467
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:316
std::random_access_iterator_tag IteratorCategory
The iterator category.
Definition: DMatScalarDivExpr.h:173
size_t columns() const
Returns the current number of columns of the matrix.
Definition: DMatScalarDivExpr.h:498
Header file for the IsRowMajorMatrix type trait.
bool operator<=(const ConstIterator &rhs) const
Less-than comparison between two ConstIterator objects.
Definition: DMatScalarDivExpr.h:338
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:435
ConstIterator end(size_t i) const
Returns an iterator just past the last non-zero element of row i.
Definition: DMatScalarDivExpr.h:478
friend const ConstIterator operator+(const ConstIterator &it, size_t inc)
Addition between a ConstIterator and an integral value.
Definition: DMatScalarDivExpr.h:372
#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:294
This ResultType
Result type for expression template evaluations.
Definition: CompressedMatrix.h:2370
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:384
MT::ConstIterator IteratorType
ConstIterator type of the dense matrix expression.
Definition: DMatScalarDivExpr.h:187
Header file for the MatScalarDivExpr base class.
LeftOperand leftOperand() const
Returns the left-hand side dense matrix operand.
Definition: DMatScalarDivExpr.h:508
MT::ReturnType RN
Return type of the dense matrix expression.
Definition: DMatScalarDivExpr.h:107
DifferenceType difference_type
Difference between two iterators.
Definition: DMatScalarDivExpr.h:184
#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:273
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:151
Header file for the IsExpression type trait class.
Header file for the FunctionTrace class.