[Boost-bugs] [Boost C++ Libraries] #4441: SFINAE for operator * breaking auto differentiation code

Subject: [Boost-bugs] [Boost C++ Libraries] #4441: SFINAE for operator * breaking auto differentiation code
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2010-07-15 22:16:34


#4441: SFINAE for operator * breaking auto differentiation code
------------------------------------------------+---------------------------
 Reporter: Jesse Perla <jesseperla@…> | Owner: guwi17
     Type: Bugs | Status: new
Milestone: Boost 1.44.0 | Component: uBLAS
  Version: Boost 1.44.0 | Severity: Problem
 Keywords: |
------------------------------------------------+---------------------------
 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.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/4441>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:03 UTC