[eigen] Zeros affect sequence of operation

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

Custom scalar AD types, for example Adolc
record an operation sequence and can use it at different values for the independent variables.

It appears that Eigen will short circuit certain operations when a value is zero. In CppAD there is a notion of a variable and a parameter. Parameters do not depend on the independent variables.

Because CppAD can have multiple levels of AD, a parameter at one level may be a variable at another. Therefore, in CppAD, it is necessary to have the notation of identically equal zero; i.e., this value will always be zero no matter what. Multiplication of a variable by an identically zero value results in an identically zero value (which leads to certain optimizations).

Note that, for the type double, identically zero and zero are the same.

It would be nice if Eigen understood variables and parameters and chose its operation sequence accordingly.


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