Automatic Differentiation
 
Loading...
Searching...
No Matches

◆ apply_scalar_binary() [3/5]

template<typename T1 , typename T2 , typename F , require_eigen_vector_vt< is_stan_scalar, T1 > * = nullptr, require_std_vector_vt< std::is_integral, T2 > * = nullptr>
auto stan::math::apply_scalar_binary ( T1 &&  x,
T2 &&  y,
F &&  f 
)
inline

Specialization for use with one Eigen vector (row or column) and a one-dimensional std::vector of integer types.

Specialization for use when the first input is an scalar and the second is an Eigen type.

Specialization for use when the first input is an Eigen type and the second is a scalar.

Specialization for use with a one-dimensional std::vector of integer types and one Eigen vector (row or column).

Template Parameters
T1Type of first argument to which functor is applied.
T2Type of second argument to which functor is applied.
FType of functor to apply.
Parameters
xEigen input to which operation is applied.
yInteger std::vector input to which operation is applied.
ffunctor to apply to inputs.
Returns
Eigen object with result of applying functor to inputs.
Template Parameters
T1Type of first argument to which functor is applied.
T2Type of second argument to which functor is applied.
FType of functor to apply.
Parameters
xInteger std::vector input to which operation is applied.
yEigen input to which operation is applied.
ffunctor to apply to inputs.
Returns
Eigen object with result of applying functor to inputs.

Eigen's unaryExpr framework is used for more efficient indexing of both row- and column-major inputs. The unaryExpr framework also allows for the scalar to be captured and applied to each element in the Eigen object.

Template Parameters
T1Type of Eigen object to which functor is applied.
T2Type of scalar to which functor is applied.
FType of functor to apply.
Parameters
xEigen input to which operation is applied.
yScalar input to which operation is applied.
ffunctor to apply to Eigen and scalar inputs.
Returns
Eigen object with result of applying functor to inputs.

Eigen's unaryExpr framework is used for more efficient indexing of both row- and column-major inputs. The unaryExpr framework also allows for the scalar to be captured and applied to each element in the Eigen object.

Template Parameters
T1Type of scalar to which functor is applied.
T2Type of Eigen object to which functor is applied.
FType of functor to apply.
Parameters
xScalar input to which operation is applied.
yEigen input to which operation is applied.
ffunctor to apply to Eigen and scalar inputs.
Returns
Eigen object with result of applying functor to inputs.

Definition at line 80 of file apply_scalar_binary.hpp.