scipopt / soplex

Sequential object-oriented simPlex
Other
59 stars 18 forks source link

Remove nondefinition declarations #23

Closed jamesjer closed 6 months ago

jamesjer commented 10 months ago

This PR fixes these errors when building gfan with soplex 6.0.4:

In file included from /usr/include/soplex/spxweightpr.h:192,
                 from src/lp_soplexcdd.cpp:15:
/usr/include/soplex/spxweightpr.hpp: At global scope:
/usr/include/soplex/spxweightpr.hpp:34:6: error: declaration of 'void soplex::SPxWeightPR<R>::computeLeavePenalty(int, int)' outside of class is not definition [-fpermissive]
   34 | void SPxWeightPR<R>::computeLeavePenalty(int start, int end);
      |      ^~~~~~~~~~~~~~
/usr/include/soplex/spxweightpr.hpp:37:6: error: declaration of 'virtual bool soplex::SPxWeightPR<R>::isConsistent() const' outside of class is not definition [-fpermissive]
   37 | bool SPxWeightPR<R>::isConsistent() const;
      |      ^~~~~~~~~~~~~~

Indeed, computeLeavePenalty and isConsistent are both declared as class members already in spxweightpr.h, so redeclaring them without definitions doesn't accomplish anything.

leoneifler commented 6 months ago

Sorry, I am only now getting to this. I agree with your change. I cherry-picked your commit onto our internal gitlab (our CI pipeline runs there, and migrating fully to GitHub takes a long time). The code change will appear here on GitHub in the coming days.