[eigen] Subject: why are AutoDiff to value conversions disabled?

[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]

See the conversions commented out here: https://bitbucket.org/eigen/eigen/src/df279134beee3771e025160762e976680de90503/unsupported/Eigen/src/AutoDiff/AutoDiffScalar.h?at=default&fileviewer=file-view-default#AutoDiffScalar.h-149

Is there a good reason for this? I often find myself writing functions templated for both real scalars scalar or autodiff scalars, and if I want to read the real scalar value out of this templated code, I need to jump through some hoops that could be avoided by just using a static_cast<double>(maybe_autodiff_scalar) if these lines were uncommented.

Alternatively, is it possible to enable this conversion externally without modifying eigen's source but to still have it as work as transparently?


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/