SVecConjExpr.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_EXPRESSIONS_SVECCONJEXPR_H_
36 #define _BLAZE_MATH_EXPRESSIONS_SVECCONJEXPR_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
43 #include <iterator>
67 #include <blaze/util/Assert.h>
69 #include <blaze/util/EnableIf.h>
70 #include <blaze/util/Exception.h>
71 #include <blaze/util/InvalidType.h>
73 #include <blaze/util/SelectType.h>
74 #include <blaze/util/Types.h>
76 
77 
78 namespace blaze {
79 
80 //=================================================================================================
81 //
82 // CLASS SVECCONJEXPR
83 //
84 //=================================================================================================
85 
86 //*************************************************************************************************
93 template< typename VT // Type of the sparse vector
94  , bool TF > // Transpose flag
95 class SVecConjExpr : public SparseVector< SVecConjExpr<VT,TF>, TF >
96  , private VecConjExpr
97  , private Computation
98 {
99  private:
100  //**Type definitions****************************************************************************
101  typedef typename VT::ResultType RT;
102  typedef typename VT::ReturnType RN;
103  typedef typename VT::CompositeType CT;
104  typedef typename VT::TransposeType TT;
105  typedef typename VT::ElementType ET;
106  //**********************************************************************************************
107 
108  //**Return type evaluation**********************************************************************
110 
115  enum { returnExpr = !IsTemporary<RN>::value };
116 
119  //**********************************************************************************************
120 
121  //**Serial evaluation strategy******************************************************************
123 
129  enum { useAssign = RequiresEvaluation<VT>::value };
130 
132  template< typename VT2 >
134  struct UseAssign {
135  enum { value = useAssign };
136  };
138  //**********************************************************************************************
139 
140  //**Parallel evaluation strategy****************************************************************
142 
148  template< typename VT2 >
149  struct UseSMPAssign {
150  enum { value = ( !VT2::smpAssignable || !VT::smpAssignable ) && useAssign };
151  };
153  //**********************************************************************************************
154 
155  public:
156  //**Type definitions****************************************************************************
158  typedef RT ResultType;
159  typedef TT TransposeType;
160  typedef ET ElementType;
161 
164 
167 
169  typedef typename SelectType< IsExpression<VT>::value, const VT, const VT& >::Type Operand;
170  //**********************************************************************************************
171 
172  //**Compilation flags***************************************************************************
174  enum { smpAssignable = VT::smpAssignable };
175  //**********************************************************************************************
176 
177  //**ConstIterator class definition**************************************************************
181  {
182  public:
183  //**Type definitions*************************************************************************
186 
189 
190  typedef std::forward_iterator_tag IteratorCategory;
191  typedef Element ValueType;
192  typedef ValueType* PointerType;
193  typedef ValueType& ReferenceType;
195 
196  // STL iterator requirements
197  typedef IteratorCategory iterator_category;
198  typedef ValueType value_type;
199  typedef PointerType pointer;
200  typedef ReferenceType reference;
201  typedef DifferenceType difference_type;
202  //*******************************************************************************************
203 
204  //**Constructor******************************************************************************
207  inline ConstIterator( IteratorType it )
208  : it_( it ) // Iterator over the elements of the sparse vector expression
209  {}
210  //*******************************************************************************************
211 
212  //**Prefix increment operator****************************************************************
218  ++it_;
219  return *this;
220  }
221  //*******************************************************************************************
222 
223  //**Element access operator******************************************************************
228  inline const Element operator*() const {
229  return Element( conj( it_->value() ), it_->index() );
230  }
231  //*******************************************************************************************
232 
233  //**Element access operator******************************************************************
238  inline const ConstIterator* operator->() const {
239  return this;
240  }
241  //*******************************************************************************************
242 
243  //**Value function***************************************************************************
248  inline ReturnType value() const {
249  return conj( it_->value() );
250  }
251  //*******************************************************************************************
252 
253  //**Index function***************************************************************************
258  inline size_t index() const {
259  return it_->index();
260  }
261  //*******************************************************************************************
262 
263  //**Equality operator************************************************************************
269  inline bool operator==( const ConstIterator& rhs ) const {
270  return it_ == rhs.it_;
271  }
272  //*******************************************************************************************
273 
274  //**Inequality operator**********************************************************************
280  inline bool operator!=( const ConstIterator& rhs ) const {
281  return it_ != rhs.it_;
282  }
283  //*******************************************************************************************
284 
285  //**Subtraction operator*********************************************************************
291  inline DifferenceType operator-( const ConstIterator& rhs ) const {
292  return it_ - rhs.it_;
293  }
294  //*******************************************************************************************
295 
296  private:
297  //**Member variables*************************************************************************
298  IteratorType it_;
299  //*******************************************************************************************
300  };
301  //**********************************************************************************************
302 
303  //**Constructor*********************************************************************************
308  explicit inline SVecConjExpr( const VT& sv )
309  : sv_( sv ) // Sparse vector of the complex conjugate expression
310  {}
311  //**********************************************************************************************
312 
313  //**Subscript operator**************************************************************************
319  inline ReturnType operator[]( size_t index ) const {
320  BLAZE_INTERNAL_ASSERT( index < sv_.size(), "Invalid vector access index" );
321  return conj( sv_[index] );
322  }
323  //**********************************************************************************************
324 
325  //**At function*********************************************************************************
332  inline ReturnType at( size_t index ) const {
333  if( index >= sv_.size() ) {
334  BLAZE_THROW_OUT_OF_RANGE( "Invalid vector access index" );
335  }
336  return (*this)[index];
337  }
338  //**********************************************************************************************
339 
340  //**Begin function******************************************************************************
345  inline ConstIterator begin() const {
346  return ConstIterator( sv_.begin() );
347  }
348  //**********************************************************************************************
349 
350  //**End function********************************************************************************
355  inline ConstIterator end() const {
356  return ConstIterator( sv_.end() );
357  }
358  //**********************************************************************************************
359 
360  //**Size function*******************************************************************************
365  inline size_t size() const {
366  return sv_.size();
367  }
368  //**********************************************************************************************
369 
370  //**NonZeros function***************************************************************************
375  inline size_t nonZeros() const {
376  return sv_.nonZeros();
377  }
378  //**********************************************************************************************
379 
380  //**Find function*******************************************************************************
386  inline ConstIterator find( size_t index ) const {
388  return ConstIterator( sv_.find( index ) );
389  }
390  //**********************************************************************************************
391 
392  //**LowerBound function*************************************************************************
398  inline ConstIterator lowerBound( size_t index ) const {
400  return ConstIterator( sv_.lowerBound( index ) );
401  }
402  //**********************************************************************************************
403 
404  //**UpperBound function*************************************************************************
410  inline ConstIterator upperBound( size_t index ) const {
412  return ConstIterator( sv_.upperBound( index ) );
413  }
414  //**********************************************************************************************
415 
416  //**Operand access******************************************************************************
421  inline Operand operand() const {
422  return sv_;
423  }
424  //**********************************************************************************************
425 
426  //**********************************************************************************************
432  template< typename T >
433  inline bool canAlias( const T* alias ) const {
434  return sv_.canAlias( alias );
435  }
436  //**********************************************************************************************
437 
438  //**********************************************************************************************
444  template< typename T >
445  inline bool isAliased( const T* alias ) const {
446  return sv_.isAliased( alias );
447  }
448  //**********************************************************************************************
449 
450  //**********************************************************************************************
455  inline bool canSMPAssign() const {
456  return sv_.canSMPAssign();
457  }
458  //**********************************************************************************************
459 
460  private:
461  //**Member variables****************************************************************************
462  Operand sv_;
463  //**********************************************************************************************
464 
465  //**Assignment to dense vectors*****************************************************************
479  template< typename VT2 > // Type of the target dense vector
480  friend inline typename EnableIf< UseAssign<VT2> >::Type
481  assign( DenseVector<VT2,TF>& lhs, const SVecConjExpr& rhs )
482  {
484 
485  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
486 
487  assign( ~lhs, rhs.sv_ );
488  assign( ~lhs, conj( ~lhs ) );
489  }
491  //**********************************************************************************************
492 
493  //**Assignment to sparse vectors****************************************************************
507  template< typename VT2 > // Type of the target sparse vector
508  friend inline typename EnableIf< UseAssign<VT2> >::Type
509  assign( SparseVector<VT2,TF>& lhs, const SVecConjExpr& rhs )
510  {
512 
513  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
514 
515  typedef typename VT2::Iterator Iterator;
516 
517  assign( ~lhs, rhs.sv_ );
518 
519  const Iterator end( (~lhs).end() );
520  for( Iterator element=(~lhs).begin(); element!=end; ++element ) {
521  conjugate( element->value() );
522  }
523  }
525  //**********************************************************************************************
526 
527  //**Addition assignment to dense vectors********************************************************
541  template< typename VT2 > // Type of the target dense vector
542  friend inline typename EnableIf< UseAssign<VT2> >::Type
543  addAssign( DenseVector<VT2,TF>& lhs, const SVecConjExpr& rhs )
544  {
546 
550 
551  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
552 
553  const ResultType tmp( serial( rhs ) );
554  addAssign( ~lhs, tmp );
555  }
557  //**********************************************************************************************
558 
559  //**Addition assignment to sparse vectors*******************************************************
560  // No special implementation for the addition assignment to sparse vectors.
561  //**********************************************************************************************
562 
563  //**Subtraction assignment to dense vectors*****************************************************
577  template< typename VT2 > // Type of the target dense vector
578  friend inline typename EnableIf< UseAssign<VT2> >::Type
579  subAssign( DenseVector<VT2,TF>& lhs, const SVecConjExpr& rhs )
580  {
582 
586 
587  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
588 
589  const ResultType tmp( serial( rhs ) );
590  subAssign( ~lhs, tmp );
591  }
593  //**********************************************************************************************
594 
595  //**Subtraction assignment to sparse vectors****************************************************
596  // No special implementation for the subtraction assignment to sparse vectors.
597  //**********************************************************************************************
598 
599  //**Multiplication assignment to dense vectors**************************************************
613  template< typename VT2 > // Type of the target dense vector
614  friend inline typename EnableIf< UseAssign<VT2> >::Type
615  multAssign( DenseVector<VT2,TF>& lhs, const SVecConjExpr& rhs )
616  {
618 
622 
623  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
624 
625  const ResultType tmp( serial( rhs ) );
626  multAssign( ~lhs, tmp );
627  }
629  //**********************************************************************************************
630 
631  //**Multiplication assignment to sparse vectors*************************************************
632  // No special implementation for the multiplication assignment to sparse vectors.
633  //**********************************************************************************************
634 
635  //**SMP assignment to dense vectors*************************************************************
649  template< typename VT2 > // Type of the target dense vector
650  friend inline typename EnableIf< UseSMPAssign<VT2> >::Type
651  smpAssign( DenseVector<VT2,TF>& lhs, const SVecConjExpr& rhs )
652  {
654 
655  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
656 
657  smpAssign( ~lhs, rhs.sv_ );
658  smpAssign( ~lhs, conj( ~lhs ) );
659  }
661  //**********************************************************************************************
662 
663  //**SMP assignment to sparse vectors************************************************************
664  // No special implementation for the SMP assignment to sparse vectors.
665  //**********************************************************************************************
666 
667  //**SMP addition assignment to dense vectors****************************************************
681  template< typename VT2 > // Type of the target dense vector
682  friend inline typename EnableIf< UseSMPAssign<VT2> >::Type
683  smpAddAssign( DenseVector<VT2,TF>& lhs, const SVecConjExpr& rhs )
684  {
686 
690 
691  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
692 
693  const ResultType tmp( rhs );
694  smpAddAssign( ~lhs, tmp );
695  }
697  //**********************************************************************************************
698 
699  //**SMP addition assignment to sparse vectors***************************************************
700  // No special implementation for the SMP addition assignment to sparse vectors.
701  //**********************************************************************************************
702 
703  //**SMP subtraction assignment to dense vectors*************************************************
717  template< typename VT2 > // Type of the target dense vector
718  friend inline typename EnableIf< UseSMPAssign<VT2> >::Type
719  smpSubAssign( DenseVector<VT2,TF>& lhs, const SVecConjExpr& rhs )
720  {
722 
726 
727  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
728 
729  const ResultType tmp( rhs );
730  smpSubAssign( ~lhs, tmp );
731  }
733  //**********************************************************************************************
734 
735  //**SMP subtraction assignment to sparse vectors************************************************
736  // No special implementation for the SMP subtraction assignment to sparse vectors.
737  //**********************************************************************************************
738 
739  //**SMP multiplication assignment to dense vectors**********************************************
753  template< typename VT2 > // Type of the target dense vector
754  friend inline typename EnableIf< UseSMPAssign<VT2> >::Type
755  smpMultAssign( DenseVector<VT2,TF>& lhs, const SVecConjExpr& rhs )
756  {
758 
762 
763  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
764 
765  const ResultType tmp( rhs );
766  smpMultAssign( ~lhs, tmp );
767  }
769  //**********************************************************************************************
770 
771  //**SMP multiplication assignment to sparse vectors*********************************************
772  // No special implementation for the SMP multiplication assignment to sparse vectors.
773  //**********************************************************************************************
774 
775  //**Compile time checks*************************************************************************
780  //**********************************************************************************************
781 };
782 //*************************************************************************************************
783 
784 
785 
786 
787 //=================================================================================================
788 //
789 // GLOBAL FUNCTIONS
790 //
791 //=================================================================================================
792 
793 //*************************************************************************************************
810 template< typename VT // Type of the sparse vector
811  , bool TF > // Transpose flag
813 {
815 
816  return SVecConjExpr<VT,TF>( ~sv );
817 }
818 //*************************************************************************************************
819 
820 
821 //*************************************************************************************************
847 template< typename VT // Type of the sparse vector
848  , bool TF > // Transpose flag
849 inline const typename CTransExprTrait<VT>::Type ctrans( const SparseVector<VT,TF>& sv )
850 {
852 
853  return trans( conj( ~sv ) );
854 }
855 //*************************************************************************************************
856 
857 
858 
859 
860 //=================================================================================================
861 //
862 // GLOBAL RESTRUCTURING FUNCTIONS
863 //
864 //=================================================================================================
865 
866 //*************************************************************************************************
884 template< typename VT // Type of the sparse vector
885  , bool TF > // Transpose flag
886 inline typename SVecConjExpr<VT,TF>::Operand conj( const SVecConjExpr<VT,TF>& sv )
887 {
889 
890  return sv.operand();
891 }
893 //*************************************************************************************************
894 
895 
896 //*************************************************************************************************
914 template< typename VT // Type of the sparse vector
915  , bool TF > // Transpose flag
916 inline const SVecTransExpr<VT,!TF> conj( const SVecTransExpr<SVecConjExpr<VT,TF>,!TF>& sv )
917 {
919 
920  return SVecTransExpr<VT,!TF>( sv.operand().operand() );
921 }
923 //*************************************************************************************************
924 
925 
926 
927 
928 //=================================================================================================
929 //
930 // SIZE SPECIALIZATIONS
931 //
932 //=================================================================================================
933 
934 //*************************************************************************************************
936 template< typename VT, bool TF >
937 struct Size< SVecConjExpr<VT,TF> > : public Size<VT>
938 {};
940 //*************************************************************************************************
941 
942 
943 
944 
945 //=================================================================================================
946 //
947 // EXPRESSION TRAIT SPECIALIZATIONS
948 //
949 //=================================================================================================
950 
951 //*************************************************************************************************
953 template< typename VT >
954 struct SVecConjExprTrait< SVecConjExpr<VT,false> >
955 {
956  public:
957  //**********************************************************************************************
958  typedef typename SelectType< IsSparseVector<VT>::value && IsColumnVector<VT>::value
959  , typename SVecConjExpr<VT,false>::Operand
960  , INVALID_TYPE >::Type Type;
961  //**********************************************************************************************
962 };
964 //*************************************************************************************************
965 
966 
967 //*************************************************************************************************
969 template< typename VT >
970 struct TSVecConjExprTrait< SVecConjExpr<VT,true> >
971 {
972  public:
973  //**********************************************************************************************
974  typedef typename SelectType< IsSparseVector<VT>::value && IsRowVector<VT>::value
975  , typename SVecConjExpr<VT,true>::Operand
976  , INVALID_TYPE >::Type Type;
977  //**********************************************************************************************
978 };
980 //*************************************************************************************************
981 
982 
983 //*************************************************************************************************
985 template< typename VT >
986 struct SVecConjExprTrait< SVecTransExpr< SVecConjExpr<VT,true>, false > >
987 {
988  public:
989  //**********************************************************************************************
990  typedef typename SelectType< IsSparseVector<VT>::value && IsRowVector<VT>::value
991  , SVecTransExpr<VT,false>
992  , INVALID_TYPE >::Type Type;
993  //**********************************************************************************************
994 };
996 //*************************************************************************************************
997 
998 
999 //*************************************************************************************************
1001 template< typename VT >
1002 struct TSVecConjExprTrait< SVecTransExpr< SVecConjExpr<VT,false>, true > >
1003 {
1004  public:
1005  //**********************************************************************************************
1006  typedef typename SelectType< IsSparseVector<VT>::value && IsColumnVector<VT>::value
1007  , SVecTransExpr<VT,true>
1008  , INVALID_TYPE >::Type Type;
1009  //**********************************************************************************************
1010 };
1012 //*************************************************************************************************
1013 
1014 
1015 //*************************************************************************************************
1017 template< typename VT, bool TF, bool AF >
1018 struct SubvectorExprTrait< SVecConjExpr<VT,TF>, AF >
1019 {
1020  public:
1021  //**********************************************************************************************
1022  typedef typename ConjExprTrait< typename SubvectorExprTrait<const VT,AF>::Type >::Type Type;
1023  //**********************************************************************************************
1024 };
1026 //*************************************************************************************************
1027 
1028 } // namespace blaze
1029 
1030 #endif
ConstIterator find(size_t index) const
Searches for a specific vector element.
Definition: SVecConjExpr.h:386
ConjExprTrait< RN >::Type ExprReturnType
Expression return type for the subscript operator.
Definition: SVecConjExpr.h:118
Pointer difference type of the Blaze library.
SVecConjExpr< VT, TF > This
Type of this SVecConjExpr instance.
Definition: SVecConjExpr.h:157
ValueType & ReferenceType
Reference return type.
Definition: SVecConjExpr.h:193
Compile time check whether the given type is a temporary vector or matrix type.This type trait class ...
Definition: IsTemporary.h:87
Expression object for the sparse vector conj() function.The SVecConjExpr class represents the compile...
Definition: Forward.h:120
Header file for basic type definitions.
const ConstIterator * operator->() const
Direct access to the sparse vector element at the current iterator position.
Definition: SVecConjExpr.h:238
ConstIterator(IteratorType it)
Constructor for the ConstIterator class.
Definition: SVecConjExpr.h:207
Header file for the SparseVector base class.
IteratorType it_
Iterator over the elements of the sparse vector expression.
Definition: SVecConjExpr.h:298
ReturnType value() const
Access to the current value of the sparse element.
Definition: SVecConjExpr.h:248
ConstIterator end() const
Returns an iterator just past the last non-zero element of the sparse vector.
Definition: SVecConjExpr.h:355
Element ValueType
Type of the underlying pointers.
Definition: SVecConjExpr.h:191
ET ElementType
Resulting element type.
Definition: SVecConjExpr.h:160
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:2588
Header file for the IsRowVector type trait.
Iterator over the elements of the sparse vector complex conjugate expression.
Definition: SVecConjExpr.h:180
ValueType * PointerType
Pointer return type.
Definition: SVecConjExpr.h:192
TT TransposeType
Transpose type for expression template evaluations.
Definition: SVecConjExpr.h:159
Header file for the VecConjExpr base class.
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 & operator++()
Pre-increment operator.
Definition: SVecConjExpr.h:217
bool operator!=(const ConstIterator &rhs) const
Inequality comparison between two ConstIterator objects.
Definition: SVecConjExpr.h:280
Header file for the Computation base class.
Header file for the RequiresEvaluation type trait.
const SelectType< returnExpr, ExprReturnType, ElementType >::Type ReturnType
Return type for expression template evaluations.
Definition: SVecConjExpr.h:163
Constraint on the data type.
ConjExprTrait< typename DiagonalProxy< MT >::RepresentedType >::Type conj(const DiagonalProxy< MT > &proxy)
Computing the complex conjugate of the represented element.
Definition: DiagonalProxy.h:487
Compile time check to query the requirement to evaluate an expression.Via this type trait it is possi...
Definition: RequiresEvaluation.h:90
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:261
ReferenceType reference
Reference return type.
Definition: SVecConjExpr.h:200
Header file for the ValueIndexPair class.
VT::ReturnType RN
Return type of the sparse vector expression.
Definition: SVecConjExpr.h:102
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: SVecConjExpr.h:258
IteratorCategory iterator_category
The iterator category.
Definition: SVecConjExpr.h:197
ValueType value_type
Type of the underlying pointers.
Definition: SVecConjExpr.h:198
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
BLAZE_ALWAYS_INLINE void conjugate(T &a)
In-place conjugation of the given value/object.
Definition: Conjugate.h:120
const CTransExprTrait< MT >::Type ctrans(const DenseMatrix< MT, SO > &dm)
Returns the conjugate transpose matrix of dm.
Definition: DMatConjExpr.h:974
bool operator==(const ConstIterator &rhs) const
Equality comparison between two ConstIterator objects.
Definition: SVecConjExpr.h:269
Base class for N-dimensional dense vectors.The DenseVector class is a base class for all arbitrarily ...
Definition: DenseVector.h:70
VT::CompositeType CT
Composite type of the sparse vector expression.
Definition: SVecConjExpr.h:103
#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
ReturnType operator[](size_t index) const
Subscript operator for the direct access to the vector elements.
Definition: SVecConjExpr.h:319
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
CompressedMatrix< Type, false > TransposeType
Transpose type for expression template evaluations.
Definition: CompressedMatrix.h:2585
PointerType pointer
Pointer return type.
Definition: SVecConjExpr.h:199
VT::TransposeType TT
Transpose type of the sparse vector expression.
Definition: SVecConjExpr.h:104
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:2586
ConstIterator begin() const
Returns an iterator to the first non-zero element of the sparse vector.
Definition: SVecConjExpr.h:345
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.
Operand operand() const
Returns the sparse vector operand.
Definition: SVecConjExpr.h:421
Header file for the EnableIf class template.
bool isAliased(const T *alias) const
Returns whether the expression is aliased with the given address alias.
Definition: SVecConjExpr.h:445
Header file for the serial shim.
RemoveReference< Operand >::Type::ConstIterator IteratorType
Iterator type of the sparse vector expression.
Definition: SVecConjExpr.h:188
SelectType< IsExpression< VT >::value, const VT, const VT & >::Type Operand
Composite data type of the sparse vector expression.
Definition: SVecConjExpr.h:169
Header file for the conjugate shim.
SelectType< useAssign, const ResultType, const SVecConjExpr & >::Type CompositeType
Data type for composite expression templates.
Definition: SVecConjExpr.h:166
VT::ResultType RT
Result type of the sparse vector expression.
Definition: SVecConjExpr.h:101
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
Evaluation of the return type of a complex conjugate expression.Via this type trait it is possible to...
Definition: ConjExprTrait.h:87
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
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
std::forward_iterator_tag IteratorCategory
The iterator category.
Definition: SVecConjExpr.h:190
Utility type for generic codes.
Header file for the TSVecConjExprTrait class template.
Header file for the SVecConjExprTrait class template.
ValueIndexPair< ElementType > Element
Element type of the sparse vector expression.
Definition: SVecConjExpr.h:185
Substitution Failure Is Not An Error (SFINAE) class.The EnableIf class template is an auxiliary tool ...
Definition: EnableIf.h:184
Element * Iterator
Iterator over non-constant elements.
Definition: CompressedMatrix.h:2591
#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
bool canAlias(const T *alias) const
Returns whether the expression can alias with the given address alias.
Definition: SVecConjExpr.h:433
DifferenceType difference_type
Difference between two iterators.
Definition: SVecConjExpr.h:201
bool canSMPAssign() const
Returns whether the expression can be used in SMP assignments.
Definition: SVecConjExpr.h:455
Evaluation of the return type of a conjugate transpose expression.Via this type trait it is possible ...
Definition: CTransExprTrait.h:87
Header file for the RemoveReference type trait.
SVecConjExpr(const VT &sv)
Constructor for the SVecConjExpr class.
Definition: SVecConjExpr.h:308
Index-value-pair for sparse vectors and matrices.The ValueIndexPair class represents a single index-v...
Definition: ValueIndexPair.h:70
ReturnType at(size_t index) const
Checked access to the vector elements.
Definition: SVecConjExpr.h:332
const DMatTransExpr< MT,!SO > trans(const DenseMatrix< MT, SO > &dm)
Calculation of the transpose of the given dense matrix.
Definition: DMatTransExpr.h:944
Header file for the IsComputation type trait class.
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
size_t size() const
Returns the current size/dimension of the vector.
Definition: SVecConjExpr.h:365
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
const Element operator*() const
Direct access to the sparse vector element at the current iterator position.
Definition: SVecConjExpr.h:228
ptrdiff_t DifferenceType
Difference between two iterators.
Definition: SVecConjExpr.h:194
This ResultType
Result type for expression template evaluations.
Definition: CompressedMatrix.h:2583
ConstIterator upperBound(size_t index) const
Returns an iterator to the first index greater then the given index.
Definition: SVecConjExpr.h:410
Header file for the SubvectorExprTrait class template.
VT::ElementType ET
Element type of the sparse vector expression.
Definition: SVecConjExpr.h:105
ConstIterator lowerBound(size_t index) const
Returns an iterator to the first index not less then the given index.
Definition: SVecConjExpr.h:398
Header file for exception macros.
Header file for the CTransExprTrait class template.
size_t nonZeros() const
Returns the number of non-zero elements in the sparse vector.
Definition: SVecConjExpr.h:375
Header file for the IsColumnVector type trait.
RT ResultType
Result type for expression template evaluations.
Definition: SVecConjExpr.h:158
Header file for the ConjExprTrait class template.
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
DifferenceType operator-(const ConstIterator &rhs) const
Calculating the number of elements between two expression iterators.
Definition: SVecConjExpr.h:291
Operand sv_
Sparse vector of the complex conjugate expression.
Definition: SVecConjExpr.h:462
#define BLAZE_INTERNAL_ASSERT(expr, msg)
Run time assertion macro for internal checks.In case of an invalid run time expression, the program execution is terminated. The BLAZE_INTERNAL_ASSERT macro can be disabled by setting the BLAZE_USER_ASSERTION flag to zero or by defining NDEBUG during the compilation.
Definition: Assert.h:101
Header file for the IsExpression type trait class.
Header file for the FunctionTrace class.