SVecImagExpr.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_EXPRESSIONS_SVECIMAGEXPR_H_
36 #define _BLAZE_MATH_EXPRESSIONS_SVECIMAGEXPR_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
43 #include <cmath>
44 #include <iterator>
69 #include <blaze/util/Assert.h>
72 #include <blaze/util/EnableIf.h>
73 #include <blaze/util/Exception.h>
74 #include <blaze/util/InvalidType.h>
76 #include <blaze/util/SelectType.h>
77 #include <blaze/util/Types.h>
79 
80 
81 namespace blaze {
82 
83 //=================================================================================================
84 //
85 // CLASS SVECIMAGEXPR
86 //
87 //=================================================================================================
88 
89 //*************************************************************************************************
96 template< typename VT // Type of the sparse vector
97  , bool TF > // Transpose flag
98 class SVecImagExpr : public SparseVector< SVecImagExpr<VT,TF>, TF >
99  , private VecImagExpr
100  , private Computation
101 {
102  private:
103  //**Type definitions****************************************************************************
104  typedef typename VT::ResultType RT;
105  typedef typename VT::ReturnType RN;
106  typedef typename VT::CompositeType CT;
107  typedef typename VT::TransposeType TT;
108  typedef typename VT::ElementType ET;
109  //**********************************************************************************************
110 
111  //**Return type evaluation**********************************************************************
113 
118  enum { returnExpr = !IsTemporary<RN>::value };
119 
122  //**********************************************************************************************
123 
124  //**Serial evaluation strategy******************************************************************
126 
132  enum { useAssign = RequiresEvaluation<VT>::value };
133 
135  template< typename VT2 >
137  struct UseAssign {
138  enum { value = useAssign };
139  };
141  //**********************************************************************************************
142 
143  //**Parallel evaluation strategy****************************************************************
145 
151  template< typename VT2 >
152  struct UseSMPAssign {
153  enum { value = ( !VT2::smpAssignable || !VT::smpAssignable ) && useAssign };
154  };
156  //**********************************************************************************************
157 
158  public:
159  //**Type definitions****************************************************************************
161  typedef typename ImagTrait<RT>::Type ResultType;
164 
167 
170 
172  typedef typename SelectType< IsExpression<VT>::value, const VT, const VT& >::Type Operand;
173  //**********************************************************************************************
174 
175  //**Compilation flags***************************************************************************
177  enum { smpAssignable = VT::smpAssignable };
178  //**********************************************************************************************
179 
180  //**ConstIterator class definition**************************************************************
184  {
185  public:
186  //**Type definitions*************************************************************************
189 
192 
193  typedef std::forward_iterator_tag IteratorCategory;
194  typedef Element ValueType;
195  typedef ValueType* PointerType;
196  typedef ValueType& ReferenceType;
198 
199  // STL iterator requirements
200  typedef IteratorCategory iterator_category;
201  typedef ValueType value_type;
202  typedef PointerType pointer;
203  typedef ReferenceType reference;
204  typedef DifferenceType difference_type;
205  //*******************************************************************************************
206 
207  //**Constructor******************************************************************************
210  inline ConstIterator( IteratorType it )
211  : it_( it ) // Iterator over the elements of the sparse vector expression
212  {}
213  //*******************************************************************************************
214 
215  //**Prefix increment operator****************************************************************
221  ++it_;
222  return *this;
223  }
224  //*******************************************************************************************
225 
226  //**Element access operator******************************************************************
231  inline const Element operator*() const {
232  return Element( imag( it_->value() ), it_->index() );
233  }
234  //*******************************************************************************************
235 
236  //**Element access operator******************************************************************
241  inline const ConstIterator* operator->() const {
242  return this;
243  }
244  //*******************************************************************************************
245 
246  //**Value function***************************************************************************
251  inline ReturnType value() const {
252  return imag( it_->value() );
253  }
254  //*******************************************************************************************
255 
256  //**Index function***************************************************************************
261  inline size_t index() const {
262  return it_->index();
263  }
264  //*******************************************************************************************
265 
266  //**Equality operator************************************************************************
272  inline bool operator==( const ConstIterator& rhs ) const {
273  return it_ == rhs.it_;
274  }
275  //*******************************************************************************************
276 
277  //**Inequality operator**********************************************************************
283  inline bool operator!=( const ConstIterator& rhs ) const {
284  return it_ != rhs.it_;
285  }
286  //*******************************************************************************************
287 
288  //**Subtraction operator*********************************************************************
294  inline DifferenceType operator-( const ConstIterator& rhs ) const {
295  return it_ - rhs.it_;
296  }
297  //*******************************************************************************************
298 
299  private:
300  //**Member variables*************************************************************************
301  IteratorType it_;
302  //*******************************************************************************************
303  };
304  //**********************************************************************************************
305 
306  //**Constructor*********************************************************************************
311  explicit inline SVecImagExpr( const VT& sv )
312  : sv_( sv ) // Sparse vector of the imaginary part expression
313  {}
314  //**********************************************************************************************
315 
316  //**Subscript operator**************************************************************************
322  inline ReturnType operator[]( size_t index ) const {
323  BLAZE_INTERNAL_ASSERT( index < sv_.size(), "Invalid vector access index" );
324  return imag( sv_[index] );
325  }
326  //**********************************************************************************************
327 
328  //**At function*********************************************************************************
335  inline ReturnType at( size_t index ) const {
336  if( index >= sv_.size() ) {
337  BLAZE_THROW_OUT_OF_RANGE( "Invalid vector access index" );
338  }
339  return (*this)[index];
340  }
341  //**********************************************************************************************
342 
343  //**Begin function******************************************************************************
348  inline ConstIterator begin() const {
349  return ConstIterator( sv_.begin() );
350  }
351  //**********************************************************************************************
352 
353  //**End function********************************************************************************
358  inline ConstIterator end() const {
359  return ConstIterator( sv_.end() );
360  }
361  //**********************************************************************************************
362 
363  //**Size function*******************************************************************************
368  inline size_t size() const {
369  return sv_.size();
370  }
371  //**********************************************************************************************
372 
373  //**NonZeros function***************************************************************************
378  inline size_t nonZeros() const {
379  return sv_.nonZeros();
380  }
381  //**********************************************************************************************
382 
383  //**Find function*******************************************************************************
389  inline ConstIterator find( size_t index ) const {
391  return ConstIterator( sv_.find( index ) );
392  }
393  //**********************************************************************************************
394 
395  //**LowerBound function*************************************************************************
401  inline ConstIterator lowerBound( size_t index ) const {
403  return ConstIterator( sv_.lowerBound( index ) );
404  }
405  //**********************************************************************************************
406 
407  //**UpperBound function*************************************************************************
413  inline ConstIterator upperBound( size_t index ) const {
415  return ConstIterator( sv_.upperBound( index ) );
416  }
417  //**********************************************************************************************
418 
419  //**Operand access******************************************************************************
424  inline Operand operand() const {
425  return sv_;
426  }
427  //**********************************************************************************************
428 
429  //**********************************************************************************************
435  template< typename T >
436  inline bool canAlias( const T* alias ) const {
437  return sv_.canAlias( alias );
438  }
439  //**********************************************************************************************
440 
441  //**********************************************************************************************
447  template< typename T >
448  inline bool isAliased( const T* alias ) const {
449  return sv_.isAliased( alias );
450  }
451  //**********************************************************************************************
452 
453  //**********************************************************************************************
458  inline bool canSMPAssign() const {
459  return sv_.canSMPAssign();
460  }
461  //**********************************************************************************************
462 
463  private:
464  //**Member variables****************************************************************************
465  Operand sv_;
466  //**********************************************************************************************
467 
468  //**Assignment to dense vectors*****************************************************************
483  template< typename VT2 > // Type of the target dense vector
484  friend inline typename EnableIf< UseAssign<VT2> >::Type
485  assign( DenseVector<VT2,TF>& lhs, const SVecImagExpr& rhs )
486  {
488 
492 
493  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
494 
495  const RT tmp( serial( rhs.sv_ ) );
496  assign( ~lhs, imag( tmp ) );
497  }
499  //**********************************************************************************************
500 
501  //**Assignment to sparse vectors****************************************************************
515  template< typename VT2 > // Type of the target sparse vector
516  friend inline typename EnableIf< UseAssign<VT2> >::Type
517  assign( SparseVector<VT2,TF>& lhs, const SVecImagExpr& rhs )
518  {
520 
524 
525  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
526 
527  const RT tmp( serial( rhs.sv_ ) );
528  (~lhs).reserve( tmp.nonZeros() );
529  assign( ~lhs, imag( tmp ) );
530  }
532  //**********************************************************************************************
533 
534  //**Addition assignment to dense vectors********************************************************
548  template< typename VT2 > // Type of the target dense vector
549  friend inline typename EnableIf< UseAssign<VT2> >::Type
550  addAssign( DenseVector<VT2,TF>& lhs, const SVecImagExpr& rhs )
551  {
553 
557 
558  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
559 
560  const RT tmp( serial( rhs.sv_ ) );
561  addAssign( ~lhs, imag( tmp ) );
562  }
564  //**********************************************************************************************
565 
566  //**Addition assignment to sparse vectors*******************************************************
567  // No special implementation for the addition assignment to sparse vectors.
568  //**********************************************************************************************
569 
570  //**Subtraction assignment to dense vectors*****************************************************
584  template< typename VT2 > // Type of the target dense vector
585  friend inline typename EnableIf< UseAssign<VT2> >::Type
586  subAssign( DenseVector<VT2,TF>& lhs, const SVecImagExpr& rhs )
587  {
589 
593 
594  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
595 
596  const RT tmp( serial( rhs.sv_ ) );
597  subAssign( ~lhs, imag( tmp ) );
598  }
600  //**********************************************************************************************
601 
602  //**Subtraction assignment to sparse vectors****************************************************
603  // No special implementation for the subtraction assignment to sparse vectors.
604  //**********************************************************************************************
605 
606  //**Multiplication assignment to dense vectors**************************************************
620  template< typename VT2 > // Type of the target dense vector
621  friend inline typename EnableIf< UseAssign<VT2> >::Type
622  multAssign( DenseVector<VT2,TF>& lhs, const SVecImagExpr& rhs )
623  {
625 
629 
630  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
631 
632  const RT tmp( serial( rhs.sv_ ) );
633  multAssign( ~lhs, imag( tmp ) );
634  }
636  //**********************************************************************************************
637 
638  //**Multiplication assignment to sparse vectors*************************************************
639  // No special implementation for the multiplication assignment to sparse vectors.
640  //**********************************************************************************************
641 
642  //**SMP assignment to dense vectors*************************************************************
656  template< typename VT2 > // Type of the target dense vector
657  friend inline typename EnableIf< UseSMPAssign<VT2> >::Type
658  smpAssign( DenseVector<VT2,TF>& lhs, const SVecImagExpr& rhs )
659  {
661 
665 
666  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
667 
668  const RT tmp( rhs.sv_ );
669  smpAssign( ~lhs, imag( tmp ) );
670  }
672  //**********************************************************************************************
673 
674  //**SMP assignment to sparse vectors************************************************************
675  // No special implementation for the SMP assignment to sparse vectors.
676  //**********************************************************************************************
677 
678  //**SMP addition assignment to dense vectors****************************************************
692  template< typename VT2 > // Type of the target dense vector
693  friend inline typename EnableIf< UseSMPAssign<VT2> >::Type
694  smpAddAssign( DenseVector<VT2,TF>& lhs, const SVecImagExpr& rhs )
695  {
697 
701 
702  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
703 
704  const RT tmp( rhs.sv_ );
705  smpAddAssign( ~lhs, imag( tmp ) );
706  }
708  //**********************************************************************************************
709 
710  //**SMP addition assignment to sparse vectors***************************************************
711  // No special implementation for the SMP addition assignment to sparse vectors.
712  //**********************************************************************************************
713 
714  //**SMP subtraction assignment to dense vectors*************************************************
728  template< typename VT2 > // Type of the target dense vector
729  friend inline typename EnableIf< UseSMPAssign<VT2> >::Type
730  smpSubAssign( DenseVector<VT2,TF>& lhs, const SVecImagExpr& rhs )
731  {
733 
737 
738  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
739 
740  const RT tmp( rhs.sv_ );
741  smpSubAssign( ~lhs, imag( tmp ) );
742  }
744  //**********************************************************************************************
745 
746  //**SMP subtraction assignment to sparse vectors************************************************
747  // No special implementation for the SMP subtraction assignment to sparse vectors.
748  //**********************************************************************************************
749 
750  //**SMP multiplication assignment to dense vectors**********************************************
764  template< typename VT2 > // Type of the target dense vector
765  friend inline typename EnableIf< UseSMPAssign<VT2> >::Type
766  smpMultAssign( DenseVector<VT2,TF>& lhs, const SVecImagExpr& rhs )
767  {
769 
773 
774  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
775 
776  const RT tmp( rhs.sv_ );
777  smpMultAssign( ~lhs, imag( tmp ) );
778  }
780  //**********************************************************************************************
781 
782  //**SMP multiplication assignment to sparse vectors*********************************************
783  // No special implementation for the SMP multiplication assignment to sparse vectors.
784  //**********************************************************************************************
785 
786  //**Compile time checks*************************************************************************
790  BLAZE_CONSTRAINT_MUST_NOT_BE_BUILTIN_TYPE( typename UnderlyingNumeric<VT>::Type );
792  //**********************************************************************************************
793 };
794 //*************************************************************************************************
795 
796 
797 
798 
799 //=================================================================================================
800 //
801 // GLOBAL FUNCTIONS
802 //
803 //=================================================================================================
804 
805 //*************************************************************************************************
822 template< typename VT // Type of the sparse vector
823  , bool TF > // Transpose flag
824 inline const typename ImagExprTrait<VT>::Type imag( const SparseVector<VT,TF>& sv )
825 {
827 
828  return typename ImagExprTrait<VT>::Type( ~sv );
829 }
830 //*************************************************************************************************
831 
832 
833 
834 
835 //=================================================================================================
836 //
837 // GLOBAL RESTRUCTURING FUNCTIONS
838 //
839 //=================================================================================================
840 
841 //*************************************************************************************************
852 template< typename VT // Type of the sparse vector
853  , bool TF > // Transpose flag
854 inline const SVecImagExpr<VT,TF>& imag( const SVecImagExpr<VT,TF>& sv )
855 {
857 
858  return sv;
859 }
861 //*************************************************************************************************
862 
863 
864 
865 
866 //=================================================================================================
867 //
868 // SIZE SPECIALIZATIONS
869 //
870 //=================================================================================================
871 
872 //*************************************************************************************************
874 template< typename VT, bool TF >
875 struct Size< SVecImagExpr<VT,TF> > : public Size<VT>
876 {};
878 //*************************************************************************************************
879 
880 
881 
882 
883 //=================================================================================================
884 //
885 // EXPRESSION TRAIT SPECIALIZATIONS
886 //
887 //=================================================================================================
888 
889 //*************************************************************************************************
891 template< typename VT >
892 struct SVecImagExprTrait< SVecImagExpr<VT,false> >
893 {
894  public:
895  //**********************************************************************************************
896  typedef typename SelectType< IsSparseVector<VT>::value && IsColumnVector<VT>::value
897  , SVecImagExpr<VT,false>
898  , INVALID_TYPE >::Type Type;
899  //**********************************************************************************************
900 };
902 //*************************************************************************************************
903 
904 
905 //*************************************************************************************************
907 template< typename VT >
908 struct TSVecImagExprTrait< SVecImagExpr<VT,true> >
909 {
910  public:
911  //**********************************************************************************************
912  typedef typename SelectType< IsSparseVector<VT>::value && IsRowVector<VT>::value
913  , SVecImagExpr<VT,true>
914  , INVALID_TYPE >::Type Type;
915  //**********************************************************************************************
916 };
918 //*************************************************************************************************
919 
920 
921 //*************************************************************************************************
923 template< typename VT, bool TF, bool AF >
924 struct SubvectorExprTrait< SVecImagExpr<VT,TF>, AF >
925 {
926  public:
927  //**********************************************************************************************
928  typedef typename ImagExprTrait< typename SubvectorExprTrait<const VT,AF>::Type >::Type Type;
929  //**********************************************************************************************
930 };
932 //*************************************************************************************************
933 
934 } // namespace blaze
935 
936 #endif
Header file for the UnderlyingNumeric type trait.
Header file for the ImagExprTrait class template.
Pointer difference type of the Blaze library.
RemoveReference< Operand >::Type::ConstIterator IteratorType
Iterator type of the sparse vector expression.
Definition: SVecImagExpr.h:191
ConstIterator begin() const
Returns an iterator to the first non-zero element of the sparse vector.
Definition: SVecImagExpr.h:348
ReferenceType reference
Reference return type.
Definition: SVecImagExpr.h:203
Compile time check whether the given type is a temporary vector or matrix type.This type trait class ...
Definition: IsTemporary.h:87
Header file for basic type definitions.
ConstIterator upperBound(size_t index) const
Returns an iterator to the first index greater then the given index.
Definition: SVecImagExpr.h:413
Header file for the SparseVector base class.
bool canSMPAssign() const
Returns whether the expression can be used in SMP assignments.
Definition: SVecImagExpr.h:458
ReturnType value() const
Access to the current value of the sparse element.
Definition: SVecImagExpr.h:251
Operand operand() const
Returns the sparse vector operand.
Definition: SVecImagExpr.h:424
Header file for the imaginary shim.
SelectType< IsExpression< VT >::value, const VT, const VT & >::Type Operand
Composite data type of the sparse vector expression.
Definition: SVecImagExpr.h:172
Efficient implementation of a compressed matrix.The CompressedMatrix class template is the represent...
Definition: CompressedMatrix.h:207
Evaluation of the return type of a imaginary part expression.Via this type trait it is possible to ev...
Definition: ImagExprTrait.h:88
PointerType pointer
Pointer return type.
Definition: SVecImagExpr.h:202
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:2588
Header file for the IsRowVector type trait.
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:259
ReturnType operator[](size_t index) const
Subscript operator for the direct access to the vector elements.
Definition: SVecImagExpr.h:322
ReturnType at(size_t index) const
Checked access to the vector elements.
Definition: SVecImagExpr.h:335
Base template for the ImagTrait class.The ImagTrait class template offers the possibility to select t...
Definition: ImagTrait.h:78
ValueType * PointerType
Pointer return type.
Definition: SVecImagExpr.h:195
const DMatSerialExpr< MT, SO > serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:721
ConstIterator end() const
Returns an iterator just past the last non-zero element of the sparse vector.
Definition: SVecImagExpr.h:358
Header file for the Computation base class.
ResultType::ElementType ElementType
Resulting element type.
Definition: SVecImagExpr.h:163
bool isAliased(const T *alias) const
Returns whether the expression is aliased with the given address alias.
Definition: SVecImagExpr.h:448
Header file for the RequiresEvaluation type trait.
VT::CompositeType CT
Composite type of the sparse vector expression.
Definition: SVecImagExpr.h:106
Header file for the TSVecImagExprTrait class template.
const ImagExprTrait< MT >::Type imag(const DenseMatrix< MT, SO > &dm)
Returns a matrix containing the imaginary part of each single element of dm.
Definition: DMatImagExpr.h:920
ConstIterator lowerBound(size_t index) const
Returns an iterator to the first index not less then the given index.
Definition: SVecImagExpr.h:401
bool operator!=(const ConstIterator &rhs) const
Inequality comparison between two ConstIterator objects.
Definition: SVecImagExpr.h:283
Constraint on the data type.
VT::ResultType RT
Result type of the sparse vector expression.
Definition: SVecImagExpr.h:104
VT::ElementType ET
Element type of the sparse vector expression.
Definition: SVecImagExpr.h:108
ptrdiff_t DifferenceType
Difference between two iterators.
Definition: SVecImagExpr.h:197
size_t nonZeros() const
Returns the number of non-zero elements in the sparse vector.
Definition: SVecImagExpr.h:378
Compile time check to query the requirement to evaluate an expression.Via this type trait it is possi...
Definition: RequiresEvaluation.h:90
ResultType::TransposeType TransposeType
Transpose type for expression template evaluations.
Definition: SVecImagExpr.h:162
Header file for the ValueIndexPair class.
Expression object for the sparse vector imag() function.The SVecImagExpr class represents the compile...
Definition: Forward.h:125
Compile time type selection.The SelectType class template selects one of the two given types T1 and T...
Definition: SelectType.h:59
Header file for the IsTemporary type trait class.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
size_t index() const
Access to the current index of the sparse element.
Definition: SVecImagExpr.h:261
ValueType & ReferenceType
Reference return type.
Definition: SVecImagExpr.h:196
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2592
#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
Operand sv_
Sparse vector of the imaginary part expression.
Definition: SVecImagExpr.h:465
VT::ReturnType RN
Return type of the sparse vector expression.
Definition: SVecImagExpr.h:105
Header file for the SVecImagExprTrait class template.
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: SVecImagExpr.h:389
bool operator==(const ConstIterator &rhs) const
Equality comparison between two ConstIterator objects.
Definition: SVecImagExpr.h:272
Constraint on the data type.
#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
Header file for the VecImagExpr base class.
CompressedMatrix< Type, false > TransposeType
Transpose type for expression template evaluations.
Definition: CompressedMatrix.h:2585
const ConstIterator * operator->() const
Direct access to the sparse vector element at the current iterator position.
Definition: SVecImagExpr.h:241
IteratorType it_
Iterator over the elements of the sparse vector expression.
Definition: SVecImagExpr.h:301
bool canAlias(const T *alias) const
Returns whether the expression can alias with the given address alias.
Definition: SVecImagExpr.h:436
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.
ConstIterator(IteratorType it)
Constructor for the ConstIterator class.
Definition: SVecImagExpr.h:210
Constraint on the data type.
Header file for the EnableIf class template.
Header file for the serial shim.
DifferenceType difference_type
Difference between two iterators.
Definition: SVecImagExpr.h:204
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
ValueType value_type
Type of the underlying pointers.
Definition: SVecImagExpr.h:201
VT::TransposeType TT
Transpose type of the sparse vector expression.
Definition: SVecImagExpr.h:107
ImagExprTrait< RN >::Type ExprReturnType
Expression return type for the subscript operator.
Definition: SVecImagExpr.h:121
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.
Element ValueType
Type of the underlying pointers.
Definition: SVecImagExpr.h:194
ValueIndexPair< ElementType > Element
Element type of the sparse vector expression.
Definition: SVecImagExpr.h:188
Substitution Failure Is Not An Error (SFINAE) class.The EnableIf class template is an auxiliary tool ...
Definition: EnableIf.h:184
#define BLAZE_CONSTRAINT_MUST_NOT_BE_BUILTIN_TYPE(T)
Constraint on the data type.In case the given data type T is a built-in data type, a compilation error is created.
Definition: Builtin.h:116
size_t size() const
Returns the current size/dimension of the vector.
Definition: SVecImagExpr.h:368
SVecImagExpr< VT, TF > This
Type of this SVecImagExpr instance.
Definition: SVecImagExpr.h:160
Header file for the imaginary trait.
#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
Header file for the RemoveReference type trait.
SelectType< useAssign, const ResultType, const SVecImagExpr & >::Type CompositeType
Data type for composite expression templates.
Definition: SVecImagExpr.h:169
const SelectType< returnExpr, ExprReturnType, ElementType >::Type ReturnType
Return type for expression template evaluations.
Definition: SVecImagExpr.h:166
ImagTrait< RT >::Type ResultType
Result type for expression template evaluations.
Definition: SVecImagExpr.h:161
ConstIterator & operator++()
Pre-increment operator.
Definition: SVecImagExpr.h:220
Index-value-pair for sparse vectors and matrices.The ValueIndexPair class represents a single index-v...
Definition: ValueIndexPair.h:70
std::forward_iterator_tag IteratorCategory
The iterator category.
Definition: SVecImagExpr.h:193
Header file for the IsComputation type trait class.
const Element operator*() const
Direct access to the sparse vector element at the current iterator position.
Definition: SVecImagExpr.h:231
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
SVecImagExpr(const VT &sv)
Constructor for the SVecImagExpr class.
Definition: SVecImagExpr.h:311
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.
Iterator over the elements of the sparse vector imaginary part expression.
Definition: SVecImagExpr.h:183
Header file for exception macros.
Header file for the IsColumnVector type trait.
DifferenceType operator-(const ConstIterator &rhs) const
Calculating the number of elements between two expression iterators.
Definition: SVecImagExpr.h:294
IteratorCategory iterator_category
The iterator category.
Definition: SVecImagExpr.h:200
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_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:81
#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
Constraint on the data type.
Header file for the IsExpression type trait class.
Header file for the FunctionTrace class.