Initialize the CPLEX environment

Tells how to initialize the environment in the C API.

To initialize a CPLEX environment, you must use the routine CPXopenCPLEX.

This routine returns a C pointer to the CPLEX environment that it creates. Your application then passes this C pointer to other CPLEX routines (except CPXXmsgstr and CPXmsgstr). As a developer, you decide for yourself whether the variable containing this pointer should be global or local in your application. This routine is time consuming, so you should call the CPXopenCPLEX routine only once, or as infrequently as possible, in a program that solves a sequence of problems.

CPLEX allows more than one environment to exist at a time. Multithreaded applications where more than one thread is using CPLEX is a typical scenario where multiple environments are used (to ensure thread-safety).

Note:

An attempt to use a problem object in any environment other than the environment where the problem object was created will raise an error.