Movatterモバイル変換


[0]ホーム

URL:


ContentsMenuExpandLight modeDark modeAuto light/dark mode
Gurobi Optimizer Reference Manual
Light LogoDark Logo

Concepts

Features

Reference

Gurobi
Back to top

GRBException#

classGRBException:publicstd::runtime_error#

Gurobi exception object. Exceptions can be thrown by nearly every methodin the Gurobi C++ API.GRBException inherits fromstd::runtime_errorwhich allows you to catch Gurobi exceptions not only via:

catch(constGRBException&e){cout<<e.getMessage()<<endl;}

but also as standard C++ exceptions, such as:

catch(conststd::runtime_error&e){cout<<e.what()<<endl;}

or:

catch(conststd::exception&e){cout<<e.what()<<endl;}
GRBExceptionGRBException(interrcode=0)#

Exception constructor that creates a Gurobi exception with the given errorcode.

Parameters:

errcode – (optional) Error code for exception.

Returns:

An exception object.

GRBExceptionGRBException(stringerrmsg,interrcode=0)#

Exception constructor that creates a Gurobi exception with the givenmessage string and error code.

Parameters:
  • errmsg – Error message for exception.

  • errcode – (optional) Error code for exception.

Returns:

An exception object.

intgetErrorCode()#

Retrieve the error code associated with a Gurobi exception.

Returns:

The error code associated with the exception.

conststringgetMessage()#

Retrieve the error message associated with a Gurobi exception.

Returns:

The error message associated with the exception.

Help and Feedback

On this page

[8]ページ先頭

©2009-2025 Movatter.jp