RE: [eigen] eigen3 migration

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


Do you use X.h's Success yourself ?
otherwise, a simple #undef Success before including Eigen would be enough (though it won't be an universal solution).

Adrien

-----Message d'origine-----
De : Listengine [mailto:listengine@xxxxxxxxxxxxxxxxx] De la part de Benjamin Schindler
Envoyé : jeudi 14 avril 2011 15:07
À : eigen@xxxxxxxxxxxxxxxxxxx
Objet : Re: [eigen] eigen3 migration

On 04/14/2011 03:04 PM, Konstantin Tokarev wrote:
> 
> 
> 14.04.2011, 16:54, "Jitse Niesen" <jitse@xxxxxxxxxxxxxxxxx>:
>> On Wed, 13 Apr 2011, Benjamin Schindler wrote:
>>
>>>  Okay, after deleting millions of lines of code, I managed to reduce it
>>>  to this:
>>>
>>>  #define Success   0 /* everything's okay */
>>>  #include <eigen3/Eigen/Core>
>>>
>>>  And this define comes from X.h, so it's rather standard
>>
>> It's pretty annoying that X.h has this #define. But I guess not including
>> X.h is rather difficult.
>>
>> In Eigen3, Success is used as an enum constant to report that a
>> computation was successful. The enum is defined as
>>
>> enum ComputationInfo {
>>    Success = 0,
>>    NumericalIssue = 1,
>>    NoConvergence = 2
>> };
>>
>> We could rename Success to say ComputationSuccess, but that would break
>> all user code that uses the Success constant. Perhaps an acceptable
>> compromise would be to rename as above and also make Success available as
>> an alternative name unless a Success macro already has been defined:
>>
>> enum ComputationInfo {
>>    ComputationSuccess = 0,
>> #ifndef Success
>>    Success = 0,
>> #endif
>>    NumericalIssue = 1,
>>    NoConvergence = 2
>> };
>>
>> Any opinions?
> 
> Require including of X.h after eigen3/Eigen/Core
> 

That doesn't fix it as any use of the enum will break, like

if(myComputation() == Success) // this is after including X.h






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