C++ Reference: class PbConstraints

Note: This documentation is automatically generated.


Class responsible for managing a set of pseudo-Boolean constraints and their propagation.
Method
AddConstraint

Return type: bool

Arguments: const std::vector<LiteralWithCoeff>& cst, Coefficient rhs, Trail* trail

Adds a constraint in canonical form to the set of managed constraints. Note that this detects constraints with exactly the same terms. In this case, the constraint rhs is updated if the new one is lower or nothing is done otherwise. There are some preconditions, and the function will return false if they are not met. The constraint can be added when the trail is not empty, however given the current propagated assignment: - The constraint cannot be conflicting. - The constraint cannot have propagated at an earlier decision level.

AddLearnedConstraint

Return type: bool

Arguments: const std::vector<LiteralWithCoeff>& cst, Coefficient rhs, Trail* trail

Same as AddConstraint(), but also marks the added constraint as learned so that it can be deleted during the constraint cleanup phase.

BumpActivity

Return type: void

Arguments: UpperBoundedLinearConstraint* constraint

Activity update functions. TODO(user): Remove duplication with other activity update functions.

ClearConflictingConstraint

Return type: void

ConflictingConstraint() returns the last PB constraint that caused a conflict. Calling ClearConflictingConstraint() reset this to nullptr. TODO(user): This is a hack to get the PB conflict, because the rest of the solver API assume only clause conflict. Find a cleaner way?

ConflictingConstraint

Return type: UpperBoundedLinearConstraint*

DeleteConstraint

Return type: void

Arguments: int index

Only used for testing.

IsEmpty

Return type: bool

num_constraint_lookups

Return type: int64_t

Some statistics.

num_inspected_constraint_literals

Return type: int64_t

num_threshold_updates

Return type: int64_t

NumberOfConstraints

Return type: int

Returns the number of constraints managed by this class.

PbConstraints

Return type: explicit

Arguments: Model* model

~PbConstraints

Propagate

Return type: bool

Arguments: Trail* trail

Reason

Return type: absl::Span<const Literal>

Arguments: const Trail& trail, int trail_index

ReasonPbConstraint

Return type: UpperBoundedLinearConstraint*

Arguments: int trail_index

Returns the underlying UpperBoundedLinearConstraint responsible for assigning the literal at given trail index.

RescaleActivities

Return type: void

Arguments: double scaling_factor

Resize

Return type: void

Arguments: int num_variables

Changes the number of variables.

Untrail

Return type: void

Arguments: const Trail& trail, int trail_index

UpdateActivityIncrement

Return type: void