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>
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 SMATSCALARDIVEXPR
87 //
88 //=================================================================================================
89 
90 //*************************************************************************************************
97 template< typename MT // Type of the left-hand side sparse matrix
98  , typename ST // Type of the right-hand side scalar value
99  , bool SO > // Storage order
100 class SMatScalarDivExpr : public SparseMatrix< SMatScalarDivExpr<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::CompositeType CT;
109  //**********************************************************************************************
110 
111  //**Return type evaluation**********************************************************************
113 
118  enum { returnExpr = !IsTemporary<RN>::value };
119 
122  //**********************************************************************************************
123 
124  //**Evaluation strategy*************************************************************************
126 
132  enum { useAssign = RequiresEvaluation<MT>::value };
133 
135  template< typename MT2 >
137  struct UseAssign {
138  enum { value = useAssign };
139  };
141  //**********************************************************************************************
142 
143  public:
144  //**Type definitions****************************************************************************
150 
153 
156 
158  typedef typename SelectType< IsExpression<MT>::value, const MT, const MT& >::Type LeftOperand;
159 
161  typedef ST RightOperand;
162  //**********************************************************************************************
163 
164  //**ConstIterator class definition**************************************************************
168  {
169  public:
170  //**Type definitions*************************************************************************
173 
176 
177  typedef std::forward_iterator_tag IteratorCategory;
178  typedef Element ValueType;
182 
183  // STL iterator requirements
189  //*******************************************************************************************
190 
191  //**Constructor******************************************************************************
194  inline ConstIterator( IteratorType matrix, RightOperand scalar )
195  : matrix_( matrix ) // Iterator over the elements of the left-hand side sparse matrix expression
196  , scalar_( scalar ) // Right-hand side scalar of the division expression
197  {}
198  //*******************************************************************************************
199 
200  //**Prefix increment operator****************************************************************
206  ++matrix_;
207  return *this;
208  }
209  //*******************************************************************************************
210 
211  //**Element access operator******************************************************************
216  inline const Element operator*() const {
217  return Element( matrix_->value() / scalar_, matrix_->index() );
218  }
219  //*******************************************************************************************
220 
221  //**Element access operator******************************************************************
226  inline const ConstIterator* operator->() const {
227  return this;
228  }
229  //*******************************************************************************************
230 
231  //**Value function***************************************************************************
236  inline ReturnType value() const {
237  return matrix_->value() / scalar_;
238  }
239  //*******************************************************************************************
240 
241  //**Index function***************************************************************************
246  inline size_t index() const {
247  return matrix_->index();
248  }
249  //*******************************************************************************************
250 
251  //**Equality operator************************************************************************
257  inline bool operator==( const ConstIterator& rhs ) const {
258  return matrix_ == rhs.matrix_;
259  }
260  //*******************************************************************************************
261 
262  //**Inequality operator**********************************************************************
268  inline bool operator!=( const ConstIterator& rhs ) const {
269  return matrix_ != rhs.matrix_;
270  }
271  //*******************************************************************************************
272 
273  //**Subtraction operator*********************************************************************
279  inline DifferenceType operator-( const ConstIterator& rhs ) const {
280  return matrix_ - rhs.matrix_;
281  }
282  //*******************************************************************************************
283 
284  private:
285  //**Member variables*************************************************************************
288  //*******************************************************************************************
289  };
290  //**********************************************************************************************
291 
292  //**Constructor*********************************************************************************
298  explicit inline SMatScalarDivExpr( const MT& matrix, ST scalar )
299  : matrix_( matrix ) // Left-hand side sparse matrix of the division expression
300  , scalar_( scalar ) // Right-hand side scalar of the division expression
301  {}
302  //**********************************************************************************************
303 
304  //**Access operator*****************************************************************************
311  inline ReturnType operator()( size_t i, size_t j ) const {
312  BLAZE_INTERNAL_ASSERT( i < matrix_.rows() , "Invalid row access index" );
313  BLAZE_INTERNAL_ASSERT( j < matrix_.columns(), "Invalid column access index" );
314  return matrix_(i,j) / scalar_;
315  }
316  //**********************************************************************************************
317 
318  //**Begin function******************************************************************************
324  inline ConstIterator begin( size_t i ) const {
325  return ConstIterator( matrix_.begin(i), scalar_ );
326  }
327  //**********************************************************************************************
328 
329  //**End function********************************************************************************
335  inline ConstIterator end( size_t i ) const {
336  return ConstIterator( matrix_.end(i), scalar_ );
337  }
338  //**********************************************************************************************
339 
340  //**Rows function*******************************************************************************
345  inline size_t rows() const {
346  return matrix_.rows();
347  }
348  //**********************************************************************************************
349 
350  //**Columns function****************************************************************************
355  inline size_t columns() const {
356  return matrix_.columns();
357  }
358  //**********************************************************************************************
359 
360  //**NonZeros function***************************************************************************
365  inline size_t nonZeros() const {
366  return matrix_.nonZeros();
367  }
368  //**********************************************************************************************
369 
370  //**NonZeros function***************************************************************************
376  inline size_t nonZeros( size_t i ) const {
377  return matrix_.nonZeros(i);
378  }
379  //**********************************************************************************************
380 
381  //**Left operand access*************************************************************************
386  inline LeftOperand leftOperand() const {
387  return matrix_;
388  }
389  //**********************************************************************************************
390 
391  //**Right operand access************************************************************************
396  inline RightOperand rightOperand() const {
397  return scalar_;
398  }
399  //**********************************************************************************************
400 
401  //**********************************************************************************************
407  template< typename T >
408  inline bool canAlias( const T* alias ) const {
409  return matrix_.canAlias( alias );
410  }
411  //**********************************************************************************************
412 
413  //**********************************************************************************************
419  template< typename T >
420  inline bool isAliased( const T* alias ) const {
421  return matrix_.isAliased( alias );
422  }
423  //**********************************************************************************************
424 
425  private:
426  //**Member variables****************************************************************************
429  //**********************************************************************************************
430 
431  //**Assignment to dense matrices****************************************************************
445  template< typename MT2 // Type of the target dense matrix
446  , bool SO2 > // Storage order of the target dense matrix
447  friend inline typename EnableIf< UseAssign<MT2> >::Type
448  assign( DenseMatrix<MT2,SO2>& lhs, const SMatScalarDivExpr& rhs )
449  {
451 
452  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
453  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
454 
455  assign( ~lhs, rhs.matrix_ );
456  (~lhs) /= rhs.scalar_;
457  }
459  //**********************************************************************************************
460 
461  //**Assignment to sparse matrices***************************************************************
475  template< typename MT2 // Type of the target sparse matrix
476  , bool SO2 > // Storage order of the target sparse matrix
477  friend inline typename EnableIf< UseAssign<MT2> >::Type
479  {
481 
482  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
483  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
484 
485  assign( ~lhs, rhs.matrix_ );
486  (~lhs) /= rhs.scalar_;
487  }
489  //**********************************************************************************************
490 
491  //**Addition assignment to dense matrices*******************************************************
505  template< typename MT2 // Type of the target dense matrix
506  , bool SO2 > // Storage order of the target dense matrix
507  friend inline typename EnableIf< UseAssign<MT2> >::Type
508  addAssign( DenseMatrix<MT2,SO2>& lhs, const SMatScalarDivExpr& rhs )
509  {
511 
514 
515  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
516  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
517 
518  const ResultType tmp( rhs );
519  addAssign( ~lhs, tmp );
520  }
522  //**********************************************************************************************
523 
524  //**Addition assignment to sparse matrices******************************************************
525  // No special implementation for the addition assignment to sparse matrices.
526  //**********************************************************************************************
527 
528  //**Subtraction assignment to dense matrices****************************************************
542  template< typename MT2 // Type of the target dense matrix
543  , bool SO2 > // Storage order of the target dense matrix
544  friend inline typename EnableIf< UseAssign<MT2> >::Type
545  subAssign( DenseMatrix<MT2,SO2>& lhs, const SMatScalarDivExpr& rhs )
546  {
548 
551 
552  BLAZE_INTERNAL_ASSERT( (~lhs).rows() == rhs.rows() , "Invalid number of rows" );
553  BLAZE_INTERNAL_ASSERT( (~lhs).columns() == rhs.columns(), "Invalid number of columns" );
554 
555  const ResultType tmp( rhs );
556  subAssign( ~lhs, tmp );
557  }
559  //**********************************************************************************************
560 
561  //**Subtraction assignment to sparse matrices***************************************************
562  // No special implementation for the subtraction assignment to sparse matrices.
563  //**********************************************************************************************
564 
565  //**Multiplication assignment to dense matrices*************************************************
566  // No special implementation for the division assignment to dense matrices.
567  //**********************************************************************************************
568 
569  //**Multiplication assignment to sparse matrices************************************************
570  // No special implementation for the division assignment to sparse matrices.
571  //**********************************************************************************************
572 
573  //**Compile time checks*************************************************************************
582  //**********************************************************************************************
583 };
584 //*************************************************************************************************
585 
586 
587 
588 
589 //=================================================================================================
590 //
591 // GLOBAL BINARY ARITHMETIC OPERATORS
592 //
593 //=================================================================================================
594 
595 //*************************************************************************************************
617 template< typename T1 // Type of the left-hand side sparse matrix
618  , bool SO // Storage order of the left-hand side sparse matrix
619  , typename T2 > // Type of the right-hand side scalar
620 inline const typename EnableIf< IsNumeric<T2>, typename DivExprTrait<T1,T2>::Type >::Type
621  operator/( const SparseMatrix<T1,SO>& mat, T2 scalar )
622 {
624 
625  BLAZE_USER_ASSERT( scalar != T2(0), "Division by zero detected" );
626 
627  typedef typename DivExprTrait<T1,T2>::Type ReturnType;
628  typedef typename ReturnType::RightOperand ScalarType;
629 
631  return ReturnType( ~mat, ScalarType(1)/ScalarType(scalar) );
632  }
633  else {
634  return ReturnType( ~mat, scalar );
635  }
636 }
637 //*************************************************************************************************
638 
639 
640 
641 
642 //=================================================================================================
643 //
644 // GLOBAL RESTRUCTURING BINARY ARITHMETIC OPERATORS
645 //
646 //=================================================================================================
647 
648 //*************************************************************************************************
661 template< typename MT // Type of the sparse matrix of the left-hand side expression
662  , typename ST1 // Type of the scalar of the left-hand side expression
663  , bool SO // Storage order of the sparse matrix
664  , typename ST2 > // Type of the right-hand side scalar
665 inline const typename EnableIf< IsFloatingPoint< typename DivTrait<ST2,ST1>::Type >
666  , typename MultExprTrait< SMatScalarDivExpr<MT,ST1,SO>, ST2 >::Type >::Type
667  operator*( const SMatScalarDivExpr<MT,ST1,SO>& mat, ST2 scalar )
668 {
670 
671  return mat.leftOperand() * ( scalar / mat.rightOperand() );
672 }
674 //*************************************************************************************************
675 
676 
677 //*************************************************************************************************
690 template< typename ST1 // Type of the left-hand side scalar
691  , typename MT // Type of the sparse matrix of the right-hand side expression
692  , typename ST2 // Type of the scalar of the right-hand side expression
693  , bool SO > // Storage order of the sparse matrix
694 inline const typename EnableIf< IsFloatingPoint< typename DivTrait<ST1,ST2>::Type >
695  , typename MultExprTrait< ST1, SMatScalarDivExpr<MT,ST2,SO> >::Type >::Type
696  operator*( ST1 scalar, const SMatScalarDivExpr<MT,ST2,SO>& mat )
697 {
699 
700  return mat.leftOperand() * ( scalar / mat.rightOperand() );
701 }
703 //*************************************************************************************************
704 
705 
706 //*************************************************************************************************
719 template< typename MT // Type of the sparse matrix of the left-hand side expression
720  , typename ST1 // Type of the scalar of the left-hand side expression
721  , bool SO // Storage order of the sparse matrix
722  , typename ST2 > // Type of the right-hand side scalar
723 inline const typename EnableIf< IsNumeric<ST2>
724  , typename DivExprTrait<MT,typename MultTrait<ST1,ST2>::Type>::Type >::Type
725  operator/( const SMatScalarDivExpr<MT,ST1,SO>& mat, ST2 scalar )
726 {
728 
729  BLAZE_USER_ASSERT( scalar != ST2(0), "Division by zero detected" );
730 
731  typedef typename MultTrait<ST1,ST2>::Type MultType;
732  typedef typename DivExprTrait<MT,MultType>::Type ReturnType;
733  typedef typename ReturnType::RightOperand ScalarType;
734 
735  if( IsMultExpr<ReturnType>::value ) {
736  return ReturnType( mat.leftOperand(), ScalarType(1)/( mat.rightOperand() * scalar ) );
737  }
738  else {
739  return ReturnType( mat.leftOperand(), mat.rightOperand() * scalar );
740  }
741 }
743 //*************************************************************************************************
744 
745 
746 
747 
748 //=================================================================================================
749 //
750 // SMATSCALARMULTEXPRTRAIT SPECIALIZATIONS
751 //
752 //=================================================================================================
753 
754 //*************************************************************************************************
756 template< typename MT, typename ST1, typename ST2 >
757 struct SMatScalarMultExprTrait< SMatScalarDivExpr<MT,ST1,false>, ST2 >
758 {
759  private:
760  //**********************************************************************************************
761  enum { condition = IsFloatingPoint<typename DivTrait<ST1,ST2>::Type>::value };
762  //**********************************************************************************************
763 
764  //**********************************************************************************************
765  typedef typename SMatScalarMultExprTrait<MT,typename DivTrait<ST1,ST2>::Type>::Type T1;
766  typedef SMatScalarMultExpr< SMatScalarDivExpr<MT,ST1,false>, ST2, false > T2;
767  //**********************************************************************************************
768 
769  public:
770  //**********************************************************************************************
771  typedef typename SelectType< IsSparseMatrix<MT>::value && IsRowMajorMatrix<MT>::value &&
772  IsNumeric<ST1>::value && IsNumeric<ST2>::value
773  , typename SelectType<condition,T1,T2>::Type
774  , INVALID_TYPE >::Type Type;
775  //**********************************************************************************************
776 };
778 //*************************************************************************************************
779 
780 
781 
782 
783 //=================================================================================================
784 //
785 // TSMATSCALARMULTEXPRTRAIT SPECIALIZATIONS
786 //
787 //=================================================================================================
788 
789 //*************************************************************************************************
791 template< typename MT, typename ST1, typename ST2 >
792 struct TSMatScalarMultExprTrait< SMatScalarDivExpr<MT,ST1,true>, ST2 >
793 {
794  private:
795  //**********************************************************************************************
796  enum { condition = IsFloatingPoint<typename DivTrait<ST1,ST2>::Type>::value };
797  //**********************************************************************************************
798 
799  //**********************************************************************************************
800  typedef typename SMatScalarMultExprTrait<MT,typename DivTrait<ST1,ST2>::Type>::Type T1;
801  typedef SMatScalarMultExpr< SMatScalarDivExpr<MT,ST1,true>, ST2, true > T2;
802  //**********************************************************************************************
803 
804  public:
805  //**********************************************************************************************
806  typedef typename SelectType< IsSparseMatrix<MT>::value && IsColumnMajorMatrix<MT>::value &&
807  IsNumeric<ST1>::value && IsNumeric<ST2>::value
808  , typename SelectType<condition,T1,T2>::Type
809  , INVALID_TYPE >::Type Type;
810  //**********************************************************************************************
811 };
813 //*************************************************************************************************
814 
815 
816 
817 
818 //=================================================================================================
819 //
820 // SUBMATRIXEXPRTRAIT SPECIALIZATIONS
821 //
822 //=================================================================================================
823 
824 //*************************************************************************************************
826 template< typename MT, typename ST, bool SO >
827 struct SubmatrixExprTrait< SMatScalarDivExpr<MT,ST,SO> >
828 {
829  public:
830  //**********************************************************************************************
831  typedef typename DivExprTrait< typename SubmatrixExprTrait<const MT>::Type, ST >::Type Type;
832  //**********************************************************************************************
833 };
835 //*************************************************************************************************
836 
837 
838 
839 
840 //=================================================================================================
841 //
842 // ROWEXPRTRAIT SPECIALIZATIONS
843 //
844 //=================================================================================================
845 
846 //*************************************************************************************************
848 template< typename MT, typename ST, bool SO >
849 struct RowExprTrait< SMatScalarDivExpr<MT,ST,SO> >
850 {
851  public:
852  //**********************************************************************************************
853  typedef typename DivExprTrait< typename RowExprTrait<const MT>::Type, ST >::Type Type;
854  //**********************************************************************************************
855 };
857 //*************************************************************************************************
858 
859 
860 
861 
862 //=================================================================================================
863 //
864 // COLUMNEXPRTRAIT SPECIALIZATIONS
865 //
866 //=================================================================================================
867 
868 //*************************************************************************************************
870 template< typename MT, typename ST, bool SO >
871 struct ColumnExprTrait< SMatScalarDivExpr<MT,ST,SO> >
872 {
873  public:
874  //**********************************************************************************************
875  typedef typename DivExprTrait< typename ColumnExprTrait<const MT>::Type, ST >::Type Type;
876  //**********************************************************************************************
877 };
879 //*************************************************************************************************
880 
881 } // namespace blaze
882 
883 #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:158
#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:121
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
PointerType pointer
Pointer return type.
Definition: SMatScalarDivExpr.h:186
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:196
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:324
ReturnType operator()(size_t i, size_t j) const
2D-access to the matrix elements.
Definition: SMatScalarDivExpr.h:311
Header file for the IsColumnMajorMatrix type trait.
ValueType value_type
Type of the underlying pointers.
Definition: SMatScalarDivExpr.h:185
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:2375
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:248
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:216
ResultType::TransposeType TransposeType
Transpose type for expression template evaluations.
Definition: SMatScalarDivExpr.h:148
Header file for the RequiresEvaluation type trait.
MT::ResultType RT
Result type of the sparse matrix expression.
Definition: SMatScalarDivExpr.h:106
ConstIterator(IteratorType matrix, RightOperand scalar)
Constructor for the ConstIterator class.
Definition: SMatScalarDivExpr.h:194
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:236
ValueType * PointerType
Pointer return type.
Definition: SMatScalarDivExpr.h:179
bool canAlias(const T *alias) const
Returns whether the expression can alias with the given address alias.
Definition: SMatScalarDivExpr.h:408
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:298
Header file for the DivExprTrait class template.
RightOperand scalar_
Right-hand side scalar of the division expression.
Definition: SMatScalarDivExpr.h:428
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.
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:147
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:250
Header file for the ValueIndexPair class.
ST RightOperand
Composite type of the right-hand side scalar value.
Definition: SMatScalarDivExpr.h:161
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:177
Header file for the IsFloatingPoint type trait.
Iterator over the elements of the sparse matrix/scalar division expression.
Definition: SMatScalarDivExpr.h:167
RemoveReference< LeftOperand >::Type::ConstIterator IteratorType
Iterator type of the sparse matrix expression.
Definition: SMatScalarDivExpr.h:175
bool isAliased(const T *alias) const
Returns whether the expression is aliased with the given address alias.
Definition: SMatScalarDivExpr.h:420
Header file for the IsMultExpr type trait class.
MultTrait< RT, ST >::Type ResultType
Result type for expression template evaluations.
Definition: SMatScalarDivExpr.h:146
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2379
IteratorCategory iterator_category
The iterator category.
Definition: SMatScalarDivExpr.h:184
MT::CompositeType CT
Composite type of the sparse matrix expression.
Definition: SMatScalarDivExpr.h:108
size_t rows() const
Returns the current number of rows of the matrix.
Definition: SMatScalarDivExpr.h:345
ReferenceType reference
Reference return type.
Definition: SMatScalarDivExpr.h:187
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:188
LeftOperand leftOperand() const
Returns the left-hand side sparse matrix operand.
Definition: SMatScalarDivExpr.h:386
#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:149
bool operator==(const ConstIterator &rhs) const
Equality comparison between two ConstIterator objects.
Definition: SMatScalarDivExpr.h:257
#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:145
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:355
SelectType< useAssign, const ResultType, const SMatScalarDivExpr & >::Type CompositeType
Data type for composite expression templates.
Definition: SMatScalarDivExpr.h:155
const SelectType< returnExpr, ExprReturnType, ElementType >::Type ReturnType
Return type for expression template evaluations.
Definition: SMatScalarDivExpr.h:152
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:396
Header file for the IsNumeric type trait.
bool operator!=(const ConstIterator &rhs) const
Inequality comparison between two ConstIterator objects.
Definition: SMatScalarDivExpr.h:268
Header file for the SubmatrixExprTrait class template.
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:2374
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:180
Header file for run time assertion macros.
size_t index() const
Access to the current index of the sparse element.
Definition: SMatScalarDivExpr.h:246
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:279
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:376
ConstIterator & operator++()
Pre-increment operator.
Definition: SMatScalarDivExpr.h:205
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:178
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:287
Header file for the RemoveReference type trait.
IteratorType matrix_
Iterator over the elements of the left-hand side sparse matrix expression.
Definition: SMatScalarDivExpr.h:286
#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:226
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:427
ptrdiff_t DifferenceType
Difference between two iterators.
Definition: SMatScalarDivExpr.h:181
#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:2370
Header file for basic type definitions.
size_t nonZeros() const
Returns the number of non-zero elements in the sparse matrix.
Definition: SMatScalarDivExpr.h:365
Header file for the MatScalarDivExpr base class.
ValueIndexPair< ElementType > Element
Element type of the sparse matrix expression.
Definition: SMatScalarDivExpr.h:172
ConstIterator end(size_t i) const
Returns an iterator just past the last non-zero element of row i.
Definition: SMatScalarDivExpr.h:335
#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:107
Header file for the IsExpression type trait class.
Header file for the FunctionTrace class.