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

#include <model.h>

Public Types

enum  Type {
  INT_VALUE , INT_INTERVAL , INT_LIST , DOMAIN_LIST ,
  FLOAT_VALUE , FLOAT_INTERVAL , FLOAT_LIST , VAR_REF ,
  VAR_REF_ARRAY , VOID_ARGUMENT
}
 

Public Member Functions

std::string DebugString () const
 
bool IsVariable () const
 Returns true if the argument is a variable.
 
bool HasOneValue () const
 
int64_t Value () const
 Returns the value of the argument. Does DCHECK(HasOneValue()).
 
bool IsArrayOfValues () const
 
bool Contains (int64_t value) const
 
int64_t ValueAt (int pos) const
 Returns the value of the pos-th element.
 
VariableVar () const
 
VariableVarAt (int pos) const
 
bool HasOneValueAt (int pos) const
 Returns true is the pos-th argument is fixed.
 
int Size () const
 Returns the number of object in the argument.
 

Static Public Member Functions

static Argument IntegerValue (int64_t value)
 --— Argument --—
 
static Argument Interval (int64_t imin, int64_t imax)
 
static Argument IntegerList (std::vector< int64_t > values)
 
static Argument DomainList (std::vector< Domain > domains)
 
static Argument FloatValue (double value)
 
static Argument FloatInterval (double lb, double ub)
 
static Argument FloatList (std::vector< double > floats)
 
static Argument VarRef (Variable *var)
 
static Argument VarRefArray (std::vector< Variable * > vars)
 
static Argument VoidArgument ()
 
static Argument FromDomain (const Domain &domain)
 

Public Attributes

Type type
 
std::vector< int64_t > values
 
std::vector< Variable * > variables
 
std::vector< Domaindomains
 
std::vector< double > floats
 

Detailed Description

An argument is either an integer value, an integer domain, a reference to a variable, or an array of variable references.

Definition at line 155 of file model.h.

Member Enumeration Documentation

◆ Type

Enumerator
INT_VALUE 
INT_INTERVAL 
INT_LIST 
DOMAIN_LIST 
FLOAT_VALUE 
FLOAT_INTERVAL 
FLOAT_LIST 
VAR_REF 
VAR_REF_ARRAY 
VOID_ARGUMENT 

Definition at line 156 of file model.h.

Member Function Documentation

◆ Contains()

bool operations_research::fz::Argument::Contains ( int64_t value) const

Returns true if the argument is an integer value, an integer list, or an interval, and it contains the given value. It will check that the type is actually one of the above.

Definition at line 677 of file model.cc.

◆ DebugString()

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

Definition at line 581 of file model.cc.

◆ DomainList()

Argument operations_research::fz::Argument::DomainList ( std::vector< Domain > domains)
static

Definition at line 519 of file model.cc.

◆ FloatInterval()

Argument operations_research::fz::Argument::FloatInterval ( double lb,
double ub )
static

Definition at line 566 of file model.cc.

◆ FloatList()

Argument operations_research::fz::Argument::FloatList ( std::vector< double > floats)
static

Definition at line 574 of file model.cc.

◆ FloatValue()

Argument operations_research::fz::Argument::FloatValue ( double value)
static

Definition at line 559 of file model.cc.

◆ FromDomain()

Argument operations_research::fz::Argument::FromDomain ( const Domain & domain)
static

Definition at line 546 of file model.cc.

◆ HasOneValue()

bool operations_research::fz::Argument::HasOneValue ( ) const

Returns true if the argument has only one value (integer value, integer list of size 1, interval of size 1, or variable with a singleton domain).

Definition at line 616 of file model.cc.

◆ HasOneValueAt()

bool operations_research::fz::Argument::HasOneValueAt ( int pos) const

Returns true is the pos-th argument is fixed.

Definition at line 718 of file model.cc.

◆ IntegerList()

Argument operations_research::fz::Argument::IntegerList ( std::vector< int64_t > values)
static

Definition at line 512 of file model.cc.

◆ IntegerValue()

Argument operations_research::fz::Argument::IntegerValue ( int64_t value)
static

--— Argument --—

Definition at line 497 of file model.cc.

◆ Interval()

Argument operations_research::fz::Argument::Interval ( int64_t imin,
int64_t imax )
static

Definition at line 504 of file model.cc.

◆ IsArrayOfValues()

bool operations_research::fz::Argument::IsArrayOfValues ( ) const

Returns true if it an integer list, or an array of integer variables (or domain) each having only one value.

Definition at line 640 of file model.cc.

◆ IsVariable()

bool operations_research::fz::Argument::IsVariable ( ) const

Returns true if the argument is a variable.

Definition at line 614 of file model.cc.

◆ Size()

int operations_research::fz::Argument::Size ( ) const

Returns the number of object in the argument.

Definition at line 749 of file model.cc.

◆ Value()

int64_t operations_research::fz::Argument::Value ( ) const

Returns the value of the argument. Does DCHECK(HasOneValue()).

Definition at line 622 of file model.cc.

◆ ValueAt()

int64_t operations_research::fz::Argument::ValueAt ( int pos) const

Returns the value of the pos-th element.

Definition at line 695 of file model.cc.

◆ Var()

Variable * operations_research::fz::Argument::Var ( ) const

Returns the variable inside the argument if the type is VAR_REF, or nullptr otherwise.

Definition at line 741 of file model.cc.

◆ VarAt()

Variable * operations_research::fz::Argument::VarAt ( int pos) const

Returns the variable at position pos inside the argument if the type is VAR_REF_ARRAY or nullptr otherwise.

Definition at line 745 of file model.cc.

◆ VarRef()

Argument operations_research::fz::Argument::VarRef ( Variable * var)
static

Definition at line 526 of file model.cc.

◆ VarRefArray()

Argument operations_research::fz::Argument::VarRefArray ( std::vector< Variable * > vars)
static

Definition at line 533 of file model.cc.

◆ VoidArgument()

Argument operations_research::fz::Argument::VoidArgument ( )
static

Definition at line 540 of file model.cc.

Member Data Documentation

◆ domains

std::vector<Domain> operations_research::fz::Argument::domains

Definition at line 213 of file model.h.

◆ floats

std::vector<double> operations_research::fz::Argument::floats

Definition at line 214 of file model.h.

◆ type

Type operations_research::fz::Argument::type

Definition at line 210 of file model.h.

◆ values

std::vector<int64_t> operations_research::fz::Argument::values

Definition at line 211 of file model.h.

◆ variables

std::vector<Variable*> operations_research::fz::Argument::variables

Definition at line 212 of file model.h.


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