Boost logo

Ublas :

Subject: Re: [ublas] Should/can I use GitHub to fix issue #7902 Division by scalar should use enable_if<>
From: Joaquim Duran (jduran.gm_at_[hidden])
Date: 2014-12-10 03:39:48


I wrote the function. I executed the tests with g++ 4.8 (Fedora 20)
and I didn't detect any issue.

As work around, you should rename the function equal_to.

To fix the issue, is it really needed have to sets of functions to
compare vectors and matrices? Maybe, we could have just a jest of
functions named 'compare'.

Thanks and Best Regards,
Joaquim Duran

2014-12-09 20:40 GMT+01:00 Sean Reilly <campreilly_at_[hidden]>:
> Still having a problem getting the tests to running on CentOS 6.6 with gcc
> 4.4.7 compiler.
>
> /usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/bits/stl_function.h:199:
> error: ‘template<class _Tp> struct std::equal_to’ is not a function,
> common/testhelper.hpp:126: error: conflict with ‘template<class M1, class
> M2> bool equal_to(const boost::numeric::ublas::vector_expression<E>&, const
> boost::numeric::ublas::vector_expression<E2>&, double)’
> test_assignment.cpp:30: error: in call to ‘equal_to’
> test_assignment.cpp:601: instantiated from here
>
>
> Basically, there seems to be a name conflict between the equal_to() template
> function defined in testhelper.h
>
> template < class M1, class M2 >
> bool equal_to( const boost::numeric::ublas::vector_expression<M1> & m1,
> const boost::numeric::ublas::vector_expression<M2> & m2,
> double tolerance = 0.0 ) {
> if (m1().size() != m2().size()) {
> return false;
> }
>
> return mean_square(m2() - m1()) <= tolerance;
> }
>
>
> And the equal_to() template function defined in stl_function.h
>
> template<typename _Tp>
> struct equal_to : public binary_function<_Tp, _Tp, bool>
> {
> bool
> operator()(const _Tp& __x, const _Tp& __y) const
> { return __x == __y; }
> };
>
>
> Anybody else having this issue?
>
> Sean Reilly
>
> _______________________________________________
> ublas mailing list
> ublas_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/ublas
> Sent to: jduran.gm_at_[hidden]