Automatic Differentiation
 
Loading...
Searching...
No Matches
arg.hpp
Go to the documentation of this file.
1#ifndef STAN_MATH_PRIM_FUN_ARG_HPP
2#define STAN_MATH_PRIM_FUN_ARG_HPP
3
4#include <cmath>
5#include <complex>
6
7namespace stan {
8namespace math {
16template <typename V>
17inline V arg(const std::complex<V>& z) {
18 return std::arg(z);
19}
20
21namespace internal {
29template <typename V>
30inline V complex_arg(const std::complex<V>& z) {
31 using std::atan2;
32 return atan2(z.imag(), z.real());
33}
34} // namespace internal
35} // namespace math
36} // namespace stan
37
38#endif
V complex_arg(const std::complex< V > &z)
Return the phase angle of the complex argument.
Definition arg.hpp:30
fvar< T > atan2(const fvar< T > &x1, const fvar< T > &x2)
Definition atan2.hpp:13
fvar< T > arg(const std::complex< fvar< T > > &z)
Return the phase angle of the complex argument.
Definition arg.hpp:19
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...