35 #ifndef _BLAZE_MATH_EXPRESSIONS_DVECTRANSPOSER_H_ 36 #define _BLAZE_MATH_EXPRESSIONS_DVECTRANSPOSER_H_ 102 enum :
bool { simdEnabled = VT::simdEnabled };
108 enum :
bool { smpAssignable = VT::smpAssignable };
153 if( index >=
dv_.size() ) {
156 return (*
this)[index];
168 if( index >=
dv_.size() ) {
171 return (*
this)[index];
262 template<
typename Other >
279 template<
typename Other >
294 inline size_t size() const noexcept {
315 template<
typename Other >
316 inline bool canAlias(
const Other* alias )
const noexcept
318 return dv_.canAlias( alias );
328 template<
typename Other >
329 inline bool isAliased(
const Other* alias )
const noexcept
331 return dv_.isAliased( alias );
342 return dv_.isAligned();
353 return dv_.canSMPAssign();
369 return dv_.load( index );
385 return dv_.loada( index );
401 return dv_.loadu( index );
418 dv_.store( index, value );
435 dv_.storea( index, value );
452 dv_.storeu( index, value );
469 dv_.stream( index, value );
484 template<
typename VT2 >
491 const size_t n(
size() );
493 const size_t ipos( n &
size_t(-2) );
496 for(
size_t i=0UL; i<ipos; i+=2UL ) {
497 dv_[i ] = (~rhs)[i ];
498 dv_[i+1UL] = (~rhs)[i+1UL];
501 dv_[ipos] = (~rhs)[ipos];
516 template<
typename VT2 >
525 for( RhsConstIterator element=(~rhs).begin(); element!=(~rhs).
end(); ++element )
526 dv_[element->index()] = element->value();
541 template<
typename VT2 >
548 const size_t n(
size() );
550 const size_t ipos( n &
size_t(-2) );
553 for(
size_t i=0UL; i<ipos; i+=2UL ) {
554 dv_[i ] += (~rhs)[i ];
555 dv_[i+1UL] += (~rhs)[i+1UL];
558 dv_[ipos] += (~rhs)[ipos];
573 template<
typename VT2 >
582 for( RhsConstIterator element=(~rhs).begin(); element!=(~rhs).
end(); ++element )
583 dv_[element->index()] += element->value();
598 template<
typename VT2 >
605 const size_t n(
size() );
607 const size_t ipos( n &
size_t(-2) );
610 for(
size_t i=0UL; i<ipos; i+=2UL ) {
611 dv_[i ] -= (~rhs)[i ];
612 dv_[i+1UL] -= (~rhs)[i+1UL];
615 dv_[ipos] -= (~rhs)[ipos];
630 template<
typename VT2 >
639 for( RhsConstIterator element=(~rhs).begin(); element!=(~rhs).
end(); ++element )
640 dv_[element->index()] -= element->value();
655 template<
typename VT2 >
662 const size_t n(
size() );
664 const size_t ipos( n &
size_t(-2) );
667 for(
size_t i=0UL; i<ipos; i+=2UL ) {
668 dv_[i ] *= (~rhs)[i ];
669 dv_[i+1UL] *= (~rhs)[i+1UL];
672 dv_[ipos] *= (~rhs)[ipos];
687 template<
typename VT2 >
699 for( RhsConstIterator element=(~rhs).
begin(); element!=(~rhs).
end(); ++element )
700 dv_[element->index()] = tmp[element->index()] * element->value();
715 template<
typename VT2 >
722 const size_t n(
size() );
724 const size_t ipos( n &
size_t(-2) );
727 for(
size_t i=0UL; i<ipos; i+=2UL ) {
728 dv_[i ] /= (~rhs)[i ];
729 dv_[i+1UL] /= (~rhs)[i+1UL];
732 dv_[ipos] /= (~rhs)[ipos];
768 template<
typename VT
788 template<
typename VT,
bool TF >
806 template<
typename VT,
bool TF >
824 template<
typename VT,
bool TF >
Reference operator[](size_t index)
Subscript operator for the direct access to the vector elements.
Definition: DVecTransposer.h:127
Constraint on the data type.
Iterator begin()
Returns an iterator to the first element of the dense vector.
Definition: DVecTransposer.h:200
Header file for auxiliary alias declarations.
bool isAliased(const Other *alias) const noexcept
Returns whether the vector is aliased with the given address alias.
Definition: DVecTransposer.h:329
BLAZE_ALWAYS_INLINE SIMDType loadu(size_t index) const noexcept
Unaligned load of a SIMD element of the vector.
Definition: DVecTransposer.h:399
#define BLAZE_USER_ASSERT(expr, msg)
Run time assertion macro for user checks.In case of an invalid run time expression, the program execution is terminated. The BLAZE_USER_ASSERT macro can be disabled by setting the BLAZE_USER_ASSERT flag to zero or by defining NDEBUG during the compilation.
Definition: Assert.h:117
Header file for basic type definitions.
bool isAligned() const noexcept
Returns whether the vector is properly aligned in memory.
Definition: DVecTransposer.h:340
#define BLAZE_CONSTRAINT_MUST_NOT_BE_COMPUTATION_TYPE(T)
Constraint on the data type.In case the given data type T is a computational expression (i...
Definition: Computation.h:81
Generic wrapper for a compile time constant integral value.The IntegralConstant class template repres...
Definition: IntegralConstant.h:71
ConstPointer data() const noexcept
Low-level data access to the vector elements.
Definition: DVecTransposer.h:190
ConstReference_< VT > ConstReference
Reference to a constant vector value.
Definition: DVecTransposer.h:90
void subAssign(const DenseVector< VT2, TF > &rhs)
Implementation of the transpose subtraction assignment of a dense vector.
Definition: DVecTransposer.h:599
typename SIMDTrait< T >::Type SIMDTrait_
Auxiliary alias declaration for the SIMDTrait class template.The SIMDTrait_ alias declaration provide...
Definition: SIMDTrait.h:316
EnableIf_< IsNumeric< Other >, DVecTransposer > & operator*=(Other rhs)
Multiplication assignment operator for the multiplication between a vector and a scalar value ( )...
Definition: DVecTransposer.h:263
void multAssign(const SparseVector< VT2, TF > &rhs)
Implementation of the transpose multiplication assignment of a sparse vector.
Definition: DVecTransposer.h:688
Header file for the DenseVector base class.
BLAZE_ALWAYS_INLINE SIMDType load(size_t index) const noexcept
Load of a SIMD element of the vector.
Definition: DVecTransposer.h:367
SIMDTrait_< ElementType > SIMDType
SIMD type of the vector elements.
Definition: DVecTransposer.h:86
Header file for the SIMD trait.
typename T::ResultType ResultType_
Alias declaration for nested ResultType type definitions.The ResultType_ alias declaration provides a...
Definition: Aliases.h:343
ConstPointer_< VT > ConstPointer
Pointer to a constant vector value.
Definition: DVecTransposer.h:92
Expression object for the transposition of a dense vector.The DVecTransposer class is a wrapper objec...
Definition: DVecTransposer.h:77
typename T::ReturnType ReturnType_
Alias declaration for nested ReturnType type definitions.The ReturnType_ alias declaration provides a...
Definition: Aliases.h:363
Base template for the SubvectorTrait class.
Definition: SubvectorTrait.h:120
Compile time check for the alignment of data types.This type trait tests whether the given data type ...
Definition: IsAligned.h:87
bool canSMPAssign() const noexcept
Returns whether the vector can be used in SMP assignments.
Definition: DVecTransposer.h:351
BLAZE_ALWAYS_INLINE void store(size_t index, const SIMDType &value) noexcept
Store of a SIMD element of the vector.
Definition: DVecTransposer.h:416
typename T::Pointer Pointer_
Alias declaration for nested Pointer type definitions.The Pointer_ alias declaration provides a conve...
Definition: Aliases.h:283
EnableIf_< IsNumeric< Other >, DVecTransposer > & operator/=(Other rhs)
Division assignment operator for the division of a vector by a scalar value ( ).
Definition: DVecTransposer.h:280
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
#define BLAZE_ALWAYS_INLINE
Platform dependent setup of an enforced inline keyword.
Definition: Inline.h:85
DVecTransposer(VT &dv) noexcept
Constructor for the DVecTransposer class.
Definition: DVecTransposer.h:116
Compile time check for data types with padding.This type trait tests whether the given data type empl...
Definition: IsPadded.h:76
#define BLAZE_THROW_OUT_OF_RANGE(MESSAGE)
Macro for the emission of a std::out_of_range exception.This macro encapsulates the default way of Bl...
Definition: Exception.h:331
typename SubvectorTrait< VT >::Type SubvectorTrait_
Auxiliary alias declaration for the SubvectorTrait type trait.The SubvectorTrait_ alias declaration p...
Definition: SubvectorTrait.h:155
Header file for the subvector trait.
typename T::ElementType ElementType_
Alias declaration for nested ElementType type definitions.The ElementType_ alias declaration provides...
Definition: Aliases.h:163
Reference at(size_t index)
Checked access to the vector elements.
Definition: DVecTransposer.h:152
Base class for N-dimensional dense vectors.The DenseVector class is a base class for all arbitrarily ...
Definition: DenseVector.h:70
Header file for the IsAligned type trait.
BLAZE_ALWAYS_INLINE void storeu(size_t index, const SIMDType &value) noexcept
Unaligned store of a SIMD element of the vector.
Definition: DVecTransposer.h:450
Constraint on the data type.
ConstIterator cend() const
Returns an iterator just past the last element of the dense vector.
Definition: DVecTransposer.h:250
Constraint on the data type.
Header file for the exception macros of the math module.
BLAZE_ALWAYS_INLINE void storea(size_t index, const SIMDType &value) noexcept
Aligned store of a SIMD element of the vector.
Definition: DVecTransposer.h:433
typename T::Reference Reference_
Alias declaration for nested Reference type definitions.The Reference_ alias declaration provides a c...
Definition: Aliases.h:303
TransposeType_< VT > ResultType
Result type for expression template evaluations.
Definition: DVecTransposer.h:83
Header file for the EnableIf class template.
Header file for the IsPadded type trait.
void reset()
Resets the vector elements.
Definition: DVecTransposer.h:304
BLAZE_ALWAYS_INLINE SIMDType loada(size_t index) const noexcept
Aligned load of a SIMD element of the vector.
Definition: DVecTransposer.h:383
ConstIterator begin() const
Returns an iterator to the first element of the dense vector.
Definition: DVecTransposer.h:210
Header file for the IsNumeric type trait.
ConstIterator_< VT > ConstIterator
Iterator over constant elements.
Definition: DVecTransposer.h:94
Header file for run time assertion macros.
Iterator end()
Returns an iterator just past the last element of the dense vector.
Definition: DVecTransposer.h:230
void addAssign(const SparseVector< VT2, TF > &rhs)
Implementation of the transpose addition assignment of a sparse vector.
Definition: DVecTransposer.h:574
BLAZE_ALWAYS_INLINE void stream(size_t index, const SIMDType &value) noexcept
Aligned, non-temporal store of a SIMD element of the vector.
Definition: DVecTransposer.h:467
void addAssign(const DenseVector< VT2, TF > &rhs)
Implementation of the transpose addition assignment of a dense vector.
Definition: DVecTransposer.h:542
Pointer data() noexcept
Low-level data access to the vector elements.
Definition: DVecTransposer.h:180
void subAssign(const SparseVector< VT2, TF > &rhs)
Implementation of the transpose subtraction assignment of a sparse vector.
Definition: DVecTransposer.h:631
void divAssign(const DenseVector< VT2, TF > &rhs)
Implementation of the transpose division assignment of a dense vector.
Definition: DVecTransposer.h:716
void assign(const SparseVector< VT2, TF > &rhs)
Implementation of the transpose assignment of a sparse vector.
Definition: DVecTransposer.h:517
typename EnableIf< Condition, T >::Type EnableIf_
Auxiliary alias declaration for the EnableIf class template.The EnableIf_ alias declaration provides ...
Definition: EnableIf.h:224
typename T::Iterator Iterator_
Alias declaration for nested Iterator type definitions.The Iterator_ alias declaration provides a con...
Definition: Aliases.h:183
typename T::ConstPointer ConstPointer_
Alias declaration for nested ConstPointer type definitions.The ConstPointer_ alias declaration provid...
Definition: Aliases.h:123
typename T::ConstReference ConstReference_
Alias declaration for nested ConstReference type definitions.The ConstReference_ alias declaration pr...
Definition: Aliases.h:143
typename T::ConstIterator ConstIterator_
Alias declaration for nested ConstIterator type definitions.The ConstIterator_ alias declaration prov...
Definition: Aliases.h:103
#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:61
void assign(const DenseVector< VT2, TF > &rhs)
Implementation of the transpose assignment of a dense vector.
Definition: DVecTransposer.h:485
ConstIterator end() const
Returns an iterator just past the last element of the dense vector.
Definition: DVecTransposer.h:240
ConstReference operator[](size_t index) const
Subscript operator for the direct access to the vector elements.
Definition: DVecTransposer.h:139
ElementType_< VT > ElementType
Type of the vector elements.
Definition: DVecTransposer.h:85
Base class for sparse vectors.The SparseVector class is a base class for all arbitrarily sized (N-dim...
Definition: Forward.h:130
Reference_< VT > Reference
Reference to a non-constant vector value.
Definition: DVecTransposer.h:89
Header file for the IntegralConstant class template.
typename T::TransposeType TransposeType_
Alias declaration for nested TransposeType type definitions.The TransposeType_ alias declaration prov...
Definition: Aliases.h:423
ResultType_< VT > TransposeType
Transpose type for expression template evaluations.
Definition: DVecTransposer.h:84
bool canAlias(const Other *alias) const noexcept
Returns whether the vector can alias with the given address alias.
Definition: DVecTransposer.h:316
Pointer_< VT > Pointer
Pointer to a non-constant vector value.
Definition: DVecTransposer.h:91
size_t size() const noexcept
Returns the current size/dimension of the vector.
Definition: DVecTransposer.h:294
System settings for the inline keywords.
void multAssign(const DenseVector< VT2, TF > &rhs)
Implementation of the transpose multiplication assignment of a dense vector.
Definition: DVecTransposer.h:656
#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:63
Iterator_< VT > Iterator
Iterator over non-constant elements.
Definition: DVecTransposer.h:93
#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
ConstReference at(size_t index) const
Checked access to the vector elements.
Definition: DVecTransposer.h:167
ReturnType_< VT > ReturnType
Return type for expression template evaluations.
Definition: DVecTransposer.h:87
VT & dv_
The dense vector operand.
Definition: DVecTransposer.h:738
ConstIterator cbegin() const
Returns an iterator to the first element of the dense vector.
Definition: DVecTransposer.h:220