Automatic Differentiation
 
Loading...
Searching...
No Matches
operator_multiplication.hpp
Go to the documentation of this file.
1#ifndef STAN_MATH_PRIM_CORE_OPERATOR_MULTIPLICATION_HPP
2#define STAN_MATH_PRIM_CORE_OPERATOR_MULTIPLICATION_HPP
3
7#include <complex>
8
9namespace stan {
10namespace math {
11
12namespace internal {
23template <typename U, typename V, require_any_complex_t<U, V>* = nullptr>
24inline complex_return_t<U, V> complex_multiply(const U& lhs, const V& rhs) {
26 y *= rhs;
27 return y;
28}
29} // namespace internal
30
40template <typename U, typename V, require_all_stan_scalar_t<U, V>* = nullptr>
41inline complex_return_t<U, V> operator*(const std::complex<U>& x,
42 const std::complex<V>& y) {
43 return internal::complex_multiply(x, y);
44}
45
55template <typename U, typename V, require_stan_scalar_t<V>* = nullptr>
56inline complex_return_t<U, V> operator*(const std::complex<U>& x, const V& y) {
57 return internal::complex_multiply(x, y);
58}
59
69template <typename U, typename V, require_stan_scalar_t<U>* = nullptr>
70inline complex_return_t<U, V> operator*(const U& x, const std::complex<V>& y) {
71 return internal::complex_multiply(x, y);
72}
73
74} // namespace math
75} // namespace stan
76
77#endif
std::complex< real_return_t< Ts... > > complex_return_t
Convenience type to calculate the complex return type, which wraps std::complex around the return typ...
complex_return_t< U, V > complex_multiply(const U &lhs, const V &rhs)
Return the product of the specified arguments.
fvar< T > operator*(const fvar< T > &x, const fvar< T > &y)
Return the product of the two arguments.
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...