Automatic Differentiation
 
Loading...
Searching...
No Matches
polar.hpp
Go to the documentation of this file.
1#ifndef STAN_MATH_REV_FUN_POLAR_HPP
2#define STAN_MATH_REV_FUN_POLAR_HPP
3
13#include <complex>
14#include <type_traits>
15
16namespace stan {
17namespace math {
18
26inline std::complex<var> polar(const var& r, const var& theta) {
27 return internal::complex_polar(r, theta);
28}
29
38template <typename T>
39inline std::complex<var> polar(T r, const var& theta) {
40 return internal::complex_polar(r, theta);
41}
42
51template <typename T>
52inline std::complex<var> polar(const var& r, T theta) {
53 return internal::complex_polar(r, theta);
54}
55
56} // namespace math
57} // namespace stan
58
59#endif
complex_return_t< U, V > complex_polar(const U &r, const V &theta)
Returns complex number with specified magnitude and phase angle.
Definition polar.hpp:22
std::complex< fvar< T > > polar(const fvar< T > &r, const fvar< T > &theta)
Returns complex number with specified magnitude and phase angle.
Definition polar.hpp:22
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...