Re: [eigen] Zeros affect sequence of operation

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


Hi,

do you have some specific exemples to point out ?

gael

On Mon, Oct 9, 2017 at 3:31 PM, Brad Bell <bradbell@xxxxxxxxxx> wrote:
Custom scalar AD types, for example Adolc
        https://eigen.tuxfamily.org/dox/TopicCustomizing_CustomScalar.html
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.

Brad.





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