[Coin-discuss] does CGL depend on CLP?
Matthew Galati
magh at lehigh.edu
Fri May 22 08:46:08 EDT 2009
This won't compile at all now when using #ifdef COIN_HAS_CPX
../../../../Cgl/src/CglLandP/CglLandPSimplex.cpp: In constructor
'LAP::CglLandPSimplex::CglLandPSimplex(const OsiSolverInterface&, const
CglLandP::CachedData&, const CglLandP::Parameters&, const LAP::Validator&)':
../../../../Cgl/src/CglLandP/CglLandPSimplex.cpp:212: error: 'else' without
a previous 'if'
../../../../Cgl/src/CglLandP/CglLandPSimplex.cpp:213: error:
'OsiXprSolverInterface' was not declared in this scope
../../../../Cgl/src/CglLandP/CglLandPSimplex.cpp:213: error: 'cpxSi' was not
declared in this scope
../../../../Cgl/src/CglLandP/CglLandPSimplex.cpp:213: error: expected
type-specifier before 'OsiXprSolverInterface'
../../../../Cgl/src/CglLandP/CglLandPSimplex.cpp:213: error: expected `>'
before 'OsiXprSolverInterface'
../../../../Cgl/src/CglLandP/CglLandPSimplex.cpp:213: error: expected `('
before 'OsiXprSolverInterface'
../../../../Cgl/src/CglLandP/CglLandPSimplex.cpp:213: error: expected
primary-expression before '>' token
../../../../Cgl/src/CglLandP/CglLandPSimplex.cpp:213: error: expected `)'
before ';' token
../../../../Cgl/src/CglLandP/CglLandPSimplex.cpp: At global scope:
../../../../Cgl/src/CglLandP/CglLandPSimplex.cpp:28: warning: 'void
MyAssertFunc(bool, const std::string&, const std::string&, unsig
Hi Matt,
>
>>
>> You missed a few places. Diffs pasted below. With these diffs now, it does
>> seem that Cgl is independent of Clp.
>
> Thanks, I fixed them.
> Best,
> Pierre
>
>>
>>
>>
>> magh at shark:~/COIN/coin-Decomp/Cgl/src$ svn diff
>> Index: CglLandP/CglLandPSimplex.cpp
>> ===================================================================
>> --- CglLandP/CglLandPSimplex.cpp (revision 736)
>> +++ CglLandP/CglLandPSimplex.cpp (working copy)
>> @@ -905,10 +905,12 @@
>> double infty = si_->getInfinity();
>> int clpLeavingStatus = leavingStatus;
>>
>> +#ifdef COIN_HAS_CLP
>> if (solver_ == clp) {
>> if (basics_[leaving] >= ncols_)
>> clpLeavingStatus = - leavingStatus;
>> }
>> +#endif
>> //row_k_.print(std::cout, 7, nonBasics_, ncols_);
>> //row_i_.print(std::cout, 7, nonBasics_, ncols_);
>> #if 0
>> Index: CglLandP/CglLandPSimplex.hpp
>> ===================================================================
>> --- CglLandP/CglLandPSimplex.hpp (revision 736)
>> +++ CglLandP/CglLandPSimplex.hpp (working copy)
>> @@ -18,7 +18,9 @@
>> #include "CoinWarmStartBasis.hpp"
>> #include "CoinPackedMatrix.hpp"
>>
>> +#ifdef COIN_HAS_CLP
>> #include "OsiClpSolverInterface.hpp"
>> +#endif
>> #include "CglLandPTabRow.hpp"
>> #include "CglLandPUtils.hpp"
>> #include "CglLandPMessages.hpp"
>> @@ -65,15 +67,19 @@
>>
>> void setSi(OsiSolverInterface *si) {
>> si_ = si;
>> +#ifdef COIN_HAS_CLP
>> OsiClpSolverInterface * clpSi =
>> dynamic_cast<OsiClpSolverInterface *>(si_);
>> if (clpSi) {
>> solver_ = clp;
>> clp_ = clpSi;
>> }
>> +#endif
>> }
>> void freeSi() {
>> delete si_;
>> +#ifdef COIN_HAS_CLP
>> clp_ = NULL;
>> +#endif
>> }
>>
>> Cuts& extraCuts() {
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> Matt,
>>> I updated makefiles in trunk so that nothing of CglLandP should be
>>> compiled if COIN_HAS_CLP is not true (I don't have writting permissions for
>>> the latest stable but modifications will come next time stable is updated).
>>> It should fix your linking problem, and remove the dependance (except if you
>>> would want to use lift-and-project cuts of course...).
>>> Best,
>>> Pierre
>>>
>>>
>>> On Fri, May 22, 2009 at 9:01 AM, John J Forrest <jjforre at us.ibm.com>wrote:
>>>
>>>> Matt,
>>>>
>>>> As the owner of Clp I plead innocent. If you look at code you will see
>>>> that only CglLAndP uses Clp. Other cut generators which use tableau e.g.
>>>> CglGomory use Coin code to do factorization.
>>>>
>>>> It would probably only be an hours work to use #ifdef COIN_HAS_CLP to
>>>> dummy out CglLandP. However it might be better to get the opinion of Pierre
>>>> Bonami as I also notice #ifdef COIN_HAS_CPX and #ifdef COIN_HAS_XPR in the
>>>> CglLandPSimplex code.
>>>>
>>>> John
>>>>
>>>> [image: Inactive hide details for Matthew Galati ---05/21/2009 09:59:14
>>>> PM---So... CGL does depend on CLP. Ok. Hopefully someone can fi]Matthew
>>>> Galati ---05/21/2009 09:59:14 PM---So... CGL does depend on CLP. Ok.
>>>> Hopefully someone can fix that someday.
>>>>
>>>>
>>>> From:
>>>> Matthew Galati <magh at lehigh.edu>
>>>> To:
>>>> ladanyi at watson.ibm.com
>>>> Cc:
>>>> "coin-discuss at list.coin-or.org" <coin-discuss at list.coin-or.org>,
>>>> Matthew Galati <Matthew.Galati at sas.com>
>>>> Date:
>>>> 05/21/2009 09:59 PM
>>>> Subject:
>>>> Re: [Coin-discuss] does CGL depend on CLP?
>>>> ------------------------------
>>>>
>>>>
>>>>
>>>> So... CGL does depend on CLP. Ok. Hopefully someone can fix that
>>>> someday.
>>>>
>>>>
>>>> On Thu, 21 May 2009, Matthew Galati wrote:
>>>>
>>>> > I am trying to use CPLEX as my LP solver. Does CGL depend on CLP?
>>>> if
>>>> > so - why? CGL should be completely independent of any LP solver -
>>>> > right?
>>>>
>>>> Yes and no... The end result is independent. However, some cut
>>>> generators (e.g., CglLandP) depend on being able to perform low
>>>> level
>>>> tableau manipulation. Those methods are not available through OSI,
>>>> so
>>>> the cut generator uses an LP solver that does support these
>>>> functions,
>>>> and clp is a natural choice there. Actually, even if those methods
>>>> would be available through OSI some LP solvers (like interior point)
>>>> do not support them, so CGL would have to link with clp (or some LP
>>>> solver that does support tableau methods) as a backup solution.
>>>>
>>>> Granted, the code could have been written with a bunch of ifdefs,
>>>> but
>>>> apparently that's not how it was done...
>>>>
>>>> --Laci
>>>>
>>>> >
>>>> >
>>>> > bla=;\
>>>> > for file in ATM_Main.o ATM_Instance.o ATM_DecompApp.o; do
>>>> bla="$bla `echo $file`"; done; \
>>>> > g++ -Wl,--rpath -Wl,/home/magh/COIN/coin-Decomp/build/lib
>>>> -O3 -fomit-frame-pointer -pipe -DNDEBUG -pedantic-errors -Wimplicit
>>>> -Wparentheses -Wreturn-type -Wcast-qual -Wall -Wpointer-arith
>>>> -Wwrite-strings -Wconversion -Wno-unknown-pragmas -o decomp_atm $bla
>>>> -L/home/magh/COIN/coin-Decomp/build/lib -lDecomp
>>>> -L/usr/local/cplex/lib/x86_rhel4.0_3.4/static_pic -lcplex -lpthread -lm
>>>> -lAlps `cat
>>>> /home/magh/COIN/coin-Decomp/build/Decomp/../Alps/alps_addlibs.txt` -lOsiCpx
>>>> -lcplex -lOsiCpx -lcplex -L/home/magh/COIN/coin-Decomp/build/lib -lCgl -lOsi
>>>> -lCoinUtils `cat
>>>> /home/magh/COIN/coin-Decomp/build/Decomp/../Cgl/cgl_addlibs.txt` `cat
>>>> /home/magh/COIN/coin-Decomp/build/Decomp/../Osi/osi_addlibs.txt` `cat
>>>> /home/magh/COIN/coin-Decomp/build/Decomp/../CoinUtils/coinutils_addlibs.txt`
>>>> > /home/magh/COIN/coin-Decomp/build/lib/libCgl.so: undefined
>>>> reference to `typeinfo for OsiClpSolverInterface'
>>>> > /home/magh/COIN/coin-Decomp/build/lib/libCgl.so: undefined
>>>> reference to `OsiClpSolverInterface::getModelPtr() const'
>>>> > /home/magh/COIN/coin-Decomp/build/lib/libCgl.so: undefined
>>>> reference to `ClpSimplex::factorize()'
>>>> > collect2: ld returned 1 exit status
>>>> > make: *** [decomp_atm] Error 1
>>>> >
>>>>
>>>> _______________________________________________
>>>> Coin-discuss mailing list*
>>>> **Coin-discuss at list.coin-or.org* <Coin-discuss at list.coin-or.org>*
>>>> **http://list.coin-or.org/mailman/listinfo/coin-discuss*<http://list.coin-or.org/mailman/listinfo/coin-discuss>
>>>>
>>>> _______________________________________________
>>>> Coin-discuss mailing list
>>>> Coin-discuss at list.coin-or.org
>>>> http://list.coin-or.org/mailman/listinfo/coin-discuss
>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>> Coin-discuss mailing list
>>>> Coin-discuss at list.coin-or.org
>>>> http://list.coin-or.org/mailman/listinfo/coin-discuss
>>>>
>>>>
>>>
>>> _______________________________________________
>>> Coin-discuss mailing list
>>> Coin-discuss at list.coin-or.org
>>> http://list.coin-or.org/mailman/listinfo/coin-discuss
>>>
>>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.coin-or.org/pipermail/coin-discuss/attachments/20090522/46669be0/attachment.html>
More information about the Coin-discuss
mailing list