1#ifndef STAN_MATH_PRIM_FUN_TO_COMPLEX_HPP
2#define STAN_MATH_PRIM_FUN_TO_COMPLEX_HPP
21template <
typename T = double,
typename S = double,
22 require_all_not_container_t<T, S>* =
nullptr>
23constexpr inline std::complex<stan::real_return_t<T, S>>
to_complex(
24 const T& re = 0,
const S& im = 0) {
25 return std::complex<stan::real_return_t<T, S>>(re, im);
38template <
typename T1,
typename T2, require_any_container_t<T1, T2>* =
nullptr,
39 require_all_st_stan_scalar<T1, T2>* =
nullptr>
constexpr std::complex< stan::real_return_t< T, S > > to_complex(const T &re=0, const S &im=0)
Return a complex value from a real component and an imaginary component.
auto apply_scalar_binary(const T1 &x, const T2 &y, const F &f)
Base template function for vectorization of binary scalar functions defined by applying a functor to ...
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...