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

◆ simplex_constrain() [5/7]

template<bool Jacobian, typename Vec , typename Lp , require_convertible_t< return_type_t< Vec >, Lp > * = nullptr>
plain_type_t< Vec > stan::math::simplex_constrain ( Vec &&  y,
Lp &  lp 
)
inline

Return the simplex corresponding to the specified free vector.

If the Jacobian parameter is true, the log density accumulator is incremented with the log absolute Jacobian determinant of the transform. All of the transforms are specified with their Jacobians in the Stan Reference Manual chapter Constraint Transforms.

Template Parameters
Jacobianif true, increment log density accumulator with log absolute Jacobian determinant of constraining transform
VecA type inheriting from Eigen::DenseBase or a var_value with inner type inheriting from Eigen::DenseBase with compile time dynamic rows and 1 column
LpA scalar type for the lp argument. The scalar type of Vec should be convertable to this.
Parameters
[in]yfree vector
[in,out]lplog density accumulator
Returns
simplex of dimensionality one greater than y

Definition at line 195 of file simplex_constrain.hpp.