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
7#include <complex>
8#include <type_traits>
9
10namespace stan {
11namespace math {
12
21template <typename T>
22inline std::complex<fvar<T>> polar(const fvar<T>& r, const fvar<T>& theta) {
23 return internal::complex_polar(r, theta);
24}
25
35template <typename T, typename U>
36inline std::complex<fvar<T>> polar(const fvar<T>& r, U theta) {
37 return internal::complex_polar(r, theta);
38}
39
49template <typename T, typename U>
50inline std::complex<fvar<T>> polar(U r, const fvar<T>& theta) {
51 return internal::complex_polar(r, theta);
52}
53} // namespace math
54} // namespace stan
55
56#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 ...
This template class represents scalars used in forward-mode automatic differentiation,...
Definition fvar.hpp:40