Automatic Differentiation
 
Loading...
Searching...
No Matches
polar.hpp
Go to the documentation of this file.
1#ifndef STAN_MATH_FWD_FUN_POLAR_HPP
2#define STAN_MATH_FWD_FUN_POLAR_HPP
3
10#include <complex>
11#include <type_traits>
12
13namespace stan {
14namespace math {
15
24template <typename T>
25inline std::complex<fvar<T>> polar(const fvar<T>& r, const fvar<T>& theta) {
26 return internal::complex_polar(r, theta);
27}
28
38template <typename T, typename U>
39inline std::complex<fvar<T>> polar(const fvar<T>& r, U theta) {
40 return internal::complex_polar(r, theta);
41}
42
52template <typename T, typename U>
53inline std::complex<fvar<T>> polar(U r, const fvar<T>& theta) {
54 return internal::complex_polar(r, theta);
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:23
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:25
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...
This template class represents scalars used in forward-mode automatic differentiation,...
Definition fvar.hpp:40