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

◆ elementwise_check() [2/2]

template<typename F , typename T , typename... Indexings, require_eigen_t< T > * = nullptr, std::enable_if_t<(Eigen::internal::traits< T >::Flags &Eigen::LinearAccessBit)||T::IsVectorAtCompileTime > * = 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 all elements of the value of x.

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

This overload works on Eigen types that support linear indexing.

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 col-major Eigen types that do not support linear indexing.

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 row-major Eigen types that do not support linear indexing.

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 150 of file elementwise_check.hpp.