|  | Google OR-Tools v9.14
    a fast and portable software suite for combinatorial optimization | 
View of a generic (non linear) constraint for the LsEvaluator. More...
View of a generic (non linear) constraint for the LsEvaluator.
Definition at line 247 of file constraint_violation.h.
#include <constraint_violation.h>
 
  
| Public Member Functions | |
| CompiledConstraint ()=default | |
| virtual | ~CompiledConstraint ()=default | 
| void | InitializeViolation (absl::Span< const int64_t > solution) | 
| Recomputes the violation of the constraint from scratch. | |
| virtual void | PerformMove (int var, int64_t old_value, absl::Span< const int64_t > solution_with_new_value) | 
| Updates the violation with the new value. | |
| virtual int64_t | ViolationDelta (int var, int64_t old_value, absl::Span< const int64_t > solution_with_new_value) | 
| Returns the delta if var changes from old_value to solution[var]. | |
| virtual std::vector< int > | UsedVariables (const CpModelProto &model_proto) const =0 | 
| int64_t | violation () const | 
| The cached violation of this constraint. | |
| Protected Member Functions | |
| virtual int64_t | ComputeViolation (absl::Span< const int64_t > solution)=0 | 
| Protected Attributes | |
| int64_t | violation_ | 
| 
 | default | 
| 
 | virtualdefault | 
| 
 | protectedpure virtual | 
Computes the violation of a constraint.
This is called by InitializeViolation() and also the default implementation of ViolationDelta().
Implemented in operations_research::sat::CompiledAllDiffConstraint, operations_research::sat::CompiledBoolXorConstraint, operations_research::sat::CompiledCircuitConstraint, operations_research::sat::CompiledIntDivConstraint, operations_research::sat::CompiledIntModConstraint, operations_research::sat::CompiledIntProdConstraint, operations_research::sat::CompiledLinMaxConstraint, operations_research::sat::CompiledNoOverlap2dConstraint, operations_research::sat::CompiledNoOverlap2dWithTwoBoxes< has_enforcement >, operations_research::sat::CompiledNoOverlapWithTwoIntervals< has_enforcement >, and operations_research::sat::CompiledReservoirConstraint.
| void operations_research::sat::CompiledConstraint::InitializeViolation | ( | absl::Span< const int64_t > | solution | ) | 
Recomputes the violation of the constraint from scratch.
--— CompiledConstraint --—
Definition at line 923 of file constraint_violation.cc.
| 
 | virtual | 
Updates the violation with the new value.
Reimplemented in operations_research::sat::CompiledCircuitConstraint, and operations_research::sat::CompiledReservoirConstraint.
Definition at line 928 of file constraint_violation.cc.
| 
 | pure virtual | 
Returns the sorted vector of variables used by this constraint. This is used to known when a violation might change, and is only called once during initialization, so speed is not to much of a concern here.
The global proto is needed to resolve interval variables reference.
Implemented in operations_research::sat::CompiledConstraintWithProto, operations_research::sat::CompiledNoOverlap2dWithTwoBoxes< has_enforcement >, operations_research::sat::CompiledNoOverlapWithTwoIntervals< has_enforcement >, and operations_research::sat::CompiledReservoirConstraint.
| 
 | inline | 
The cached violation of this constraint.
Definition at line 273 of file constraint_violation.h.
| 
 | virtual | 
Returns the delta if var changes from old_value to solution[var].
Reimplemented in operations_research::sat::CompiledBoolXorConstraint, operations_research::sat::CompiledCircuitConstraint, operations_research::sat::CompiledNoOverlap2dWithTwoBoxes< has_enforcement >, operations_research::sat::CompiledNoOverlapWithTwoIntervals< has_enforcement >, and operations_research::sat::CompiledReservoirConstraint.
Definition at line 934 of file constraint_violation.cc.
| 
 | protected | 
Definition at line 282 of file constraint_violation.h.