SVecTransExpr.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_EXPRESSIONS_SVECTRANSEXPR_H_
36 #define _BLAZE_MATH_EXPRESSIONS_SVECTRANSEXPR_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
43 #include <iterator>
62 #include <blaze/util/Assert.h>
63 #include <blaze/util/EmptyType.h>
64 #include <blaze/util/EnableIf.h>
65 #include <blaze/util/Exception.h>
66 #include <blaze/util/InvalidType.h>
68 #include <blaze/util/SelectType.h>
69 #include <blaze/util/Types.h>
71 
72 
73 namespace blaze {
74 
75 //=================================================================================================
76 //
77 // CLASS SVECTRANSEXPR
78 //
79 //=================================================================================================
80 
81 //*************************************************************************************************
88 template< typename VT // Type of the sparse vector
89  , bool TF > // Transpose flag
90 class SVecTransExpr : public SparseVector< SVecTransExpr<VT,TF>, TF >
91  , private VecTransExpr
92  , private SelectType< IsComputation<VT>::value, Computation, EmptyType >::Type
93 {
94  private:
95  //**Type definitions****************************************************************************
96  typedef typename VT::CompositeType CT;
97  //**********************************************************************************************
98 
99  //**Serial evaluation strategy******************************************************************
101 
107  enum { useAssign = RequiresEvaluation<VT>::value };
108 
110  template< typename VT2 >
112  struct UseAssign {
113  enum { value = useAssign };
114  };
116  //**********************************************************************************************
117 
118  //**Parallel evaluation strategy****************************************************************
120 
125  template< typename VT2 >
126  struct UseSMPAssign {
127  enum { value = VT2::smpAssignable && useAssign };
128  };
130  //**********************************************************************************************
131 
132  public:
133  //**Type definitions****************************************************************************
135  typedef typename VT::TransposeType ResultType;
136  typedef typename VT::ResultType TransposeType;
137  typedef typename VT::ElementType ElementType;
138  typedef typename VT::ReturnType ReturnType;
139 
142 
144  typedef typename SelectType< IsExpression<VT>::value, const VT, const VT& >::Type Operand;
145  //**********************************************************************************************
146 
147  //**Compilation flags***************************************************************************
149  enum { smpAssignable = VT::smpAssignable };
150  //**********************************************************************************************
151 
152  //**ConstIterator class definition**************************************************************
156  {
157  public:
158  //**Type definitions*************************************************************************
161 
162  typedef std::forward_iterator_tag IteratorCategory;
163  typedef typename std::iterator_traits<IteratorType>::value_type ValueType;
164  typedef typename std::iterator_traits<IteratorType>::pointer PointerType;
165  typedef typename std::iterator_traits<IteratorType>::reference ReferenceType;
166  typedef typename std::iterator_traits<IteratorType>::difference_type DifferenceType;
167 
168  // STL iterator requirements
169  typedef IteratorCategory iterator_category;
170  typedef ValueType value_type;
171  typedef PointerType pointer;
172  typedef ReferenceType reference;
173  typedef DifferenceType difference_type;
174  //*******************************************************************************************
175 
176  //**Constructor******************************************************************************
179  inline ConstIterator( IteratorType it )
180  : it_( it ) // Iterator over the elements of the sparse vector expression
181  {}
182  //*******************************************************************************************
183 
184  //**Prefix increment operator****************************************************************
190  ++it_;
191  return *this;
192  }
193  //*******************************************************************************************
194 
195  //**Element access operator******************************************************************
200  inline const ValueType operator*() const {
201  return *it_;
202  }
203  //*******************************************************************************************
204 
205  //**Element access operator******************************************************************
210  inline const ConstIterator* operator->() const {
211  return this;
212  }
213  //*******************************************************************************************
214 
215  //**Value function***************************************************************************
220  inline ReturnType value() const {
221  return it_->value();
222  }
223  //*******************************************************************************************
224 
225  //**Index function***************************************************************************
230  inline size_t index() const {
231  return it_->index();
232  }
233  //*******************************************************************************************
234 
235  //**Equality operator************************************************************************
241  inline bool operator==( const ConstIterator& rhs ) const {
242  return it_ == rhs.it_;
243  }
244  //*******************************************************************************************
245 
246  //**Inequality operator**********************************************************************
252  inline bool operator!=( const ConstIterator& rhs ) const {
253  return it_ != rhs.it_;
254  }
255  //*******************************************************************************************
256 
257  //**Subtraction operator*********************************************************************
263  inline DifferenceType operator-( const ConstIterator& rhs ) const {
264  return it_ - rhs.it_;
265  }
266  //*******************************************************************************************
267 
268  private:
269  //**Member variables*************************************************************************
270  IteratorType it_;
271  //*******************************************************************************************
272  };
273  //**********************************************************************************************
274 
275  //**Constructor*********************************************************************************
280  explicit inline SVecTransExpr( const VT& sv )
281  : sv_( sv ) // Sparse vector of the transposition expression
282  {}
283  //**********************************************************************************************
284 
285  //**Subscript operator**************************************************************************
291  inline ReturnType operator[]( size_t index ) const {
292  BLAZE_INTERNAL_ASSERT( index < sv_.size(), "Invalid vector access index" );
293  return sv_[index];
294  }
295  //**********************************************************************************************
296 
297  //**At function*********************************************************************************
304  inline ReturnType at( size_t index ) const {
305  if( index >= sv_.size() ) {
306  BLAZE_THROW_OUT_OF_RANGE( "Invalid vector access index" );
307  }
308  return (*this)[index];
309  }
310  //**********************************************************************************************
311 
312  //**Begin function******************************************************************************
317  inline ConstIterator begin() const {
318  return ConstIterator( sv_.begin() );
319  }
320  //**********************************************************************************************
321 
322  //**End function********************************************************************************
327  inline ConstIterator end() const {
328  return ConstIterator( sv_.end() );
329  }
330  //**********************************************************************************************
331 
332  //**Size function*******************************************************************************
337  inline size_t size() const {
338  return sv_.size();
339  }
340  //**********************************************************************************************
341 
342  //**NonZeros function***************************************************************************
347  inline size_t nonZeros() const {
348  return sv_.nonZeros();
349  }
350  //**********************************************************************************************
351 
352  //**Find function*******************************************************************************
358  inline ConstIterator find( size_t index ) const {
360  return ConstIterator( sv_.find( index ) );
361  }
362  //**********************************************************************************************
363 
364  //**LowerBound function*************************************************************************
370  inline ConstIterator lowerBound( size_t index ) const {
372  return ConstIterator( sv_.lowerBound( index ) );
373  }
374  //**********************************************************************************************
375 
376  //**UpperBound function*************************************************************************
382  inline ConstIterator upperBound( size_t index ) const {
384  return ConstIterator( sv_.upperBound( index ) );
385  }
386  //**********************************************************************************************
387 
388  //**Operand access******************************************************************************
393  inline Operand operand() const {
394  return sv_;
395  }
396  //**********************************************************************************************
397 
398  //**********************************************************************************************
404  template< typename T >
405  inline bool canAlias( const T* alias ) const {
406  return sv_.canAlias( alias );
407  }
408  //**********************************************************************************************
409 
410  //**********************************************************************************************
416  template< typename T >
417  inline bool isAliased( const T* alias ) const {
418  return sv_.isAliased( alias );
419  }
420  //**********************************************************************************************
421 
422  //**********************************************************************************************
427  inline bool canSMPAssign() const {
428  return sv_.canSMPAssign();
429  }
430  //**********************************************************************************************
431 
432  private:
433  //**Member variables****************************************************************************
434  Operand sv_;
435  //**********************************************************************************************
436 
437  //**Assignment to dense vectors*****************************************************************
451  template< typename VT2 > // Type of the target dense vector
452  friend inline typename EnableIf< UseAssign<VT2> >::Type
453  assign( DenseVector<VT2,TF>& lhs, const SVecTransExpr& rhs )
454  {
456 
457  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
458 
459  DVecTransposer<VT2,!TF> tmp( ~lhs );
460  assign( tmp, rhs.sv_ );
461  }
463  //**********************************************************************************************
464 
465  //**Assignment to sparse vectors****************************************************************
479  template< typename VT2 > // Type of the target sparse vector
480  friend inline typename EnableIf< UseAssign<VT2> >::Type
481  assign( SparseVector<VT2,TF>& lhs, const SVecTransExpr& rhs )
482  {
484 
485  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
486 
487  SVecTransposer<VT2,!TF> tmp( ~lhs );
488  assign( tmp, rhs.sv_ );
489  }
491  //**********************************************************************************************
492 
493  //**Addition assignment to dense vectors********************************************************
507  template< typename VT2 > // Type of the target dense vector
508  friend inline typename EnableIf< UseAssign<VT2> >::Type
509  addAssign( DenseVector<VT2,TF>& lhs, const SVecTransExpr& rhs )
510  {
512 
513  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
514 
515  DVecTransposer<VT2,!TF> tmp( ~lhs );
516  addAssign( tmp, rhs.sv_ );
517  }
519  //**********************************************************************************************
520 
521  //**Addition assignment to sparse vectors*******************************************************
522  // No special implementation for the addition assignment to sparse vectors.
523  //**********************************************************************************************
524 
525  //**Subtraction assignment to dense vectors*****************************************************
539  template< typename VT2 > // Type of the target dense vector
540  friend inline typename EnableIf< UseAssign<VT2> >::Type
541  subAssign( DenseVector<VT2,TF>& lhs, const SVecTransExpr& rhs )
542  {
544 
545  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
546 
547  DVecTransposer<VT2,!TF> tmp( ~lhs );
548  subAssign( tmp, rhs.sv_ );
549  }
551  //**********************************************************************************************
552 
553  //**Subtraction assignment to sparse vectors****************************************************
554  // No special implementation for the subtraction assignment to sparse vectors.
555  //**********************************************************************************************
556 
557  //**Multiplication assignment to dense vectors**************************************************
571  template< typename VT2 > // Type of the target dense vector
572  friend inline typename EnableIf< UseAssign<VT2> >::Type
573  multAssign( DenseVector<VT2,TF>& lhs, const SVecTransExpr& rhs )
574  {
576 
577  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
578 
579  DVecTransposer<VT2,!TF> tmp( ~lhs );
580  multAssign( tmp, rhs.sv_ );
581  }
583  //**********************************************************************************************
584 
585  //**Multiplication assignment to sparse vectors*************************************************
586  // No special implementation for the multiplication assignment to sparse vectors.
587  //**********************************************************************************************
588 
589  //**SMP assignment to dense vectors*************************************************************
603  template< typename VT2 > // Type of the target dense vector
604  friend inline typename EnableIf< UseSMPAssign<VT2> >::Type
605  smpAssign( DenseVector<VT2,TF>& lhs, const SVecTransExpr& rhs )
606  {
608 
609  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
610 
611  DVecTransposer<VT2,!TF> tmp( ~lhs );
612  smpAssign( tmp, rhs.sv_ );
613  }
615  //**********************************************************************************************
616 
617  //**SMP assignment to sparse vectors************************************************************
631  template< typename VT2 > // Type of the target sparse vector
632  friend inline typename EnableIf< UseSMPAssign<VT2> >::Type
633  smpAssign( SparseVector<VT2,TF>& lhs, const SVecTransExpr& rhs )
634  {
636 
637  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
638 
639  SVecTransposer<VT2,!TF> tmp( ~lhs );
640  smpAssign( tmp, rhs.sv_ );
641  }
643  //**********************************************************************************************
644 
645  //**SMP addition assignment to dense vectors****************************************************
659  template< typename VT2 > // Type of the target dense vector
660  friend inline typename EnableIf< UseSMPAssign<VT2> >::Type
661  smpAddAssign( DenseVector<VT2,TF>& lhs, const SVecTransExpr& rhs )
662  {
664 
665  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
666 
667  DVecTransposer<VT2,!TF> tmp( ~lhs );
668  smpAddAssign( tmp, rhs.sv_ );
669  }
671  //**********************************************************************************************
672 
673  //**SMP addition assignment to sparse vectors***************************************************
674  // No special implementation for the SMP addition assignment to sparse vectors.
675  //**********************************************************************************************
676 
677  //**SMP subtraction assignment to dense vectors*************************************************
691  template< typename VT2 > // Type of the target dense vector
692  friend inline typename EnableIf< UseSMPAssign<VT2> >::Type
693  smpSubAssign( DenseVector<VT2,TF>& lhs, const SVecTransExpr& rhs )
694  {
696 
697  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
698 
699  DVecTransposer<VT2,!TF> tmp( ~lhs );
700  smpSubAssign( tmp, rhs.sv_ );
701  }
703  //**********************************************************************************************
704 
705  //**SMP subtraction assignment to sparse vectors************************************************
706  // No special implementation for the SMP subtraction assignment to sparse vectors.
707  //**********************************************************************************************
708 
709  //**SMP multiplication assignment to dense vectors**********************************************
724  template< typename VT2 > // Type of the target dense vector
725  friend inline typename EnableIf< UseSMPAssign<VT2> >::Type
726  smpMultAssign( DenseVector<VT2,TF>& lhs, const SVecTransExpr& rhs )
727  {
729 
730  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
731 
732  DVecTransposer<VT2,!TF> tmp( ~lhs );
733  smpMultAssign( tmp, rhs.sv_ );
734  }
736  //**********************************************************************************************
737 
738  //**SMP multiplication assignment to sparse vectors*********************************************
739  // No special implementation for the SMP multiplication assignment to sparse vectors.
740  //**********************************************************************************************
741 
742  //**Compile time checks*************************************************************************
746  //**********************************************************************************************
747 };
748 //*************************************************************************************************
749 
750 
751 
752 
753 //=================================================================================================
754 //
755 // GLOBAL OPERATORS
756 //
757 //=================================================================================================
758 
759 //*************************************************************************************************
778 template< typename VT // Type of the sparse vector
779  , bool TF > // Transpose flag
781 {
783 
784  return SVecTransExpr<VT,!TF>( ~sv );
785 }
786 //*************************************************************************************************
787 
788 
789 
790 
791 //=================================================================================================
792 //
793 // GLOBAL RESTRUCTURING FUNCTIONS
794 //
795 //=================================================================================================
796 
797 //*************************************************************************************************
817 template< typename VT // Type of the sparse vector
818  , bool TF > // Transpose flag
819 inline typename SVecTransExpr<VT,TF>::Operand trans( const SVecTransExpr<VT,TF>& sv )
820 {
822 
823  return sv.operand();
824 }
826 //*************************************************************************************************
827 
828 
829 
830 
831 //=================================================================================================
832 //
833 // SIZE SPECIALIZATIONS
834 //
835 //=================================================================================================
836 
837 //*************************************************************************************************
839 template< typename VT, bool TF >
840 struct Size< SVecTransExpr<VT,TF> > : public Size<VT>
841 {};
843 //*************************************************************************************************
844 
845 
846 
847 
848 //=================================================================================================
849 //
850 // EXPRESSION TRAIT SPECIALIZATIONS
851 //
852 //=================================================================================================
853 
854 //*************************************************************************************************
856 template< typename VT >
857 struct SVecTransExprTrait< SVecTransExpr<VT,false> >
858 {
859  public:
860  //**********************************************************************************************
861  typedef typename SelectType< IsSparseVector<VT>::value && IsRowVector<VT>::value
862  , typename SVecTransExpr<VT,false>::Operand
863  , INVALID_TYPE >::Type Type;
864  //**********************************************************************************************
865 };
867 //*************************************************************************************************
868 
869 
870 //*************************************************************************************************
872 template< typename VT >
873 struct TSVecTransExprTrait< SVecTransExpr<VT,true> >
874 {
875  public:
876  //**********************************************************************************************
877  typedef typename SelectType< IsSparseVector<VT>::value && IsColumnVector<VT>::value
878  , typename SVecTransExpr<VT,true>::Operand
879  , INVALID_TYPE >::Type Type;
880  //**********************************************************************************************
881 };
883 //*************************************************************************************************
884 
885 
886 //*************************************************************************************************
888 template< typename VT, bool TF, bool AF >
889 struct SubvectorExprTrait< SVecTransExpr<VT,TF>, AF >
890 {
891  public:
892  //**********************************************************************************************
893  typedef typename TransExprTrait< typename SubvectorExprTrait<const VT,AF>::Type >::Type Type;
894  //**********************************************************************************************
895 };
897 //*************************************************************************************************
898 
899 } // namespace blaze
900 
901 #endif
bool canSMPAssign() const
Returns whether the expression can be used in SMP assignments.
Definition: SVecTransExpr.h:427
Operand sv_
Sparse vector of the transposition expression.
Definition: SVecTransExpr.h:434
PointerType pointer
Pointer return type.
Definition: SVecTransExpr.h:171
Header file for basic type definitions.
Header file for the SparseVector base class.
ConstIterator & operator++()
Pre-increment operator.
Definition: SVecTransExpr.h:189
bool isAliased(const T *alias) const
Returns whether the expression is aliased with the given address alias.
Definition: SVecTransExpr.h:417
ConstIterator begin() const
Returns an iterator to the first non-zero element of the sparse vector.
Definition: SVecTransExpr.h:317
std::iterator_traits< IteratorType >::pointer PointerType
Pointer return type.
Definition: SVecTransExpr.h:164
SelectType< IsExpression< VT >::value, const VT, const VT & >::Type Operand
Composite data type of the sparse vector expression.
Definition: SVecTransExpr.h:144
ValueType value_type
Type of the underlying pointers.
Definition: SVecTransExpr.h:170
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:2588
Header file for the IsRowVector type trait.
VT::TransposeType ResultType
Result type for expression template evaluations.
Definition: SVecTransExpr.h:135
Expression object for sparse vector transpositions.The SVecTransExpr class represents the compile tim...
Definition: Forward.h:135
Header file for the Computation base class.
Header file for the RequiresEvaluation type trait.
bool operator!=(const ConstIterator &rhs) const
Inequality comparison between two ConstIterator objects.
Definition: SVecTransExpr.h:252
VT::ReturnType ReturnType
Return type for expression template evaluations.
Definition: SVecTransExpr.h:138
std::forward_iterator_tag IteratorCategory
The iterator category.
Definition: SVecTransExpr.h:162
Expression object for the transposition of a dense vector.The DVecTransposer class is a wrapper objec...
Definition: DVecTransposer.h:76
ConstIterator lowerBound(size_t index) const
Returns an iterator to the first index not less then the given index.
Definition: SVecTransExpr.h:370
VT::ResultType TransposeType
Transpose type for expression template evaluations.
Definition: SVecTransExpr.h:136
SVecTransExpr(const VT &sv)
Constructor for the SVecTransExpr class.
Definition: SVecTransExpr.h:280
Compile time check to query the requirement to evaluate an expression.Via this type trait it is possi...
Definition: RequiresEvaluation.h:90
bool operator==(const ConstIterator &rhs) const
Equality comparison between two ConstIterator objects.
Definition: SVecTransExpr.h:241
const ConstIterator * operator->() const
Direct access to the sparse vector element at the current iterator position.
Definition: SVecTransExpr.h:210
Compile time type selection.The SelectType class template selects one of the two given types T1 and T...
Definition: SelectType.h:59
size_t index() const
Access to the current index of the sparse element.
Definition: SVecTransExpr.h:230
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
Header file for the dense vector transposer.
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2592
std::iterator_traits< IteratorType >::value_type ValueType
Type of the underlying pointers.
Definition: SVecTransExpr.h:163
IteratorCategory iterator_category
The iterator category.
Definition: SVecTransExpr.h:169
#define BLAZE_THROW_OUT_OF_RANGE(MESSAGE)
Macro for the emission of a std::out_of_range exceptionThis macro encapsulates the default way of Bla...
Definition: Exception.h:331
Iterator over the elements of the sparse vector absolute value expression.
Definition: SVecTransExpr.h:155
std::iterator_traits< IteratorType >::reference ReferenceType
Reference return type.
Definition: SVecTransExpr.h:165
Expression object for the transposition of a sparse vector.The SVecTransposer class is a wrapper obje...
Definition: Forward.h:136
SelectType< useAssign, const ResultType, const SVecTransExpr & >::Type CompositeType
Data type for composite expression templates.
Definition: SVecTransExpr.h:141
Operand operand() const
Returns the sparse vector operand.
Definition: SVecTransExpr.h:393
Base class for N-dimensional dense vectors.The DenseVector class is a base class for all arbitrarily ...
Definition: DenseVector.h:70
#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
ConstIterator find(size_t index) const
Searches for a specific vector element.
Definition: SVecTransExpr.h:358
DifferenceType difference_type
Difference between two iterators.
Definition: SVecTransExpr.h:173
CompressedMatrix< Type, false > TransposeType
Transpose type for expression template evaluations.
Definition: CompressedMatrix.h:2585
DifferenceType operator-(const ConstIterator &rhs) const
Calculating the number of elements between two expression iterators.
Definition: SVecTransExpr.h:263
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:2586
Constraint on the data type.
Header file for the SelectType class template.
Header file for all forward declarations for expression class templates.
Constraint on the data type.
Header file for the EnableIf class template.
ReturnType value() const
Access to the current value of the sparse element.
Definition: SVecTransExpr.h:220
EnableIf< IsDenseMatrix< MT1 > >::Type smpSubAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP subtraction assignment of a matrix to dense matrix.
Definition: DenseMatrix.h:160
Header file for the IsSparseVector type trait.
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:2587
Removal of reference modifiers.The RemoveCV type trait removes any reference modifiers from the given...
Definition: RemoveReference.h:69
VT::CompositeType CT
Composite type of the sparse vector expression.
Definition: SVecTransExpr.h:96
Header file for the VecTransExpr base class.
Header file for run time assertion macros.
EnableIf< IsDenseMatrix< MT1 > >::Type smpAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:98
Utility type for generic codes.
std::iterator_traits< IteratorType >::difference_type DifferenceType
Difference between two iterators.
Definition: SVecTransExpr.h:166
Substitution Failure Is Not An Error (SFINAE) class.The EnableIf class template is an auxiliary tool ...
Definition: EnableIf.h:184
size_t nonZeros() const
Returns the number of non-zero elements in the sparse vector.
Definition: SVecTransExpr.h:347
bool canAlias(const T *alias) const
Returns whether the expression can alias with the given address alias.
Definition: SVecTransExpr.h:405
RemoveReference< Operand >::Type::ConstIterator IteratorType
Iterator type of the sparse vector expression.
Definition: SVecTransExpr.h:160
Header file for the TransExprTrait class template.
ReturnType at(size_t index) const
Checked access to the vector elements.
Definition: SVecTransExpr.h:304
ConstIterator(IteratorType it)
Constructor for the ConstIterator class.
Definition: SVecTransExpr.h:179
#define BLAZE_CONSTRAINT_MUST_NOT_REQUIRE_EVALUATION(T)
Constraint on the data type.In case the given data type T requires an intermediate evaluation within ...
Definition: RequiresEvaluation.h:118
ConstIterator end() const
Returns an iterator just past the last non-zero element of the sparse vector.
Definition: SVecTransExpr.h:327
Header file for the RemoveReference type trait.
VT::ElementType ElementType
Resulting element type.
Definition: SVecTransExpr.h:137
Header file for the SVecTransExprTrait class template.
ReturnType operator[](size_t index) const
Subscript operator for the direct access to the vector elements.
Definition: SVecTransExpr.h:291
Header file for the sparse vector transposer.
const DMatTransExpr< MT,!SO > trans(const DenseMatrix< MT, SO > &dm)
Calculation of the transpose of the given dense matrix.
Definition: DMatTransExpr.h:944
ConstIterator upperBound(size_t index) const
Returns an iterator to the first index greater then the given index.
Definition: SVecTransExpr.h:382
EnableIf< IsDenseMatrix< MT1 > >::Type smpAddAssign(Matrix< 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:129
Base class for sparse vectors.The SparseVector class is a base class for all arbitrarily sized (N-dim...
Definition: Forward.h:118
#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:2583
Header file for the SubvectorExprTrait class template.
size_t size() const
Returns the current size/dimension of the vector.
Definition: SVecTransExpr.h:337
Header file for the TSVecTransExprTrait class template.
SVecTransExpr< VT, TF > This
Type of this SVecTransExpr instance.
Definition: SVecTransExpr.h:134
Header file for exception macros.
ReferenceType reference
Reference return type.
Definition: SVecTransExpr.h:172
const ValueType operator*() const
Direct access to the sparse vector element at the current iterator position.
Definition: SVecTransExpr.h:200
Header file for the IsColumnVector type trait.
Header file for the empty type.
EnableIf< IsDenseVector< VT1 > >::Type smpMultAssign(Vector< 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:189
Header file for the Size type trait.
#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
IteratorType it_
Iterator over the elements of the sparse vector expression.
Definition: SVecTransExpr.h:270
Header file for the IsExpression type trait class.
Header file for the FunctionTrace class.