Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
operations_research::sat::CompiledConstraintWithProto Class Reference

#include <constraint_violation.h>

Inheritance diagram for operations_research::sat::CompiledConstraintWithProto:
operations_research::sat::CompiledConstraint 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

Public Member Functions

 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.
 
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].
 
int64_t violation () const
 The cached violation of this constraint.
 

Additional Inherited Members

- Protected Member Functions inherited from operations_research::sat::CompiledConstraint
virtual int64_t ComputeViolation (absl::Span< const int64_t > solution)=0
 
- Protected Attributes inherited from operations_research::sat::CompiledConstraint
int64_t violation_
 

Detailed Description

Intermediate class for all constraints that store directly their proto as part of their implementation.

Definition at line 284 of file constraint_violation.h.

Constructor & Destructor Documentation

◆ CompiledConstraintWithProto()

operations_research::sat::CompiledConstraintWithProto::CompiledConstraintWithProto ( const ConstraintProto & ct_proto)
explicit

--— CompiledConstraintWithProto --—

Definition at line 980 of file constraint_violation.cc.

◆ ~CompiledConstraintWithProto()

operations_research::sat::CompiledConstraintWithProto::~CompiledConstraintWithProto ( )
overridedefault

Member Function Documentation

◆ ct_proto()

const ConstraintProto & operations_research::sat::CompiledConstraintWithProto::ct_proto ( ) const
inline

Definition at line 289 of file constraint_violation.h.

◆ UsedVariables()

std::vector< int > operations_research::sat::CompiledConstraintWithProto::UsedVariables ( const CpModelProto & model_proto) const
finalvirtual

This just returns the variables used by the stored ct_proto_.

Implements operations_research::sat::CompiledConstraint.

Definition at line 984 of file constraint_violation.cc.


The documentation for this class was generated from the following files: