OR-Tools  8.2
SimpleBoundCosts

Detailed Description

A structure meant to store soft bounds and associated violation constants.

It is 'Simple' because it has one BoundCost per element, in contrast to 'Multiple'. Design notes:

  • it is meant to store model information to be shared through pointers, so it disallows copy and assign to avoid accidental duplication.
  • it keeps soft bounds as an array of structs to help cache, because code that uses such bounds typically use both bound and cost.
  • soft bounds are named pairs, prevents some mistakes.
  • using operator[] to access elements is not interesting, because the structure will be accessed through pointers, moreover having to type bound_cost reminds the user of the order if they do a copy assignment of the element.

Definition at line 2329 of file routing.h.

Classes

struct  BoundCost
 

Public Member Functions

 SimpleBoundCosts (int num_bounds, BoundCost default_bound_cost)
 
BoundCostbound_cost (int element)
 
BoundCost bound_cost (int element) const
 
int Size ()
 
 SimpleBoundCosts (const SimpleBoundCosts &)=delete
 
SimpleBoundCosts operator= (const SimpleBoundCosts &)=delete
 

Constructor & Destructor Documentation

◆ SimpleBoundCosts() [1/2]

SimpleBoundCosts ( int  num_bounds,
BoundCost  default_bound_cost 
)
inline

Definition at line 2335 of file routing.h.

◆ SimpleBoundCosts() [2/2]

SimpleBoundCosts ( const SimpleBoundCosts )
delete

Member Function Documentation

◆ bound_cost() [1/2]

BoundCost& bound_cost ( int  element)
inline

Definition at line 2337 of file routing.h.

◆ bound_cost() [2/2]

BoundCost bound_cost ( int  element) const
inline

Definition at line 2338 of file routing.h.

◆ operator=()

SimpleBoundCosts operator= ( const SimpleBoundCosts )
delete

◆ Size()

int Size ( )
inline

Definition at line 2339 of file routing.h.


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