Core functions defined in header <scicpp/core.hpp>
Quick overview comparing function calls for fixed and variable size arrays.
Provides vectorized versions of standard mathematical functions.
A vectorized version applies the function element-wise on the input array(s).
Function naming follows the NumPy definitions, which sometimes differs from the C++ definitions (ex. arcsin vs asin).
sin
, cos
, tan
, arcsin
, arccos
, arctan
, arctan2
, hypot
, sinc
.
sinh
, cosh
, tanh
, arcsinh
, arccosh
, arctanh
.
exp
, expm1
, exp2
, log
, log2
, log10
, log1p
.
around
, floor
, ceil
, trunc
, rint
.
real
, imag
, angle
, conj
, norm
, polar
NB: norm
and polar
are not provided by NumPy,
but are vectorized versions of the std::complex functions.
gcd
, lcm
.
absolute
, sqrt
, cbrt
, pow
.
Provides arithmetic operators +
, -
, *
, /
, %
for std::array and std::vector.
The statement using namespace scicpp::operators
must be included in the scope where
operators are used.
std::vector
of a given type.Operator |
is used for array concatenation.
Operators for element-wise comparison between an array and a scalar ==
, !=
, >
, >=
, <
, <=
.
For element-wise comparison between arrays, operators are not available because the C++ standard defines them for lexicographical comparison.
The comparison functions (same as Numpy) can be used instead: equal
, not_equal
, less
, less_equal
, greater
and greater_equal
.
Operators &&
and ||
are defined for element-wise logical operations.