All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SMatScalarDivExpr.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_EXPRESSIONS_SMATSCALARDIVEXPR_H_
36 #define _BLAZE_MATH_EXPRESSIONS_SMATSCALARDIVEXPR_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
43 #include <iterator>
68 #include <blaze/util/Assert.h>
73 #include <blaze/util/EnableIf.h>
74 #include <blaze/util/InvalidType.h>
76 #include <blaze/util/SelectType.h>
77 #include <blaze/util/Types.h>
81 
82 
83 namespace blaze {
84 
85 //=================================================================================================
86 //
87 // CLASS SMATSCALARDIVEXPR
88 //
89 //=================================================================================================
90 
91 //*************************************************************************************************
98 template< typename MT // Type of the left-hand side sparse matrix
99  , typename ST // Type of the right-hand side scalar value
100  , bool SO > // Storage order
101 class SMatScalarDivExpr : public SparseMatrix< SMatScalarDivExpr<MT,ST,SO>, SO >
102  , private MatScalarDivExpr
103  , private Computation
104 {
105  private:
106  //**Type definitions****************************************************************************
107  typedef typename MT::ResultType RT;
108  typedef typename MT::ReturnType RN;
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****************************************************************************
151 
154 
157 
159  typedef typename SelectType< IsExpression<MT>::value, const MT, const MT& >::Type LeftOperand;
160 
162  typedef ST RightOperand;
163  //**********************************************************************************************
164 
165  //**ConstIterator class definition**************************************************************
169  {
170  public:
171  //**Type definitions*************************************************************************
174 
177 
178  typedef std::forward_iterator_tag IteratorCategory;
179  typedef Element ValueType;
183 
184  // STL iterator requirements
190  //*******************************************************************************************
191 
192  //**Constructor******************************************************************************
195  inline ConstIterator( IteratorType matrix, RightOperand scalar )
196  : matrix_( matrix ) // Iterator over the elements of the left-hand side sparse matrix expression
197  , scalar_( scalar ) // Right-hand side scalar of the division expression
198  {}
199  //*******************************************************************************************
200 
201  //**Prefix increment operator****************************************************************
207  ++matrix_;
208  return *this;
209  }
210  //*******************************************************************************************
211 
212  //**Element access operator******************************************************************
217  inline const Element operator*() const {
218  return Element( matrix_->value() / scalar_, matrix_->index() );
219  }
220  //*******************************************************************************************
221 
222  //**Element access operator******************************************************************
227  inline const ConstIterator* operator->() const {
228  return this;
229  }
230  //*******************************************************************************************
231 
232  //**Value function***************************************************************************
237  inline ReturnType value() const {
238  return matrix_->value() / scalar_;
239  }
240  //*******************************************************************************************
241 
242  //**Index function***************************************************************************
247  inline size_t index() const {
248  return matrix_->index();
249  }
250  //*******************************************************************************************
251 
252  //**Equality operator************************************************************************
258  inline bool operator==( const ConstIterator& rhs ) const {
259  return matrix_ == rhs.matrix_;
260  }
261  //*******************************************************************************************
262 
263  //**Inequality operator**********************************************************************
269  inline bool operator!=( const ConstIterator& rhs ) const {
270  return matrix_ != rhs.matrix_;
271  }
272  //*******************************************************************************************
273 
274  //**Subtraction operator*********************************************************************
280  inline DifferenceType operator-( const ConstIterator& rhs ) const {
281  return matrix_ - rhs.matrix_;
282  }
283  //*******************************************************************************************
284 
285  private:
286  //**Member variables*************************************************************************
289  //*******************************************************************************************
290  };
291  //**********************************************************************************************
292 
293  //**Compilation flags***************************************************************************
295  enum { smpAssignable = 0 };
296  //**********************************************************************************************
297 
298  //**Constructor*********************************************************************************
304  explicit inline SMatScalarDivExpr( const MT& matrix, ST scalar )
305  : matrix_( matrix ) // Left-hand side sparse matrix of the division expression
306  , scalar_( scalar ) // Right-hand side scalar of the division expression
307  {}
308  //**********************************************************************************************
309 
310  //**Access operator*****************************************************************************
317  inline ReturnType operator()( size_t i, size_t j ) const {
318  BLAZE_INTERNAL_ASSERT( i < matrix_.rows() , "Invalid row access index" );
319  BLAZE_INTERNAL_ASSERT( j < matrix_.columns(), "Invalid column access index" );
320  return matrix_(i,j) / scalar_;
321  }
322  //**********************************************************************************************
323 
324  //**Begin function******************************************************************************
330  inline ConstIterator begin( size_t i ) const {
331  return ConstIterator( matrix_.begin(i), scalar_ );
332  }
333  //**********************************************************************************************
334 
335  //**End function********************************************************************************
341  inline ConstIterator end( size_t i ) const {
342  return ConstIterator( matrix_.end(i), scalar_ );
343  }
344  //**********************************************************************************************
345 
346  //**Rows function*******************************************************************************
351  inline size_t rows() const {
352  return matrix_.rows();
353  }
354  //**********************************************************************************************
355 
356  //**Columns function****************************************************************************
361  inline size_t columns() const {
362  return matrix_.columns();
363  }
364  //**********************************************************************************************
365 
366  //**NonZeros function***************************************************************************
371  inline size_t nonZeros() const {
372  return matrix_.nonZeros();
373  }
374  //**********************************************************************************************
375 
376  //**NonZeros function***************************************************************************
382  inline size_t nonZeros( size_t i ) const {
383  return matrix_.nonZeros(i);
384  }
385  //**********************************************************************************************
386 
387  //**Left operand access*************************************************************************
392  inline LeftOperand leftOperand() const {
393  return matrix_;
394  }
395  //**********************************************************************************************
396 
397  //**Right operand access************************************************************************
402  inline RightOperand rightOperand() const {
403  return scalar_;
404  }
405  //**********************************************************************************************
406 
407  //**********************************************************************************************
413  template< typename T >
414  inline bool canAlias( const T* alias ) const {
415  return matrix_.canAlias( alias );
416  }
417  //**********************************************************************************************
418 
419  //**********************************************************************************************
425  template< typename T >
426  inline bool isAliased( const T* alias ) const {
427  return matrix_.isAliased( alias );
428  }
429  //**********************************************************************************************
430 
431  private:
432  //**Member variables****************************************************************************
435  //**********************************************************************************************
436 
437  //**Assignment to dense matrices****************************************************************
451  template< typename MT2 // Type of the target dense matrix
452  , bool SO2 > // Storage order of the target dense matrix
453  friend inline typename EnableIf< UseAssign<MT2> >::Type
454  assign( DenseMatrix<MT2,SO2>& lhs, const SMatScalarDivExpr& rhs )
455  {
457 
458  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
459  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
460 
461  assign( ~lhs, rhs.matrix_ );
462  (~lhs) /= rhs.scalar_;
463  }
465  //**********************************************************************************************
466 
467  //**Assignment to sparse matrices***************************************************************
481  template< typename MT2 // Type of the target sparse matrix
482  , bool SO2 > // Storage order of the target sparse matrix
483  friend inline typename EnableIf< UseAssign<MT2> >::Type
485  {
487 
488  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
489  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
490 
491  assign( ~lhs, rhs.matrix_ );
492  (~lhs) /= rhs.scalar_;
493  }
495  //**********************************************************************************************
496 
497  //**Addition assignment to dense matrices*******************************************************
511  template< typename MT2 // Type of the target dense matrix
512  , bool SO2 > // Storage order of the target dense matrix
513  friend inline typename EnableIf< UseAssign<MT2> >::Type
514  addAssign( DenseMatrix<MT2,SO2>& lhs, const SMatScalarDivExpr& rhs )
515  {
517 
520 
521  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
522  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
523 
524  const ResultType tmp( rhs );
525  smpAddAssign( ~lhs, tmp );
526  }
528  //**********************************************************************************************
529 
530  //**Addition assignment to sparse matrices******************************************************
531  // No special implementation for the addition assignment to sparse matrices.
532  //**********************************************************************************************
533 
534  //**Subtraction assignment to dense matrices****************************************************
548  template< typename MT2 // Type of the target dense matrix
549  , bool SO2 > // Storage order of the target dense matrix
550  friend inline typename EnableIf< UseAssign<MT2> >::Type
551  subAssign( DenseMatrix<MT2,SO2>& lhs, const SMatScalarDivExpr& rhs )
552  {
554 
557 
558  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
559  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
560 
561  const ResultType tmp( rhs );
562  smpSubAssign( ~lhs, tmp );
563  }
565  //**********************************************************************************************
566 
567  //**Subtraction assignment to sparse matrices***************************************************
568  // No special implementation for the subtraction assignment to sparse matrices.
569  //**********************************************************************************************
570 
571  //**Multiplication assignment to dense matrices*************************************************
572  // No special implementation for the division assignment to dense matrices.
573  //**********************************************************************************************
574 
575  //**Multiplication assignment to sparse matrices************************************************
576  // No special implementation for the division assignment to sparse matrices.
577  //**********************************************************************************************
578 
579  //**Compile time checks*************************************************************************
588  //**********************************************************************************************
589 };
590 //*************************************************************************************************
591 
592 
593 
594 
595 //=================================================================================================
596 //
597 // GLOBAL BINARY ARITHMETIC OPERATORS
598 //
599 //=================================================================================================
600 
601 //*************************************************************************************************
623 template< typename T1 // Type of the left-hand side sparse matrix
624  , bool SO // Storage order of the left-hand side sparse matrix
625  , typename T2 > // Type of the right-hand side scalar
626 inline const typename EnableIf< IsNumeric<T2>, typename DivExprTrait<T1,T2>::Type >::Type
627  operator/( const SparseMatrix<T1,SO>& mat, T2 scalar )
628 {
630 
631  BLAZE_USER_ASSERT( scalar != T2(0), "Division by zero detected" );
632 
633  typedef typename DivExprTrait<T1,T2>::Type ReturnType;
634  typedef typename ReturnType::RightOperand ScalarType;
635 
637  return ReturnType( ~mat, ScalarType(1)/ScalarType(scalar) );
638  }
639  else {
640  return ReturnType( ~mat, scalar );
641  }
642 }
643 //*************************************************************************************************
644 
645 
646 
647 
648 //=================================================================================================
649 //
650 // GLOBAL RESTRUCTURING BINARY ARITHMETIC OPERATORS
651 //
652 //=================================================================================================
653 
654 //*************************************************************************************************
667 template< typename MT // Type of the sparse matrix of the left-hand side expression
668  , typename ST1 // Type of the scalar of the left-hand side expression
669  , bool SO // Storage order of the sparse matrix
670  , typename ST2 > // Type of the right-hand side scalar
671 inline const typename EnableIf< IsFloatingPoint< typename DivTrait<ST2,ST1>::Type >
672  , typename MultExprTrait< SMatScalarDivExpr<MT,ST1,SO>, ST2 >::Type >::Type
673  operator*( const SMatScalarDivExpr<MT,ST1,SO>& mat, ST2 scalar )
674 {
676 
677  return mat.leftOperand() * ( scalar / mat.rightOperand() );
678 }
680 //*************************************************************************************************
681 
682 
683 //*************************************************************************************************
696 template< typename ST1 // Type of the left-hand side scalar
697  , typename MT // Type of the sparse matrix of the right-hand side expression
698  , typename ST2 // Type of the scalar of the right-hand side expression
699  , bool SO > // Storage order of the sparse matrix
700 inline const typename EnableIf< IsFloatingPoint< typename DivTrait<ST1,ST2>::Type >
701  , typename MultExprTrait< ST1, SMatScalarDivExpr<MT,ST2,SO> >::Type >::Type
702  operator*( ST1 scalar, const SMatScalarDivExpr<MT,ST2,SO>& mat )
703 {
705 
706  return mat.leftOperand() * ( scalar / mat.rightOperand() );
707 }
709 //*************************************************************************************************
710 
711 
712 //*************************************************************************************************
725 template< typename MT // Type of the sparse matrix of the left-hand side expression
726  , typename ST1 // Type of the scalar of the left-hand side expression
727  , bool SO // Storage order of the sparse matrix
728  , typename ST2 > // Type of the right-hand side scalar
729 inline const typename EnableIf< IsNumeric<ST2>
730  , typename DivExprTrait<MT,typename MultTrait<ST1,ST2>::Type>::Type >::Type
731  operator/( const SMatScalarDivExpr<MT,ST1,SO>& mat, ST2 scalar )
732 {
734 
735  BLAZE_USER_ASSERT( scalar != ST2(0), "Division by zero detected" );
736 
737  typedef typename MultTrait<ST1,ST2>::Type MultType;
738  typedef typename DivExprTrait<MT,MultType>::Type ReturnType;
739  typedef typename ReturnType::RightOperand ScalarType;
740 
741  if( IsMultExpr<ReturnType>::value ) {
742  return ReturnType( mat.leftOperand(), ScalarType(1)/( mat.rightOperand() * scalar ) );
743  }
744  else {
745  return ReturnType( mat.leftOperand(), mat.rightOperand() * scalar );
746  }
747 }
749 //*************************************************************************************************
750 
751 
752 
753 
754 //=================================================================================================
755 //
756 // SMATSCALARMULTEXPRTRAIT SPECIALIZATIONS
757 //
758 //=================================================================================================
759 
760 //*************************************************************************************************
762 template< typename MT, typename ST1, typename ST2 >
763 struct SMatScalarMultExprTrait< SMatScalarDivExpr<MT,ST1,false>, ST2 >
764 {
765  private:
766  //**********************************************************************************************
767  enum { condition = IsFloatingPoint<typename DivTrait<ST1,ST2>::Type>::value };
768  //**********************************************************************************************
769 
770  //**********************************************************************************************
771  typedef typename SMatScalarMultExprTrait<MT,typename DivTrait<ST1,ST2>::Type>::Type T1;
772  typedef SMatScalarMultExpr< SMatScalarDivExpr<MT,ST1,false>, ST2, false > T2;
773  //**********************************************************************************************
774 
775  public:
776  //**********************************************************************************************
777  typedef typename SelectType< IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
778  IsNumeric<ST1>::value && IsNumeric<ST2>::value
779  , typename SelectType<condition,T1,T2>::Type
780  , INVALID_TYPE >::Type Type;
781  //**********************************************************************************************
782 };
784 //*************************************************************************************************
785 
786 
787 
788 
789 //=================================================================================================
790 //
791 // TSMATSCALARMULTEXPRTRAIT SPECIALIZATIONS
792 //
793 //=================================================================================================
794 
795 //*************************************************************************************************
797 template< typename MT, typename ST1, typename ST2 >
798 struct TSMatScalarMultExprTrait< SMatScalarDivExpr<MT,ST1,true>, ST2 >
799 {
800  private:
801  //**********************************************************************************************
802  enum { condition = IsFloatingPoint<typename DivTrait<ST1,ST2>::Type>::value };
803  //**********************************************************************************************
804 
805  //**********************************************************************************************
806  typedef typename SMatScalarMultExprTrait<MT,typename DivTrait<ST1,ST2>::Type>::Type T1;
807  typedef SMatScalarMultExpr< SMatScalarDivExpr<MT,ST1,true>, ST2, true > T2;
808  //**********************************************************************************************
809 
810  public:
811  //**********************************************************************************************
812  typedef typename SelectType< IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
813  IsNumeric<ST1>::value && IsNumeric<ST2>::value
814  , typename SelectType<condition,T1,T2>::Type
815  , INVALID_TYPE >::Type Type;
816  //**********************************************************************************************
817 };
819 //*************************************************************************************************
820 
821 
822 
823 
824 //=================================================================================================
825 //
826 // SUBMATRIXEXPRTRAIT SPECIALIZATIONS
827 //
828 //=================================================================================================
829 
830 //*************************************************************************************************
832 template< typename MT, typename ST, bool SO, bool AF >
833 struct SubmatrixExprTrait< SMatScalarDivExpr<MT,ST,SO>, AF >
834 {
835  public:
836  //**********************************************************************************************
837  typedef typename DivExprTrait< typename SubmatrixExprTrait<const MT,AF>::Type, ST >::Type Type;
838  //**********************************************************************************************
839 };
841 //*************************************************************************************************
842 
843 
844 
845 
846 //=================================================================================================
847 //
848 // ROWEXPRTRAIT SPECIALIZATIONS
849 //
850 //=================================================================================================
851 
852 //*************************************************************************************************
854 template< typename MT, typename ST, bool SO >
855 struct RowExprTrait< SMatScalarDivExpr<MT,ST,SO> >
856 {
857  public:
858  //**********************************************************************************************
859  typedef typename DivExprTrait< typename RowExprTrait<const MT>::Type, ST >::Type Type;
860  //**********************************************************************************************
861 };
863 //*************************************************************************************************
864 
865 
866 
867 
868 //=================================================================================================
869 //
870 // COLUMNEXPRTRAIT SPECIALIZATIONS
871 //
872 //=================================================================================================
873 
874 //*************************************************************************************************
876 template< typename MT, typename ST, bool SO >
877 struct ColumnExprTrait< SMatScalarDivExpr<MT,ST,SO> >
878 {
879  public:
880  //**********************************************************************************************
881  typedef typename DivExprTrait< typename ColumnExprTrait<const MT>::Type, ST >::Type Type;
882  //**********************************************************************************************
883 };
885 //*************************************************************************************************
886 
887 } // namespace blaze
888 
889 #endif
Pointer difference type of the Blaze library.
Data type constraint.
Constraint on the data type.
SelectType< IsExpression< MT >::value, const MT, const MT & >::Type LeftOperand
Composite data type of the sparse matrix expression.
Definition: SMatScalarDivExpr.h:159
#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
Compile time check whether the given type is a temporary vector or matrix type.This type trait class ...
Definition: IsTemporary.h:87
DivExprTrait< RN, ST >::Type ExprReturnType
Expression return type for the subscript operator.
Definition: SMatScalarDivExpr.h:122
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
PointerType pointer
Pointer return type.
Definition: SMatScalarDivExpr.h:187
Header file for the IsSparseMatrix type trait.
#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
Header file for the ColumnExprTrait class template.
ConstIterator begin(size_t i) const
Returns an iterator to the first non-zero element of row i.
Definition: SMatScalarDivExpr.h:330
ReturnType operator()(size_t i, size_t j) const
2D-access to the matrix elements.
Definition: SMatScalarDivExpr.h:317
Header file for the IsColumnMajorMatrix type trait.
ValueType value_type
Type of the underlying pointers.
Definition: SMatScalarDivExpr.h:186
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:2384
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:249
Header file for the Computation base class.
const Element operator*() const
Direct access to the sparse matrix element at the current iterator position.
Definition: SMatScalarDivExpr.h:217
ResultType::TransposeType TransposeType
Transpose type for expression template evaluations.
Definition: SMatScalarDivExpr.h:149
Header file for the RequiresEvaluation type trait.
MT::ResultType RT
Result type of the sparse matrix expression.
Definition: SMatScalarDivExpr.h:107
ConstIterator(IteratorType matrix, RightOperand scalar)
Constructor for the ConstIterator class.
Definition: SMatScalarDivExpr.h:195
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
ReturnType value() const
Access to the current value of the sparse element.
Definition: SMatScalarDivExpr.h:237
ValueType * PointerType
Pointer return type.
Definition: SMatScalarDivExpr.h:180
bool canAlias(const T *alias) const
Returns whether the expression can alias with the given address alias.
Definition: SMatScalarDivExpr.h:414
Constraint on the data type.
Header file for the SparseMatrix base class.
SMatScalarDivExpr(const MT &matrix, ST scalar)
Constructor for the SMatScalarDivExpr class.
Definition: SMatScalarDivExpr.h:304
Header file for the DivExprTrait class template.
RightOperand scalar_
Right-hand side scalar of the division expression.
Definition: SMatScalarDivExpr.h:434
Evaluation of the resulting expression type of a division.Via this type trait it is possible to evalu...
Definition: DivExprTrait.h:87
Constraint on the data type.
Header file for the MultExprTrait class template.
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
ResultType::OppositeType OppositeType
Result type with opposite storage order for expression template evaluations.
Definition: SMatScalarDivExpr.h:148
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:251
Header file for the ValueIndexPair class.
ST RightOperand
Composite type of the right-hand side scalar value.
Definition: SMatScalarDivExpr.h:162
Compile time type selection.The SelectType class template selects one of the two given types T1 and T...
Definition: SelectType.h:59
Header file for the IsTemporary type trait class.
Header file for the multiplication trait.
std::forward_iterator_tag IteratorCategory
The iterator category.
Definition: SMatScalarDivExpr.h:178
Header file for the IsFloatingPoint type trait.
Iterator over the elements of the sparse matrix/scalar division expression.
Definition: SMatScalarDivExpr.h:168
RemoveReference< LeftOperand >::Type::ConstIterator IteratorType
Iterator type of the sparse matrix expression.
Definition: SMatScalarDivExpr.h:176
bool isAliased(const T *alias) const
Returns whether the expression is aliased with the given address alias.
Definition: SMatScalarDivExpr.h:426
Header file for the IsMultExpr type trait class.
MultTrait< RT, ST >::Type ResultType
Result type for expression template evaluations.
Definition: SMatScalarDivExpr.h:147
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2388
IteratorCategory iterator_category
The iterator category.
Definition: SMatScalarDivExpr.h:185
MT::CompositeType CT
Composite type of the sparse matrix expression.
Definition: SMatScalarDivExpr.h:109
size_t rows() const
Returns the current number of rows of the matrix.
Definition: SMatScalarDivExpr.h:351
Header file for the dense matrix SMP implementation.
ReferenceType reference
Reference return type.
Definition: SMatScalarDivExpr.h:188
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
DifferenceType difference_type
Difference between two iterators.
Definition: SMatScalarDivExpr.h:189
LeftOperand leftOperand() const
Returns the left-hand side sparse matrix operand.
Definition: SMatScalarDivExpr.h:392
#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
ResultType::ElementType ElementType
Resulting element type.
Definition: SMatScalarDivExpr.h:150
bool operator==(const ConstIterator &rhs) const
Equality comparison between two ConstIterator objects.
Definition: SMatScalarDivExpr.h:258
#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
Constraints on the storage order of matrix types.
SMatScalarDivExpr< MT, ST, SO > This
Type of this SMatScalarDivExpr instance.
Definition: SMatScalarDivExpr.h:146
Header file for the SelectType class template.
Header file for the RowExprTrait class template.
Header file for all forward declarations for expression class templates.
size_t columns() const
Returns the current number of columns of the matrix.
Definition: SMatScalarDivExpr.h:361
SelectType< useAssign, const ResultType, const SMatScalarDivExpr & >::Type CompositeType
Data type for composite expression templates.
Definition: SMatScalarDivExpr.h:156
const SelectType< returnExpr, ExprReturnType, ElementType >::Type ReturnType
Return type for expression template evaluations.
Definition: SMatScalarDivExpr.h:153
Header file for the EnableIf class template.
Header file for the BaseElementType type trait.
RightOperand rightOperand() const
Returns the right-hand side scalar operand.
Definition: SMatScalarDivExpr.h:402
Header file for the IsNumeric type trait.
bool operator!=(const ConstIterator &rhs) const
Inequality comparison between two ConstIterator objects.
Definition: SMatScalarDivExpr.h:269
Header file for the SubmatrixExprTrait class template.
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:2383
Removal of reference modifiers.The RemoveCV type trait removes any reference modifiers from the given...
Definition: RemoveReference.h:69
ValueType & ReferenceType
Reference return type.
Definition: SMatScalarDivExpr.h:181
Header file for run time assertion macros.
size_t index() const
Access to the current index of the sparse element.
Definition: SMatScalarDivExpr.h:247
Utility type for generic codes.
Base template for the MultTrait class.
Definition: MultTrait.h:141
Header file for the division trait.
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
Expression object for sparse matrix-scalar divisions.The SMatScalarMult class represents the compile ...
Definition: Forward.h:91
DifferenceType operator-(const ConstIterator &rhs) const
Calculating the number of elements between two expression iterators.
Definition: SMatScalarDivExpr.h:280
Substitution Failure Is Not An Error (SFINAE) class.The EnableIf class template is an auxiliary tool ...
Definition: EnableIf.h:184
size_t nonZeros(size_t i) const
Returns the number of non-zero elements in the specified row.
Definition: SMatScalarDivExpr.h:382
ConstIterator & operator++()
Pre-increment operator.
Definition: SMatScalarDivExpr.h:206
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
Element ValueType
Type of the underlying pointers.
Definition: SMatScalarDivExpr.h:179
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
RightOperand scalar_
Right-hand side scalar of the division expression.
Definition: SMatScalarDivExpr.h:288
Header file for the RemoveReference type trait.
IteratorType matrix_
Iterator over the elements of the left-hand side sparse matrix expression.
Definition: SMatScalarDivExpr.h:287
#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
const ConstIterator * operator->() const
Direct access to the sparse matrix element at the current iterator position.
Definition: SMatScalarDivExpr.h:227
Index-value-pair for sparse vectors and matrices.The ValueIndexPair class represents a single index-v...
Definition: ValueIndexPair.h:69
Header file for the IsRowMajorMatrix type trait.
Header file for the IsComputation type trait class.
LeftOperand matrix_
Left-hand side sparse matrix of the division expression.
Definition: SMatScalarDivExpr.h:433
ptrdiff_t DifferenceType
Difference between two iterators.
Definition: SMatScalarDivExpr.h:182
#define BLAZE_FUNCTION_TRACE
Function trace macro.This macro can be used to reliably trace function calls. In case function tracin...
Definition: FunctionTrace.h:157
This ResultType
Result type for expression template evaluations.
Definition: CompressedMatrix.h:2379
Header file for basic type definitions.
size_t nonZeros() const
Returns the number of non-zero elements in the sparse matrix.
Definition: SMatScalarDivExpr.h:371
Header file for the MatScalarDivExpr base class.
ValueIndexPair< ElementType > Element
Element type of the sparse matrix expression.
Definition: SMatScalarDivExpr.h:173
ConstIterator end(size_t i) const
Returns an iterator just past the last non-zero element of row i.
Definition: SMatScalarDivExpr.h:341
#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
#define BLAZE_CONSTRAINT_MUST_BE_SPARSE_MATRIX_TYPE(T)
Constraint on the data type.In case the given data type T is not a sparse, N-dimensional matrix type...
Definition: SparseMatrix.h:79
MT::ReturnType RN
Return type of the sparse matrix expression.
Definition: SMatScalarDivExpr.h:108
Header file for the IsExpression type trait class.
Header file for the FunctionTrace class.