Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
operations_research::fz::Constraint Struct Reference

#include <model.h>

Public Member Functions

 Constraint (absl::string_view t, std::vector< Argument > args, bool strong_propag)
 
std::string DebugString () const
 --— Constraint --—
 
void MarkAsInactive ()
 Helpers to be used during presolve.
 
void RemoveArg (int arg_pos)
 Helper method to remove one argument.
 
void SetAsFalse ()
 Set as a False constraint.
 

Public Attributes

std::string type
 
std::vector< Argumentarguments
 
bool strong_propagation: 1
 
bool active: 1
 
bool presolve_propagation_done: 1
 Indicates if presolve has finished propagating this constraint.
 

Detailed Description

A constraint has a type, some arguments, and a few tags. Typically, a Constraint is on the heap, and owned by the global Model object.

Definition at line 219 of file model.h.

Constructor & Destructor Documentation

◆ Constraint()

operations_research::fz::Constraint::Constraint ( absl::string_view t,
std::vector< Argument > args,
bool strong_propag )
inline

Definition at line 220 of file model.h.

Member Function Documentation

◆ DebugString()

std::string operations_research::fz::Constraint::DebugString ( ) const

--— Constraint --—

Definition at line 804 of file model.cc.

◆ MarkAsInactive()

void operations_research::fz::Constraint::MarkAsInactive ( )

Helpers to be used during presolve.

Todo
(user): Reclaim arguments and memory.

Definition at line 818 of file model.cc.

◆ RemoveArg()

void operations_research::fz::Constraint::RemoveArg ( int arg_pos)

Helper method to remove one argument.

Definition at line 814 of file model.cc.

◆ SetAsFalse()

void operations_research::fz::Constraint::SetAsFalse ( )

Set as a False constraint.

Definition at line 823 of file model.cc.

Member Data Documentation

◆ active

bool operations_research::fz::Constraint::active

Indicates if the constraint is active. Presolve can make it inactive by propagating it, or by regrouping it. Once a constraint is inactive, it is logically removed from the model, it is not extracted, and it is ignored by presolve.

Definition at line 251 of file model.h.

◆ arguments

std::vector<Argument> operations_research::fz::Constraint::arguments

Definition at line 240 of file model.h.

◆ presolve_propagation_done

bool operations_research::fz::Constraint::presolve_propagation_done

Indicates if presolve has finished propagating this constraint.

Definition at line 254 of file model.h.

◆ strong_propagation

bool operations_research::fz::Constraint::strong_propagation

Is true if the constraint should use the strongest level of propagation. This is a hint in the model. For instance, in the AllDifferent constraint, there are different algorithms to propagate with different pruning/speed ratios. When strong_propagation is true, one should use, if possible, the algorithm with the strongest pruning.

Definition at line 246 of file model.h.

◆ type

std::string operations_research::fz::Constraint::type

The flatzinc type of the constraint (i.e. "int_eq" for integer equality) stored as a string.

Definition at line 239 of file model.h.


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