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

#include <constraint_solveri.h>

Public Types

enum  VoidConstraintType { VOID_FALSE_CONSTRAINT = 0 , VOID_TRUE_CONSTRAINT , VOID_CONSTRAINT_MAX }
 
enum  VarConstantConstraintType {
  VAR_CONSTANT_EQUALITY = 0 , VAR_CONSTANT_GREATER_OR_EQUAL , VAR_CONSTANT_LESS_OR_EQUAL , VAR_CONSTANT_NON_EQUALITY ,
  VAR_CONSTANT_CONSTRAINT_MAX
}
 
enum  VarConstantConstantConstraintType { VAR_CONSTANT_CONSTANT_BETWEEN = 0 , VAR_CONSTANT_CONSTANT_CONSTRAINT_MAX }
 
enum  ExprExprConstraintType {
  EXPR_EXPR_EQUALITY = 0 , EXPR_EXPR_GREATER , EXPR_EXPR_GREATER_OR_EQUAL , EXPR_EXPR_LESS ,
  EXPR_EXPR_LESS_OR_EQUAL , EXPR_EXPR_NON_EQUALITY , EXPR_EXPR_CONSTRAINT_MAX
}
 
enum  ExprExpressionType { EXPR_OPPOSITE = 0 , EXPR_ABS , EXPR_SQUARE , EXPR_EXPRESSION_MAX }
 
enum  ExprExprExpressionType {
  EXPR_EXPR_DIFFERENCE = 0 , EXPR_EXPR_PROD , EXPR_EXPR_DIV , EXPR_EXPR_MAX ,
  EXPR_EXPR_MIN , EXPR_EXPR_SUM , EXPR_EXPR_IS_LESS , EXPR_EXPR_IS_LESS_OR_EQUAL ,
  EXPR_EXPR_IS_EQUAL , EXPR_EXPR_IS_NOT_EQUAL , EXPR_EXPR_EXPRESSION_MAX
}
 
enum  ExprExprConstantExpressionType { EXPR_EXPR_CONSTANT_CONDITIONAL = 0 , EXPR_EXPR_CONSTANT_EXPRESSION_MAX }
 
enum  ExprConstantExpressionType {
  EXPR_CONSTANT_DIFFERENCE = 0 , EXPR_CONSTANT_DIVIDE , EXPR_CONSTANT_PROD , EXPR_CONSTANT_MAX ,
  EXPR_CONSTANT_MIN , EXPR_CONSTANT_SUM , EXPR_CONSTANT_IS_EQUAL , EXPR_CONSTANT_IS_NOT_EQUAL ,
  EXPR_CONSTANT_IS_GREATER_OR_EQUAL , EXPR_CONSTANT_IS_LESS_OR_EQUAL , EXPR_CONSTANT_EXPRESSION_MAX
}
 
enum  VarConstantConstantExpressionType { VAR_CONSTANT_CONSTANT_SEMI_CONTINUOUS = 0 , VAR_CONSTANT_CONSTANT_EXPRESSION_MAX }
 
enum  VarConstantArrayExpressionType { VAR_CONSTANT_ARRAY_ELEMENT = 0 , VAR_CONSTANT_ARRAY_EXPRESSION_MAX }
 
enum  VarArrayConstantArrayExpressionType { VAR_ARRAY_CONSTANT_ARRAY_SCAL_PROD = 0 , VAR_ARRAY_CONSTANT_ARRAY_EXPRESSION_MAX }
 
enum  VarArrayExpressionType { VAR_ARRAY_MAX = 0 , VAR_ARRAY_MIN , VAR_ARRAY_SUM , VAR_ARRAY_EXPRESSION_MAX }
 
enum  VarArrayConstantExpressionType { VAR_ARRAY_CONSTANT_INDEX = 0 , VAR_ARRAY_CONSTANT_EXPRESSION_MAX }
 

Public Member Functions

 ModelCache (Solver *solver)
 --— ModelCache --—
 
virtual ~ModelCache ()
 
virtual void Clear ()=0
 
virtual ConstraintFindVoidConstraint (VoidConstraintType type) const =0
 Void constraints.
 
virtual void InsertVoidConstraint (Constraint *ct, VoidConstraintType type)=0
 
virtual ConstraintFindVarConstantConstraint (IntVar *var, int64_t value, VarConstantConstraintType type) const =0
 Var Constant Constraints.
 
virtual void InsertVarConstantConstraint (Constraint *ct, IntVar *var, int64_t value, VarConstantConstraintType type)=0
 
virtual ConstraintFindVarConstantConstantConstraint (IntVar *var, int64_t value1, int64_t value2, VarConstantConstantConstraintType type) const =0
 Var Constant Constant Constraints.
 
virtual void InsertVarConstantConstantConstraint (Constraint *ct, IntVar *var, int64_t value1, int64_t value2, VarConstantConstantConstraintType type)=0
 
virtual ConstraintFindExprExprConstraint (IntExpr *expr1, IntExpr *expr2, ExprExprConstraintType type) const =0
 Expr Expr Constraints.
 
virtual void InsertExprExprConstraint (Constraint *ct, IntExpr *expr1, IntExpr *expr2, ExprExprConstraintType type)=0
 
virtual IntExprFindExprExpression (IntExpr *expr, ExprExpressionType type) const =0
 Expr Expressions.
 
virtual void InsertExprExpression (IntExpr *expression, IntExpr *expr, ExprExpressionType type)=0
 
virtual IntExprFindExprConstantExpression (IntExpr *expr, int64_t value, ExprConstantExpressionType type) const =0
 Expr Constant Expressions.
 
virtual void InsertExprConstantExpression (IntExpr *expression, IntExpr *var, int64_t value, ExprConstantExpressionType type)=0
 
virtual IntExprFindExprExprExpression (IntExpr *var1, IntExpr *var2, ExprExprExpressionType type) const =0
 Expr Expr Expressions.
 
virtual void InsertExprExprExpression (IntExpr *expression, IntExpr *var1, IntExpr *var2, ExprExprExpressionType type)=0
 
virtual IntExprFindExprExprConstantExpression (IntExpr *var1, IntExpr *var2, int64_t constant, ExprExprConstantExpressionType type) const =0
 Expr Expr Constant Expressions.
 
virtual void InsertExprExprConstantExpression (IntExpr *expression, IntExpr *var1, IntExpr *var2, int64_t constant, ExprExprConstantExpressionType type)=0
 
virtual IntExprFindVarConstantConstantExpression (IntVar *var, int64_t value1, int64_t value2, VarConstantConstantExpressionType type) const =0
 Var Constant Constant Expressions.
 
virtual void InsertVarConstantConstantExpression (IntExpr *expression, IntVar *var, int64_t value1, int64_t value2, VarConstantConstantExpressionType type)=0
 
virtual IntExprFindVarConstantArrayExpression (IntVar *var, const std::vector< int64_t > &values, VarConstantArrayExpressionType type) const =0
 Var Constant Array Expressions.
 
virtual void InsertVarConstantArrayExpression (IntExpr *expression, IntVar *var, const std::vector< int64_t > &values, VarConstantArrayExpressionType type)=0
 
virtual IntExprFindVarArrayExpression (const std::vector< IntVar * > &vars, VarArrayExpressionType type) const =0
 Var Array Expressions.
 
virtual void InsertVarArrayExpression (IntExpr *expression, const std::vector< IntVar * > &vars, VarArrayExpressionType type)=0
 
virtual IntExprFindVarArrayConstantArrayExpression (const std::vector< IntVar * > &vars, const std::vector< int64_t > &values, VarArrayConstantArrayExpressionType type) const =0
 Var Array Constant Array Expressions.
 
virtual void InsertVarArrayConstantArrayExpression (IntExpr *expression, const std::vector< IntVar * > &var, const std::vector< int64_t > &values, VarArrayConstantArrayExpressionType type)=0
 
virtual IntExprFindVarArrayConstantExpression (const std::vector< IntVar * > &vars, int64_t value, VarArrayConstantExpressionType type) const =0
 Var Array Constant Expressions.
 
virtual void InsertVarArrayConstantExpression (IntExpr *expression, const std::vector< IntVar * > &var, int64_t value, VarArrayConstantExpressionType type)=0
 
Solversolver () const
 

Detailed Description

Implements a complete cache for model elements: expressions and constraints. Caching is based on the signatures of the elements, as well as their types. This class is used internally to avoid creating duplicate objects.

Definition at line 2427 of file constraint_solveri.h.

Member Enumeration Documentation

◆ ExprConstantExpressionType

Enumerator
EXPR_CONSTANT_DIFFERENCE 
EXPR_CONSTANT_DIVIDE 
EXPR_CONSTANT_PROD 
EXPR_CONSTANT_MAX 
EXPR_CONSTANT_MIN 
EXPR_CONSTANT_SUM 
EXPR_CONSTANT_IS_EQUAL 
EXPR_CONSTANT_IS_NOT_EQUAL 
EXPR_CONSTANT_IS_GREATER_OR_EQUAL 
EXPR_CONSTANT_IS_LESS_OR_EQUAL 
EXPR_CONSTANT_EXPRESSION_MAX 

Definition at line 2484 of file constraint_solveri.h.

◆ ExprExprConstantExpressionType

Enumerator
EXPR_EXPR_CONSTANT_CONDITIONAL 
EXPR_EXPR_CONSTANT_EXPRESSION_MAX 

Definition at line 2479 of file constraint_solveri.h.

◆ ExprExprConstraintType

Enumerator
EXPR_EXPR_EQUALITY 
EXPR_EXPR_GREATER 
EXPR_EXPR_GREATER_OR_EQUAL 
EXPR_EXPR_LESS 
EXPR_EXPR_LESS_OR_EQUAL 
EXPR_EXPR_NON_EQUALITY 
EXPR_EXPR_CONSTRAINT_MAX 

Definition at line 2448 of file constraint_solveri.h.

◆ ExprExpressionType

Enumerator
EXPR_OPPOSITE 
EXPR_ABS 
EXPR_SQUARE 
EXPR_EXPRESSION_MAX 

Definition at line 2458 of file constraint_solveri.h.

◆ ExprExprExpressionType

Enumerator
EXPR_EXPR_DIFFERENCE 
EXPR_EXPR_PROD 
EXPR_EXPR_DIV 
EXPR_EXPR_MAX 
EXPR_EXPR_MIN 
EXPR_EXPR_SUM 
EXPR_EXPR_IS_LESS 
EXPR_EXPR_IS_LESS_OR_EQUAL 
EXPR_EXPR_IS_EQUAL 
EXPR_EXPR_IS_NOT_EQUAL 
EXPR_EXPR_EXPRESSION_MAX 

Definition at line 2465 of file constraint_solveri.h.

◆ VarArrayConstantArrayExpressionType

Enumerator
VAR_ARRAY_CONSTANT_ARRAY_SCAL_PROD 
VAR_ARRAY_CONSTANT_ARRAY_EXPRESSION_MAX 

Definition at line 2507 of file constraint_solveri.h.

◆ VarArrayConstantExpressionType

Enumerator
VAR_ARRAY_CONSTANT_INDEX 
VAR_ARRAY_CONSTANT_EXPRESSION_MAX 

Definition at line 2519 of file constraint_solveri.h.

◆ VarArrayExpressionType

Enumerator
VAR_ARRAY_MAX 
VAR_ARRAY_MIN 
VAR_ARRAY_SUM 
VAR_ARRAY_EXPRESSION_MAX 

Definition at line 2512 of file constraint_solveri.h.

◆ VarConstantArrayExpressionType

Enumerator
VAR_CONSTANT_ARRAY_ELEMENT 
VAR_CONSTANT_ARRAY_EXPRESSION_MAX 

Definition at line 2502 of file constraint_solveri.h.

◆ VarConstantConstantConstraintType

Enumerator
VAR_CONSTANT_CONSTANT_BETWEEN 
VAR_CONSTANT_CONSTANT_CONSTRAINT_MAX 

Definition at line 2443 of file constraint_solveri.h.

◆ VarConstantConstantExpressionType

Enumerator
VAR_CONSTANT_CONSTANT_SEMI_CONTINUOUS 
VAR_CONSTANT_CONSTANT_EXPRESSION_MAX 

Definition at line 2497 of file constraint_solveri.h.

◆ VarConstantConstraintType

Enumerator
VAR_CONSTANT_EQUALITY 
VAR_CONSTANT_GREATER_OR_EQUAL 
VAR_CONSTANT_LESS_OR_EQUAL 
VAR_CONSTANT_NON_EQUALITY 
VAR_CONSTANT_CONSTRAINT_MAX 

Definition at line 2435 of file constraint_solveri.h.

◆ VoidConstraintType

Enumerator
VOID_FALSE_CONSTRAINT 
VOID_TRUE_CONSTRAINT 
VOID_CONSTRAINT_MAX 

Definition at line 2429 of file constraint_solveri.h.

Constructor & Destructor Documentation

◆ ModelCache()

operations_research::ModelCache::ModelCache ( Solver * solver)
explicit

--— ModelCache --—

Definition at line 31 of file model_cache.cc.

◆ ~ModelCache()

operations_research::ModelCache::~ModelCache ( )
virtual

Definition at line 33 of file model_cache.cc.

Member Function Documentation

◆ Clear()

virtual void operations_research::ModelCache::Clear ( )
pure virtual

◆ FindExprConstantExpression()

virtual IntExpr * operations_research::ModelCache::FindExprConstantExpression ( IntExpr * expr,
int64_t value,
ExprConstantExpressionType type ) const
pure virtual

Expr Constant Expressions.

◆ FindExprExprConstantExpression()

virtual IntExpr * operations_research::ModelCache::FindExprExprConstantExpression ( IntExpr * var1,
IntExpr * var2,
int64_t constant,
ExprExprConstantExpressionType type ) const
pure virtual

Expr Expr Constant Expressions.

◆ FindExprExprConstraint()

virtual Constraint * operations_research::ModelCache::FindExprExprConstraint ( IntExpr * expr1,
IntExpr * expr2,
ExprExprConstraintType type ) const
pure virtual

Expr Expr Constraints.

◆ FindExprExpression()

virtual IntExpr * operations_research::ModelCache::FindExprExpression ( IntExpr * expr,
ExprExpressionType type ) const
pure virtual

Expr Expressions.

◆ FindExprExprExpression()

virtual IntExpr * operations_research::ModelCache::FindExprExprExpression ( IntExpr * var1,
IntExpr * var2,
ExprExprExpressionType type ) const
pure virtual

Expr Expr Expressions.

◆ FindVarArrayConstantArrayExpression()

virtual IntExpr * operations_research::ModelCache::FindVarArrayConstantArrayExpression ( const std::vector< IntVar * > & vars,
const std::vector< int64_t > & values,
VarArrayConstantArrayExpressionType type ) const
pure virtual

Var Array Constant Array Expressions.

◆ FindVarArrayConstantExpression()

virtual IntExpr * operations_research::ModelCache::FindVarArrayConstantExpression ( const std::vector< IntVar * > & vars,
int64_t value,
VarArrayConstantExpressionType type ) const
pure virtual

Var Array Constant Expressions.

◆ FindVarArrayExpression()

virtual IntExpr * operations_research::ModelCache::FindVarArrayExpression ( const std::vector< IntVar * > & vars,
VarArrayExpressionType type ) const
pure virtual

Var Array Expressions.

◆ FindVarConstantArrayExpression()

virtual IntExpr * operations_research::ModelCache::FindVarConstantArrayExpression ( IntVar * var,
const std::vector< int64_t > & values,
VarConstantArrayExpressionType type ) const
pure virtual

Var Constant Array Expressions.

◆ FindVarConstantConstantConstraint()

virtual Constraint * operations_research::ModelCache::FindVarConstantConstantConstraint ( IntVar * var,
int64_t value1,
int64_t value2,
VarConstantConstantConstraintType type ) const
pure virtual

Var Constant Constant Constraints.

◆ FindVarConstantConstantExpression()

virtual IntExpr * operations_research::ModelCache::FindVarConstantConstantExpression ( IntVar * var,
int64_t value1,
int64_t value2,
VarConstantConstantExpressionType type ) const
pure virtual

Var Constant Constant Expressions.

◆ FindVarConstantConstraint()

virtual Constraint * operations_research::ModelCache::FindVarConstantConstraint ( IntVar * var,
int64_t value,
VarConstantConstraintType type ) const
pure virtual

Var Constant Constraints.

◆ FindVoidConstraint()

virtual Constraint * operations_research::ModelCache::FindVoidConstraint ( VoidConstraintType type) const
pure virtual

Void constraints.

◆ InsertExprConstantExpression()

virtual void operations_research::ModelCache::InsertExprConstantExpression ( IntExpr * expression,
IntExpr * var,
int64_t value,
ExprConstantExpressionType type )
pure virtual

◆ InsertExprExprConstantExpression()

virtual void operations_research::ModelCache::InsertExprExprConstantExpression ( IntExpr * expression,
IntExpr * var1,
IntExpr * var2,
int64_t constant,
ExprExprConstantExpressionType type )
pure virtual

◆ InsertExprExprConstraint()

virtual void operations_research::ModelCache::InsertExprExprConstraint ( Constraint * ct,
IntExpr * expr1,
IntExpr * expr2,
ExprExprConstraintType type )
pure virtual

◆ InsertExprExpression()

virtual void operations_research::ModelCache::InsertExprExpression ( IntExpr * expression,
IntExpr * expr,
ExprExpressionType type )
pure virtual

◆ InsertExprExprExpression()

virtual void operations_research::ModelCache::InsertExprExprExpression ( IntExpr * expression,
IntExpr * var1,
IntExpr * var2,
ExprExprExpressionType type )
pure virtual

◆ InsertVarArrayConstantArrayExpression()

virtual void operations_research::ModelCache::InsertVarArrayConstantArrayExpression ( IntExpr * expression,
const std::vector< IntVar * > & var,
const std::vector< int64_t > & values,
VarArrayConstantArrayExpressionType type )
pure virtual

◆ InsertVarArrayConstantExpression()

virtual void operations_research::ModelCache::InsertVarArrayConstantExpression ( IntExpr * expression,
const std::vector< IntVar * > & var,
int64_t value,
VarArrayConstantExpressionType type )
pure virtual

◆ InsertVarArrayExpression()

virtual void operations_research::ModelCache::InsertVarArrayExpression ( IntExpr * expression,
const std::vector< IntVar * > & vars,
VarArrayExpressionType type )
pure virtual

◆ InsertVarConstantArrayExpression()

virtual void operations_research::ModelCache::InsertVarConstantArrayExpression ( IntExpr * expression,
IntVar * var,
const std::vector< int64_t > & values,
VarConstantArrayExpressionType type )
pure virtual

◆ InsertVarConstantConstantConstraint()

virtual void operations_research::ModelCache::InsertVarConstantConstantConstraint ( Constraint * ct,
IntVar * var,
int64_t value1,
int64_t value2,
VarConstantConstantConstraintType type )
pure virtual

◆ InsertVarConstantConstantExpression()

virtual void operations_research::ModelCache::InsertVarConstantConstantExpression ( IntExpr * expression,
IntVar * var,
int64_t value1,
int64_t value2,
VarConstantConstantExpressionType type )
pure virtual

◆ InsertVarConstantConstraint()

virtual void operations_research::ModelCache::InsertVarConstantConstraint ( Constraint * ct,
IntVar * var,
int64_t value,
VarConstantConstraintType type )
pure virtual

◆ InsertVoidConstraint()

virtual void operations_research::ModelCache::InsertVoidConstraint ( Constraint * ct,
VoidConstraintType type )
pure virtual

◆ solver()

Solver * operations_research::ModelCache::solver ( ) const

Definition at line 35 of file model_cache.cc.


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