35 #ifndef _BLAZE_MATH_EXPRESSIONS_DVECTRANSPOSER_H_
36 #define _BLAZE_MATH_EXPRESSIONS_DVECTRANSPOSER_H_
105 enum { vectorizable = VT::vectorizable };
111 enum { smpAssignable = VT::smpAssignable };
155 inline Reference
at(
size_t index ) {
156 if( index >=
dv_.size() ) {
159 return (*
this)[index];
170 inline ConstReference
at(
size_t index )
const {
171 if( index >=
dv_.size() ) {
174 return (*
this)[index];
193 inline ConstPointer
data()
const {
213 inline ConstIterator
begin()
const {
243 inline ConstIterator
end()
const {
253 inline ConstIterator
cend()
const {
265 template<
typename Other >
282 template<
typename Other >
318 template<
typename Other >
321 return dv_.canAlias( alias );
331 template<
typename Other >
334 return dv_.isAliased( alias );
345 return dv_.isAligned();
356 return dv_.canSMPAssign();
372 return dv_.load( index );
388 return dv_.loada( index );
404 return dv_.loadu( index );
421 dv_.store( index, value );
438 dv_.storea( index, value );
455 dv_.storeu( index, value );
472 dv_.stream( index, value );
487 template<
typename VT2 >
494 const size_t n(
size() );
496 const size_t ipos( n &
size_t(-2) );
499 for(
size_t i=0UL; i<ipos; i+=2UL ) {
500 dv_[i ] = (~rhs)[i ];
501 dv_[i+1UL] = (~rhs)[i+1UL];
504 dv_[ipos] = (~rhs)[ipos];
519 template<
typename VT2 >
528 for( RhsConstIterator element=(~rhs).begin(); element!=(~rhs).
end(); ++element )
529 dv_[element->index()] = element->value();
544 template<
typename VT2 >
551 const size_t n(
size() );
553 const size_t ipos( n &
size_t(-2) );
556 for(
size_t i=0UL; i<ipos; i+=2UL ) {
557 dv_[i ] += (~rhs)[i ];
558 dv_[i+1UL] += (~rhs)[i+1UL];
561 dv_[ipos] += (~rhs)[ipos];
576 template<
typename VT2 >
585 for( RhsConstIterator element=(~rhs).begin(); element!=(~rhs).
end(); ++element )
586 dv_[element->index()] += element->value();
601 template<
typename VT2 >
608 const size_t n(
size() );
610 const size_t ipos( n &
size_t(-2) );
613 for(
size_t i=0UL; i<ipos; i+=2UL ) {
614 dv_[i ] -= (~rhs)[i ];
615 dv_[i+1UL] -= (~rhs)[i+1UL];
618 dv_[ipos] -= (~rhs)[ipos];
633 template<
typename VT2 >
642 for( RhsConstIterator element=(~rhs).begin(); element!=(~rhs).
end(); ++element )
643 dv_[element->index()] -= element->value();
658 template<
typename VT2 >
665 const size_t n(
size() );
667 const size_t ipos( n &
size_t(-2) );
670 for(
size_t i=0UL; i<ipos; i+=2UL ) {
671 dv_[i ] *= (~rhs)[i ];
672 dv_[i+1UL] *= (~rhs)[i+1UL];
675 dv_[ipos] *= (~rhs)[ipos];
690 template<
typename VT2 >
702 for( RhsConstIterator element=(~rhs).
begin(); element!=(~rhs).
end(); ++element )
703 dv_[element->index()] = tmp[element->index()] * element->value();
739 template<
typename VT
759 template<
typename VT,
bool TF >
760 struct IsAligned< DVecTransposer<VT,TF> > :
public IsTrue< IsAligned<VT>::value >
776 template<
typename VT,
bool TF >
777 struct IsPadded< DVecTransposer<VT,TF> > :
public IsTrue< IsPadded<VT>::value >
793 template<
typename VT,
bool TF >
794 struct SubvectorTrait< DVecTransposer<VT,TF> >
Reference operator[](size_t index)
Subscript operator for the direct access to the vector elements.
Definition: DVecTransposer.h:130
Constraint on the data type.
Iterator begin()
Returns an iterator to the first element of the dense vector.
Definition: DVecTransposer.h:203
bool isAliased(const Other *alias) const
Returns whether the vector is aliased with the given address alias.
Definition: DVecTransposer.h:332
VT::ConstIterator ConstIterator
Iterator over constant elements.
Definition: DVecTransposer.h:97
#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
size_t size() const
Returns the current size/dimension of the vector.
Definition: DVecTransposer.h:297
Header file for basic type definitions.
VT::Iterator Iterator
Iterator over non-constant elements.
Definition: DVecTransposer.h:96
ConstReference at(size_t index) const
Checked access to the vector elements.
Definition: DVecTransposer.h:170
#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:118
bool canSMPAssign() const
Returns whether the vector can be used in SMP assignments.
Definition: DVecTransposer.h:354
void subAssign(const DenseVector< VT2, TF > &rhs)
Implementation of the transpose subtraction assignment of a dense vector.
Definition: DVecTransposer.h:602
BLAZE_ALWAYS_INLINE IntrinsicType load(size_t index) const
Load of an intrinsic element of the vector.
Definition: DVecTransposer.h:370
void reset(const DiagonalProxy< MT > &proxy)
Resetting the represented element to the default initial values.
Definition: DiagonalProxy.h:507
VT::ConstReference ConstReference
Reference to a constant vector value.
Definition: DVecTransposer.h:93
ConstIterator cend() const
Returns an iterator just past the last element of the dense vector.
Definition: DVecTransposer.h:253
void multAssign(const SparseVector< VT2, TF > &rhs)
Implementation of the transpose multiplication assignment of a sparse vector.
Definition: DVecTransposer.h:691
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:142
bool canAlias(const Other *alias) const
Returns whether the vector can alias with the given address alias.
Definition: DVecTransposer.h:319
VT::ConstPointer ConstPointer
Pointer to a constant vector value.
Definition: DVecTransposer.h:95
ConstIterator begin() const
Returns an iterator to the first element of the dense vector.
Definition: DVecTransposer.h:213
VT::ElementType ElementType
Type of the vector elements.
Definition: DVecTransposer.h:88
Header file for the intrinsic trait.
BLAZE_ALWAYS_INLINE void stream(size_t index, const IntrinsicType &value)
Aligned, non-temporal store of an intrinsic element of the vector.
Definition: DVecTransposer.h:470
Expression object for the transposition of a dense vector.The DVecTransposer class is a wrapper objec...
Definition: DVecTransposer.h:76
VT::ResultType TransposeType
Transpose type for expression template evaluations.
Definition: DVecTransposer.h:87
bool isAligned() const
Returns whether the vector is properly aligned in memory.
Definition: DVecTransposer.h:343
VT::ReturnType ReturnType
Return type for expression template evaluations.
Definition: DVecTransposer.h:90
IntrinsicTrait< typename VT::ElementType > IT
Intrinsic trait for the vector element type.
Definition: DVecTransposer.h:80
DVecTransposer(VT &dv)
Constructor for the DVecTransposer class.
Definition: DVecTransposer.h:119
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
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:2592
BLAZE_ALWAYS_INLINE IntrinsicType loada(size_t index) const
Aligned load of an intrinsic element of the vector.
Definition: DVecTransposer.h:386
#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
Pointer data()
Low-level data access to the vector elements.
Definition: DVecTransposer.h:183
Header file for the subvector trait.
Reference at(size_t index)
Checked access to the vector elements.
Definition: DVecTransposer.h:155
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.
Constraint on the data type.
CompressedMatrix< Type, false > TransposeType
Transpose type for expression template evaluations.
Definition: CompressedMatrix.h:2585
Constraint on the data type.
VT::Reference Reference
Reference to a non-constant vector value.
Definition: DVecTransposer.h:92
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:2586
const Type & ConstReference
Reference to a constant matrix value.
Definition: CompressedMatrix.h:2590
BLAZE_ALWAYS_INLINE IntrinsicType loadu(size_t index) const
Unaligned load of an intrinsic element of the vector.
Definition: DVecTransposer.h:402
Header file for the EnableIf class template.
Header file for the IsPadded type trait.
void reset()
Resets the vector elements.
Definition: DVecTransposer.h:307
Header file for the IsNumeric type trait.
DVecTransposer< VT, TF > This
Type of this DVecTransposer instance.
Definition: DVecTransposer.h:85
BLAZE_ALWAYS_INLINE void storeu(size_t index, const IntrinsicType &value)
Unaligned store of an intrinsic element of the vector.
Definition: DVecTransposer.h:453
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:2587
Intrinsic characteristics of data types.The IntrinsicTrait class template provides the intrinsic char...
Definition: IntrinsicTrait.h:1232
Header file for run time assertion macros.
const This & CompositeType
Data type for composite expression templates.
Definition: DVecTransposer.h:91
Iterator end()
Returns an iterator just past the last element of the dense vector.
Definition: DVecTransposer.h:233
void addAssign(const SparseVector< VT2, TF > &rhs)
Implementation of the transpose addition assignment of a sparse vector.
Definition: DVecTransposer.h:577
Substitution Failure Is Not An Error (SFINAE) class.The EnableIf class template is an auxiliary tool ...
Definition: EnableIf.h:184
void addAssign(const DenseVector< VT2, TF > &rhs)
Implementation of the transpose addition assignment of a dense vector.
Definition: DVecTransposer.h:545
ConstIterator end() const
Returns an iterator just past the last element of the dense vector.
Definition: DVecTransposer.h:243
BLAZE_ALWAYS_INLINE void storea(size_t index, const IntrinsicType &value)
Aligned store of an intrinsic element of the vector.
Definition: DVecTransposer.h:436
IT::Type IntrinsicType
Intrinsic type of the vector elements.
Definition: DVecTransposer.h:89
Element * Iterator
Iterator over non-constant elements.
Definition: CompressedMatrix.h:2591
void subAssign(const SparseVector< VT2, TF > &rhs)
Implementation of the transpose subtraction assignment of a sparse vector.
Definition: DVecTransposer.h:634
VT::Pointer Pointer
Pointer to a non-constant vector value.
Definition: DVecTransposer.h:94
void assign(const SparseVector< VT2, TF > &rhs)
Implementation of the transpose assignment of a sparse vector.
Definition: DVecTransposer.h:520
#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
VT::TransposeType ResultType
Result type for expression template evaluations.
Definition: DVecTransposer.h:86
void assign(const DenseVector< VT2, TF > &rhs)
Implementation of the transpose assignment of a dense vector.
Definition: DVecTransposer.h:488
EnableIf< IsNumeric< Other >, DVecTransposer >::Type & operator/=(Other rhs)
Division assignment operator for the division of a vector by a scalar value ( ).
Definition: DVecTransposer.h:283
Base class for sparse vectors.The SparseVector class is a base class for all arbitrarily sized (N-dim...
Definition: Forward.h:118
This ResultType
Result type for expression template evaluations.
Definition: CompressedMatrix.h:2583
Header file for the IsTrue value trait.
EnableIf< IsNumeric< Other >, DVecTransposer >::Type & operator*=(Other rhs)
Multiplication assignment operator for the multiplication between a vector and a scalar value ( )...
Definition: DVecTransposer.h:266
MatrixAccessProxy< This > Reference
Reference to a non-constant matrix value.
Definition: CompressedMatrix.h:2589
Header file for exception macros.
BLAZE_ALWAYS_INLINE void store(size_t index, const IntrinsicType &value)
Store of an intrinsic element of the vector.
Definition: DVecTransposer.h:419
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:659
#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
ConstIterator cbegin() const
Returns an iterator to the first element of the dense vector.
Definition: DVecTransposer.h:223
VT & dv_
The dense vector operand.
Definition: DVecTransposer.h:709
ConstPointer data() const
Low-level data access to the vector elements.
Definition: DVecTransposer.h:193