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

◆ apply_scalar_binary() [5/5]

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

Specialization for use when the first input is a (non-nested) std::vector and the second is a scalar.

Specialization for use when the one input is an `var_value<Eigen> type and the other is a scalar.

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

Specialization for use with combinations of Eigen::Matrix and var_value<Eigen::Matrix> inputs.

Specialization for use when the first input is a scalar and the second is a nested std::vector.

Specialization for use when the first input is a nested std::vector and the second is a scalar.

Specialization for use when the first input is a scalar and the second is a (non-nested) std::vector.

The std::vector input is mapped to an Eigen column vector and then the result is evaluated directly into the returned std::vector (via Eigen::Map).

The returned scalar type is deduced to allow for cases where the input and return scalar types differ (e.g., functions implicitly promoting integers).

Template Parameters
T1Type of std::vector to which functor is applied.
T2Type of scalar to which functor is applied.
FType of functor to apply.
Parameters
xstd::vector input to which operation is applied.
yScalar input to which operation is applied.
ffunctor to apply to std::vector and scalar inputs.
Returns
std::vector with result of applying functor to inputs.

The std::vector input is mapped to an Eigen column vector and then the result is evaluated directly into the returned std::vector (via Eigen::Map).

The returned scalar type is deduced to allow for cases where the input and return scalar types differ (e.g., functions implicitly promoting integers).

Template Parameters
T1Type of scalar to which functor is applied.
T2Type of std::vector to which functor is applied.
FType of functor to apply.
Parameters
xScalar input to which operation is applied.
ystd::vector input to which operation is applied.
ffunctor to apply to std::vector and scalar inputs.
Returns
std::vector with result of applying functor to inputs.

The returned scalar type is deduced to allow for cases where the input and return scalar types differ (e.g., functions implicitly promoting integers).

Template Parameters
T1Type of std::vector to which functor is applied.
T2Type of scalar to which functor is applied.
FType of functor to apply.
Parameters
xstd::vector input to which operation is applied.
yScalar input to which operation is applied.
ffunctor to apply to inputs.
Returns
std::vector with result of applying functor to inputs.

The returned scalar type is deduced to allow for cases where the input and return scalar types differ (e.g., functions implicitly promoting integers).

Template Parameters
T1Type of scalar to which functor is applied.
T2Type of std::vector to which functor is applied.
FType of functor to apply.
Parameters
xScalar input to which operation is applied.
ystd::vector input to which operation is applied.
ffunctor to apply to inputs.
Returns
std::vector with result of applying functor to inputs.

Eigen's binaryExpr framework is used for more efficient indexing of both row- and column-major inputs without separate loops.

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
xFirst Matrix input to which operation is applied.
ySecond Matrix input to which operation is applied.
ffunctor to apply to Matrix inputs.
Returns
var_value<Matrix> 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
xMatrix input to which operation is applied.
yInteger std::vector input to which operation is applied.
ffunctor to apply to inputs.
Returns
var_value<Eigen> object with result of applying functor to inputs.
Template Parameters
T1Type of either var_value<Matrix> or scalar object to which functor is applied.
T2Type of either var_value<Matrix> or scalar object to which functor is applied.
FType of functor to apply.
Parameters
xMatrix or Scalar input to which operation is applied.
xMatrix or Scalar input to which operation is applied.
ffunctor to apply to var matrix and scalar inputs.
Returns
`var_value<Matrix> object with result of applying functor to inputs.

Definition at line 288 of file apply_scalar_binary.hpp.