43 template <nda::Scalar S>
53 template <nda::Scalar S>
64 inline double abs2(
double x) {
return x * x; }
67 inline double abs2(std::complex<double> z) {
return (conj(z) * z).real(); }
70 inline bool isnan(std::complex<double>
const &z) {
return std::isnan(z.real()) or std::isnan(z.
imag()); }
74 auto operator()(
auto const &x)
const {
return conj(x); };
87 template <ArrayOrScalar A>
88 auto pow(A &&a,
double p) {
92 })(std::forward<A>(a));
104 template <ArrayOrScalar A>
105 decltype(
auto) conj(A &&a) {
107 return nda::map(detail::conj_f{})(std::forward<A>(a));
109 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).
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.