Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
|
#include <feasibility_jump.h>
Public Member Functions | |
CompoundMoveBuilder (int num_variables) | |
void | Push (int var, int64_t prev_value, double score) |
bool | Backtrack (int *var, int64_t *value, double *score) |
void | Clear () |
Removes all moves on the stack. | |
int | Size () const |
Returns the number of variables in the move. | |
bool | OnStack (int var) const |
Returns true if this var has been set in this move already,. | |
double | Score () const |
Returns the sum of scores of atomic moved pushed to this compound move. | |
double | BestChildScore () const |
int | Discrepancy () const |
Returns the number of backtracks to any ancestor of the current leaf. | |
bool | StackValuesInDomains (absl::Span< const Domain > var_domains) const |
Returns true if all prev_values on the stack are in the appropriate domain. | |
This class helps keep track of moves that change more than one variable. Mainly this class keeps track of how to backtrack back to the local minimum as you make a sequence of exploratory moves, so in order to commit a compound move, you just need to call Clear
instead of Backtracking over the changes.
Definition at line 629 of file feasibility_jump.h.
|
inlineexplicit |
Definition at line 631 of file feasibility_jump.h.
bool operations_research::sat::CompoundMoveBuilder::Backtrack | ( | int * | var, |
int64_t * | value, | ||
double * | score ) |
Sets var, val and score to a move that will revert the most recent atomic move on the stack, and pops this move from the stack. Returns false if the stack is empty.
Definition at line 1149 of file feasibility_jump.cc.
|
inline |
Definition at line 657 of file feasibility_jump.h.
void operations_research::sat::CompoundMoveBuilder::Clear | ( | ) |
Removes all moves on the stack.
Definition at line 1138 of file feasibility_jump.cc.
|
inline |
Returns the number of backtracks to any ancestor of the current leaf.
Definition at line 662 of file feasibility_jump.h.
bool operations_research::sat::CompoundMoveBuilder::OnStack | ( | int | var | ) | const |
Returns true if this var has been set in this move already,.
Definition at line 1145 of file feasibility_jump.cc.
void operations_research::sat::CompoundMoveBuilder::Push | ( | int | var, |
int64_t | prev_value, | ||
double | score ) |
Adds an atomic move to the stack. var
must not be on the stack (this is DCHECKed).
Definition at line 1162 of file feasibility_jump.cc.
|
inline |
Returns the sum of scores of atomic moved pushed to this compound move.
Definition at line 653 of file feasibility_jump.h.
|
inline |
Returns the number of variables in the move.
Definition at line 647 of file feasibility_jump.h.
bool operations_research::sat::CompoundMoveBuilder::StackValuesInDomains | ( | absl::Span< const Domain > | var_domains | ) | const |
Returns true if all prev_values on the stack are in the appropriate domain.
Definition at line 1178 of file feasibility_jump.cc.