1#ifndef STAN_MATH_PRIM_FUN_DOT_PRODUCT_HPP
2#define STAN_MATH_PRIM_FUN_DOT_PRODUCT_HPP
21template <
typename Vec1,
typename Vec2,
22 require_all_eigen_vector_t<Vec1, Vec2> * =
nullptr,
23 require_not_var_t<return_type_t<Vec1, Vec2>> * =
nullptr>
36template <
typename Scalar1,
typename Scalar2,
39inline auto dot_product(
const Scalar1 *v1,
const Scalar2 *v2,
size_t length) {
41 for (
size_t i = 0; i < length; i++) {
42 result += v1[i] * v2[i];
54template <
typename Scalar1,
typename Scalar2,
typename Alloc1,
typename Alloc2,
57 const std::vector<Scalar1, Alloc1> &v1,
58 const std::vector<Scalar2, Alloc2> &v2) {
auto as_column_vector_or_scalar(T &&a)
as_column_vector_or_scalar of a kernel generator expression.
require_all_t< is_stan_scalar< std::decay_t< Types > >... > require_all_stan_scalar_t
Require all of the types satisfy is_stan_scalar.
typename return_type< Ts... >::type return_type_t
Convenience type for the return type of the specified template parameters.
require_all_not_t< is_var< std::decay_t< Types > >... > require_all_not_var_t
Require none of the types satisfy is_var.
void check_matching_sizes(const char *function, const char *name1, const T_y1 &y1, const char *name2, const T_y2 &y2)
Check if two structures at the same size.
auto dot_product(const T_a &a, const T_b &b)
Returns the dot product of the specified vectors.
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...