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

◆ elementwise_check() [1/2]

template<typename F , typename T , typename... Indexings, require_stan_scalar_t< T > * = nullptr>
void stan::math::elementwise_check ( const F &  is_good,
const char *  function,
const char *  name,
const T &  x,
const char *  must_be,
const Indexings &...  indexings 
)
inline

Check that the predicate holds for the value of x.

Check that the predicate holds for all elements of the value of x.

This overload works on scalars.

Template Parameters
Ftype of predicate
Ttype of x
Indexingstypes of indexings
Parameters
is_goodpredicate to check, must accept doubles and produce bools
functionfunction name (for error messages)
namevariable name (for error messages)
xvariable to check, can be a scalar, a container of scalars, a container of containers of scalars, etc
must_bemessage describing what the value should be
indexingsany additional indexing to print. Intended for internal use in elementwise_check only.
Exceptions
`std::domain_error`if is_good returns false for the value of any element in x

This overload works on std::vector types.

Template Parameters
Ftype of predicate
Ttype of x
Indexingstypes of indexings
Parameters
is_goodpredicate to check, must accept doubles and produce bools
functionfunction name (for error messages)
namevariable name (for error messages)
xvariable to check, can be a scalar, a container of scalars, a container of containers of scalars, etc
must_bemessage describing what the value should be
indexingsany additional indexing to print. Intended for internal use in elementwise_check only.
Exceptions
`std::domain_error`if is_good returns false for the value of any element in x

This overload works on vars containing Eigen types.

Template Parameters
Ftype of predicate
Ttype of x
Indexingstypes of indexings
Parameters
is_goodpredicate to check, must accept doubles and produce bools
functionfunction name (for error messages)
namevariable name (for error messages)
xvariable to check, can be a scalar, a container of scalars, a container of containers of scalars, etc
must_bemessage describing what the value should be
indexingsany additional indexing to print. Intended for internal use in elementwise_check only.
Exceptions
`std::domain_error`if is_good returns false for the value of any element in x

Definition at line 116 of file elementwise_check.hpp.