# CbcHeuristicJustOne Class Reference

Just One class - this chooses one at random. More...

`#include <CbcHeuristic.hpp>`

Inheritance diagram for CbcHeuristicJustOne:
[legend]
Collaboration diagram for CbcHeuristicJustOne:
[legend]

List of all members.

## Public Member Functions
| CbcHeuristicJustOne ()
| CbcHeuristicJustOne (CbcModel &model)
| CbcHeuristicJustOne (const CbcHeuristicJustOne &)
| ~CbcHeuristicJustOne ()
virtual CbcHeuristicJustOne * | clone () const
| Clone.
CbcHeuristicJustOne & | operator= (const CbcHeuristicJustOne &rhs)
| Assignment operator.
virtual void | generateCpp (FILE *fp)
| Create C++ lines to get to current state.
virtual int | solution (double &objectiveValue, double *newSolution)
| returns 0 if no solution, 1 if valid solution with better objective value than one passed in Sets solution values if good, sets objective value (only if good) This is called after cuts have been added - so can not add cuts This does Fractional Diving
virtual void | resetModel (CbcModel *model)
| Resets stuff if model changes.
virtual void | setModel (CbcModel *model)
| update model (This is needed if cliques update matrix etc)
virtual bool | selectVariableToBranch (OsiSolverInterface *, const double *, int &, int &)
| Selects the next variable to branch on.
virtual void | validate ()
| Validate model i.e. sets when_ to 0 if necessary (may be NULL).
void | addHeuristic (const CbcHeuristic *heuristic, double probability)
| Adds an heuristic with probability.
void | normalizeProbabilities ()
| Normalize probabilities.
## Protected Attributes
double * | probabilities_
CbcHeuristic ** | heuristic_
int | numberHeuristics_

## Detailed Description

Just One class - this chooses one at random.

Definition at line 601 of file CbcHeuristic.hpp.

## Constructor & Destructor Documentation

CbcHeuristicJustOne::CbcHeuristicJustOne | ( |  | ) |

CbcHeuristicJustOne::CbcHeuristicJustOne | ( | CbcModel & | model | ) |

CbcHeuristicJustOne::CbcHeuristicJustOne | ( | const CbcHeuristicJustOne & |  | ) |

CbcHeuristicJustOne::~CbcHeuristicJustOne | ( |  | ) |

## Member Function Documentation

virtual CbcHeuristicJustOne* CbcHeuristicJustOne::clone | ( |  | ) | const`[virtual]`

Clone.

Implements CbcHeuristic.

CbcHeuristicJustOne& CbcHeuristicJustOne::operator= | ( | const CbcHeuristicJustOne & | rhs | ) |

Assignment operator.

Reimplemented from CbcHeuristic.

virtual void CbcHeuristicJustOne::generateCpp | ( | FILE * | fp | ) | `[virtual]`

Create C++ lines to get to current state.

Reimplemented from CbcHeuristic.

virtual int CbcHeuristicJustOne::solution | ( | double & | objectiveValue,
|  | double * | newSolution |
| ) |  |  | `[virtual]`

returns 0 if no solution, 1 if valid solution with better objective value than one passed in Sets solution values if good, sets objective value (only if good) This is called after cuts have been added - so can not add cuts This does Fractional Diving

Implements CbcHeuristic.

virtual void CbcHeuristicJustOne::resetModel | ( | CbcModel * | model | ) | `[virtual]`

Resets stuff if model changes.

Implements CbcHeuristic.

virtual void CbcHeuristicJustOne::setModel | ( | CbcModel * | model | ) | `[virtual]`

update model (This is needed if cliques update matrix etc)

Reimplemented from CbcHeuristic.

virtual bool CbcHeuristicJustOne::selectVariableToBranch | ( | OsiSolverInterface * | ,
|  | const double * | ,
|  | int & | ,
|  | int & |  |
| ) |  |  | `[inline, virtual]`

Selects the next variable to branch on.

Returns true if all the fractional variables can be trivially rounded. Returns false, if there is at least one fractional variable that is not trivially roundable. In this case, the bestColumn returned will not be trivially roundable. This is dummy as never called

Definition at line 645 of file CbcHeuristic.hpp.

virtual void CbcHeuristicJustOne::validate | ( |  | ) | `[virtual]`

Validate model i.e. sets when_ to 0 if necessary (may be NULL).

Reimplemented from CbcHeuristic.

void CbcHeuristicJustOne::addHeuristic | ( | const CbcHeuristic * | heuristic,
|  | double | probability |
| ) |  |  |

Adds an heuristic with probability.

void CbcHeuristicJustOne::normalizeProbabilities | ( |  | ) |

Normalize probabilities.

## Member Data Documentation

double* CbcHeuristicJustOne::probabilities_`[protected]`

Definition at line 661 of file CbcHeuristic.hpp.

CbcHeuristic** CbcHeuristicJustOne::heuristic_`[protected]`

Definition at line 664 of file CbcHeuristic.hpp.

int CbcHeuristicJustOne::numberHeuristics_`[protected]`

Definition at line 667 of file CbcHeuristic.hpp.

The documentation for this class was generated from the following file:

- /home/coin/svn-release/Cbc-2.8.0/Cbc/src/CbcHeuristic.hpp

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines