DVecRealExpr.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_EXPRESSIONS_DVECREALEXPR_H_
36 #define _BLAZE_MATH_EXPRESSIONS_DVECREALEXPR_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
43 #include <cmath>
44 #include <iterator>
51 #include <blaze/math/shims/Real.h>
68 #include <blaze/system/Inline.h>
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>
78 
79 
80 namespace blaze {
81 
82 //=================================================================================================
83 //
84 // CLASS DVECREALEXPR
85 //
86 //=================================================================================================
87 
88 //*************************************************************************************************
95 template< typename VT // Type of the dense vector
96  , bool TF > // Transpose flag
97 class DVecRealExpr : public DenseVector< DVecRealExpr<VT,TF>, TF >
98  , private VecRealExpr
99  , private Computation
100 {
101  private:
102  //**Type definitions****************************************************************************
103  typedef typename VT::ResultType RT;
104  typedef typename VT::ReturnType RN;
105  //**********************************************************************************************
106 
107  //**Return type evaluation**********************************************************************
109 
114  enum { returnExpr = !IsTemporary<RN>::value };
115 
118  //**********************************************************************************************
119 
120  //**Serial evaluation strategy******************************************************************
122 
128  enum { useAssign = RequiresEvaluation<VT>::value };
129 
131  template< typename VT2 >
133  struct UseAssign {
134  enum { value = useAssign };
135  };
137  //**********************************************************************************************
138 
139  //**Parallel evaluation strategy****************************************************************
141 
147  template< typename VT2 >
148  struct UseSMPAssign {
149  enum { value = ( !VT2::smpAssignable || !VT::smpAssignable ) && useAssign };
150  };
152  //**********************************************************************************************
153 
154  public:
155  //**Type definitions****************************************************************************
157  typedef typename RealTrait<RT>::Type ResultType;
160 
163 
166 
168  typedef typename SelectType< IsExpression<VT>::value, const VT, const VT& >::Type Operand;
169  //**********************************************************************************************
170 
171  //**ConstIterator class definition**************************************************************
175  {
176  public:
177  //**Type definitions*************************************************************************
178  typedef std::random_access_iterator_tag IteratorCategory;
179  typedef ElementType ValueType;
180  typedef ElementType* PointerType;
181  typedef ElementType& ReferenceType;
183 
184  // STL iterator requirements
185  typedef IteratorCategory iterator_category;
186  typedef ValueType value_type;
187  typedef PointerType pointer;
188  typedef ReferenceType reference;
189  typedef DifferenceType difference_type;
190 
192  typedef typename VT::ConstIterator IteratorType;
193  //*******************************************************************************************
194 
195  //**Constructor******************************************************************************
200  explicit inline ConstIterator( IteratorType it )
201  : it_( it ) // Iterator to the current vector element
202  {}
203  //*******************************************************************************************
204 
205  //**Addition assignment operator*************************************************************
211  inline ConstIterator& operator+=( size_t inc ) {
212  it_ += inc;
213  return *this;
214  }
215  //*******************************************************************************************
216 
217  //**Subtraction assignment operator**********************************************************
223  inline ConstIterator& operator-=( size_t dec ) {
224  it_ -= dec;
225  return *this;
226  }
227  //*******************************************************************************************
228 
229  //**Prefix increment operator****************************************************************
235  ++it_;
236  return *this;
237  }
238  //*******************************************************************************************
239 
240  //**Postfix increment operator***************************************************************
245  inline const ConstIterator operator++( int ) {
246  return ConstIterator( it_++ );
247  }
248  //*******************************************************************************************
249 
250  //**Prefix decrement operator****************************************************************
256  --it_;
257  return *this;
258  }
259  //*******************************************************************************************
260 
261  //**Postfix decrement operator***************************************************************
266  inline const ConstIterator operator--( int ) {
267  return ConstIterator( it_-- );
268  }
269  //*******************************************************************************************
270 
271  //**Element access operator******************************************************************
276  inline ReturnType operator*() const {
277  return real( *it_ );
278  }
279  //*******************************************************************************************
280 
281  //**Equality operator************************************************************************
287  inline bool operator==( const ConstIterator& rhs ) const {
288  return it_ == rhs.it_;
289  }
290  //*******************************************************************************************
291 
292  //**Inequality operator**********************************************************************
298  inline bool operator!=( const ConstIterator& rhs ) const {
299  return it_ != rhs.it_;
300  }
301  //*******************************************************************************************
302 
303  //**Less-than operator***********************************************************************
309  inline bool operator<( const ConstIterator& rhs ) const {
310  return it_ < rhs.it_;
311  }
312  //*******************************************************************************************
313 
314  //**Greater-than operator********************************************************************
320  inline bool operator>( const ConstIterator& rhs ) const {
321  return it_ > rhs.it_;
322  }
323  //*******************************************************************************************
324 
325  //**Less-or-equal-than operator**************************************************************
331  inline bool operator<=( const ConstIterator& rhs ) const {
332  return it_ <= rhs.it_;
333  }
334  //*******************************************************************************************
335 
336  //**Greater-or-equal-than operator***********************************************************
342  inline bool operator>=( const ConstIterator& rhs ) const {
343  return it_ >= rhs.it_;
344  }
345  //*******************************************************************************************
346 
347  //**Subtraction operator*********************************************************************
353  inline DifferenceType operator-( const ConstIterator& rhs ) const {
354  return it_ - rhs.it_;
355  }
356  //*******************************************************************************************
357 
358  //**Addition operator************************************************************************
365  friend inline const ConstIterator operator+( const ConstIterator& it, size_t inc ) {
366  return ConstIterator( it.it_ + inc );
367  }
368  //*******************************************************************************************
369 
370  //**Addition operator************************************************************************
377  friend inline const ConstIterator operator+( size_t inc, const ConstIterator& it ) {
378  return ConstIterator( it.it_ + inc );
379  }
380  //*******************************************************************************************
381 
382  //**Subtraction operator*********************************************************************
389  friend inline const ConstIterator operator-( const ConstIterator& it, size_t dec ) {
390  return ConstIterator( it.it_ - dec );
391  }
392  //*******************************************************************************************
393 
394  private:
395  //**Member variables*************************************************************************
396  IteratorType it_;
397  //*******************************************************************************************
398  };
399  //**********************************************************************************************
400 
401  //**Compilation flags***************************************************************************
403  enum { vectorizable = 0 };
404 
406  enum { smpAssignable = VT::smpAssignable };
407  //**********************************************************************************************
408 
409  //**Constructor*********************************************************************************
414  explicit inline DVecRealExpr( const VT& dv )
415  : dv_( dv ) // Dense vector of the real part expression
416  {}
417  //**********************************************************************************************
418 
419  //**Subscript operator**************************************************************************
425  inline ReturnType operator[]( size_t index ) const {
426  BLAZE_INTERNAL_ASSERT( index < dv_.size(), "Invalid vector access index" );
427  return real( dv_[index] );
428  }
429  //**********************************************************************************************
430 
431  //**At function*********************************************************************************
438  inline ReturnType at( size_t index ) const {
439  if( index >= dv_.size() ) {
440  BLAZE_THROW_OUT_OF_RANGE( "Invalid vector access index" );
441  }
442  return (*this)[index];
443  }
444  //**********************************************************************************************
445 
446  //**Begin function******************************************************************************
451  inline ConstIterator begin() const {
452  return ConstIterator( dv_.begin() );
453  }
454  //**********************************************************************************************
455 
456  //**End function********************************************************************************
461  inline ConstIterator end() const {
462  return ConstIterator( dv_.end() );
463  }
464  //**********************************************************************************************
465 
466  //**Size function*******************************************************************************
471  inline size_t size() const {
472  return dv_.size();
473  }
474  //**********************************************************************************************
475 
476  //**Operand access******************************************************************************
481  inline Operand operand() const {
482  return dv_;
483  }
484  //**********************************************************************************************
485 
486  //**********************************************************************************************
492  template< typename T >
493  inline bool canAlias( const T* alias ) const {
494  return IsComputation<VT>::value && dv_.canAlias( alias );
495  }
496  //**********************************************************************************************
497 
498  //**********************************************************************************************
504  template< typename T >
505  inline bool isAliased( const T* alias ) const {
506  return dv_.isAliased( alias );
507  }
508  //**********************************************************************************************
509 
510  //**********************************************************************************************
515  inline bool isAligned() const {
516  return dv_.isAligned();
517  }
518  //**********************************************************************************************
519 
520  //**********************************************************************************************
525  inline bool canSMPAssign() const {
526  return dv_.canSMPAssign();
527  }
528  //**********************************************************************************************
529 
530  private:
531  //**Member variables****************************************************************************
532  Operand dv_;
533  //**********************************************************************************************
534 
535  //**Assignment to dense vectors*****************************************************************
549  template< typename VT2 > // Type of the target dense vector
550  friend inline typename EnableIf< UseAssign<VT2> >::Type
551  assign( DenseVector<VT2,TF>& lhs, const DVecRealExpr& rhs )
552  {
554 
558 
559  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
560 
561  const RT tmp( serial( rhs.dv_ ) );
562  assign( ~lhs, real( tmp ) );
563  }
565  //**********************************************************************************************
566 
567  //**Assignment to sparse vectors****************************************************************
581  template< typename VT2 > // Type of the target sparse vector
582  friend inline typename EnableIf< UseAssign<VT2> >::Type
583  assign( SparseVector<VT2,TF>& lhs, const DVecRealExpr& rhs )
584  {
586 
590 
591  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
592 
593  const RT tmp( serial( rhs.dv_ ) );
594  assign( ~lhs, real( tmp ) );
595  }
597  //**********************************************************************************************
598 
599  //**Addition assignment to dense vectors********************************************************
613  template< typename VT2 > // Type of the target dense vector
614  friend inline typename EnableIf< UseAssign<VT2> >::Type
615  addAssign( DenseVector<VT2,TF>& lhs, const DVecRealExpr& rhs )
616  {
618 
622 
623  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
624 
625  const RT tmp( serial( rhs.dv_ ) );
626  addAssign( ~lhs, real( tmp ) );
627  }
629  //**********************************************************************************************
630 
631  //**Addition assignment to sparse vectors*******************************************************
632  // No special implementation for the addition assignment to sparse vectors.
633  //**********************************************************************************************
634 
635  //**Subtraction assignment to dense vectors*****************************************************
649  template< typename VT2 > // Type of the target dense vector
650  friend inline typename EnableIf< UseAssign<VT2> >::Type
651  subAssign( DenseVector<VT2,TF>& lhs, const DVecRealExpr& rhs )
652  {
654 
658 
659  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
660 
661  const RT tmp( serial( rhs.dv_ ) );
662  subAssign( ~lhs, real( tmp ) );
663  }
665  //**********************************************************************************************
666 
667  //**Subtraction assignment to sparse vectors****************************************************
668  // No special implementation for the subtraction assignment to sparse vectors.
669  //**********************************************************************************************
670 
671  //**Multiplication assignment to dense vectors**************************************************
685  template< typename VT2 > // Type of the target dense vector
686  friend inline typename EnableIf< UseAssign<VT2> >::Type
687  multAssign( DenseVector<VT2,TF>& lhs, const DVecRealExpr& rhs )
688  {
690 
694 
695  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
696 
697  const RT tmp( serial( rhs.dv_ ) );
698  multAssign( ~lhs, real( tmp ) );
699  }
701  //**********************************************************************************************
702 
703  //**Multiplication assignment to sparse vectors*************************************************
704  // No special implementation for the multiplication assignment to sparse vectors.
705  //**********************************************************************************************
706 
707  //**SMP assignment to dense vectors*************************************************************
722  template< typename VT2 > // Type of the target dense vector
723  friend inline typename EnableIf< UseSMPAssign<VT2> >::Type
724  smpAssign( DenseVector<VT2,TF>& lhs, const DVecRealExpr& rhs )
725  {
727 
731 
732  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
733 
734  const RT tmp( rhs.dv_ );
735  smpAssign( ~lhs, real( tmp ) );
736  }
738  //**********************************************************************************************
739 
740  //**SMP assignment to sparse vectors************************************************************
754  template< typename VT2 > // Type of the target sparse vector
755  friend inline typename EnableIf< UseSMPAssign<VT2> >::Type
756  smpAssign( SparseVector<VT2,TF>& lhs, const DVecRealExpr& rhs )
757  {
759 
763 
764  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
765 
766  const RT tmp( rhs.dv_ );
767  smpAssign( ~lhs, real( tmp ) );
768  }
770  //**********************************************************************************************
771 
772  //**SMP addition assignment to dense vectors****************************************************
786  template< typename VT2 > // Type of the target dense vector
787  friend inline typename EnableIf< UseSMPAssign<VT2> >::Type
788  smpAddAssign( DenseVector<VT2,TF>& lhs, const DVecRealExpr& rhs )
789  {
791 
795 
796  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
797 
798  const RT tmp( rhs.dv_ );
799  smpAddAssign( ~lhs, real( tmp ) );
800  }
802  //**********************************************************************************************
803 
804  //**SMP addition assignment to sparse vectors***************************************************
805  // No special implementation for the SMP addition assignment to sparse vectors.
806  //**********************************************************************************************
807 
808  //**SMP subtraction assignment to dense vectors*************************************************
822  template< typename VT2 > // Type of the target dense vector
823  friend inline typename EnableIf< UseSMPAssign<VT2> >::Type
824  smpSubAssign( DenseVector<VT2,TF>& lhs, const DVecRealExpr& rhs )
825  {
827 
831 
832  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
833 
834  const RT tmp( rhs.dv_ );
835  smpSubAssign( ~lhs, real( tmp ) );
836  }
838  //**********************************************************************************************
839 
840  //**SMP subtraction assignment to sparse vectors************************************************
841  // No special implementation for the SMP subtraction assignment to sparse vectors.
842  //**********************************************************************************************
843 
844  //**SMP multiplication assignment to dense vectors**********************************************
858  template< typename VT2 > // Type of the target dense vector
859  friend inline typename EnableIf< UseSMPAssign<VT2> >::Type
860  smpMultAssign( DenseVector<VT2,TF>& lhs, const DVecRealExpr& rhs )
861  {
863 
867 
868  BLAZE_INTERNAL_ASSERT( (~lhs).size() == rhs.size(), "Invalid vector sizes" );
869 
870  const RT tmp( rhs.dv_ );
871  smpMultAssign( ~lhs, real( tmp ) );
872  }
874  //**********************************************************************************************
875 
876  //**SMP multiplication assignment to sparse vectors*********************************************
877  // No special implementation for the SMP multiplication assignment to sparse vectors.
878  //**********************************************************************************************
879 
880  //**Compile time checks*************************************************************************
884  BLAZE_CONSTRAINT_MUST_NOT_BE_BUILTIN_TYPE( typename UnderlyingNumeric<VT>::Type );
886  //**********************************************************************************************
887 };
888 //*************************************************************************************************
889 
890 
891 
892 
893 //=================================================================================================
894 //
895 // GLOBAL FUNCTIONS
896 //
897 //=================================================================================================
898 
899 //*************************************************************************************************
916 template< typename VT // Type of the dense vector
917  , bool TF > // Transpose flag
918 inline const typename RealExprTrait<VT>::Type real( const DenseVector<VT,TF>& dv )
919 {
921 
922  return typename RealExprTrait<VT>::Type( ~dv );
923 }
924 //*************************************************************************************************
925 
926 
927 
928 
929 //=================================================================================================
930 //
931 // GLOBAL RESTRUCTURING FUNCTIONS
932 //
933 //=================================================================================================
934 
935 //*************************************************************************************************
946 template< typename VT // Type of the dense vector
947  , bool TF > // Transpose flag
948 inline const DVecRealExpr<VT,TF>& real( const DVecRealExpr<VT,TF>& dv )
949 {
951 
952  return dv;
953 }
955 //*************************************************************************************************
956 
957 
958 
959 
960 //=================================================================================================
961 //
962 // SIZE SPECIALIZATIONS
963 //
964 //=================================================================================================
965 
966 //*************************************************************************************************
968 template< typename VT, bool TF >
969 struct Size< DVecRealExpr<VT,TF> > : public Size<VT>
970 {};
972 //*************************************************************************************************
973 
974 
975 
976 
977 //=================================================================================================
978 //
979 // ISALIGNED SPECIALIZATIONS
980 //
981 //=================================================================================================
982 
983 //*************************************************************************************************
985 template< typename VT, bool TF >
986 struct IsAligned< DVecRealExpr<VT,TF> > : public IsTrue< IsAligned<VT>::value >
987 {};
989 //*************************************************************************************************
990 
991 
992 
993 
994 //=================================================================================================
995 //
996 // EXPRESSION TRAIT SPECIALIZATIONS
997 //
998 //=================================================================================================
999 
1000 //*************************************************************************************************
1002 template< typename VT >
1003 struct DVecRealExprTrait< DVecRealExpr<VT,false> >
1004 {
1005  public:
1006  //**********************************************************************************************
1007  typedef typename SelectType< IsDenseVector<VT>::value && IsColumnVector<VT>::value
1008  , DVecRealExpr<VT,false>
1009  , INVALID_TYPE >::Type Type;
1010  //**********************************************************************************************
1011 };
1013 //*************************************************************************************************
1014 
1015 
1016 //*************************************************************************************************
1018 template< typename VT >
1019 struct TDVecRealExprTrait< DVecRealExpr<VT,true> >
1020 {
1021  public:
1022  //**********************************************************************************************
1023  typedef typename SelectType< IsDenseVector<VT>::value && IsRowVector<VT>::value
1024  , DVecRealExpr<VT,true>
1025  , INVALID_TYPE >::Type Type;
1026  //**********************************************************************************************
1027 };
1029 //*************************************************************************************************
1030 
1031 
1032 //*************************************************************************************************
1034 template< typename VT, bool TF, bool AF >
1035 struct SubvectorExprTrait< DVecRealExpr<VT,TF>, AF >
1036 {
1037  public:
1038  //**********************************************************************************************
1039  typedef typename RealExprTrait< typename SubvectorExprTrait<const VT,AF>::Type >::Type Type;
1040  //**********************************************************************************************
1041 };
1043 //*************************************************************************************************
1044 
1045 } // namespace blaze
1046 
1047 #endif
ElementType & ReferenceType
Reference return type.
Definition: DVecRealExpr.h:181
RealTrait< RT >::Type ResultType
Result type for expression template evaluations.
Definition: DVecRealExpr.h:157
RealExprTrait< RN >::Type ExprReturnType
Expression return type for the subscript operator.
Definition: DVecRealExpr.h:117
DifferenceType difference_type
Difference between two iterators.
Definition: DVecRealExpr.h:189
Header file for the UnderlyingNumeric type trait.
Pointer difference type of the Blaze library.
bool isAliased(const T *alias) const
Returns whether the expression is aliased with the given address alias.
Definition: DVecRealExpr.h:505
Compile time check whether the given type is a computational expression template.This type trait clas...
Definition: IsComputation.h:89
Header file for the VecRealExpr base class.
Compile time check whether the given type is a temporary vector or matrix type.This type trait class ...
Definition: IsTemporary.h:87
ConstIterator end() const
Returns an iterator just past the last non-zero element of the dense vector.
Definition: DVecRealExpr.h:461
VT::ConstIterator IteratorType
ConstIterator type of the left-hand side dense vector expression.
Definition: DVecRealExpr.h:192
Header file for basic type definitions.
std::random_access_iterator_tag IteratorCategory
The iterator category.
Definition: DVecRealExpr.h:178
Efficient implementation of a compressed matrix.The CompressedMatrix class template is the represent...
Definition: CompressedMatrix.h:207
VT::ReturnType RN
Return type of the dense vector expression.
Definition: DVecRealExpr.h:104
Iterator over the elements of the dense vector.
Definition: DVecRealExpr.h:174
bool operator<(const ConstIterator &rhs) const
Less-than comparison between two ConstIterator objects.
Definition: DVecRealExpr.h:309
Header file for the DVecRealExprTrait class template.
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
Header file for the DenseVector base class.
Header file for the TDVecRealExprTrait class template.
DVecRealExpr< VT, TF > This
Type of this DVecRealExpr instance.
Definition: DVecRealExpr.h:156
Header file for the RealExprTrait class template.
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
Header file for the Computation base class.
Expression object for the dense vector real() function.The DVecRealExpr class represents the compile ...
Definition: DVecRealExpr.h:97
const SelectType< returnExpr, ExprReturnType, ElementType >::Type ReturnType
Return type for expression template evaluations.
Definition: DVecRealExpr.h:162
ConstIterator & operator-=(size_t dec)
Subtraction assignment operator.
Definition: DVecRealExpr.h:223
PointerType pointer
Pointer return type.
Definition: DVecRealExpr.h:187
Header file for the RequiresEvaluation type trait.
DVecRealExpr(const VT &dv)
Constructor for the DVecRealExpr class.
Definition: DVecRealExpr.h:414
const ConstIterator operator++(int)
Post-increment operator.
Definition: DVecRealExpr.h:245
friend const ConstIterator operator+(size_t inc, const ConstIterator &it)
Addition between an integral value and a ConstIterator.
Definition: DVecRealExpr.h:377
Constraint on the data type.
friend const ConstIterator operator-(const ConstIterator &it, size_t dec)
Subtraction between a ConstIterator and an integral value.
Definition: DVecRealExpr.h:389
ValueType value_type
Type of the underlying elements.
Definition: DVecRealExpr.h:186
ConstIterator & operator+=(size_t inc)
Addition assignment operator.
Definition: DVecRealExpr.h:211
Compile time check to query the requirement to evaluate an expression.Via this type trait it is possi...
Definition: RequiresEvaluation.h:90
Operand operand() const
Returns the dense vector operand.
Definition: DVecRealExpr.h:481
ReturnType at(size_t index) const
Checked access to the vector elements.
Definition: DVecRealExpr.h:438
bool isAligned() const
Returns whether the operands of the expression are properly aligned in memory.
Definition: DVecRealExpr.h:515
const ConstIterator operator--(int)
Post-decrement operator.
Definition: DVecRealExpr.h:266
bool canSMPAssign() const
Returns whether the expression can be used in SMP assignments.
Definition: DVecRealExpr.h:525
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
Base class for all vector real part expression templates.The VecRealExpr class serves as a tag for al...
Definition: VecRealExpr.h:65
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2592
ConstIterator(IteratorType it)
Constructor for the ConstIterator class.
Definition: DVecRealExpr.h:200
#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 dv_
Dense vector of the real part expression.
Definition: DVecRealExpr.h:532
const RealExprTrait< MT >::Type real(const DenseMatrix< MT, SO > &dm)
Returns a matrix containing the real part of each single element of dm.
Definition: DMatRealExpr.h:920
Base class for N-dimensional dense vectors.The DenseVector class is a base class for all arbitrarily ...
Definition: DenseVector.h:70
ReturnType operator[](size_t index) const
Subscript operator for the direct access to the vector elements.
Definition: DVecRealExpr.h:425
bool operator!=(const ConstIterator &rhs) const
Inequality comparison between two ConstIterator objects.
Definition: DVecRealExpr.h:298
Header file for the IsAligned type trait.
ElementType * PointerType
Pointer return type.
Definition: DVecRealExpr.h:180
Constraint on the data type.
Header file for the real trait.
#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 real shim.
Constraint on the data type.
Header file for the SelectType class template.
Header file for all forward declarations for expression class templates.
ResultType::TransposeType TransposeType
Transpose type for expression template evaluations.
Definition: DVecRealExpr.h:158
Header file for the EnableIf class template.
Header file for the serial shim.
IteratorType it_
Iterator to the current vector element.
Definition: DVecRealExpr.h:396
friend const ConstIterator operator+(const ConstIterator &it, size_t inc)
Addition between a ConstIterator and an integral value.
Definition: DVecRealExpr.h:365
ReferenceType reference
Reference return type.
Definition: DVecRealExpr.h:188
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
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:2587
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.
ResultType::ElementType ElementType
Resulting element type.
Definition: DVecRealExpr.h:159
ptrdiff_t DifferenceType
Difference between two iterators.
Definition: DVecRealExpr.h:182
ConstIterator & operator++()
Pre-increment operator.
Definition: DVecRealExpr.h:234
Base template for the RealTrait class.The RealTrait class template offers the possibility to select t...
Definition: RealTrait.h:78
Substitution Failure Is Not An Error (SFINAE) class.The EnableIf class template is an auxiliary tool ...
Definition: EnableIf.h:184
SelectType< useAssign, const ResultType, const DVecRealExpr & >::Type CompositeType
Data type for composite expression templates.
Definition: DVecRealExpr.h:165
bool canAlias(const T *alias) const
Returns whether the expression can alias with the given address alias.
Definition: DVecRealExpr.h:493
ConstIterator begin() const
Returns an iterator to the first non-zero element of the dense vector.
Definition: DVecRealExpr.h:451
#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
ConstIterator & operator--()
Pre-decrement operator.
Definition: DVecRealExpr.h:255
Header file for the IsDenseVector type trait.
#define BLAZE_CONSTRAINT_MUST_BE_DENSE_VECTOR_TYPE(T)
Constraint on the data type.In case the given data type T is not a dense, N-dimensional vector type...
Definition: DenseVector.h:79
SelectType< IsExpression< VT >::value, const VT, const VT & >::Type Operand
Composite data type of the dense vector expression.
Definition: DVecRealExpr.h:168
bool operator>=(const ConstIterator &rhs) const
Greater-than comparison between two ConstIterator objects.
Definition: DVecRealExpr.h:342
bool operator>(const ConstIterator &rhs) const
Greater-than comparison between two ConstIterator objects.
Definition: DVecRealExpr.h:320
Header file for the IsComputation type trait class.
Evaluation of the return type of a real part expression.Via this type trait it is possible to evaluat...
Definition: RealExprTrait.h:88
Base class for all compute expression templates.The Computation class serves as a tag for all computa...
Definition: Computation.h:59
EnableIf< IsDenseMatrix< MT1 > >::Type smpAddAssign(Matrix< MT1, SO1 > &lhs, const Matrix< MT2, SO2 > &rhs)
Default implementation of the SMP addition assignment of a matrix to a dense matrix.
Definition: DenseMatrix.h:129
Base class for sparse vectors.The SparseVector class is a base class for all arbitrarily sized (N-dim...
Definition: Forward.h:118
#define BLAZE_FUNCTION_TRACE
Function trace macro.This macro can be used to reliably trace function calls. In case function tracin...
Definition: FunctionTrace.h:157
This ResultType
Result type for expression template evaluations.
Definition: CompressedMatrix.h:2583
Header file for the SubvectorExprTrait class template.
Header file for exception macros.
Header file for the IsColumnVector type trait.
bool operator<=(const ConstIterator &rhs) const
Less-than comparison between two ConstIterator objects.
Definition: DVecRealExpr.h:331
ReturnType operator*() const
Direct access to the element at the current iterator position.
Definition: DVecRealExpr.h:276
bool operator==(const ConstIterator &rhs) const
Equality comparison between two ConstIterator objects.
Definition: DVecRealExpr.h:287
System settings for the inline keywords.
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.
DifferenceType operator-(const ConstIterator &rhs) const
Calculating the number of elements between two iterators.
Definition: DVecRealExpr.h:353
VT::ResultType RT
Result type of the dense vector expression.
Definition: DVecRealExpr.h:103
IteratorCategory iterator_category
The iterator category.
Definition: DVecRealExpr.h:185
size_t size() const
Returns the current size/dimension of the vector.
Definition: DVecRealExpr.h:471
Header file for the IsExpression type trait class.
Header file for the FunctionTrace class.
ElementType ValueType
Type of the underlying elements.
Definition: DVecRealExpr.h:179