35 #ifndef _BLAZE_MATH_EXPRESSIONS_DVECTRANSPOSER_H_
36 #define _BLAZE_MATH_EXPRESSIONS_DVECTRANSPOSER_H_
101 enum :
bool { simdEnabled = VT::simdEnabled };
107 enum :
bool { smpAssignable = VT::smpAssignable };
151 inline Reference
at(
size_t index ) {
152 if( index >=
dv_.size() ) {
155 return (*
this)[index];
166 inline ConstReference
at(
size_t index )
const {
167 if( index >=
dv_.size() ) {
170 return (*
this)[index];
179 inline Pointer
data() noexcept {
189 inline ConstPointer
data() const noexcept {
209 inline ConstIterator
begin()
const {
239 inline ConstIterator
end()
const {
249 inline ConstIterator
cend()
const {
261 template<
typename Other >
278 template<
typename Other >
293 inline size_t size() const noexcept {
314 template<
typename Other >
315 inline bool canAlias(
const Other* alias )
const noexcept
317 return dv_.canAlias( alias );
327 template<
typename Other >
328 inline bool isAliased(
const Other* alias )
const noexcept
330 return dv_.isAliased( alias );
341 return dv_.isAligned();
352 return dv_.canSMPAssign();
368 return dv_.load( index );
384 return dv_.loada( index );
400 return dv_.loadu( index );
417 dv_.store( index, value );
434 dv_.storea( index, value );
451 dv_.storeu( index, value );
468 dv_.stream( index, value );
483 template<
typename VT2 >
490 const size_t n(
size() );
492 const size_t ipos( n &
size_t(-2) );
495 for(
size_t i=0UL; i<ipos; i+=2UL ) {
496 dv_[i ] = (~rhs)[i ];
497 dv_[i+1UL] = (~rhs)[i+1UL];
500 dv_[ipos] = (~rhs)[ipos];
515 template<
typename VT2 >
524 for( RhsConstIterator element=(~rhs).begin(); element!=(~rhs).
end(); ++element )
525 dv_[element->index()] = element->value();
540 template<
typename VT2 >
547 const size_t n(
size() );
549 const size_t ipos( n &
size_t(-2) );
552 for(
size_t i=0UL; i<ipos; i+=2UL ) {
553 dv_[i ] += (~rhs)[i ];
554 dv_[i+1UL] += (~rhs)[i+1UL];
557 dv_[ipos] += (~rhs)[ipos];
572 template<
typename VT2 >
581 for( RhsConstIterator element=(~rhs).begin(); element!=(~rhs).
end(); ++element )
582 dv_[element->index()] += element->value();
597 template<
typename VT2 >
604 const size_t n(
size() );
606 const size_t ipos( n &
size_t(-2) );
609 for(
size_t i=0UL; i<ipos; i+=2UL ) {
610 dv_[i ] -= (~rhs)[i ];
611 dv_[i+1UL] -= (~rhs)[i+1UL];
614 dv_[ipos] -= (~rhs)[ipos];
629 template<
typename VT2 >
638 for( RhsConstIterator element=(~rhs).begin(); element!=(~rhs).
end(); ++element )
639 dv_[element->index()] -= element->value();
654 template<
typename VT2 >
661 const size_t n(
size() );
663 const size_t ipos( n &
size_t(-2) );
666 for(
size_t i=0UL; i<ipos; i+=2UL ) {
667 dv_[i ] *= (~rhs)[i ];
668 dv_[i+1UL] *= (~rhs)[i+1UL];
671 dv_[ipos] *= (~rhs)[ipos];
686 template<
typename VT2 >
698 for( RhsConstIterator element=(~rhs).
begin(); element!=(~rhs).
end(); ++element )
699 dv_[element->index()] = tmp[element->index()] * element->value();
714 template<
typename VT2 >
721 const size_t n(
size() );
723 const size_t ipos( n &
size_t(-2) );
726 for(
size_t i=0UL; i<ipos; i+=2UL ) {
727 dv_[i ] /= (~rhs)[i ];
728 dv_[i+1UL] /= (~rhs)[i+1UL];
731 dv_[ipos] /= (~rhs)[ipos];
767 template<
typename VT
787 template<
typename VT,
bool TF >
788 struct IsAligned< DVecTransposer<VT,TF> >
805 template<
typename VT,
bool TF >
806 struct IsPadded< DVecTransposer<VT,TF> >
823 template<
typename VT,
bool TF >
824 struct SubvectorTrait< DVecTransposer<VT,TF> >
826 using Type = SubvectorTrait_< ResultType_< DVecTransposer<VT,TF> > >;
Reference operator[](size_t index)
Subscript operator for the direct access to the vector elements.
Definition: DVecTransposer.h:126
Constraint on the data type.
Iterator begin()
Returns an iterator to the first element of the dense vector.
Definition: DVecTransposer.h:199
Header file for auxiliary alias declarations.
BLAZE_ALWAYS_INLINE SIMDType loada(size_t index) const noexcept
Aligned load of a SIMD element of the vector.
Definition: DVecTransposer.h:382
#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.
ConstReference at(size_t index) const
Checked access to the vector elements.
Definition: DVecTransposer.h:166
#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
void subAssign(const DenseVector< VT2, TF > &rhs)
Implementation of the transpose subtraction assignment of a dense vector.
Definition: DVecTransposer.h:598
typename SIMDTrait< T >::Type SIMDTrait_
Auxiliary alias declaration for the SIMDTrait class template.The SIMDTrait_ alias declaration provide...
Definition: SIMDTrait.h:315
BLAZE_ALWAYS_INLINE SIMDType loadu(size_t index) const noexcept
Unaligned load of a SIMD element of the vector.
Definition: DVecTransposer.h:398
EnableIf_< IsNumeric< Other >, DVecTransposer > & operator*=(Other rhs)
Multiplication assignment operator for the multiplication between a vector and a scalar value ( )...
Definition: DVecTransposer.h:262
void reset(const DiagonalProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: DiagonalProxy.h:533
SIMDTrait_< ElementType > SIMDType
SIMD type of the vector elements.
Definition: DVecTransposer.h:85
ConstIterator cend() const
Returns an iterator just past the last element of the dense vector.
Definition: DVecTransposer.h:249
void multAssign(const SparseVector< VT2, TF > &rhs)
Implementation of the transpose multiplication assignment of a sparse vector.
Definition: DVecTransposer.h:687
Header file for the DenseVector base class.
ConstReference operator[](size_t index) const
Subscript operator for the direct access to the vector elements.
Definition: DVecTransposer.h:138
ConstReference_< VT > ConstReference
Reference to a constant vector value.
Definition: DVecTransposer.h:89
ConstIterator begin() const
Returns an iterator to the first element of the dense vector.
Definition: DVecTransposer.h:209
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:323
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:343
BLAZE_ALWAYS_INLINE void store(size_t index, const SIMDType &value) noexcept
Store of a SIMD element of the vector.
Definition: DVecTransposer.h:415
bool canAlias(const Other *alias) const noexcept
Returns whether the vector can alias with the given address alias.
Definition: DVecTransposer.h:315
typename T::Pointer Pointer_
Alias declaration for nested Pointer type definitions.The Pointer_ alias declaration provides a conve...
Definition: Aliases.h:263
Iterator_< VT > Iterator
Iterator over non-constant elements.
Definition: DVecTransposer.h:92
EnableIf_< IsNumeric< Other >, DVecTransposer > & operator/=(Other rhs)
Division assignment operator for the division of a vector by a scalar value ( ).
Definition: DVecTransposer.h:279
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:115
Pointer_< VT > Pointer
Pointer to a non-constant vector value.
Definition: DVecTransposer.h:90
bool isAligned() const noexcept
Returns whether the vector is properly aligned in memory.
Definition: DVecTransposer.h:339
bool isAliased(const Other *alias) const noexcept
Returns whether the vector is aliased with the given address alias.
Definition: DVecTransposer.h:328
BLAZE_ALWAYS_INLINE SIMDType load(size_t index) const noexcept
Load of a SIMD element of the vector.
Definition: DVecTransposer.h:366
#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
ConstPointer_< VT > ConstPointer
Pointer to a constant vector value.
Definition: DVecTransposer.h:91
size_t size() const noexcept
Returns the current size/dimension of the vector.
Definition: DVecTransposer.h:293
bool canSMPAssign() const noexcept
Returns whether the vector can be used in SMP assignments.
Definition: DVecTransposer.h:350
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:151
Base class for N-dimensional dense vectors.The DenseVector class is a base class for all arbitrarily ...
Definition: DenseVector.h:70
TransposeType_< VT > ResultType
Result type for expression template evaluations.
Definition: DVecTransposer.h:82
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:449
Constraint on the data type.
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:432
typename T::Reference Reference_
Alias declaration for nested Reference type definitions.The Reference_ alias declaration provides a c...
Definition: Aliases.h:283
Header file for the EnableIf class template.
Header file for the IsPadded type trait.
void reset()
Resets the vector elements.
Definition: DVecTransposer.h:303
Header file for the IsNumeric type trait.
DVecTransposer< VT, TF > This
Type of this DVecTransposer instance.
Definition: DVecTransposer.h:81
Header file for run time assertion macros.
const This & CompositeType
Data type for composite expression templates.
Definition: DVecTransposer.h:87
Iterator end()
Returns an iterator just past the last element of the dense vector.
Definition: DVecTransposer.h:229
void addAssign(const SparseVector< VT2, TF > &rhs)
Implementation of the transpose addition assignment of a sparse vector.
Definition: DVecTransposer.h:573
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:466
void addAssign(const DenseVector< VT2, TF > &rhs)
Implementation of the transpose addition assignment of a dense vector.
Definition: DVecTransposer.h:541
ResultType_< VT > TransposeType
Transpose type for expression template evaluations.
Definition: DVecTransposer.h:83
ConstIterator end() const
Returns an iterator just past the last element of the dense vector.
Definition: DVecTransposer.h:239
Pointer data() noexcept
Low-level data access to the vector elements.
Definition: DVecTransposer.h:179
void subAssign(const SparseVector< VT2, TF > &rhs)
Implementation of the transpose subtraction assignment of a sparse vector.
Definition: DVecTransposer.h:630
void divAssign(const DenseVector< VT2, TF > &rhs)
Implementation of the transpose division assignment of a dense vector.
Definition: DVecTransposer.h:715
void assign(const SparseVector< VT2, TF > &rhs)
Implementation of the transpose assignment of a sparse vector.
Definition: DVecTransposer.h:516
IntegralConstant< bool, B > BoolConstant
Generic wrapper for a compile time constant boolean value.The BoolConstant class template represents ...
Definition: IntegralConstant.h:100
typename EnableIf< Condition, T >::Type EnableIf_
Auxiliary alias declaration for the EnableIf class template.The EnableIf_ alias declaration provides ...
Definition: EnableIf.h:223
typename T::Iterator Iterator_
Alias declaration for nested Iterator type definitions.The Iterator_ alias declaration provides a con...
Definition: Aliases.h:183
Reference_< VT > Reference
Reference to a non-constant vector value.
Definition: DVecTransposer.h:88
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:484
Base class for sparse vectors.The SparseVector class is a base class for all arbitrarily sized (N-dim...
Definition: Forward.h:110
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:403
ConstIterator_< VT > ConstIterator
Iterator over constant elements.
Definition: DVecTransposer.h:93
ReturnType_< VT > ReturnType
Return type for expression template evaluations.
Definition: DVecTransposer.h:86
ConstPointer data() const noexcept
Low-level data access to the vector elements.
Definition: DVecTransposer.h:189
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:655
#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
#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
ConstIterator cbegin() const
Returns an iterator to the first element of the dense vector.
Definition: DVecTransposer.h:219
VT & dv_
The dense vector operand.
Definition: DVecTransposer.h:737
ElementType_< VT > ElementType
Type of the vector elements.
Definition: DVecTransposer.h:84