The class relax implements a generic solver for consistent labelling problems, using relaxation labelling algorithm. More...
#include <relax.h>
Public Member Functions | |
relax (int, double, double) | |
Constructor. | |
void | reset (const problem &) |
Prepare for a new problem (i.e. free tables and alloc for the new problem). | |
void | add_constraint (int, int, const std::list< std::list< std::pair< int, int > > > &, double) |
add a new constraint to the problem | |
void | solve () |
solve consistent labelling problem | |
std::list< int > | best_label (int) const |
get best label(s) --hopefully only one-- for given variable | |
Private Member Functions | |
double | NormalizeSupport (double) const |
private methods | |
bool | there_are_changes () const |
Private Attributes | |
std::vector< std::vector< label > > | vars |
table with variable-labels in the CLP. | |
int | CURRENT |
which of both weight sets are we using and which are we computing | |
int | NEXT |
int | MaxIter |
Maximum number of iterations in case of not converging. | |
double | ScaleFactor |
Scale factor for label supports. | |
double | Epsilon |
epsilon value to decide whether or not an iteration has caused relevant weight changes |
The class relax implements a generic solver for consistent labelling problems, using relaxation labelling algorithm.
relax::relax | ( | int | , | |
double | , | |||
double | ||||
) |
Constructor.
void relax::add_constraint | ( | int | , | |
int | , | |||
const std::list< std::list< std::pair< int, int > > > & | , | |||
double | ||||
) |
add a new constraint to the problem
std::list<int> relax::best_label | ( | int | ) | const |
get best label(s) --hopefully only one-- for given variable
double relax::NormalizeSupport | ( | double | ) | const [private] |
private methods
void relax::reset | ( | const problem & | ) |
Prepare for a new problem (i.e. free tables and alloc for the new problem).
void relax::solve | ( | ) |
solve consistent labelling problem
bool relax::there_are_changes | ( | ) | const [private] |
int relax::CURRENT [private] |
which of both weight sets are we using and which are we computing
double relax::Epsilon [private] |
epsilon value to decide whether or not an iteration has caused relevant weight changes
int relax::MaxIter [private] |
Maximum number of iterations in case of not converging.
int relax::NEXT [private] |
double relax::ScaleFactor [private] |
Scale factor for label supports.
std::vector<std::vector<label> > relax::vars [private] |
table with variable-labels in the CLP.