Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
|
The violation of a bool_xor constraint is 0 or 1. More...
#include <constraint_violation.h>
Public Member Functions | |
CompiledBoolXorConstraint (const ConstraintProto &ct_proto) | |
--— CompiledBoolXorConstraint --— | |
~CompiledBoolXorConstraint () override=default | |
int64_t | ComputeViolation (absl::Span< const int64_t > solution) override |
int64_t | ViolationDelta (int, int64_t, absl::Span< const int64_t > solution_with_new_value) override |
Returns the delta if var changes from old_value to solution[var]. | |
Public Member Functions inherited from operations_research::sat::CompiledConstraintWithProto | |
CompiledConstraintWithProto (const ConstraintProto &ct_proto) | |
--— CompiledConstraintWithProto --— | |
~CompiledConstraintWithProto () override=default | |
const ConstraintProto & | ct_proto () const |
std::vector< int > | UsedVariables (const CpModelProto &model_proto) const final |
This just returns the variables used by the stored ct_proto_. | |
Public Member Functions inherited from operations_research::sat::CompiledConstraint | |
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. | |
int64_t | violation () const |
The cached violation of this constraint. | |
Additional Inherited Members | |
Protected Member Functions inherited from operations_research::sat::CompiledConstraint | |
Protected Attributes inherited from operations_research::sat::CompiledConstraint | |
int64_t | violation_ |
The violation of a bool_xor constraint is 0 or 1.
Individual compiled constraints.
Definition at line 463 of file constraint_violation.h.
|
explicit |
--— CompiledBoolXorConstraint --—
Definition at line 1000 of file constraint_violation.cc.
|
overridedefault |
|
overridevirtual |
Computes the violation of a constraint.
This is called by InitializeViolation() and also the default implementation of ViolationDelta().
Implements operations_research::sat::CompiledConstraint.
Definition at line 1004 of file constraint_violation.cc.
|
overridevirtual |
Returns the delta if var changes from old_value to solution[var].
Reimplemented from operations_research::sat::CompiledConstraint.
Definition at line 1013 of file constraint_violation.cc.