32 template <nda::Scalar S>
42 template <nda::Scalar S>
53 inline double abs2(
double x) {
return x * x; }
56 inline double abs2(std::complex<double> z) {
return (conj(z) * z).real(); }
59 inline bool isnan(std::complex<double>
const &z) {
return std::isnan(z.real()) or std::isnan(z.
imag()); }
63 auto operator()(
auto const &x)
const {
return conj(x); };
76 template <ArrayOrScalar A>
77 auto pow(A &&a,
double p) {
81 })(std::forward<A>(a));
93 template <ArrayOrScalar A>
94 decltype(
auto)
conj(A &&a) {
96 return nda::map(detail::conj_f{})(std::forward<A>(a));
98 return std::forward<A>(a);
Provides concepts for the nda library.
auto pow(A &&a, double p)
Function pow for nda::ArrayOrScalar types (lazy and coefficient-wise for nda::Array types).
auto imag(A &&a)
Function imag for nda::ArrayOrScalar types (lazy and coefficient-wise for nda::Array types).
decltype(auto) conj(A &&a)
Function conj for nda::ArrayOrScalar types (lazy and coefficient-wise for nda::Array types with a com...
mapped< F > map(F f)
Create a lazy function call expression on arrays/views.
constexpr bool is_complex_v
Constexpr variable that is true if type T is a std::complex type.
Provides lazy function calls on arrays/views.
Provides type traits for the nda library.