23namespace vctr::expressions
26template <
size_t extent,
class SrcType>
27requires is::realFloatNumber<ValueType<SrcType>> || is::complexFloatNumber<ValueType<SrcType>>
33 VCTR_COMMON_UNARY_EXPRESSION_MEMBERS (
Sqrt, src)
35 VCTR_FORCEDINLINE
constexpr value_type operator[] (
size_t i)
const
37 VCTR_ASSERT (inputValueValid (src[i]));
38 return std::sqrt (src[i]);
43 VCTR_FORCEDINLINE
const value_type* evalNextVectorOpInExpressionChain (value_type* dst)
const
46 const auto* s = src.evalNextVectorOpInExpressionChain (dst);
47 VCTR_ASSERT (std::all_of (s, s + size(), inputValueValid));
49 Expression::Accelerate::sqrt (s, dst,
sizeToInt (size()));
53 VCTR_FORCEDINLINE
const value_type* evalNextVectorOpInExpressionChain (value_type* dst)
const
56 const auto* s = src.evalNextVectorOpInExpressionChain (dst);
57 VCTR_ASSERT (std::all_of (s, s + size(), inputValueValid));
59 Expression::IPP::sqrt (s, dst,
sizeToInt (size()));
65 static constexpr bool inputValueValid (value_type in)
68 return in >= value_type (0);
Constrains a type to represent a real valued number.
Definition: NumericTypeConcepts.h:75
A combined concept to check if Apple Accelerate is a suitable option for a real valued floating point...
Definition: ContainerAndExpressionConcepts.h:242
A combined concept to check if Intel IPP is a suitable option for a real or complex valued floating p...
Definition: ContainerAndExpressionConcepts.h:278
constexpr ExpressionChainBuilder< expressions::Sqrt > sqrt
Computes the square root of the source values.
Definition: Sqrt.h:83
The main namespace of the VCTR project.
Definition: Array.h:24
typename detail::ValueType< std::remove_cvref_t< T > >::Type ValueType
If T is an expression template, it equals its return type, if it's a type that defines value_type as ...
Definition: Traits.h:201
int sizeToInt(size_t size)
Casts the size_t argument to an int.
Definition: PlatformVectorOpsHelpers.h:27
An expression chain builder is an object which supplies various operator<< overloads which build chai...
Definition: ExpressionChainBuilder.h:136
The base class to every expression template.
Definition: ExpressionTemplate.h:37