Show
Ignore:
Timestamp:
03/05/04 12:17:11 (5 years ago)
Author:
caphill
Message:

Fixed some compile problems for linux boxes like expo. Committing this now so
Bill can track down some config problems.

( Links to Acro-related mail archives at http://software.sandia.gov/Acro/ )

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • pico/trunk/src/lp/pico/PicoCpxLP.h

    r3663 r3671  
    3636bool PicoLPSubclass<OsiCpxSolverInterface,PicoLPCutMngmnt>::isTimeLimitReached() const 
    3737{ 
    38 int stat = CPXgetstat( const_cast<PicoLPSubclass<OsiCpxSolverInterface,PicoLPCutMngmnt>*>(this)->OsiCpxSolverInterface::getEnvironmentPtr(), getLpPtr() ); 
     38int stat = CPXgetstat( const_cast<PicoLPSubclass<OsiCpxSolverInterface,PicoLPCutMngmnt>*>(this)->OsiCpxSolverInterface::getEnvironmentPtr(), getConstLpPtr() ); 
    3939#if (CPX_VERSION >= 800) 
    4040return stat == CPXMIP_TIME_LIM_INFEAS || stat == CPXMIP_TIME_LIM_FEAS; 
     
    4848bool PicoLPSubclass<OsiCpxSolverInterface,PicoLPCutMngmnt>::isProvenPrimalUnbounded() const 
    4949{ 
    50 int stat = CPXgetstat( const_cast<PicoLPSubclass<OsiCpxSolverInterface,PicoLPCutMngmnt>*>(this)->OsiCpxSolverInterface::getEnvironmentPtr(), getLpPtr() ); 
     50int stat = CPXgetstat( const_cast<PicoLPSubclass<OsiCpxSolverInterface,PicoLPCutMngmnt>*>(this)->OsiCpxSolverInterface::getEnvironmentPtr(), getConstLpPtr() ); 
    5151#if (CPX_VERSION >= 800) 
    5252return stat == CPX_STAT_UNBOUNDED; 
    5353#else 
    54 int method = CPXgetmethod(const_cast<PicoLPSubclass<OsiCpxSolverInterface,PicoLPCutMngmnt>*>(this)->OsiCpxSolverInterface::getEnvironmentPtr(), getLpPtr() ); 
     54int method = CPXgetmethod(const_cast<PicoLPSubclass<OsiCpxSolverInterface,PicoLPCutMngmnt>*>(this)->OsiCpxSolverInterface::getEnvironmentPtr(), getConstLpPtr() ); 
    5555// stat for version < 8 is relative to solver. If running dual simplex and stat is 
    5656// infeasible, we do not necessarily know the primal is unbounded (could be infeasible). 
     
    6565  // Version 8.0 and up returns status wrt the primal only.  There is no primal status that 
    6666  // proves dual unboundedness.  CAP. 
    67 int stat = CPXgetstat( const_cast<PicoLPSubclass<OsiCpxSolverInterface,PicoLPCutMngmnt>*>(this)->OsiCpxSolverInterface::getEnvironmentPtr(), getLpPtr() ); 
     67int stat = CPXgetstat( const_cast<PicoLPSubclass<OsiCpxSolverInterface,PicoLPCutMngmnt>*>(this)->OsiCpxSolverInterface::getEnvironmentPtr(), getConstLpPtr() ); 
    6868#if (CPX_VERSION >= 800) 
    6969return false; 
    7070#else 
    71 int method = CPXgetmethod(const_cast<PicoLPSubclass<OsiCpxSolverInterface,PicoLPCutMngmnt>*>(this)->OsiCpxSolverInterface::getEnvironmentPtr(), getLpPtr() ); 
     71int method = CPXgetmethod(const_cast<PicoLPSubclass<OsiCpxSolverInterface,PicoLPCutMngmnt>*>(this)->OsiCpxSolverInterface::getEnvironmentPtr(), getConstLpPtr() ); 
    7272// stat for version < 8 is relative to solver. If running primal simplex and stat is 
    7373// infeasible, we do not necessarily know the dual is unbounded (could be infeasible). 
     
    8181{ 
    8282double ans; 
    83 CPXgetlb(const_cast<PicoLPSubclass<OsiCpxSolverInterface,PicoLPCutMngmnt>*>(this)->OsiCpxSolverInterface::getEnvironmentPtr(),getLpPtr(),&ans,whichVariable,whichVariable); 
     83CPXgetlb(const_cast<PicoLPSubclass<OsiCpxSolverInterface,PicoLPCutMngmnt>*>(this)->OsiCpxSolverInterface::getEnvironmentPtr(),getConstLpPtr(),&ans,whichVariable,whichVariable); 
    8484return ans; 
    8585} 
     
    9090{ 
    9191double ans; 
    92 CPXgetub(const_cast<PicoLPSubclass<OsiCpxSolverInterface,PicoLPCutMngmnt>*>(this)->OsiCpxSolverInterface::getEnvironmentPtr(),getLpPtr(),&ans,whichVariable,whichVariable); 
     92CPXgetub(const_cast<PicoLPSubclass<OsiCpxSolverInterface,PicoLPCutMngmnt>*>(this)->OsiCpxSolverInterface::getEnvironmentPtr(),getConstLpPtr(),&ans,whichVariable,whichVariable); 
    9393return ans; 
    9494} 
     
    9999{ 
    100100char sense; 
    101 CPXgetsense(const_cast<PicoLPSubclass<OsiCpxSolverInterface,PicoLPCutMngmnt>*>(this)->OsiCpxSolverInterface::getEnvironmentPtr(),getLpPtr(),&sense,whichVariable,whichVariable); 
     101CPXgetsense(const_cast<PicoLPSubclass<OsiCpxSolverInterface,PicoLPCutMngmnt>*>(this)->OsiCpxSolverInterface::getEnvironmentPtr(),getConstLpPtr(),&sense,whichVariable,whichVariable); 
    102102double rhs; 
    103 CPXgetrhs(const_cast<PicoLPSubclass<OsiCpxSolverInterface,PicoLPCutMngmnt>*>(this)->OsiCpxSolverInterface::getEnvironmentPtr(),getLpPtr(),&rhs,whichVariable,whichVariable); 
     103CPXgetrhs(const_cast<PicoLPSubclass<OsiCpxSolverInterface,PicoLPCutMngmnt>*>(this)->OsiCpxSolverInterface::getEnvironmentPtr(),getConstLpPtr(),&rhs,whichVariable,whichVariable); 
    104104double range; 
    105 CPXgetrngval(const_cast<PicoLPSubclass<OsiCpxSolverInterface,PicoLPCutMngmnt>*>(this)->OsiCpxSolverInterface::getEnvironmentPtr(),getLpPtr(),&range,whichVariable,whichVariable); 
     105CPXgetrngval(const_cast<PicoLPSubclass<OsiCpxSolverInterface,PicoLPCutMngmnt>*>(this)->OsiCpxSolverInterface::getEnvironmentPtr(),getConstLpPtr(),&range,whichVariable,whichVariable); 
    106106double lower, upper; 
    107107convertSenseToBound(sense, rhs, range, lower, upper); 
     
    114114{ 
    115115char sense; 
    116 CPXgetsense(const_cast<PicoLPSubclass<OsiCpxSolverInterface,PicoLPCutMngmnt>*>(this)->OsiCpxSolverInterface::getEnvironmentPtr(),getLpPtr(),&sense,whichVariable,whichVariable); 
     116CPXgetsense(const_cast<PicoLPSubclass<OsiCpxSolverInterface,PicoLPCutMngmnt>*>(this)->OsiCpxSolverInterface::getEnvironmentPtr(),getConstLpPtr(),&sense,whichVariable,whichVariable); 
    117117double rhs; 
    118 CPXgetrhs(const_cast<PicoLPSubclass<OsiCpxSolverInterface,PicoLPCutMngmnt>*>(this)->OsiCpxSolverInterface::getEnvironmentPtr(),getLpPtr(),&rhs,whichVariable,whichVariable); 
     118CPXgetrhs(const_cast<PicoLPSubclass<OsiCpxSolverInterface,PicoLPCutMngmnt>*>(this)->OsiCpxSolverInterface::getEnvironmentPtr(),getConstLpPtr(),&rhs,whichVariable,whichVariable); 
    119119double range; 
    120 CPXgetrngval(const_cast<PicoLPSubclass<OsiCpxSolverInterface,PicoLPCutMngmnt>*>(this)->OsiCpxSolverInterface::getEnvironmentPtr(),getLpPtr(),&range,whichVariable,whichVariable); 
     120CPXgetrngval(const_cast<PicoLPSubclass<OsiCpxSolverInterface,PicoLPCutMngmnt>*>(this)->OsiCpxSolverInterface::getEnvironmentPtr(),getConstLpPtr(),&range,whichVariable,whichVariable); 
    121121double lower, upper; 
    122122convertSenseToBound(sense, rhs, range, lower, upper); 
     
    129129{ 
    130130double rhs; 
    131 CPXgetrhs(const_cast<PicoLPSubclass<OsiCpxSolverInterface,PicoLPCutMngmnt>*>(this)->OsiCpxSolverInterface::getEnvironmentPtr(),getLpPtr(),&rhs,whichConstraint,whichConstraint); 
     131CPXgetrhs(const_cast<PicoLPSubclass<OsiCpxSolverInterface,PicoLPCutMngmnt>*>(this)->OsiCpxSolverInterface::getEnvironmentPtr(),getConstLpPtr(),&rhs,whichConstraint,whichConstraint); 
    132132return rhs; 
    133133} 
     
    138138{ 
    139139char csense; 
    140 CPXgetsense( const_cast<PicoLPSubclass<OsiCpxSolverInterface,PicoLPCutMngmnt>*>(this)->OsiCpxSolverInterface::getEnvironmentPtr(),getLpPtr(), &csense, whichConstraint, whichConstraint); 
     140CPXgetsense( const_cast<PicoLPSubclass<OsiCpxSolverInterface,PicoLPCutMngmnt>*>(this)->OsiCpxSolverInterface::getEnvironmentPtr(),getConstLpPtr(), &csense, whichConstraint, whichConstraint); 
    141141 
    142142PicoLPInterface::constraintSense sense; 
     
    158158{ 
    159159double ans; 
    160 int err = CPXgetobj(const_cast<PicoLPSubclass<OsiCpxSolverInterface,PicoLPCutMngmnt>*>(this)->OsiCpxSolverInterface::getEnvironmentPtr(),getLpPtr(),&ans,whichVariable,whichVariable); 
     160int err = CPXgetobj(const_cast<PicoLPSubclass<OsiCpxSolverInterface,PicoLPCutMngmnt>*>(this)->OsiCpxSolverInterface::getEnvironmentPtr(),getConstLpPtr(),&ans,whichVariable,whichVariable); 
    161161checkCPXerror( err, "CPXgetobj", "getObjCoefficient" ); 
    162162return ans; 
     
    168168{ 
    169169double ans = 0.0; 
    170 int probType = CPXgetprobtype(const_cast<PicoLPSubclass<OsiCpxSolverInterface,PicoLPCutMngmnt>*>(this)->OsiCpxSolverInterface::getEnvironmentPtr(),getLpPtr()); 
     170int probType = CPXgetprobtype(const_cast<PicoLPSubclass<OsiCpxSolverInterface,PicoLPCutMngmnt>*>(this)->OsiCpxSolverInterface::getEnvironmentPtr(),getConstLpPtr()); 
    171171#if (CPX_VERSION >= 800) 
    172172if ( probType == CPXPROB_MILP ) { 
     
    174174if ( probType == CPXPROB_MIP ) { 
    175175#endif 
    176    int err = CPXgetmipx( const_cast<PicoLPSubclass<OsiCpxSolverInterface,PicoLPCutMngmnt>*>(this)->OsiCpxSolverInterface::getEnvironmentPtr(),getLpPtr(), &ans, whichCol, whichCol); 
     176   int err = CPXgetmipx( const_cast<PicoLPSubclass<OsiCpxSolverInterface,PicoLPCutMngmnt>*>(this)->OsiCpxSolverInterface::getEnvironmentPtr(),getConstLpPtr(), &ans, whichCol, whichCol); 
    177177   if ( err == CPXERR_NO_INT_SOLN ) 
    178178      ans = 0.0; 
     
    181181   } 
    182182else { 
    183    int err = CPXgetx( const_cast<PicoLPSubclass<OsiCpxSolverInterface,PicoLPCutMngmnt>*>(this)->OsiCpxSolverInterface::getEnvironmentPtr(),getLpPtr(), &ans, whichCol, whichCol ); 
     183   int err = CPXgetx( const_cast<PicoLPSubclass<OsiCpxSolverInterface,PicoLPCutMngmnt>*>(this)->OsiCpxSolverInterface::getEnvironmentPtr(),getConstLpPtr(), &ans, whichCol, whichCol ); 
    184184   if ( err == CPXERR_NO_SOLN ) 
    185185      ans = 0.0; 
     
    195195{ 
    196196double ans; 
    197 int err = CPXgetpi(const_cast<PicoLPSubclass<OsiCpxSolverInterface,PicoLPCutMngmnt>*>(this)->OsiCpxSolverInterface::getEnvironmentPtr(),getLpPtr(),&ans,whichRow,whichRow); 
     197int err = CPXgetpi(const_cast<PicoLPSubclass<OsiCpxSolverInterface,PicoLPCutMngmnt>*>(this)->OsiCpxSolverInterface::getEnvironmentPtr(),getConstLpPtr(),&ans,whichRow,whichRow); 
    198198if (err == CPXERR_NO_SOLN) 
    199199   ans = 0.0; 
     
    208208{ 
    209209double ans; 
    210 int err = CPXgetdj(const_cast<PicoLPSubclass<OsiCpxSolverInterface,PicoLPCutMngmnt>*>(this)->OsiCpxSolverInterface::getEnvironmentPtr(),getLpPtr(),&ans,whichCol,whichCol); 
     210int err = CPXgetdj(const_cast<PicoLPSubclass<OsiCpxSolverInterface,PicoLPCutMngmnt>*>(this)->OsiCpxSolverInterface::getEnvironmentPtr(),getConstLpPtr(),&ans,whichCol,whichCol); 
    211211if (err == CPXERR_NO_SOLN) 
    212212   ans = 0.0; 
     
    223223int basisSize = numCols + getNumRows(); 
    224224utilib::IntVector tempBasis(basisSize); 
    225 int tmp = CPXgetbase(const_cast<PicoLPSubclass<OsiCpxSolverInterface,PicoLPCutMngmnt>*>(this)->OsiCpxSolverInterface::getEnvironmentPtr(),getLpPtr(),(int*)(tempBasis.data()),(int*)(&tempBasis[numCols])); 
     225int tmp = CPXgetbase(const_cast<PicoLPSubclass<OsiCpxSolverInterface,PicoLPCutMngmnt>*>(this)->OsiCpxSolverInterface::getEnvironmentPtr(),getConstLpPtr(),(int*)(tempBasis.data()),(int*)(&tempBasis[numCols])); 
    226226if (tmp) 
    227227   EXCEPTION_MNGR(runtime_error,"CPLEX would not retreive basis"); 
     
    239239int numCols = getNumCols(); 
    240240utilib::IntVector tempBasis(numCols + getNumRows()); 
    241 int tmp = CPXgetbase(const_cast<PicoLPSubclass<OsiCpxSolverInterface,PicoLPCutMngmnt>*>(this)->OsiCpxSolverInterface::getEnvironmentPtr(),getLpPtr(), 
     241int tmp = CPXgetbase(const_cast<PicoLPSubclass<OsiCpxSolverInterface,PicoLPCutMngmnt>*>(this)->OsiCpxSolverInterface::getEnvironmentPtr(),getConstLpPtr(), 
    242242                (int*)(tempBasis.data()),(int*)(&tempBasis[numCols])); 
    243243if (tmp) 
     
    263263for (int i = 0; i < basisSize; i++) 
    264264  tempBasis[i] = (int)basisBuffer(i); 
    265 status = CPXcopybase(const_cast<PicoLPSubclass<OsiCpxSolverInterface,PicoLPCutMngmnt>*>(this)->OsiCpxSolverInterface::getEnvironmentPtr(),getLpPtr(),(int*)(tempBasis.data()), 
     265status = CPXcopybase(const_cast<PicoLPSubclass<OsiCpxSolverInterface,PicoLPCutMngmnt>*>(this)->OsiCpxSolverInterface::getEnvironmentPtr(),getConstLpPtr(),(int*)(tempBasis.data()), 
    266266                                        (int*)(&tempBasis[getNumCols() ])); 
    267267if (status && lpWarnings) 
     
    360360  // Going to getting lp pointer with default values rather than 
    361361  // OsiCpxSolverInterface::FREECACHED_COLUMN, for debugging 
    362   int err = CPXchgbds( getEnvironmentPtr(), getLpPtr(), len, indexList, &c, upperBounds); 
     362  int err = CPXchgbds( getEnvironmentPtr(), getConstLpPtr(), len, indexList, &c, upperBounds); 
    363363  checkCPXerror( err, "CPXchgbds", "setColUpper" ); 
    364364} 
     
    368368{ 
    369369  char c = 'L'; 
    370   int err = CPXchgbds( getEnvironmentPtr(), getLpPtr(), len, indexList, &c, lowerBounds); 
     370  int err = CPXchgbds( getEnvironmentPtr(), getConstLpPtr(), len, indexList, &c, lowerBounds); 
    371371  checkCPXerror( err, "CPXchgbds", "setColLower" ); 
    372372} 
     
    383383    // doesn't give the real variable names (etc) to the cplex solver, 
    384384    // it will be equivalent to the "REW" filetype = generic names 
    385   writeStatus = CPXwriteprob(getEnvironmentPtr(), getLpPtr(), filename, "MPS"); 
     385  writeStatus = CPXwriteprob(getEnvironmentPtr(), getConstLpPtr(), filename, "MPS"); 
    386386  if (writeStatus) 
    387387    ucout << "Error writing lp to file\n"; 
     
    390390if (format == lp_format) 
    391391  { 
    392   writeStatus = CPXwriteprob(getEnvironmentPtr(), getLpPtr(), filename, "LP"); 
     392  writeStatus = CPXwriteprob(getEnvironmentPtr(), getConstLpPtr(), filename, "LP"); 
    393393  if (status) 
    394394    ucout << "Error writing lp to file\n"; 
     
    402402void PicoLPSubclass<OsiCpxSolverInterface,PicoLPCutMngmnt>::printBrokenInfo() 
    403403{ 
    404     int stat = CPXgetstat( getEnvironmentPtr(), getLpPtr() ); 
     404    int stat = CPXgetstat( getEnvironmentPtr(), getConstLpPtr() ); 
    405405    cout << "Broken LP has cplex status " << stat << "\n"; 
    406406} 
     
    409409void PicoLPSubclass<OsiCpxSolverInterface,PicoLPCutMngmnt>::setMatrixCoeff(int row, int col, double newValue) 
    410410{ 
    411     int stat = CPXchgcoef(getEnvironmentPtr(), getLpPtr(), row, col, newValue); 
     411    int stat = CPXchgcoef(getEnvironmentPtr(), getConstLpPtr(), row, col, newValue); 
    412412    if (stat != 0) EXCEPTION_MNGR(runtime_error, "Cplex error setting matrix coefficient for (" << row << ", " << col << ")") 
    413413}