Boost logo

Boost :

Subject: [boost] compilation errors with ublas / cppad
From: Peter Caspers (pcaspers1973_at_[hidden])
Date: 2015-11-24 13:22:05


Hi,

I think this has been asked before, but since I am not aware of any
answer, I would like to bring up the topic again:

When using CppAD::AD<double> with boost ublas, certain compilation
errors show up. I attach a small example (ublas_cppad.cpp) and the
(start of the) error messages I get (compilation_errors.txt, produced
with boost 1.59.0, g++ 4.9.3, CppAD-20151124).

The problem is in matrix_assign.hpp; when changing

    template<class E1, class E2, class S>
    BOOST_UBLAS_INLINE
    bool equals (const matrix_expression<E1> &e1, const
matrix_expression<E2> &e2, S epsilon, S min_norm) {
         return norm_inf (e1 - e2) < epsilon *
                std::max<S> (std::max<S> (norm_inf (e1), norm_inf
(e2)), min_norm);
    }

to

    template<class E1, class E2, class S>
    BOOST_UBLAS_INLINE
    bool equals (const matrix_expression<E1> &e1, const
matrix_expression<E2> &e2, S epsilon, S min_norm) {
        S tmp = norm_inf (e1 - e2);
        return tmp < epsilon *
               std::max<S> (std::max<S> (norm_inf (e1), norm_inf
(e2)), min_norm);
    }

the example code compiles without errors. Can someone point out, how
this should be fixed (either on boost or CppAD side)? In general, are
there requirements for a type T to cooperate with ublas matrices one
should be aware of?

Thank you
Peter





Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk