35 #ifndef _BLAZE_MATH_EXPRESSIONS_DVECSCALARMULTEXPR_H_ 36 #define _BLAZE_MATH_EXPRESSIONS_DVECSCALARMULTEXPR_H_ 101 template<
typename VT
140 template<
typename VT2 >
143 enum :
bool { value = useAssign };
156 template<
typename VT2 >
157 struct UseSMPAssign {
158 enum :
bool { value = ( !VT2::smpAssignable || !VT::smpAssignable ) && useAssign };
214 : iterator_( iterator )
300 inline auto load() const noexcept {
301 return iterator_.load() *
set(
scalar_ );
428 enum :
bool { simdEnabled = VT::simdEnabled &&
434 enum :
bool { smpAssignable = VT::smpAssignable };
474 if( index >=
vector_.size() ) {
477 return (*
this)[index];
519 inline size_t size() const noexcept {
550 template<
typename T >
551 inline bool canAlias(
const T* alias )
const noexcept {
562 template<
typename T >
563 inline bool isAliased(
const T* alias )
const noexcept {
564 return vector_.isAliased( alias );
584 return vector_.canSMPAssign() || (
size() > SMP_DVECSCALARMULT_THRESHOLD );
608 template<
typename VT2 >
617 assign( ~lhs, (~lhs) * rhs.
scalar_ );
636 template<
typename VT2 >
664 template<
typename VT2 >
677 addAssign( ~lhs, tmp );
700 template<
typename VT2 >
713 subAssign( ~lhs, tmp );
736 template<
typename VT2 >
749 multAssign( ~lhs, tmp );
772 template<
typename VT2 >
785 divAssign( ~lhs, tmp );
808 template<
typename VT2 >
836 template<
typename VT2 >
864 template<
typename VT2 >
900 template<
typename VT2 >
936 template<
typename VT2 >
972 template<
typename VT2 >
1031 template<
typename VT
1074 template<
typename VT
1078 inline decltype(
auto) operator*( const
DenseVector<VT,TF>& vec, ST scalar )
1111 template<
typename ST
1115 inline decltype(
auto) operator*( ST scalar, const
DenseVector<VT,TF>& vec )
1152 template<
typename VT
1189 template<
typename VT
1224 template<
typename VT
1252 template<
typename ST1
1280 template<
typename VT
1309 template<
typename VT1
1313 inline decltype(
auto)
1338 template<
typename VT1
1342 inline decltype(
auto)
1367 template<
typename VT1
1372 inline decltype(
auto)
1397 template<
typename VT1
1400 inline decltype(
auto)
1425 template<
typename VT1
1428 inline decltype(
auto)
1453 template<
typename VT1
1457 inline decltype(
auto)
1482 template<
typename VT1
1486 inline decltype(
auto)
1511 template<
typename VT1
1515 inline decltype(
auto)
1541 template<
typename VT1
1546 inline decltype(
auto)
1572 template<
typename VT1
1577 inline decltype(
auto)
1602 template<
typename VT1
1605 inline decltype(
auto)
1630 template<
typename VT1
1633 inline decltype(
auto)
1659 template<
typename VT1
1663 inline decltype(
auto)
1689 template<
typename VT1
1693 inline decltype(
auto)
1718 template<
typename MT
1722 inline decltype(
auto)
1747 template<
typename VT
1751 inline decltype(
auto)
1776 template<
typename MT
1780 inline decltype(
auto)
1805 template<
typename VT
1809 inline decltype(
auto)
1830 template<
typename VT,
typename ST,
bool TF >
1831 struct Size< DVecScalarMultExpr<VT,ST,TF>, 0UL >
1832 :
public Size<VT,0UL>
1848 template<
typename VT,
typename ST,
bool TF >
1849 struct IsAligned< DVecScalarMultExpr<VT,ST,TF> >
1866 template<
typename VT,
typename ST,
bool TF >
1867 struct IsPadded< DVecScalarMultExpr<VT,ST,TF> >
RightOperand rightOperand() const noexcept
Returns the right-hand side scalar operand.
Definition: SVecScalarMultExpr.h:437
bool isAligned() const noexcept
Returns whether the operands of the expression are properly aligned in memory.
Definition: DVecScalarMultExpr.h:573
Pointer difference type of the Blaze library.
LeftOperand leftOperand() const noexcept
Returns the left-hand side dense vector operand.
Definition: DVecScalarMultExpr.h:529
Header file for auxiliary alias declarations.
Compile time check whether the given type is a computational expression template.This type trait clas...
Definition: IsComputation.h:71
Compile time check for numeric types.This type trait tests whether or not the given template paramete...
Definition: IsNumeric.h:79
Constraint on the data type.
Compile time check whether the given type is a temporary vector or matrix type.This type trait class ...
Definition: IsTemporary.h:69
Header file for basic type definitions.
Header file for the SparseVector base class.
BLAZE_ALWAYS_INLINE auto load(size_t index) const noexcept
Access to the SIMD elements of the vector.
Definition: DVecScalarMultExpr.h:487
RightOperand rightOperand() const noexcept
Returns the right-hand side scalar operand.
Definition: DVecScalarMultExpr.h:539
decltype(auto) operator/(const DenseMatrix< MT, SO > &mat, ST scalar)
Division operator for the division of a dense matrix by a scalar value ( ).
Definition: DMatScalarDivExpr.h:1070
EnableIf_< IsDenseMatrix< MT1 > > 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:164
Header file for the serial shim.
const ConstIterator operator++(int)
Post-increment operator.
Definition: DVecScalarMultExpr.h:259
ValueType value_type
Type of the underlying elements.
Definition: DVecScalarMultExpr.h:198
Availability of a SIMD multiplication for the given data types.Depending on the available instruction...
Definition: HasSIMDMult.h:172
EnableIf_< IsDenseVector< VT1 > > 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:193
size_t size() const noexcept
Returns the current size/dimension of the vector.
Definition: DVecScalarMultExpr.h:519
Header file for the And class template.
Header file for the DenseVector base class.
CompositeType_< VT > CT
Composite type of the dense vector expression.
Definition: DVecScalarMultExpr.h:113
typename MultTrait< T1, T2 >::Type MultTrait_
Auxiliary alias declaration for the MultTrait class template.The MultTrait_ alias declaration provide...
Definition: MultTrait.h:291
Header file for the Computation base class.
auto load() const noexcept
Access to the SIMD elements of the vector.
Definition: DVecScalarMultExpr.h:300
Header file for the UnderlyingElement type trait.
const DenseIterator< Type, AF > operator-(const DenseIterator< Type, AF > &it, ptrdiff_t inc) noexcept
Subtraction between a DenseIterator and an integral value.
Definition: DenseIterator.h:733
Header file for the RequiresEvaluation type trait.
bool operator==(const ConstIterator &rhs) const
Equality comparison between two ConstIterator objects.
Definition: DVecScalarMultExpr.h:311
ConstIterator(IteratorType iterator, RightOperand scalar)
Constructor for the ConstIterator class.
Definition: DVecScalarMultExpr.h:213
Header file for the VecScalarMultExpr base class.
typename T::ResultType ResultType_
Alias declaration for nested ResultType type definitions.The ResultType_ alias declaration provides a...
Definition: Aliases.h:343
EnableIf_< IsDenseMatrix< MT1 > > 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:133
ConstIterator end() const
Returns an iterator just past the last non-zero element of the dense vector.
Definition: DVecScalarMultExpr.h:509
If_< IsExpression< VT >, const VT, const VT &> LeftOperand
Composite type of the left-hand side dense vector expression.
Definition: DVecScalarMultExpr.h:177
typename UnderlyingBuiltin< T >::Type UnderlyingBuiltin_
Auxiliary alias declaration for the UnderlyingBuiltin type trait.The UnderlyingBuiltin_ alias declara...
Definition: UnderlyingBuiltin.h:133
Base class for dense matrices.The DenseMatrix class is a base class for all dense matrix classes...
Definition: DenseMatrix.h:80
Base class for sparse matrices.The SparseMatrix class is a base class for all sparse matrix classes...
Definition: Forward.h:129
std::random_access_iterator_tag IteratorCategory
The iterator category.
Definition: DVecScalarMultExpr.h:190
ElementType ValueType
Type of the underlying elements.
Definition: DVecScalarMultExpr.h:191
IfTrue_< useAssign, const ResultType, const DVecScalarMultExpr &> CompositeType
Data type for composite expression templates.
Definition: DVecScalarMultExpr.h:174
auto length(const DenseVector< VT, TF > &dv) -> decltype(sqrt(sqrLength(~dv)))
Calculation of the length (magnitude) of the dense vector .
Definition: DenseVector.h:714
typename IfTrue< Condition, T1, T2 >::Type IfTrue_
Auxiliary alias declaration for the IfTrue class template.The IfTrue_ alias declaration provides a co...
Definition: If.h:109
typename T::ReturnType ReturnType_
Alias declaration for nested ReturnType type definitions.The ReturnType_ alias declaration provides a...
Definition: Aliases.h:363
ResultType_< VT > RT
Result type of the dense vector expression.
Definition: DVecScalarMultExpr.h:110
Header file for the SparseMatrix base class.
Compile time check for the alignment of data types.This type trait tests whether the given data type ...
Definition: IsAligned.h:87
typename MultExprTrait< T1, T2 >::Type MultExprTrait_
Auxiliary alias declaration for the MultExprTrait class template.The MultExprTrait_ alias declaration...
Definition: MultExprTrait.h:112
Header file for the MultExprTrait class template.
Compile time check to query the requirement to evaluate an expression.Via this type trait it is possi...
Definition: RequiresEvaluation.h:71
typename T::CompositeType CompositeType_
Alias declaration for nested CompositeType type definitions.The CompositeType_ alias declaration prov...
Definition: Aliases.h:83
MultExprTrait_< RN, ST > ExprReturnType
Expression return type for the subscript operator.
Definition: DVecScalarMultExpr.h:126
ReturnType at(size_t index) const
Checked access to the vector elements.
Definition: DVecScalarMultExpr.h:473
Header file for the IsTemporary type trait class.
ElementType_< ResultType > ElementType
Resulting element type.
Definition: DVecScalarMultExpr.h:168
Header file for the multiplication trait.
TransposeType_< ResultType > TransposeType
Transpose type for expression template evaluations.
Definition: DVecScalarMultExpr.h:167
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58
#define BLAZE_ALWAYS_INLINE
Platform dependent setup of an enforced inline keyword.
Definition: Inline.h:85
Header file for the If class template.
ElementType * PointerType
Pointer return type.
Definition: DVecScalarMultExpr.h:192
Header file for the UnderlyingBuiltin type trait.
Compile time check for data types with padding.This type trait tests whether the given data type empl...
Definition: IsPadded.h:76
EnableIf_< IsDenseMatrix< MT1 > > 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:102
Type ElementType
Type of the compressed matrix elements.
Definition: CompressedMatrix.h:3079
Header file for the Or class template.
#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
Iterator over the elements of the dense vector.
Definition: DVecScalarMultExpr.h:186
Header file for the DenseMatrix base class.
decltype(auto) normalize(const DenseVector< VT, TF > &vec)
Normalization of the dense vector ( ).
Definition: DVecScalarMultExpr.h:1154
const Element * ConstIterator
Iterator over constant elements.
Definition: CompressedMatrix.h:3085
bool operator<=(const ConstIterator &rhs) const
Less-than comparison between two ConstIterator objects.
Definition: DVecScalarMultExpr.h:355
ConstIterator begin() const
Returns an iterator to the first non-zero element of the dense vector.
Definition: DVecScalarMultExpr.h:499
typename T::ElementType ElementType_
Alias declaration for nested ElementType type definitions.The ElementType_ alias declaration provides...
Definition: Aliases.h:163
Header file for all SIMD functionality.
Base class for N-dimensional dense vectors.The DenseVector class is a base class for all arbitrarily ...
Definition: DenseVector.h:76
#define BLAZE_CONSTRAINT_MUST_BE_SAME_TYPE(A, B)
Data type constraint.In case the two types A and B are not the same (ignoring all cv-qualifiers of bo...
Definition: SameType.h:71
Header file for the IsAligned type trait.
ElementType_< VT > ET
Element type of the dense vector expression.
Definition: DVecScalarMultExpr.h:112
Constraint on the data type.
const IfTrue_< returnExpr, ExprReturnType, ElementType > ReturnType
Return type for expression template evaluations.
Definition: DVecScalarMultExpr.h:171
Constraint on the data type.
Header file for the exception macros of the math module.
decltype(auto) operator*(const DenseMatrix< MT1, false > &lhs, const DenseMatrix< MT2, false > &rhs)
Multiplication operator for the multiplication of two row-major dense matrices ( ).
Definition: DMatDMatMultExpr.h:8893
Constraint on the data type.
LeftOperand vector_
Left-hand side dense vector of the multiplication expression.
Definition: DVecScalarMultExpr.h:590
Header file for all forward declarations for expression class templates.
Header file for the EnableIf class template.
ConstIterator & operator++()
Pre-increment operator.
Definition: DVecScalarMultExpr.h:248
Header file for the IsPadded type trait.
bool isAliased(const T *alias) const noexcept
Returns whether the expression is aliased with the given address alias.
Definition: DVecScalarMultExpr.h:563
DifferenceType operator-(const ConstIterator &rhs) const
Calculating the number of elements between two iterators.
Definition: DVecScalarMultExpr.h:377
ReturnType_< VT > RN
Return type of the dense vector expression.
Definition: DVecScalarMultExpr.h:111
ReferenceType reference
Reference return type.
Definition: DVecScalarMultExpr.h:200
ElementType & ReferenceType
Reference return type.
Definition: DVecScalarMultExpr.h:193
MultTrait_< RT, ST > ResultType
Result type for expression template evaluations.
Definition: DVecScalarMultExpr.h:166
friend const ConstIterator operator+(const ConstIterator &it, size_t inc)
Addition between a ConstIterator and an integral value.
Definition: DVecScalarMultExpr.h:389
bool operator<(const ConstIterator &rhs) const
Less-than comparison between two ConstIterator objects.
Definition: DVecScalarMultExpr.h:333
Header file for the IsNumeric type trait.
RightOperand scalar_
Right-hand side scalar of the multiplication expression.
Definition: DVecScalarMultExpr.h:591
ReturnType operator[](size_t index) const
Subscript operator for the direct access to the vector elements.
Definition: DVecScalarMultExpr.h:460
Base class for all vector/scalar multiplication expression templates.The VecScalarMultExpr class serv...
Definition: VecScalarMultExpr.h:67
Header file for the HasSIMDMult type trait.
Header file for run time assertion macros.
bool canSMPAssign() const noexcept
Returns whether the expression can be used in SMP assignments.
Definition: DVecScalarMultExpr.h:583
IteratorCategory iterator_category
The iterator category.
Definition: DVecScalarMultExpr.h:197
IteratorType iterator_
Iterator to the current element.
Definition: DVecScalarMultExpr.h:420
bool operator!=(const ConstIterator &rhs) const
Inequality comparison between two ConstIterator objects.
Definition: DVecScalarMultExpr.h:322
typename If< T1, T2, T3 >::Type If_
Auxiliary alias declaration for the If class template.The If_ alias declaration provides a convenient...
Definition: If.h:154
EnableIf_< IsDenseVector< VT1 > > smpDivAssign(Vector< VT1, TF1 > &lhs, const Vector< VT2, TF2 > &rhs)
Default implementation of the SMP division assignment of a vector to a dense vector.
Definition: DenseVector.h:222
Constraint on the data type.
#define BLAZE_CONSTRAINT_MUST_BE_NUMERIC_TYPE(T)
Constraint on the data type.In case the given data type T is not a numeric (integral or floating poin...
Definition: Numeric.h:61
SIMD characteristics of data types.The SIMDTrait class template provides the SIMD characteristics of ...
Definition: SIMDTrait.h:296
#define BLAZE_FUNCTION_TRACE
Function trace macro.This macro can be used to reliably trace function calls. In case function tracin...
Definition: FunctionTrace.h:94
friend const ConstIterator operator+(size_t inc, const ConstIterator &it)
Addition between an integral value and a ConstIterator.
Definition: DVecScalarMultExpr.h:401
Compile time check for data types.This type trait tests whether or not the given template parameter i...
Definition: IsInvertible.h:82
decltype(auto) serial(const DenseMatrix< MT, SO > &dm)
Forces the serial evaluation of the given dense matrix expression dm.
Definition: DMatSerialExpr.h:816
#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:81
Header file for the IsInvertible type trait.
typename EnableIf< Condition, T >::Type EnableIf_
Auxiliary alias declaration for the EnableIf class template.The EnableIf_ alias declaration provides ...
Definition: EnableIf.h:224
friend const ConstIterator operator-(const ConstIterator &it, size_t dec)
Subtraction between a ConstIterator and an integral value.
Definition: DVecScalarMultExpr.h:413
const Type & ReturnType
Return type for expression template evaluations.
Definition: CompressedMatrix.h:3080
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
bool canAlias(const T *alias) const noexcept
Returns whether the expression can alias with the given address alias.
Definition: DVecScalarMultExpr.h:551
Header file for the IsComputation type trait class.
bool operator>(const ConstIterator &rhs) const
Greater-than comparison between two ConstIterator objects.
Definition: DVecScalarMultExpr.h:344
const ConstIterator operator--(int)
Post-decrement operator.
Definition: DVecScalarMultExpr.h:280
Expression object for dense vector-scalar multiplications.The DVecScalarMultExpr class represents the...
Definition: DVecScalarMultExpr.h:104
Expression object for sparse vector-scalar multiplications.The SVecScalarMultExpr class represents th...
Definition: Forward.h:139
ConstIterator & operator+=(size_t inc)
Addition assignment operator.
Definition: DVecScalarMultExpr.h:225
Base class for all compute expression templates.The Computation class serves as a tag for all computa...
Definition: Computation.h:66
Compile time logical 'or' evaluation.The Or alias declaration performs at compile time a logical 'or'...
Definition: Or.h:76
DVecScalarMultExpr(const VT &vector, ST scalar) noexcept
Constructor for the DVecScalarMultExpr class.
Definition: DVecScalarMultExpr.h:448
Compile time evaluation of the size of vectors and matrices.The Size type trait evaluates the size of...
Definition: Size.h:80
Base class for sparse vectors.The SparseVector class is a base class for all arbitrarily sized (N-dim...
Definition: Forward.h:130
ConstIterator & operator-=(size_t dec)
Subtraction assignment operator.
Definition: DVecScalarMultExpr.h:237
typename T::TransposeType TransposeType_
Alias declaration for nested TransposeType type definitions.The TransposeType_ alias declaration prov...
Definition: Aliases.h:423
ReturnType operator*() const
Direct access to the element at the current iterator position.
Definition: DVecScalarMultExpr.h:290
bool operator>=(const ConstIterator &rhs) const
Greater-than comparison between two ConstIterator objects.
Definition: DVecScalarMultExpr.h:366
ConstIterator_< VT > IteratorType
ConstIterator type of the dense vector expression.
Definition: DVecScalarMultExpr.h:204
System settings for the inline keywords.
Header file for the Size type trait.
RightOperand scalar_
Scalar of the multiplication expression.
Definition: DVecScalarMultExpr.h:421
#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
Header file for the thresholds for matrix/vector and matrix/matrix multiplications.
#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
LeftOperand leftOperand() const noexcept
Returns the left-hand side sparse vector operand.
Definition: SVecScalarMultExpr.h:427
Compile time check whether the given type is an expression template.This type trait class tests wheth...
Definition: IsExpression.h:95
#define BLAZE_CONSTRAINT_MUST_BE_FLOATING_POINT_TYPE(T)
Constraint on the data type.In case the given data type T is not a floating point data type...
Definition: FloatingPoint.h:61
Header file for the IsExpression type trait class.
PointerType pointer
Pointer return type.
Definition: DVecScalarMultExpr.h:199
Header file for the function trace functionality.
ConstIterator & operator--()
Pre-decrement operator.
Definition: DVecScalarMultExpr.h:269
ST RightOperand
Composite type of the right-hand side scalar value.
Definition: DVecScalarMultExpr.h:180