Re: [eigen] no matching function for call to 'abs(const float&)'

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


Hi,

The fact that it can't be compiled by the cross compiler proves there is something not supported by your platform. Why it fails may be now a question for the ML for your compiler?

Cheers,

Matthieu

2015-08-27 15:12 GMT+01:00 Nuno Marques <n.marques21@xxxxxxxxxxx>:
The code you shared will compile ok with g++ -std=c++98 -pedantic -Wall mathabs.cpp but not with gcc-arm-none-eabi.

Thanks anyway. Best,

---
Nuno Marques
Tenente Aluno de Transmissões (Eng)

Azambuja | Portugal

As the creation appears, the path is driven in the conscious feeling of madness and happiness, which returns, in multiple ways, to what we achieve in greatness...

Follow me in:
   

This message and any files herewith attached may contain confidential or privileged information and is intended solely for the use of the entity to which it is addressed. If you receive this message in error, please notify the sender immediately and delete this message and any files attached without copying them in any way.



From: tbs1980@xxxxxxxxx
Subject: Re: [eigen] no matching function for call to 'abs(const float&)'
Date: Thu, 27 Aug 2015 15:04:20 +0100
To: eigen@xxxxxxxxxxxxxxxxxxx


Hi Numo,

You could try to see if abs() really supports floating point arguments in your system. For example if this small code 


compiles fine then you shouldn’t have any issues compiling the Eigen code. The other option may be is to define a custom version of abs() in the namespace std. 

Best,
Sree

Sreekumar Thaithara Balan
Research Associate in Cosmology
University College London
Email:sbalan@star.ucl.ac..uk

On 27 Aug 2015, at 18:59, Ilja Honkonen <ilja.j.honkonen@xxxxxxxx> wrote:

cmath has been included.
> > OK, replacing line 44 of Eigen/src/Core/functors/UnaryFunctors.h with:
> > EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const result_type operator()
> > (const Scalar& a) const { using std::fabs; return fabs(a); }
> Will this work even if cmath hasn't been included at all?

And if it's not? Eigen cannot control what has been included before or after Eigen headers and I'm guessing your fix would break as soon as someone uses that code without including cmath first.
Ilja






--
Information System Engineer, Ph.D.
Blog: http://matt.eifelle.com
LinkedIn: http://www.linkedin.com/in/matthieubrucher


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