|
3 | 3 |
|
4 | 4 | #include <stan/math/prim/meta.hpp>
|
5 | 5 | #include <stan/math/rev/core/var.hpp>
|
| 6 | +#include <stan/math/rev/core/operator_addition.hpp> |
| 7 | +#include <stan/math/rev/core/operator_subtraction.hpp> |
| 8 | +#include <stan/math/rev/core/operator_plus_equal.hpp> |
| 9 | +#include <stan/math/rev/core/operator_minus_equal.hpp> |
6 | 10 | #include <stan/math/rev/core/vv_vari.hpp>
|
7 | 11 | #include <stan/math/rev/core/vd_vari.hpp>
|
| 12 | +#include <stan/math/prim/core/operator_multiplication.hpp> |
8 | 13 | #include <stan/math/prim/fun/constants.hpp>
|
9 | 14 | #include <stan/math/prim/fun/is_any_nan.hpp>
|
10 | 15 | #include <stan/math/prim/fun/isinf.hpp>
|
@@ -112,6 +117,45 @@ inline var operator*(Arith a, const var& b) {
|
112 | 117 | return {new internal::multiply_vd_vari(b.vi_, a)}; // by symmetry
|
113 | 118 | }
|
114 | 119 |
|
| 120 | +/** |
| 121 | + * Return the product of std::complex<var> arguments. |
| 122 | + * |
| 123 | + * @param[in] x first argument |
| 124 | + * @param[in] y second argument |
| 125 | + * @return product of arguments |
| 126 | + */ |
| 127 | +inline std::complex<stan::math::var> operator*( |
| 128 | + const std::complex<stan::math::var>& x, |
| 129 | + const std::complex<stan::math::var>& y) { |
| 130 | + return internal::complex_multiply(x, y); |
| 131 | +} |
| 132 | + |
| 133 | +/** |
| 134 | + * Return the product of std::complex<double> and |
| 135 | + * std::complex<var> arguments. |
| 136 | + * |
| 137 | + * @param[in] x first argument |
| 138 | + * @param[in] y second argument |
| 139 | + * @return product of arguments |
| 140 | + */ |
| 141 | +inline std::complex<stan::math::var> operator*( |
| 142 | + const std::complex<double>& x, const std::complex<stan::math::var>& y) { |
| 143 | + return internal::complex_multiply(x, y); |
| 144 | +} |
| 145 | + |
| 146 | +/** |
| 147 | + * Return the product of std::complex<double> and |
| 148 | + * std::complex<var> arguments. |
| 149 | + * |
| 150 | + * @param[in] x first argument |
| 151 | + * @param[in] y second argument |
| 152 | + * @return product of arguments |
| 153 | + */ |
| 154 | +inline std::complex<stan::math::var> operator*( |
| 155 | + const std::complex<stan::math::var>& x, const std::complex<double>& y) { |
| 156 | + return internal::complex_multiply(x, y); |
| 157 | +} |
| 158 | + |
115 | 159 | } // namespace math
|
116 | 160 | } // namespace stan
|
117 | 161 | #endif
|
0 commit comments