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

#include <status.h>

Public Types

enum  ErrorCode {
  GLOP_OK = 0 , ERROR_LU = 1 , ERROR_BOUND = 2 , ERROR_NULL = 3 ,
  ERROR_INVALID_PROBLEM = 4
}
 Possible kinds of errors. More...
 

Public Member Functions

 Status ()
 Creates a "successful" status.
 
 Status (ErrorCode error_code, std::string error_message)
 
ErrorCode error_code () const
 Accessors.
 
const std::string & error_message () const
 
bool ok () const
 

Static Public Member Functions

static Status OK ()
 Improves readability but identical to 0-arg constructor.
 

Detailed Description

Return type for the solver functions that return "Did that work?". It should only be used for unrecoverable errors.

Definition at line 26 of file status.h.

Member Enumeration Documentation

◆ ErrorCode

Possible kinds of errors.

Enumerator
GLOP_OK 

Not an error. Returned on success.

ERROR_LU 

The LU factorization of the current basis couldn't be computed.

ERROR_BOUND 

The current variable values are out of their bound modulo the tolerance.

ERROR_NULL 

A pointer argument was NULL when it shouldn't be.

ERROR_INVALID_PROBLEM 

The linear program is invalid or it does not have the required format.

Definition at line 29 of file status.h.

Constructor & Destructor Documentation

◆ Status() [1/2]

operations_research::glop::Status::Status ( )

Creates a "successful" status.

Definition at line 24 of file status.cc.

◆ Status() [2/2]

operations_research::glop::Status::Status ( ErrorCode error_code,
std::string error_message )

Creates a status with the specified error code and error message. If "code == 0", error_message is ignored and a Status object identical to Status::OK is constructed.

Definition at line 26 of file status.cc.

Member Function Documentation

◆ error_code()

ErrorCode operations_research::glop::Status::error_code ( ) const
inline

Accessors.

Definition at line 58 of file status.h.

◆ error_message()

const std::string & operations_research::glop::Status::error_message ( ) const
inline

Definition at line 59 of file status.h.

◆ OK()

static Status operations_research::glop::Status::OK ( )
inlinestatic

Improves readability but identical to 0-arg constructor.

Definition at line 55 of file status.h.

◆ ok()

bool operations_research::glop::Status::ok ( ) const
inline

Definition at line 60 of file status.h.


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