Google OR-Tools v9.14
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
operations_research::sat::OpbReader Class Reference

Detailed Description

This class loads a file in pbo file format into a LinearBooleanProblem. The format is described here: http://www.cril.univ-artois.fr/PB24/format.pdf

Definition at line 45 of file opb_reader.h.

#include <opb_reader.h>

Public Member Functions

 OpbReader ()=default
 OpbReader (const OpbReader &)=delete
 This type is neither copyable nor movable.
OpbReaderoperator= (const OpbReader &)=delete
int num_variables () const
 Returns the number of variables in the problem.
bool model_is_supported () const
ABSL_MUST_USE_RESULT bool LoadAndValidate (const std::string &filename, CpModelProto *model)

Constructor & Destructor Documentation

◆ OpbReader() [1/2]

operations_research::sat::OpbReader::OpbReader ( )
default

◆ OpbReader() [2/2]

operations_research::sat::OpbReader::OpbReader ( const OpbReader & )
delete

This type is neither copyable nor movable.

Member Function Documentation

◆ LoadAndValidate()

ABSL_MUST_USE_RESULT bool operations_research::sat::OpbReader::LoadAndValidate ( const std::string & filename,
CpModelProto * model )
inline

Loads the given opb filename into the given problem. Returns true on success.

Read constraints line by line (1 constraint per line). We process into a temporary structure to support non linear constraints and weighted constraints.

Check if the model is supported. It is not supported if one constant contains an integer that does not fit in an int64_t.

Definition at line 61 of file opb_reader.h.

◆ model_is_supported()

bool operations_research::sat::OpbReader::model_is_supported ( ) const
inline

Returns true if the model is supported. A model is not supported if it contains an integer that does not fit in int64_t.

Definition at line 57 of file opb_reader.h.

◆ num_variables()

int operations_research::sat::OpbReader::num_variables ( ) const
inline

Returns the number of variables in the problem.

Definition at line 53 of file opb_reader.h.

◆ operator=()

OpbReader & operations_research::sat::OpbReader::operator= ( const OpbReader & )
delete

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