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>
44 #include <blaze/math/Aliases.h>
47 #include <blaze/math/Exception.h>
64 #include <blaze/util/Assert.h>
65 #include <blaze/util/EmptyType.h>
66 #include <blaze/util/EnableIf.h>
67 #include <blaze/util/InvalidType.h>
69 #include <blaze/util/mpl/And.h>
70 #include <blaze/util/mpl/If.h>
71 #include <blaze/util/Types.h>
73 
74 
75 namespace blaze {
76 
77 //=================================================================================================
78 //
79 // CLASS SVECTRANSEXPR
80 //
81 //=================================================================================================
82 
83 //*************************************************************************************************
90 template< typename VT // Type of the sparse vector
91  , bool TF > // Transpose flag
92 class SVecTransExpr : public SparseVector< SVecTransExpr<VT,TF>, TF >
93  , private VecTransExpr
94  , private If< IsComputation<VT>, Computation, EmptyType >::Type
95 {
96  private:
97  //**Type definitions****************************************************************************
99  //**********************************************************************************************
100 
101  //**Serial evaluation strategy******************************************************************
103 
109  enum : bool { useAssign = RequiresEvaluation<VT>::value };
110 
112  template< typename VT2 >
114  struct UseAssign {
115  enum : bool { value = useAssign };
116  };
118  //**********************************************************************************************
119 
120  //**Parallel evaluation strategy****************************************************************
122 
127  template< typename VT2 >
128  struct UseSMPAssign {
129  enum : bool { value = VT2::smpAssignable && useAssign };
130  };
132  //**********************************************************************************************
133 
134  public:
135  //**Type definitions****************************************************************************
141 
144 
146  typedef If_< IsExpression<VT>, const VT, const VT& > Operand;
147  //**********************************************************************************************
148 
149  //**Compilation flags***************************************************************************
151  enum : bool { smpAssignable = VT::smpAssignable };
152  //**********************************************************************************************
153 
154  //**ConstIterator class definition**************************************************************
158  {
159  public:
160  //**Type definitions*************************************************************************
163 
164  typedef std::forward_iterator_tag IteratorCategory;
165  typedef typename std::iterator_traits<IteratorType>::value_type ValueType;
166  typedef typename std::iterator_traits<IteratorType>::pointer PointerType;
167  typedef typename std::iterator_traits<IteratorType>::reference ReferenceType;
168  typedef typename std::iterator_traits<IteratorType>::difference_type DifferenceType;
169 
170  // STL iterator requirements
171  typedef IteratorCategory iterator_category;
172  typedef ValueType value_type;
173  typedef PointerType pointer;
174  typedef ReferenceType reference;
175  typedef DifferenceType difference_type;
176  //*******************************************************************************************
177 
178  //**Constructor******************************************************************************
181  inline ConstIterator( IteratorType it )
182  : it_( it ) // Iterator over the elements of the sparse vector expression
183  {}
184  //*******************************************************************************************
185 
186  //**Prefix increment operator****************************************************************
192  ++it_;
193  return *this;
194  }
195  //*******************************************************************************************
196 
197  //**Element access operator******************************************************************
202  inline const ValueType operator*() const {
203  return *it_;
204  }
205  //*******************************************************************************************
206 
207  //**Element access operator******************************************************************
212  inline const ConstIterator* operator->() const {
213  return this;
214  }
215  //*******************************************************************************************
216 
217  //**Value function***************************************************************************
222  inline ReturnType value() const {
223  return it_->value();
224  }
225  //*******************************************************************************************
226 
227  //**Index function***************************************************************************
232  inline size_t index() const {
233  return it_->index();
234  }
235  //*******************************************************************************************
236 
237  //**Equality operator************************************************************************
243  inline bool operator==( const ConstIterator& rhs ) const {
244  return it_ == rhs.it_;
245  }
246  //*******************************************************************************************
247 
248  //**Inequality operator**********************************************************************
254  inline bool operator!=( const ConstIterator& rhs ) const {
255  return it_ != rhs.it_;
256  }
257  //*******************************************************************************************
258 
259  //**Subtraction operator*********************************************************************
265  inline DifferenceType operator-( const ConstIterator& rhs ) const {
266  return it_ - rhs.it_;
267  }
268  //*******************************************************************************************
269 
270  private:
271  //**Member variables*************************************************************************
272  IteratorType it_;
273  //*******************************************************************************************
274  };
275  //**********************************************************************************************
276 
277  //**Constructor*********************************************************************************
282  explicit inline SVecTransExpr( const VT& sv ) noexcept
283  : sv_( sv ) // Sparse vector of the transposition expression
284  {}
285  //**********************************************************************************************
286 
287  //**Subscript operator**************************************************************************
293  inline ReturnType operator[]( size_t index ) const {
294  BLAZE_INTERNAL_ASSERT( index < sv_.size(), "Invalid vector access index" );
295  return sv_[index];
296  }
297  //**********************************************************************************************
298 
299  //**At function*********************************************************************************
306  inline ReturnType at( size_t index ) const {
307  if( index >= sv_.size() ) {
308  BLAZE_THROW_OUT_OF_RANGE( "Invalid vector access index" );
309  }
310  return (*this)[index];
311  }
312  //**********************************************************************************************
313 
314  //**Begin function******************************************************************************
319  inline ConstIterator begin() const {
320  return ConstIterator( sv_.begin() );
321  }
322  //**********************************************************************************************
323 
324  //**End function********************************************************************************
329  inline ConstIterator end() const {
330  return ConstIterator( sv_.end() );
331  }
332  //**********************************************************************************************
333 
334  //**Size function*******************************************************************************
339  inline size_t size() const noexcept {
340  return sv_.size();
341  }
342  //**********************************************************************************************
343 
344  //**NonZeros function***************************************************************************
349  inline size_t nonZeros() const {
350  return sv_.nonZeros();
351  }
352  //**********************************************************************************************
353 
354  //**Find function*******************************************************************************
360  inline ConstIterator find( size_t index ) const {
362  return ConstIterator( sv_.find( index ) );
363  }
364  //**********************************************************************************************
365 
366  //**LowerBound function*************************************************************************
372  inline ConstIterator lowerBound( size_t index ) const {
374  return ConstIterator( sv_.lowerBound( index ) );
375  }
376  //**********************************************************************************************
377 
378  //**UpperBound function*************************************************************************
384  inline ConstIterator upperBound( size_t index ) const {
386  return ConstIterator( sv_.upperBound( index ) );
387  }
388  //**********************************************************************************************
389 
390  //**Operand access******************************************************************************
395  inline Operand operand() const noexcept {
396  return sv_;
397  }
398  //**********************************************************************************************
399 
400  //**********************************************************************************************
406  template< typename T >
407  inline bool canAlias( const T* alias ) const noexcept {
408  return sv_.canAlias( alias );
409  }
410  //**********************************************************************************************
411 
412  //**********************************************************************************************
418  template< typename T >
419  inline bool isAliased( const T* alias ) const noexcept {
420  return sv_.isAliased( alias );
421  }
422  //**********************************************************************************************
423 
424  //**********************************************************************************************
429  inline bool canSMPAssign() const noexcept {
430  return sv_.canSMPAssign();
431  }
432  //**********************************************************************************************
433 
434  private:
435  //**Member variables****************************************************************************
436  Operand sv_;
437  //**********************************************************************************************
438 
439  //**Assignment to dense vectors*****************************************************************
453  template< typename VT2 > // Type of the target dense vector
454  friend inline EnableIf_< UseAssign<VT2> >
455  assign( DenseVector<VT2,TF>& lhs, const SVecTransExpr& rhs )
456  {
458 
459  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
460 
461  DVecTransposer<VT2,!TF> tmp( ~lhs );
462  assign( tmp, rhs.sv_ );
463  }
465  //**********************************************************************************************
466 
467  //**Assignment to sparse vectors****************************************************************
481  template< typename VT2 > // Type of the target sparse vector
482  friend inline EnableIf_< UseAssign<VT2> >
483  assign( SparseVector<VT2,TF>& lhs, const SVecTransExpr& rhs )
484  {
486 
487  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
488 
489  SVecTransposer<VT2,!TF> tmp( ~lhs );
490  assign( tmp, rhs.sv_ );
491  }
493  //**********************************************************************************************
494 
495  //**Addition assignment to dense vectors********************************************************
509  template< typename VT2 > // Type of the target dense vector
510  friend inline EnableIf_< UseAssign<VT2> >
511  addAssign( DenseVector<VT2,TF>& lhs, const SVecTransExpr& rhs )
512  {
514 
515  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
516 
517  DVecTransposer<VT2,!TF> tmp( ~lhs );
518  addAssign( tmp, rhs.sv_ );
519  }
521  //**********************************************************************************************
522 
523  //**Addition assignment to sparse vectors*******************************************************
524  // No special implementation for the addition assignment to sparse vectors.
525  //**********************************************************************************************
526 
527  //**Subtraction assignment to dense vectors*****************************************************
541  template< typename VT2 > // Type of the target dense vector
542  friend inline EnableIf_< UseAssign<VT2> >
543  subAssign( DenseVector<VT2,TF>& lhs, const SVecTransExpr& rhs )
544  {
546 
547  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
548 
549  DVecTransposer<VT2,!TF> tmp( ~lhs );
550  subAssign( tmp, rhs.sv_ );
551  }
553  //**********************************************************************************************
554 
555  //**Subtraction assignment to sparse vectors****************************************************
556  // No special implementation for the subtraction assignment to sparse vectors.
557  //**********************************************************************************************
558 
559  //**Multiplication assignment to dense vectors**************************************************
573  template< typename VT2 > // Type of the target dense vector
574  friend inline EnableIf_< UseAssign<VT2> >
575  multAssign( DenseVector<VT2,TF>& lhs, const SVecTransExpr& rhs )
576  {
578 
579  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
580 
581  DVecTransposer<VT2,!TF> tmp( ~lhs );
582  multAssign( tmp, rhs.sv_ );
583  }
585  //**********************************************************************************************
586 
587  //**Multiplication assignment to sparse vectors*************************************************
588  // No special implementation for the multiplication assignment to sparse vectors.
589  //**********************************************************************************************
590 
591  //**SMP assignment to dense vectors*************************************************************
605  template< typename VT2 > // Type of the target dense vector
606  friend inline EnableIf_< UseSMPAssign<VT2> >
607  smpAssign( DenseVector<VT2,TF>& lhs, const SVecTransExpr& rhs )
608  {
610 
611  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
612 
613  DVecTransposer<VT2,!TF> tmp( ~lhs );
614  smpAssign( tmp, rhs.sv_ );
615  }
617  //**********************************************************************************************
618 
619  //**SMP assignment to sparse vectors************************************************************
633  template< typename VT2 > // Type of the target sparse vector
634  friend inline EnableIf_< UseSMPAssign<VT2> >
635  smpAssign( SparseVector<VT2,TF>& lhs, const SVecTransExpr& rhs )
636  {
638 
639  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
640 
641  SVecTransposer<VT2,!TF> tmp( ~lhs );
642  smpAssign( tmp, rhs.sv_ );
643  }
645  //**********************************************************************************************
646 
647  //**SMP addition assignment to dense vectors****************************************************
661  template< typename VT2 > // Type of the target dense vector
662  friend inline EnableIf_< UseSMPAssign<VT2> >
663  smpAddAssign( DenseVector<VT2,TF>& lhs, const SVecTransExpr& rhs )
664  {
666 
667  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
668 
669  DVecTransposer<VT2,!TF> tmp( ~lhs );
670  smpAddAssign( tmp, rhs.sv_ );
671  }
673  //**********************************************************************************************
674 
675  //**SMP addition assignment to sparse vectors***************************************************
676  // No special implementation for the SMP addition assignment to sparse vectors.
677  //**********************************************************************************************
678 
679  //**SMP subtraction assignment to dense vectors*************************************************
693  template< typename VT2 > // Type of the target dense vector
694  friend inline EnableIf_< UseSMPAssign<VT2> >
695  smpSubAssign( DenseVector<VT2,TF>& lhs, const SVecTransExpr& rhs )
696  {
698 
699  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
700 
701  DVecTransposer<VT2,!TF> tmp( ~lhs );
702  smpSubAssign( tmp, rhs.sv_ );
703  }
705  //**********************************************************************************************
706 
707  //**SMP subtraction assignment to sparse vectors************************************************
708  // No special implementation for the SMP subtraction assignment to sparse vectors.
709  //**********************************************************************************************
710 
711  //**SMP multiplication assignment to dense vectors**********************************************
726  template< typename VT2 > // Type of the target dense vector
727  friend inline EnableIf_< UseSMPAssign<VT2> >
728  smpMultAssign( DenseVector<VT2,TF>& lhs, const SVecTransExpr& rhs )
729  {
731 
732  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
733 
734  DVecTransposer<VT2,!TF> tmp( ~lhs );
735  smpMultAssign( tmp, rhs.sv_ );
736  }
738  //**********************************************************************************************
739 
740  //**SMP multiplication assignment to sparse vectors*********************************************
741  // No special implementation for the SMP multiplication assignment to sparse vectors.
742  //**********************************************************************************************
743 
744  //**Compile time checks*************************************************************************
748  //**********************************************************************************************
749 };
750 //*************************************************************************************************
751 
752 
753 
754 
755 //=================================================================================================
756 //
757 // GLOBAL OPERATORS
758 //
759 //=================================================================================================
760 
761 //*************************************************************************************************
780 template< typename VT // Type of the sparse vector
781  , bool TF > // Transpose flag
783 {
785 
786  return SVecTransExpr<VT,!TF>( ~sv );
787 }
788 //*************************************************************************************************
789 
790 
791 
792 
793 //=================================================================================================
794 //
795 // GLOBAL RESTRUCTURING FUNCTIONS
796 //
797 //=================================================================================================
798 
799 //*************************************************************************************************
819 template< typename VT // Type of the sparse vector
820  , bool TF > // Transpose flag
821 inline typename SVecTransExpr<VT,TF>::Operand trans( const SVecTransExpr<VT,TF>& sv )
822 {
824 
825  return sv.operand();
826 }
828 //*************************************************************************************************
829 
830 
831 
832 
833 //=================================================================================================
834 //
835 // SIZE SPECIALIZATIONS
836 //
837 //=================================================================================================
838 
839 //*************************************************************************************************
841 template< typename VT, bool TF >
842 struct Size< SVecTransExpr<VT,TF> > : public Size<VT>
843 {};
845 //*************************************************************************************************
846 
847 
848 
849 
850 //=================================================================================================
851 //
852 // EXPRESSION TRAIT SPECIALIZATIONS
853 //
854 //=================================================================================================
855 
856 //*************************************************************************************************
858 template< typename VT >
859 struct SVecTransExprTrait< SVecTransExpr<VT,false> >
860 {
861  public:
862  //**********************************************************************************************
863  using Type = If_< And< IsSparseVector<VT>, IsRowVector<VT> >
864  , Operand_< SVecTransExpr<VT,false> >
865  , INVALID_TYPE >;
866  //**********************************************************************************************
867 };
869 //*************************************************************************************************
870 
871 
872 //*************************************************************************************************
874 template< typename VT >
875 struct TSVecTransExprTrait< SVecTransExpr<VT,true> >
876 {
877  public:
878  //**********************************************************************************************
879  using Type = If_< And< IsSparseVector<VT>, IsColumnVector<VT> >
880  , Operand_< SVecTransExpr<VT,true> >
881  , INVALID_TYPE >;
882  //**********************************************************************************************
883 };
885 //*************************************************************************************************
886 
887 
888 //*************************************************************************************************
890 template< typename VT, bool TF, bool AF >
891 struct SubvectorExprTrait< SVecTransExpr<VT,TF>, AF >
892 {
893  public:
894  //**********************************************************************************************
895  using Type = TransExprTrait_< SubvectorExprTrait_<const VT,AF> >;
896  //**********************************************************************************************
897 };
899 //*************************************************************************************************
900 
901 } // namespace blaze
902 
903 #endif
Header file for auxiliary alias declarations.
size_t size() const noexcept
Returns the current size/dimension of the vector.
Definition: SVecTransExpr.h:339
Operand sv_
Sparse vector of the transposition expression.
Definition: SVecTransExpr.h:436
PointerType pointer
Pointer return type.
Definition: SVecTransExpr.h:173
Header file for basic type definitions.
Header file for the SparseVector base class.
ResultType_< VT > TransposeType
Transpose type for expression template evaluations.
Definition: SVecTransExpr.h:138
ConstIterator & operator++()
Pre-increment operator.
Definition: SVecTransExpr.h:191
EnableIf_< IsDenseMatrix< MT1 > > 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
ConstIterator begin() const
Returns an iterator to the first non-zero element of the sparse vector.
Definition: SVecTransExpr.h:319
bool canAlias(const T *alias) const noexcept
Returns whether the expression can alias with the given address alias.
Definition: SVecTransExpr.h:407
TransposeType_< VT > ResultType
Result type for expression template evaluations.
Definition: SVecTransExpr.h:137
std::iterator_traits< IteratorType >::pointer PointerType
Pointer return type.
Definition: SVecTransExpr.h:166
ValueType value_type
Type of the underlying pointers.
Definition: SVecTransExpr.h:172
Header file for the IsRowVector type trait.
EnableIf_< IsDenseVector< VT1 > > 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:193
Header file for the And class template.
Expression object for sparse vector transpositions.The SVecTransExpr class represents the compile tim...
Definition: Forward.h:125
Header file for the Computation base class.
ConstIterator_< RemoveReference_< Operand > > IteratorType
Iterator type of the sparse vector expression.
Definition: SVecTransExpr.h:162
Header file for the RequiresEvaluation type trait.
bool operator!=(const ConstIterator &rhs) const
Inequality comparison between two ConstIterator objects.
Definition: SVecTransExpr.h:254
typename T::ResultType ResultType_
Alias declaration for nested ResultType type definitions.The ResultType_ alias declaration provides a...
Definition: Aliases.h:323
EnableIf_< IsDenseMatrix< MT1 > > 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
std::forward_iterator_tag IteratorCategory
The iterator category.
Definition: SVecTransExpr.h:164
Expression object for the transposition of a dense vector.The DVecTransposer class is a wrapper objec...
Definition: DVecTransposer.h:77
ConstIterator lowerBound(size_t index) const
Returns an iterator to the first index not less then the given index.
Definition: SVecTransExpr.h:372
typename IfTrue< Condition, T1, T2 >::Type IfTrue_
Auxiliary alias declaration for the IfTrue class template.The IfTrue_ alias declaration provides a co...
Definition: If.h:109
ElementType_< VT > ElementType
Resulting element type.
Definition: SVecTransExpr.h:139
typename T::ReturnType ReturnType_
Alias declaration for nested ReturnType type definitions.The ReturnType_ alias declaration provides a...
Definition: Aliases.h:343
ReturnType_< VT > ReturnType
Return type for expression template evaluations.
Definition: SVecTransExpr.h:140
Compile time check to query the requirement to evaluate an expression.Via this type trait it is possi...
Definition: RequiresEvaluation.h:72
typename T::CompositeType CompositeType_
Alias declaration for nested CompositeType type definitions.The CompositeType_ alias declaration prov...
Definition: Aliases.h:83
bool operator==(const ConstIterator &rhs) const
Equality comparison between two ConstIterator objects.
Definition: SVecTransExpr.h:243
const ConstIterator * operator->() const
Direct access to the sparse vector element at the current iterator position.
Definition: SVecTransExpr.h:212
size_t index() const
Access to the current index of the sparse element.
Definition: SVecTransExpr.h:232
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
Header file for the If class template.
Header file for the dense vector transposer.
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2647
std::iterator_traits< IteratorType >::value_type ValueType
Type of the underlying pointers.
Definition: SVecTransExpr.h:165
CompositeType_< VT > CT
Composite type of the sparse vector expression.
Definition: SVecTransExpr.h:98
EnableIf_< IsDenseMatrix< MT1 > > 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
IteratorCategory iterator_category
The iterator category.
Definition: SVecTransExpr.h:171
#define BLAZE_THROW_OUT_OF_RANGE(MESSAGE)
Macro for the emission of a std::out_of_range exception.This macro encapsulates the default way of Bl...
Definition: Exception.h:331
Iterator over the elements of the sparse vector absolute value expression.
Definition: SVecTransExpr.h:157
std::iterator_traits< IteratorType >::reference ReferenceType
Reference return type.
Definition: SVecTransExpr.h:167
typename T::ElementType ElementType_
Alias declaration for nested ElementType type definitions.The ElementType_ alias declaration provides...
Definition: Aliases.h:163
Expression object for the transposition of a sparse vector.The SVecTransposer class is a wrapper obje...
Definition: Forward.h:126
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:61
ConstIterator find(size_t index) const
Searches for a specific vector element.
Definition: SVecTransExpr.h:360
If_< IsExpression< VT >, const VT, const VT & > Operand
Composite data type of the sparse vector expression.
Definition: SVecTransExpr.h:146
DifferenceType difference_type
Difference between two iterators.
Definition: SVecTransExpr.h:175
DifferenceType operator-(const ConstIterator &rhs) const
Calculating the number of elements between two expression iterators.
Definition: SVecTransExpr.h:265
Header file for the exception macros of the math module.
Constraint on the data type.
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:222
Operand operand() const noexcept
Returns the sparse vector operand.
Definition: SVecTransExpr.h:395
Header file for the IsSparseVector type trait.
Header file for the VecTransExpr base class.
Header file for run time assertion macros.
SVecTransExpr(const VT &sv) noexcept
Constructor for the SVecTransExpr class.
Definition: SVecTransExpr.h:282
IfTrue_< useAssign, const ResultType, const SVecTransExpr & > CompositeType
Data type for composite expression templates.
Definition: SVecTransExpr.h:143
Utility type for generic codes.
std::iterator_traits< IteratorType >::difference_type DifferenceType
Difference between two iterators.
Definition: SVecTransExpr.h:168
typename If< T1, T2, T3 >::Type If_
Auxiliary alias declaration for the If class template.The If_ alias declaration provides a convenient...
Definition: If.h:160
size_t nonZeros() const
Returns the number of non-zero elements in the sparse vector.
Definition: SVecTransExpr.h:349
Header file for the TransExprTrait class template.
ReturnType at(size_t index) const
Checked access to the vector elements.
Definition: SVecTransExpr.h:306
ConstIterator(IteratorType it)
Constructor for the ConstIterator class.
Definition: SVecTransExpr.h:181
#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:81
ConstIterator end() const
Returns an iterator just past the last non-zero element of the sparse vector.
Definition: SVecTransExpr.h:329
Header file for the RemoveReference type trait.
typename EnableIf< Condition, T >::Type EnableIf_
Auxiliary alias declaration for the EnableIf class template.The EnableIf_ alias declaration provides ...
Definition: EnableIf.h:223
Header file for the SVecTransExprTrait class template.
bool isAliased(const T *alias) const noexcept
Returns whether the expression is aliased with the given address alias.
Definition: SVecTransExpr.h:419
ReturnType operator[](size_t index) const
Subscript operator for the direct access to the vector elements.
Definition: SVecTransExpr.h:293
typename T::ConstIterator ConstIterator_
Alias declaration for nested ConstIterator type definitions.The ConstIterator_ alias declaration prov...
Definition: Aliases.h:103
Header file for the sparse vector transposer.
bool canSMPAssign() const noexcept
Returns whether the expression can be used in SMP assignments.
Definition: SVecTransExpr.h:429
const DMatTransExpr< MT,!SO > trans(const DenseMatrix< MT, SO > &dm)
Calculation of the transpose of the given dense matrix.
Definition: DMatTransExpr.h:950
ConstIterator upperBound(size_t index) const
Returns an iterator to the first index greater then the given index.
Definition: SVecTransExpr.h:384
Base class for sparse vectors.The SparseVector class is a base class for all arbitrarily sized (N-dim...
Definition: Forward.h:110
#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
Header file for the SubvectorExprTrait class template.
Header file for the TSVecTransExprTrait class template.
SVecTransExpr< VT, TF > This
Type of this SVecTransExpr instance.
Definition: SVecTransExpr.h:136
typename T::TransposeType TransposeType_
Alias declaration for nested TransposeType type definitions.The TransposeType_ alias declaration prov...
Definition: Aliases.h:403
ReferenceType reference
Reference return type.
Definition: SVecTransExpr.h:174
const ValueType operator*() const
Direct access to the sparse vector element at the current iterator position.
Definition: SVecTransExpr.h:202
Header file for the IsColumnVector type trait.
Header file for the empty type.
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:272
Header file for the IsExpression type trait class.
Header file for the FunctionTrace class.