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

◆ ordered_constrain() [3/5]

template<bool Jacobian, typename T , require_not_std_vector_t< T > * = nullptr>
auto stan::math::ordered_constrain ( const T &  x,
return_type_t< T > &  lp 
)
inline

Return a positive valued, increasing ordered vector derived from the specified free vector.

The returned constrained vector will have the same dimensionality as 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
TA type inheriting from Eigen::DenseBase or a var_value with inner type inheriting from Eigen::DenseBase with compile time dynamic rows and 1 column
Parameters
xFree vector of scalars
[in,out]lplog density accumulator
Returns
Positive, increasing ordered vector.

The returned constrained vector will have the same dimensionality as 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
TA standard vector with inner type inheriting from Eigen::DenseBase or a var_value with inner type inheriting from Eigen::DenseBase with compile time dynamic rows and 1 column
Parameters
xFree vector of scalars
[in,out]lplog density accumulator
Returns
Positive, increasing ordered vector.

Definition at line 81 of file ordered_constrain.hpp.