All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SVecAbsExpr.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_EXPRESSIONS_SVECABSEXPR_H_
36 #define _BLAZE_MATH_EXPRESSIONS_SVECABSEXPR_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
43 #include <cmath>
44 #include <iterator>
64 #include <blaze/util/Assert.h>
66 #include <blaze/util/EnableIf.h>
67 #include <blaze/util/InvalidType.h>
69 #include <blaze/util/SelectType.h>
70 #include <blaze/util/Types.h>
72 
73 
74 namespace blaze {
75 
76 //=================================================================================================
77 //
78 // CLASS SVECABSEXPR
79 //
80 //=================================================================================================
81 
82 //*************************************************************************************************
89 template< typename VT // Type of the sparse vector
90  , bool TF > // Transpose flag
91 class SVecAbsExpr : public SparseVector< SVecAbsExpr<VT,TF>, TF >
92  , private VecAbsExpr
93  , private Computation
94 {
95  private:
96  //**Type definitions****************************************************************************
97  typedef typename VT::ResultType RT;
98  typedef typename VT::ReturnType RN;
99  typedef typename VT::CompositeType CT;
100  typedef typename VT::TransposeType TT;
101  typedef typename VT::ElementType ET;
102  //**********************************************************************************************
103 
104  //**Return type evaluation**********************************************************************
106 
111  enum { returnExpr = !IsTemporary<RN>::value };
112 
115  //**********************************************************************************************
116 
117  //**Serial evaluation strategy******************************************************************
119 
125  enum { useAssign = RequiresEvaluation<VT>::value };
126 
128  template< typename VT2 >
130  struct UseAssign {
131  enum { value = useAssign };
132  };
134  //**********************************************************************************************
135 
136  //**Parallel evaluation strategy****************************************************************
138 
144  template< typename VT2 >
145  struct UseSMPAssign {
146  enum { value = ( !VT2::smpAssignable || !VT::smpAssignable ) && useAssign };
147  };
149  //**********************************************************************************************
150 
151  public:
152  //**Type definitions****************************************************************************
154  typedef RT ResultType;
155  typedef TT TransposeType;
156  typedef ET ElementType;
157 
160 
163 
165  typedef typename SelectType< IsExpression<VT>::value, const VT, const VT& >::Type Operand;
166  //**********************************************************************************************
167 
168  //**Compilation flags***************************************************************************
170  enum { smpAssignable = VT::smpAssignable };
171  //**********************************************************************************************
172 
173  //**ConstIterator class definition**************************************************************
177  {
178  public:
179  //**Type definitions*************************************************************************
182 
185 
186  typedef std::forward_iterator_tag IteratorCategory;
187  typedef Element ValueType;
191 
192  // STL iterator requirements
198  //*******************************************************************************************
199 
200  //**Constructor******************************************************************************
204  : it_( it ) // Iterator over the elements of the sparse vector expression
205  {}
206  //*******************************************************************************************
207 
208  //**Prefix increment operator****************************************************************
214  ++it_;
215  return *this;
216  }
217  //*******************************************************************************************
218 
219  //**Element access operator******************************************************************
224  inline const Element operator*() const {
225  using std::abs;
226  return Element( abs( it_->value() ), it_->index() );
227  }
228  //*******************************************************************************************
229 
230  //**Element access operator******************************************************************
235  inline const ConstIterator* operator->() const {
236  return this;
237  }
238  //*******************************************************************************************
239 
240  //**Value function***************************************************************************
245  inline ReturnType value() const {
246  using std::abs;
247  return abs( it_->value() );
248  }
249  //*******************************************************************************************
250 
251  //**Index function***************************************************************************
256  inline size_t index() const {
257  return it_->index();
258  }
259  //*******************************************************************************************
260 
261  //**Equality operator************************************************************************
267  inline bool operator==( const ConstIterator& rhs ) const {
268  return it_ == rhs.it_;
269  }
270  //*******************************************************************************************
271 
272  //**Inequality operator**********************************************************************
278  inline bool operator!=( const ConstIterator& rhs ) const {
279  return it_ != rhs.it_;
280  }
281  //*******************************************************************************************
282 
283  //**Subtraction operator*********************************************************************
289  inline DifferenceType operator-( const ConstIterator& rhs ) const {
290  return it_ - rhs.it_;
291  }
292  //*******************************************************************************************
293 
294  private:
295  //**Member variables*************************************************************************
297  //*******************************************************************************************
298  };
299  //**********************************************************************************************
300 
301  //**Constructor*********************************************************************************
306  explicit inline SVecAbsExpr( const VT& sv )
307  : sv_( sv ) // Sparse vector of the absolute value expression
308  {}
309  //**********************************************************************************************
310 
311  //**Subscript operator**************************************************************************
317  inline ReturnType operator[]( size_t index ) const {
318  using std::abs;
319  BLAZE_INTERNAL_ASSERT( index < sv_.size(), "Invalid vector access index" );
320  return abs( sv_[index] );
321  }
322  //**********************************************************************************************
323 
324  //**Begin function******************************************************************************
329  inline ConstIterator begin() const {
330  return ConstIterator( sv_.begin() );
331  }
332  //**********************************************************************************************
333 
334  //**End function********************************************************************************
339  inline ConstIterator end() const {
340  return ConstIterator( sv_.end() );
341  }
342  //**********************************************************************************************
343 
344  //**Size function*******************************************************************************
349  inline size_t size() const {
350  return sv_.size();
351  }
352  //**********************************************************************************************
353 
354  //**NonZeros function***************************************************************************
359  inline size_t nonZeros() const {
360  return sv_.nonZeros();
361  }
362  //**********************************************************************************************
363 
364  //**Operand access******************************************************************************
369  inline Operand operand() const {
370  return sv_;
371  }
372  //**********************************************************************************************
373 
374  //**********************************************************************************************
380  template< typename T >
381  inline bool canAlias( const T* alias ) const {
382  return sv_.canAlias( alias );
383  }
384  //**********************************************************************************************
385 
386  //**********************************************************************************************
392  template< typename T >
393  inline bool isAliased( const T* alias ) const {
394  return sv_.isAliased( alias );
395  }
396  //**********************************************************************************************
397 
398  //**********************************************************************************************
403  inline bool canSMPAssign() const {
404  return sv_.canSMPAssign();
405  }
406  //**********************************************************************************************
407 
408  private:
409  //**Member variables****************************************************************************
411  //**********************************************************************************************
412 
413  //**Assignment to dense vectors*****************************************************************
427  template< typename VT2 > // Type of the target dense vector
428  friend inline typename EnableIf< UseAssign<VT2> >::Type
429  assign( DenseVector<VT2,TF>& lhs, const SVecAbsExpr& rhs )
430  {
432 
433  using std::abs;
434 
435  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
436 
437  assign( ~lhs, rhs.sv_ );
438  assign( ~lhs, abs( ~lhs ) );
439  }
441  //**********************************************************************************************
442 
443  //**Assignment to sparse vectors****************************************************************
457  template< typename VT2 > // Type of the target sparse vector
458  friend inline typename EnableIf< UseAssign<VT2> >::Type
459  assign( SparseVector<VT2,TF>& lhs, const SVecAbsExpr& rhs )
460  {
462 
463  using std::abs;
464 
465  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
466 
467  typedef typename VT2::Iterator Iterator;
468 
469  assign( ~lhs, rhs.sv_ );
470 
471  const Iterator end( (~lhs).end() );
472  for( Iterator element=(~lhs).begin(); element!=end; ++element ) {
473  element->value() = abs( element->value() );
474  }
475  }
477  //**********************************************************************************************
478 
479  //**Addition assignment to dense vectors********************************************************
493  template< typename VT2 > // Type of the target dense vector
494  friend inline typename EnableIf< UseAssign<VT2> >::Type
495  addAssign( DenseVector<VT2,TF>& lhs, const SVecAbsExpr& rhs )
496  {
498 
502 
503  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
504 
505  const ResultType tmp( serial( rhs ) );
506  addAssign( ~lhs, tmp );
507  }
509  //**********************************************************************************************
510 
511  //**Addition assignment to sparse vectors*******************************************************
512  // No special implementation for the addition assignment to sparse vectors.
513  //**********************************************************************************************
514 
515  //**Subtraction assignment to dense vectors*****************************************************
529  template< typename VT2 > // Type of the target dense vector
530  friend inline typename EnableIf< UseAssign<VT2> >::Type
531  subAssign( DenseVector<VT2,TF>& lhs, const SVecAbsExpr& rhs )
532  {
534 
538 
539  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
540 
541  const ResultType tmp( serial( rhs ) );
542  subAssign( ~lhs, tmp );
543  }
545  //**********************************************************************************************
546 
547  //**Subtraction assignment to sparse vectors****************************************************
548  // No special implementation for the subtraction assignment to sparse vectors.
549  //**********************************************************************************************
550 
551  //**Multiplication assignment to dense vectors**************************************************
565  template< typename VT2 > // Type of the target dense vector
566  friend inline typename EnableIf< UseAssign<VT2> >::Type
567  multAssign( DenseVector<VT2,TF>& lhs, const SVecAbsExpr& rhs )
568  {
570 
574 
575  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
576 
577  const ResultType tmp( serial( rhs ) );
578  multAssign( ~lhs, tmp );
579  }
581  //**********************************************************************************************
582 
583  //**Multiplication assignment to sparse vectors*************************************************
584  // No special implementation for the multiplication assignment to sparse vectors.
585  //**********************************************************************************************
586 
587  //**SMP assignment to dense vectors*************************************************************
601  template< typename VT2 > // Type of the target dense vector
602  friend inline typename EnableIf< UseSMPAssign<VT2> >::Type
603  smpAssign( DenseVector<VT2,TF>& lhs, const SVecAbsExpr& rhs )
604  {
606 
607  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
608 
609  smpAssign( ~lhs, rhs.sv_ );
610  smpAssign( ~lhs, abs( ~lhs ) );
611  }
613  //**********************************************************************************************
614 
615  //**SMP assignment to sparse vectors************************************************************
616  // No special implementation for the SMP assignment to sparse vectors.
617  //**********************************************************************************************
618 
619  //**SMP addition assignment to dense vectors****************************************************
633  template< typename VT2 > // Type of the target dense vector
634  friend inline typename EnableIf< UseSMPAssign<VT2> >::Type
635  smpAddAssign( DenseVector<VT2,TF>& lhs, const SVecAbsExpr& rhs )
636  {
638 
642 
643  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
644 
645  const ResultType tmp( rhs );
646  smpAddAssign( ~lhs, tmp );
647  }
649  //**********************************************************************************************
650 
651  //**SMP addition assignment to sparse vectors***************************************************
652  // No special implementation for the SMP addition assignment to sparse vectors.
653  //**********************************************************************************************
654 
655  //**SMP subtraction assignment to dense vectors*************************************************
669  template< typename VT2 > // Type of the target dense vector
670  friend inline typename EnableIf< UseSMPAssign<VT2> >::Type
671  smpSubAssign( DenseVector<VT2,TF>& lhs, const SVecAbsExpr& rhs )
672  {
674 
678 
679  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
680 
681  const ResultType tmp( rhs );
682  smpSubAssign( ~lhs, tmp );
683  }
685  //**********************************************************************************************
686 
687  //**SMP subtraction assignment to sparse vectors************************************************
688  // No special implementation for the SMP subtraction assignment to sparse vectors.
689  //**********************************************************************************************
690 
691  //**SMP multiplication assignment to dense vectors**********************************************
705  template< typename VT2 > // Type of the target dense vector
706  friend inline typename EnableIf< UseSMPAssign<VT2> >::Type
707  smpMultAssign( DenseVector<VT2,TF>& lhs, const SVecAbsExpr& rhs )
708  {
710 
714 
715  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
716 
717  const ResultType tmp( rhs );
718  smpMultAssign( ~lhs, tmp );
719  }
721  //**********************************************************************************************
722 
723  //**SMP multiplication assignment to sparse vectors*********************************************
724  // No special implementation for the SMP multiplication assignment to sparse vectors.
725  //**********************************************************************************************
726 
727  //**Compile time checks*************************************************************************
732  //**********************************************************************************************
733 };
734 //*************************************************************************************************
735 
736 
737 
738 
739 //=================================================================================================
740 //
741 // GLOBAL FUNCTIONS
742 //
743 //=================================================================================================
744 
745 //*************************************************************************************************
762 template< typename VT // Type of the sparse vector
763  , bool TF > // Transpose flag
764 inline const SVecAbsExpr<VT,TF> abs( const SparseVector<VT,TF>& sv )
765 {
767 
768  return SVecAbsExpr<VT,TF>( ~sv );
769 }
770 //*************************************************************************************************
771 
772 
773 
774 
775 //=================================================================================================
776 //
777 // GLOBAL RESTRUCTURING FUNCTIONS
778 //
779 //=================================================================================================
780 
781 //*************************************************************************************************
792 template< typename VT // Type of the sparse vector
793  , bool TF > // Transpose flag
794 inline const SVecAbsExpr<VT,TF>& abs( const SVecAbsExpr<VT,TF>& sv )
795 {
797 
798  return sv;
799 }
801 //*************************************************************************************************
802 
803 
804 
805 
806 //=================================================================================================
807 //
808 // EXPRESSION TRAIT SPECIALIZATIONS
809 //
810 //=================================================================================================
811 
812 //*************************************************************************************************
814 template< typename VT >
815 struct SVecAbsExprTrait< SVecAbsExpr<VT,false> >
816 {
817  public:
818  //**********************************************************************************************
819  typedef typename SelectType< IsSparseVector<VT>::value && IsColumnVector<VT>::value
820  , SVecAbsExpr<VT,false>
821  , INVALID_TYPE >::Type Type;
822  //**********************************************************************************************
823 };
825 //*************************************************************************************************
826 
827 
828 //*************************************************************************************************
830 template< typename VT >
831 struct TSVecAbsExprTrait< SVecAbsExpr<VT,true> >
832 {
833  public:
834  //**********************************************************************************************
835  typedef typename SelectType< IsSparseVector<VT>::value && IsRowVector<VT>::value
836  , SVecAbsExpr<VT,true>
837  , INVALID_TYPE >::Type Type;
838  //**********************************************************************************************
839 };
841 //*************************************************************************************************
842 
843 
844 //*************************************************************************************************
846 template< typename VT, bool TF, bool AF >
847 struct SubvectorExprTrait< SVecAbsExpr<VT,TF>, AF >
848 {
849  public:
850  //**********************************************************************************************
851  typedef typename AbsExprTrait< typename SubvectorExprTrait<const VT,AF>::Type >::Type Type;
852  //**********************************************************************************************
853 };
855 //*************************************************************************************************
856 
857 } // namespace blaze
858 
859 #endif
Pointer difference type of the Blaze library.
ptrdiff_t DifferenceType
Difference between two iterators.
Definition: SVecAbsExpr.h:190
Header file for the TSVecAbsExprTrait class template.
Compile time check whether the given type is a temporary vector or matrix type.This type trait class ...
Definition: IsTemporary.h:87
VT::ReturnType RN
Return type of the sparse vector expression.
Definition: SVecAbsExpr.h:98
Header file for the SparseVector base class.
void smpSubAssign(DenseMatrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP subtraction assignment of a matrix to dense matrix.
Definition: DenseMatrix.h:152
void smpMultAssign(DenseVector< VT1, TF1 > &lhs, const Vector< VT2, TF2 > &rhs)
Default implementation of the SMP multiplication assignment of a vector to a dense vector...
Definition: DenseVector.h:179
const SVecAbsExpr< VT, TF > abs(const SparseVector< VT, TF > &sv)
Returns a vector containing the absolute values of each single element of sv.
Definition: SVecAbsExpr.h:764
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:2408
SelectType< useAssign, const ResultType, const SVecAbsExpr & >::Type CompositeType
Data type for composite expression templates.
Definition: SVecAbsExpr.h:162
Header file for the IsRowVector type trait.
IteratorCategory iterator_category
The iterator category.
Definition: SVecAbsExpr.h:193
const DMatAbsExpr< MT, SO > abs(const DenseMatrix< MT, SO > &dm)
Returns a matrix containing the absolute values of each single element of dm.
Definition: DMatAbsExpr.h:903
ReturnType value() const
Access to the current value of the sparse element.
Definition: SVecAbsExpr.h:245
const DMatSerialExpr< MT, SO > serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:690
Header file for the Computation base class.
Header file for the SVecAbsExprTrait class template.
Header file for the RequiresEvaluation type trait.
ValueType * PointerType
Pointer return type.
Definition: SVecAbsExpr.h:188
DifferenceType operator-(const ConstIterator &rhs) const
Calculating the number of elements between two expression iterators.
Definition: SVecAbsExpr.h:289
VT::ElementType ET
Element type of the sparse vector expression.
Definition: SVecAbsExpr.h:101
Expression object for the sparse vector abs() function.The SVecAbsExpr class represents the compile t...
Definition: Forward.h:109
const SelectType< returnExpr, ExprReturnType, ElementType >::Type ReturnType
Return type for expression template evaluations.
Definition: SVecAbsExpr.h:159
ConstIterator begin() const
Returns an iterator to the first non-zero element of the sparse vector.
Definition: SVecAbsExpr.h:329
Constraint on the data type.
RT ResultType
Result type for expression template evaluations.
Definition: SVecAbsExpr.h:154
ValueType value_type
Type of the underlying pointers.
Definition: SVecAbsExpr.h:194
void smpAddAssign(DenseMatrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP addition assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:122
Compile time check to query the requirement to evaluate an expression.Via this type trait it is possi...
Definition: RequiresEvaluation.h:90
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:253
ValueType & ReferenceType
Reference return type.
Definition: SVecAbsExpr.h:189
Header file for the ValueIndexPair class.
Compile time type selection.The SelectType class template selects one of the two given types T1 and T...
Definition: SelectType.h:59
bool operator!=(const ConstIterator &rhs) const
Inequality comparison between two ConstIterator objects.
Definition: SVecAbsExpr.h:278
Header file for the IsTemporary type trait class.
IteratorType it_
Iterator over the elements of the sparse vector expression.
Definition: SVecAbsExpr.h:296
ConstIterator(IteratorType it)
Constructor for the ConstIterator class.
Definition: SVecAbsExpr.h:203
size_t nonZeros() const
Returns the number of non-zero elements in the sparse vector.
Definition: SVecAbsExpr.h:359
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2412
void assign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the assignment of a matrix to a matrix.
Definition: Matrix.h:271
size_t index() const
Access to the current index of the sparse element.
Definition: SVecAbsExpr.h:256
Base class for N-dimensional dense vectors.The DenseVector class is a base class for all arbitrarily ...
Definition: DenseVector.h:70
ET ElementType
Resulting element type.
Definition: SVecAbsExpr.h:156
#define BLAZE_CONSTRAINT_MUST_BE_SPARSE_VECTOR_TYPE(T)
Constraint on the data type.In case the given data type T is not a sparse, N-dimensional vector type...
Definition: SparseVector.h:79
Header file for the VecAbsExpr base class.
Constraint on the data type.
Element ValueType
Type of the underlying pointers.
Definition: SVecAbsExpr.h:187
#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
CompressedMatrix< Type, false > TransposeType
Transpose type for expression template evaluations.
Definition: CompressedMatrix.h:2405
DifferenceType difference_type
Difference between two iterators.
Definition: SVecAbsExpr.h:197
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:2406
void multAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the multiplication assignment of a matrix to a matrix.
Definition: Matrix.h:361
ValueIndexPair< ElementType > Element
Element type of the sparse vector expression.
Definition: SVecAbsExpr.h:181
Header file for the SelectType class template.
Header file for all forward declarations for expression class templates.
Constraint on the data type.
ReferenceType reference
Reference return type.
Definition: SVecAbsExpr.h:196
AbsExprTrait< RN >::Type ExprReturnType
Expression return type for the subscript operator.
Definition: SVecAbsExpr.h:114
Header file for the EnableIf class template.
VT::TransposeType TT
Transpose type of the sparse vector expression.
Definition: SVecAbsExpr.h:100
Header file for the serial shim.
RemoveReference< Operand >::Type::ConstIterator IteratorType
Iterator type of the sparse vector expression.
Definition: SVecAbsExpr.h:184
void smpAssign(DenseMatrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:92
ConstIterator end() const
Returns an iterator just past the last non-zero element of the sparse vector.
Definition: SVecAbsExpr.h:339
Operand sv_
Sparse vector of the absolute value expression.
Definition: SVecAbsExpr.h:410
Header file for the IsSparseVector type trait.
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:2407
Removal of reference modifiers.The RemoveCV type trait removes any reference modifiers from the given...
Definition: RemoveReference.h:69
Iterator over the elements of the sparse vector absolute value expression.
Definition: SVecAbsExpr.h:176
SVecAbsExpr< VT, TF > This
Type of this SVecAbsExpr instance.
Definition: SVecAbsExpr.h:153
Header file for run time assertion macros.
Utility type for generic codes.
ReturnType operator[](size_t index) const
Subscript operator for the direct access to the vector elements.
Definition: SVecAbsExpr.h:317
void addAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the addition assignment of a matrix to a matrix.
Definition: Matrix.h:301
bool isAliased(const T *alias) const
Returns whether the expression is aliased with the given address alias.
Definition: SVecAbsExpr.h:393
VT::ResultType RT
Result type of the sparse vector expression.
Definition: SVecAbsExpr.h:97
Substitution Failure Is Not An Error (SFINAE) class.The EnableIf class template is an auxiliary tool ...
Definition: EnableIf.h:184
void subAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the subtraction assignment of a matrix to matrix.
Definition: Matrix.h:331
Element * Iterator
Iterator over non-constant elements.
Definition: CompressedMatrix.h:2411
std::forward_iterator_tag IteratorCategory
The iterator category.
Definition: SVecAbsExpr.h:186
Header file for the RemoveReference type trait.
bool canAlias(const T *alias) const
Returns whether the expression can alias with the given address alias.
Definition: SVecAbsExpr.h:381
VT::CompositeType CT
Composite type of the sparse vector expression.
Definition: SVecAbsExpr.h:99
PointerType pointer
Pointer return type.
Definition: SVecAbsExpr.h:195
Index-value-pair for sparse vectors and matrices.The ValueIndexPair class represents a single index-v...
Definition: ValueIndexPair.h:69
Header file for the IsComputation type trait class.
bool canSMPAssign() const
Returns whether the expression can be used in SMP assignments.
Definition: SVecAbsExpr.h:403
TT TransposeType
Transpose type for expression template evaluations.
Definition: SVecAbsExpr.h:155
Base class for sparse vectors.The SparseVector class is a base class for all arbitrarily sized (N-dim...
Definition: Forward.h:108
#define BLAZE_FUNCTION_TRACE
Function trace macro.This macro can be used to reliably trace function calls. In case function tracin...
Definition: FunctionTrace.h:157
This ResultType
Result type for expression template evaluations.
Definition: CompressedMatrix.h:2403
Header file for basic type definitions.
Header file for the SubvectorExprTrait class template.
const Element operator*() const
Direct access to the sparse vector element at the current iterator position.
Definition: SVecAbsExpr.h:224
Header file for the AbsExprTrait class template.
SelectType< IsExpression< VT >::value, const VT, const VT & >::Type Operand
Composite data type of the sparse vector expression.
Definition: SVecAbsExpr.h:165
Header file for the IsColumnVector type trait.
Evaluation of the return type of an absolute value expression.Via this type trait it is possible to e...
Definition: AbsExprTrait.h:86
const ConstIterator * operator->() const
Direct access to the sparse vector element at the current iterator position.
Definition: SVecAbsExpr.h:235
ConstIterator & operator++()
Pre-increment operator.
Definition: SVecAbsExpr.h:213
bool operator==(const ConstIterator &rhs) const
Equality comparison between two ConstIterator objects.
Definition: SVecAbsExpr.h:267
#define BLAZE_CONSTRAINT_MUST_BE_VECTOR_WITH_TRANSPOSE_FLAG(T, TF)
Constraint on the data type.In case the given data type T is not a dense or sparse vector type and in...
Definition: TransposeFlag.h:238
#define BLAZE_INTERNAL_ASSERT(expr, msg)
Run time assertion macro for internal checks.In case of an invalid run time expression, the program execution is terminated. The BLAZE_INTERNAL_ASSERT macro can be disabled by setting the BLAZE_USER_ASSERTION flag to zero or by defining NDEBUG during the compilation.
Definition: Assert.h:101
Header file for the IsExpression type trait class.
Header file for the FunctionTrace class.
size_t size() const
Returns the current size/dimension of the vector.
Definition: SVecAbsExpr.h:349
Operand operand() const
Returns the sparse vector operand.
Definition: SVecAbsExpr.h:369
SVecAbsExpr(const VT &sv)
Constructor for the SVecAbsExpr class.
Definition: SVecAbsExpr.h:306