![]() |
Stan Math Library
5.4.0
Automatic Differentiation
|
Partial specialization of Eigen's ternary evaluator for .select() expressions on matrices of fvar<T>, restoring the lazy (Eigen 3.x) semantics where only the branch chosen by the condition is evaluated for each coefficient.
Higher-order autodiff types (e.g. fvar<var>) tape their inner operations, so eagerly evaluating an unselected branch can allocate orphan varis whose chain rules inject 0 * INF = NaN into the adjoints of live inputs. See stan/math/prim/meta/lazy_select_evaluator.hpp for details.
| T | value and tangent type of autodiff variable |
Definition at line 236 of file Eigen_NumTraits.hpp.
#include <Eigen_NumTraits.hpp>
Inheritance diagram for Eigen::internal::ternary_evaluator< CwiseTernaryOp< scalar_boolean_select_op< stan::math::fvar< T >, stan::math::fvar< T >, CondScalar >, Arg1, Arg2, Arg3 >, IndexBased, IndexBased >:Public Types | |
| using | Base = stan::math::internal::lazy_select_evaluator< scalar_boolean_select_op< stan::math::fvar< T >, stan::math::fvar< T >, CondScalar >, Arg1, Arg2, Arg3 > |
| enum | |
| using | XprType = Eigen::CwiseTernaryOp< scalar_boolean_select_op< stan::math::fvar< T >, stan::math::fvar< T >, CondScalar >, Arg1, Arg2, Arg3 > |
| using | CoeffReturnType = typename XprType::CoeffReturnType |
| using | CondScalar = typename Arg3::Scalar |
Public Member Functions | |
| CoeffReturnType | coeff (Eigen::Index row, Eigen::Index col) const |
| CoeffReturnType | coeff (Eigen::Index index) const |
Protected Attributes | |
| Data | m_d |