OR-Tools  8.2
PiecewiseLinearExpr

Detailed Description

Definition at line 7158 of file expressions.cc.

Public Member Functions

 PiecewiseLinearExpr (Solver *solver, IntExpr *expr, const PiecewiseLinearFunction &f)
 
 ~PiecewiseLinearExpr () override
 
int64 Min () const override
 
void SetMin (int64 m) override
 
int64 Max () const override
 
void SetMax (int64 m) override
 
void SetRange (int64 l, int64 u) override
 This method sets both the min and the max of the expression. More...
 
std::string name () const override
 Object naming. More...
 
std::string DebugString () const override
 
void WhenRange (Demon *d) override
 Attach a demon that will watch the min or the max of the expression. More...
 
void Accept (ModelVisitor *const visitor) const override
 Accepts the given visitor. More...
 
IntVarVar () override
 Creates a variable from the expression. More...
 
virtual IntVarCastToVar ()
 
virtual void Range (int64 *l, int64 *u)
 By default calls Min() and Max(), but can be redefined when Min and Max code can be factorized. More...
 
virtual void SetValue (int64 v)
 This method sets the value of the expression. More...
 
virtual bool Bound () const
 Returns true if the min and the max of the expression are equal. More...
 
virtual bool IsVar () const
 Returns true if the expression is indeed a variable. More...
 
IntVarVarWithName (const std::string &name)
 Creates a variable from the expression and set the name of the resulting var. More...
 
void WhenRange (Solver::Closure closure)
 Attach a demon that will watch the min or the max of the expression. More...
 
void WhenRange (Solver::Action action)
 Attach a demon that will watch the min or the max of the expression. More...
 
Solversolver () const
 
void FreezeQueue ()
 This method freezes the propagation queue. More...
 
void UnfreezeQueue ()
 This method unfreezes the propagation queue. More...
 
void EnqueueDelayedDemon (Demon *const d)
 This method pushes the demon onto the propagation queue. More...
 
void EnqueueVar (Demon *const d)
 
void ExecuteAll (const SimpleRevFIFO< Demon * > &demons)
 
void EnqueueAll (const SimpleRevFIFO< Demon * > &demons)
 
void set_action_on_fail (Solver::Action a)
 
void reset_action_on_fail ()
 This method clears the failure callback. More...
 
void set_variable_to_clean_on_fail (IntVar *v)
 Shortcut for variable cleaner. More...
 
void set_name (const std::string &name)
 
bool HasName () const
 Returns whether the object has been named or not. More...
 
virtual std::string BaseName () const
 Returns a base name for automatic naming. More...
 

Constructor & Destructor Documentation

◆ PiecewiseLinearExpr()

PiecewiseLinearExpr ( Solver solver,
IntExpr expr,
const PiecewiseLinearFunction f 
)
inline

Definition at line 7160 of file expressions.cc.

◆ ~PiecewiseLinearExpr()

~PiecewiseLinearExpr ( )
inlineoverride

Definition at line 7163 of file expressions.cc.

Member Function Documentation

◆ Accept()

void Accept ( ModelVisitor *const  visitor) const
inlineoverridevirtual

Accepts the given visitor.

Reimplemented from IntExpr.

Definition at line 7200 of file expressions.cc.

◆ BaseName()

std::string BaseName ( ) const
virtualinherited

Returns a base name for automatic naming.

Reimplemented in BooleanVar.

Definition at line 2515 of file constraint_solver.cc.

◆ Bound()

virtual bool Bound ( ) const
inlinevirtualinherited

Returns true if the min and the max of the expression are equal.

Reimplemented in BooleanVar.

Definition at line 3862 of file constraint_solver.h.

◆ CastToVar()

IntVar * CastToVar ( )
virtualinherited

Definition at line 7417 of file expressions.cc.

◆ DebugString()

std::string DebugString ( ) const
inlineoverridevirtual

Reimplemented from PropagationBaseObject.

Definition at line 7193 of file expressions.cc.

◆ EnqueueAll()

void EnqueueAll ( const SimpleRevFIFO< Demon * > &  demons)
inherited

Definition at line 2521 of file constraint_solver.cc.

◆ EnqueueDelayedDemon()

void EnqueueDelayedDemon ( Demon *const  d)
inlineinherited

This method pushes the demon onto the propagation queue.

It will be processed directly if the queue is empty. It will be enqueued according to its priority otherwise.

Definition at line 3192 of file constraint_solver.h.

◆ EnqueueVar()

void EnqueueVar ( Demon *const  d)
inlineinherited

Definition at line 3193 of file constraint_solver.h.

◆ ExecuteAll()

void ExecuteAll ( const SimpleRevFIFO< Demon * > &  demons)
inherited

Definition at line 2517 of file constraint_solver.cc.

◆ FreezeQueue()

void FreezeQueue ( )
inlineinherited

This method freezes the propagation queue.

It is useful when you need to apply multiple modifications at once.

Definition at line 3183 of file constraint_solver.h.

◆ HasName()

bool HasName ( ) const
inherited

Returns whether the object has been named or not.

Definition at line 2513 of file constraint_solver.cc.

◆ IsVar()

virtual bool IsVar ( ) const
inlinevirtualinherited

Returns true if the expression is indeed a variable.

Reimplemented in IntVar.

Definition at line 3865 of file constraint_solver.h.

◆ Max()

int64 Max ( ) const
inlineoverridevirtual

Implements IntExpr.

Definition at line 7173 of file expressions.cc.

◆ Min()

int64 Min ( ) const
inlineoverridevirtual

Implements IntExpr.

Definition at line 7164 of file expressions.cc.

◆ name()

std::string name ( ) const
inlineoverridevirtual

Object naming.

Reimplemented from PropagationBaseObject.

Definition at line 7188 of file expressions.cc.

◆ Range()

virtual void Range ( int64 l,
int64 u 
)
inlinevirtualinherited

By default calls Min() and Max(), but can be redefined when Min and Max code can be factorized.

Definition at line 3848 of file constraint_solver.h.

◆ reset_action_on_fail()

void reset_action_on_fail ( )
inlineinherited

This method clears the failure callback.

Definition at line 3206 of file constraint_solver.h.

◆ set_action_on_fail()

void set_action_on_fail ( Solver::Action  a)
inlineinherited

Definition at line 3200 of file constraint_solver.h.

◆ set_name()

void set_name ( const std::string &  name)
inherited

Definition at line 2509 of file constraint_solver.cc.

◆ set_variable_to_clean_on_fail()

void set_variable_to_clean_on_fail ( IntVar v)
inlineinherited

Shortcut for variable cleaner.

Definition at line 3209 of file constraint_solver.h.

◆ SetMax()

void SetMax ( int64  m)
inlineoverridevirtual

Implements IntExpr.

Definition at line 7177 of file expressions.cc.

◆ SetMin()

void SetMin ( int64  m)
inlineoverridevirtual

Implements IntExpr.

Definition at line 7167 of file expressions.cc.

◆ SetRange()

void SetRange ( int64  l,
int64  u 
)
inlineoverridevirtual

This method sets both the min and the max of the expression.

Reimplemented from IntExpr.

Definition at line 7183 of file expressions.cc.

◆ SetValue()

virtual void SetValue ( int64  v)
inlinevirtualinherited

This method sets the value of the expression.

Definition at line 3859 of file constraint_solver.h.

◆ solver()

Solver* solver ( ) const
inlineinherited

Definition at line 3179 of file constraint_solver.h.

◆ UnfreezeQueue()

void UnfreezeQueue ( )
inlineinherited

This method unfreezes the propagation queue.

All modifications that happened when the queue was frozen will be processed.

Definition at line 3187 of file constraint_solver.h.

◆ Var()

IntVar * Var ( )
overridevirtualinherited

Creates a variable from the expression.

Implements IntExpr.

Definition at line 7409 of file expressions.cc.

◆ VarWithName()

IntVar * VarWithName ( const std::string &  name)
inherited

Creates a variable from the expression and set the name of the resulting var.

If the expression is already a variable, then it will set the name of the expression, possibly overwriting it. This is just a shortcut to Var() followed by set_name().

Definition at line 49 of file expressions.cc.

◆ WhenRange() [1/3]

void WhenRange ( Demon d)
inlineoverridevirtual

Attach a demon that will watch the min or the max of the expression.

Implements IntExpr.

Definition at line 7198 of file expressions.cc.

◆ WhenRange() [2/3]

void WhenRange ( Solver::Action  action)
inlineinherited

Attach a demon that will watch the min or the max of the expression.

Definition at line 3885 of file constraint_solver.h.

◆ WhenRange() [3/3]

void WhenRange ( Solver::Closure  closure)
inlineinherited

Attach a demon that will watch the min or the max of the expression.

Definition at line 3879 of file constraint_solver.h.


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