1#ifndef STAN_MATH_PRIM_FUN_CONJ_HPP
2#define STAN_MATH_PRIM_FUN_CONJ_HPP
17template <
typename V, require_complex_bt<std::is_arithmetic, V>* =
nullptr>
18inline auto conj(
const V& z) {
29template <
typename V, require_complex_bt<is_autodiff, V>* =
nullptr>
31 return {z.real(), -z.imag()};
42template <
typename Eig, require_eigen_vt<is_complex, Eig>* =
nullptr>
46 return z_inner.unaryExpr([](
auto&& z_i) {
return conj(z_i); });
48 std::forward<Eig>(z));
58template <
typename StdVec, require_std_vector_st<is_complex, StdVec>* =
nullptr>
59inline auto conj(
const StdVec& z) {
60 const auto z_size = z.size();
62 for (std::size_t i = 0; i < z_size; ++i) {
63 result[i] =
conj(z[i]);
auto make_holder(const F &func, Args &&... args)
Constructs an expression from given arguments using given functor.
typename promote_scalar_type< std::decay_t< T >, std::decay_t< S > >::type promote_scalar_t
auto conj(const V &z)
Return the complex conjugate the complex argument.
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...