 Timestamp:
 Jun 26, 2015 10:38:52 AM (6 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/Cbc/src/CbcSolver.cpp
r2163 r2203 37 37 #include "ClpDualRowSteepest.hpp" 38 38 #include "ClpDualRowDantzig.hpp" 39 #include "ClpPEDualRowSteepest.hpp" 40 #include "ClpPEDualRowDantzig.hpp" 41 #include "ClpPEPrimalColumnSteepest.hpp" 42 #include "ClpPEPrimalColumnDantzig.hpp" 39 43 #include "ClpLinearObjective.hpp" 40 44 #include "ClpPrimalColumnSteepest.hpp" … … 2456 2460 ClpDualRowSteepest steep(2); 2457 2461 lpSolver>setDualRowPivotAlgorithm(steep); 2458 } else {2462 } else if (action == 3) { 2459 2463 ClpDualRowSteepest steep; 2460 2464 lpSolver>setDualRowPivotAlgorithm(steep); 2465 } else if (action == 4) { 2466 // Positive edge steepest 2467 ClpPEDualRowSteepest p(fabs(parameters_[whichParam(CLP_PARAM_DBL_PSI, numberParameters_, parameters_)].doubleValue())); 2468 lpSolver>setDualRowPivotAlgorithm(p); 2469 } else if (action == 5) { 2470 // Positive edge Dantzig 2471 ClpPEDualRowDantzig p(fabs(parameters_[whichParam(CLP_PARAM_DBL_PSI, numberParameters_, parameters_)].doubleValue())); 2472 lpSolver>setDualRowPivotAlgorithm(p); 2461 2473 } 2462 2474 break; … … 2483 2495 ClpPrimalColumnSteepest steep(10); 2484 2496 lpSolver>setPrimalColumnPivotAlgorithm(steep); 2497 } else if (action == 7) { 2498 // Positive edge steepest 2499 ClpPEPrimalColumnSteepest p(fabs(parameters_[whichParam(CLP_PARAM_DBL_PSI, numberParameters_, parameters_)].doubleValue())); 2500 lpSolver>setPrimalColumnPivotAlgorithm(p); 2501 } else if (action == 8) { 2502 // Positive edge Dantzig 2503 ClpPEPrimalColumnDantzig p(fabs(parameters_[whichParam(CLP_PARAM_DBL_PSI, numberParameters_, parameters_)].doubleValue())); 2504 lpSolver>setPrimalColumnPivotAlgorithm(p); 2485 2505 } 2486 2506 break; … … 2727 2747 double objScale = 2728 2748 parameters_[whichParam(CLP_PARAM_DBL_OBJSCALE2, numberParameters_, parameters_)].doubleValue(); 2749 // deal with positive edge 2750 double psi = parameters_[whichParam(CLP_PARAM_DBL_PSI, numberParameters_, parameters_)].doubleValue(); 2751 if (psi>0.0) { 2752 ClpDualRowPivot * dualp = lpSolver>dualRowPivot(); 2753 ClpDualRowSteepest * d1 = dynamic_cast<ClpDualRowSteepest *>(dualp); 2754 ClpDualRowDantzig * d2 = dynamic_cast<ClpDualRowDantzig *>(dualp); 2755 if (d1) { 2756 ClpPEDualRowSteepest p(psi,d1>mode()); 2757 lpSolver>setDualRowPivotAlgorithm(p); 2758 } else if (d2) { 2759 ClpPEDualRowDantzig p(psi); 2760 lpSolver>setDualRowPivotAlgorithm(p); 2761 } 2762 ClpPrimalColumnPivot * primalp = lpSolver>primalColumnPivot(); 2763 ClpPrimalColumnSteepest * p1 = dynamic_cast<ClpPrimalColumnSteepest *>(primalp); 2764 ClpPrimalColumnDantzig * p2 = dynamic_cast<ClpPrimalColumnDantzig *>(primalp); 2765 if (p1) { 2766 ClpPEPrimalColumnSteepest p(psi,p1>mode()); 2767 lpSolver>setPrimalColumnPivotAlgorithm(p); 2768 } else if (p2) { 2769 ClpPEPrimalColumnDantzig p(psi); 2770 lpSolver>setPrimalColumnPivotAlgorithm(p); 2771 } 2772 } 2729 2773 if (objScale != 1.0) { 2730 2774 int iColumn; … … 3408 3452 si>getModelPtr()>scaling(doScaling); 3409 3453 ClpSimplex * lpSolver = si>getModelPtr(); 3454 // deal with positive edge 3455 double psi = parameters_[whichParam(CLP_PARAM_DBL_PSI, numberParameters_, parameters_)].doubleValue(); 3456 if (psi>0.0) { 3457 ClpDualRowPivot * dualp = lpSolver>dualRowPivot(); 3458 ClpDualRowSteepest * d1 = dynamic_cast<ClpDualRowSteepest *>(dualp); 3459 ClpDualRowDantzig * d2 = dynamic_cast<ClpDualRowDantzig *>(dualp); 3460 if (d1) { 3461 ClpPEDualRowSteepest p(psi,d1>mode()); 3462 lpSolver>setDualRowPivotAlgorithm(p); 3463 } else if (d2) { 3464 ClpPEDualRowDantzig p(psi); 3465 lpSolver>setDualRowPivotAlgorithm(p); 3466 } 3467 ClpPrimalColumnPivot * primalp = lpSolver>primalColumnPivot(); 3468 ClpPrimalColumnSteepest * p1 = dynamic_cast<ClpPrimalColumnSteepest *>(primalp); 3469 ClpPrimalColumnDantzig * p2 = dynamic_cast<ClpPrimalColumnDantzig *>(primalp); 3470 if (p1) { 3471 ClpPEPrimalColumnSteepest p(psi,p1>mode()); 3472 lpSolver>setPrimalColumnPivotAlgorithm(p); 3473 } else if (p2) { 3474 ClpPEPrimalColumnDantzig p(psi); 3475 lpSolver>setPrimalColumnPivotAlgorithm(p); 3476 } 3477 } 3410 3478 if (doVector) { 3411 3479 ClpMatrixBase * matrix = lpSolver>clpMatrix();
Note: See TracChangeset
for help on using the changeset viewer.