Opened 12 years ago
Last modified 12 years ago
#4441 new Bugs
SFINAE for operator * breaking auto differentiation code
Reported by: | Owned by: | Gunter | |
---|---|---|---|
Milestone: | Boost 1.44.0 | Component: | uBLAS |
Version: | Boost 1.44.0 | Severity: | Problem |
Keywords: | Cc: |
Description
A while back we had discussed adding overload resolution with SFINAE to the matrix/vector expressions involving scalars in order to implement operator*, etc. The choice was made to use is_convertible between the scalar and matrix type.
But this ended up breaking an auto-differentiation library (CPPAD) I was using. Templated AD libraries will often have their own, arithmetic type which will record operations of the type * a double, etc. for a matrix multiplication by a scalar, etc. But you can't convert between them!
The basic change is to change from using is_convertible to using is_arithmetic. A change to the result type is also needed for autodifferentation to work.
See the attached patch for the change to matrix/vector expression.
Attachments (2)
Change History (3)
by , 12 years ago
Attachment: | enable_if_sfinae.patch added |
---|
by , 12 years ago
Attachment: | enable_if_sfinae.2.patch added |
---|
Actually, let me fix that patch... I used an older version. Use the .2. version.
It is much simpler, just swapping out to is_arithmetic for now. If this doesn't patch properly, my apologies... I am trying to separate out a bunch of changes.