1 #ifndef STAN_MATH_PRIM_FUN_CONJ_HPP
2 #define STAN_MATH_PRIM_FUN_CONJ_HPP
3 
4 #include <complex>
5 
6 namespace stan {
7 namespace math {
8 namespace internal {
9 /**
10  * Return the complex conjugate the complex argument.
11  *
12  * @tparam V value type of argument
13  * @param[in] z argument
14  * @return complex conjugate of the argument
15  */
16 template <typename V>
complex_conj(const std::complex<V> & z)17 inline std::complex<V> complex_conj(const std::complex<V>& z) {
18   return {z.real(), -z.imag()};
19 }
20 }  // namespace internal
21 }  // namespace math
22 }  // namespace stan
23 
24 #endif
25