Clp
1.16.11
|
This class implements a very silly algorithm. More...
#include <Idiot.hpp>
Public Member Functions | |
Constructors and destructor | |
Just a pointer to model is kept | |
Idiot () | |
Default constructor. More... | |
Idiot (OsiSolverInterface &model) | |
Constructor with model. More... | |
Idiot (const Idiot &) | |
Copy constructor. More... | |
Idiot & | operator= (const Idiot &rhs) |
Assignment operator. This copies the data. More... | |
~Idiot () | |
Destructor. More... | |
Algorithmic calls | |
void | solve () |
Get an approximate solution with the idiot code. More... | |
void | crash (int numberPass, CoinMessageHandler *handler, const CoinMessages *messages, bool doCrossover=true) |
Lightweight "crash". More... | |
void | crossOver (int mode) |
Use simplex to get an optimal solution mode is how many steps the simplex crossover should take to arrive to an extreme point: 0 - chosen,all ever used, all 1 - chosen, all 2 - all 3 - do not do anything - maybe basis. More... | |
Gets and sets of most useful data | |
double | getStartingWeight () const |
Starting weight - small emphasizes feasibility, default 1.0e-4. More... | |
void | setStartingWeight (double value) |
double | getWeightFactor () const |
Weight factor - weight multiplied by this when changes, default 0.333. More... | |
void | setWeightFactor (double value) |
double | getFeasibilityTolerance () const |
Feasibility tolerance - problem essentially feasible if individual infeasibilities less than this. More... | |
void | setFeasibilityTolerance (double value) |
double | getReasonablyFeasible () const |
Reasonably feasible. More... | |
void | setReasonablyFeasible (double value) |
double | getExitInfeasibility () const |
Exit infeasibility - exit if sum of infeasibilities less than this. More... | |
void | setExitInfeasibility (double value) |
int | getMajorIterations () const |
Major iterations. More... | |
void | setMajorIterations (int value) |
int | getMinorIterations () const |
Minor iterations. More... | |
void | setMinorIterations (int value) |
int | getMinorIterations0 () const |
void | setMinorIterations0 (int value) |
int | getReduceIterations () const |
Reduce weight after this many major iterations. More... | |
void | setReduceIterations (int value) |
int | getLogLevel () const |
Amount of information - default of 1 should be okay. More... | |
void | setLogLevel (int value) |
int | getLightweight () const |
How lightweight - 0 not, 1 yes, 2 very lightweight. More... | |
void | setLightweight (int value) |
int | getStrategy () const |
strategy More... | |
void | setStrategy (int value) |
double | getDropEnoughFeasibility () const |
Fine tuning - okay if feasibility drop this factor. More... | |
void | setDropEnoughFeasibility (double value) |
double | getDropEnoughWeighted () const |
Fine tuning - okay if weighted obj drop this factor. More... | |
void | setDropEnoughWeighted (double value) |
void | setModel (OsiSolverInterface *model) |
Set model. More... | |
void | solve2 (CoinMessageHandler *handler, const CoinMessages *messages) |
Stuff for internal use. More... | |
This class implements a very silly algorithm.
It has no merit apart from the fact that it gets an approximate solution to some classes of problems. Better if vaguely homogeneous. It works on problems where volume algorithm works and often gets a better primal solution but it has no dual solution.
It can also be used as a "crash" to get a problem started. This is probably its most useful function.
It is based on the idea that algorithms with terrible convergence properties may be okay at first. Throw in some random dubious tricks and the resulting code may be worth keeping as long as you don't look at it.
Idiot::Idiot | ( | ) |
Default constructor.
Idiot::Idiot | ( | OsiSolverInterface & | model | ) |
Constructor with model.
Idiot::Idiot | ( | const Idiot & | ) |
Copy constructor.
Idiot::~Idiot | ( | ) |
Destructor.
void Idiot::solve | ( | ) |
Get an approximate solution with the idiot code.
void Idiot::crash | ( | int | numberPass, |
CoinMessageHandler * | handler, | ||
const CoinMessages * | messages, | ||
bool | doCrossover = true |
||
) |
Lightweight "crash".
void Idiot::crossOver | ( | int | mode | ) |
Use simplex to get an optimal solution mode is how many steps the simplex crossover should take to arrive to an extreme point: 0 - chosen,all ever used, all 1 - chosen, all 2 - all 3 - do not do anything - maybe basis.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Minor iterations.
Do this number of tiny steps before deciding whether to change weights etc. Default - dubious sqrt(Number of Rows). Good numbers 105 to 405 say (5 is dubious method of making sure idiot is not trying to be clever which it may do every 10 minor iterations)
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
void Idiot::solve2 | ( | CoinMessageHandler * | handler, |
const CoinMessages * | messages | ||
) |
Stuff for internal use.
Does actual work