Ignore:
Timestamp:
Jan 3, 2013 12:07:26 PM (7 years ago)
Author:
stefan
Message:

patch by Miles Lubin to make solve options available in C interface

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Clp/src/Clp_C_Interface.cpp

    r1901 r1902  
    766766     return model->model_->initialSolve();
    767767}
     768/* Pass solve options. (Exception to direct analogue rule) */
     769COINLIBAPI int COINLINKAGE
     770Clp_initialSolveWithOptions(Clp_Simplex * model, Clp_Solve * s)
     771{
     772     return model->model_->initialSolve(s->options);
     773}
    768774/* Barrier initial solve */
    769775COINLIBAPI int COINLINKAGE
     
    12121218#endif
    12131219
     1220COINLIBAPI Clp_Solve * COINLINKAGE
     1221ClpSolve_new()
     1222{
     1223    return new Clp_Solve();
     1224}
     1225
     1226COINLIBAPI void COINLINKAGE
     1227ClpSolve_delete(Clp_Solve * solve)
     1228{
     1229    delete solve;
     1230}
     1231
     1232// space- and error-saving macros
     1233#define ClpSolveGetIntProperty(prop) \
     1234COINLIBAPI int COINLINKAGE \
     1235ClpSolve_ ## prop (Clp_Solve *s) \
     1236{ \
     1237    return s->options.prop(); \
     1238}
     1239
     1240#define ClpSolveSetIntProperty(prop) \
     1241COINLIBAPI void COINLINKAGE \
     1242ClpSolve_ ## prop (Clp_Solve *s, int val) \
     1243{ \
     1244    s->options.prop(val); \
     1245}
     1246
     1247COINLIBAPI void COINLINKAGE
     1248ClpSolve_setSpecialOption(Clp_Solve * s, int which, int value, int extraInfo)
     1249{
     1250    s->options.setSpecialOption(which,value,extraInfo);
     1251}
     1252
     1253COINLIBAPI int COINLINKAGE
     1254ClpSolve_getSpecialOption(Clp_Solve * s, int which)
     1255{
     1256    return s->options.getSpecialOption(which);
     1257}
     1258
     1259COINLIBAPI void COINLINKAGE
     1260ClpSolve_setSolveType(Clp_Solve * s, int method, int extraInfo)
     1261{
     1262    s->options.setSolveType(static_cast<ClpSolve::SolveType>(method), extraInfo);
     1263}
     1264
     1265ClpSolveGetIntProperty(getSolveType)
     1266
     1267COINLIBAPI void COINLINKAGE ClpSolve_setPresolveType(Clp_Solve * s, int amount, int extraInfo)
     1268{
     1269    s->options.setPresolveType(static_cast<ClpSolve::PresolveType>(amount),extraInfo);
     1270}
     1271
     1272ClpSolveGetIntProperty(getPresolveType)
     1273
     1274ClpSolveGetIntProperty(getPresolvePasses)
     1275
     1276
     1277COINLIBAPI int COINLINKAGE
     1278ClpSolve_getExtraInfo(Clp_Solve * s, int which) {
     1279     return s->options.getExtraInfo(which);
     1280}
     1281
     1282ClpSolveSetIntProperty(setInfeasibleReturn)
     1283ClpSolveGetIntProperty(infeasibleReturn)
     1284
     1285ClpSolveGetIntProperty(doDual)
     1286ClpSolveSetIntProperty(setDoDual)
     1287
     1288ClpSolveGetIntProperty(doSingleton)
     1289ClpSolveSetIntProperty(setDoSingleton)
     1290
     1291ClpSolveGetIntProperty(doDoubleton)
     1292ClpSolveSetIntProperty(setDoDoubleton)
     1293
     1294ClpSolveGetIntProperty(doTripleton)
     1295ClpSolveSetIntProperty(setDoTripleton)
     1296
     1297ClpSolveGetIntProperty(doTighten)
     1298ClpSolveSetIntProperty(setDoTighten)
     1299
     1300ClpSolveGetIntProperty(doForcing)
     1301ClpSolveSetIntProperty(setDoForcing)
     1302
     1303ClpSolveGetIntProperty(doImpliedFree)
     1304ClpSolveSetIntProperty(setDoImpliedFree)
     1305
     1306ClpSolveGetIntProperty(doDupcol)
     1307ClpSolveSetIntProperty(setDoDupcol)
     1308
     1309ClpSolveGetIntProperty(doDuprow)
     1310ClpSolveSetIntProperty(setDoDuprow)
     1311
     1312ClpSolveGetIntProperty(doSingletonColumn)
     1313ClpSolveSetIntProperty(setDoSingletonColumn)
     1314
     1315ClpSolveGetIntProperty(presolveActions)
     1316ClpSolveSetIntProperty(setPresolveActions)
     1317
     1318ClpSolveGetIntProperty(substitution)
     1319ClpSolveSetIntProperty(setSubstitution)
     1320
    12141321#if defined(__MWERKS__)
    12151322#pragma export off
Note: See TracChangeset for help on using the changeset viewer.