12.07.2015 Views

ILOG CPLEX 11.0 User's Manual

ILOG CPLEX 11.0 User's Manual

ILOG CPLEX 11.0 User's Manual

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

This routine checks for a valid <strong>ILOG</strong> <strong>CPLEX</strong> license and then returns a C pointer to the<strong>ILOG</strong> <strong>CPLEX</strong> environment that is creates. Your application then passes this C pointer toother <strong>ILOG</strong> <strong>CPLEX</strong> routines (except CPXmsg). As a developer, you decide for yourselfwhether the variable containing this pointer should be global or local in your application.Because the operation of checking the license can be relatively time consuming, it isstrongly recommended that you call the CPXopen<strong>CPLEX</strong> routine only once, or asinfrequently as possible, in a program that solves a sequence of problems.A multithreaded application needs multiple <strong>ILOG</strong> <strong>CPLEX</strong> environments. Consequently,<strong>ILOG</strong> <strong>CPLEX</strong> allows more than one environment to exist at a time.Note: An attempt to use a problem object in any environment other than the environment(or a child of that environment) where the problem object was created will raise an error.Instantiate the Problem ObjectOnce you have initialized a <strong>ILOG</strong> <strong>CPLEX</strong> environment, your next step is to instantiate (thatis, create and initialize) a problem object by calling CPXcreateprob. This routine returns aC pointer to the problem object. Your application then passes this pointer to other routines ofthe Callable Library.Most applications will use only one problem object, though <strong>ILOG</strong> <strong>CPLEX</strong> allows you tocreate multiple problem objects within a given <strong>ILOG</strong> <strong>CPLEX</strong> environment.Put Data in the Problem ObjectWhen you instantiate a problem object, it is originally empty. In other words, it has noconstraints, no variables, and no coefficient matrix. <strong>ILOG</strong> <strong>CPLEX</strong> offers you severalalternative ways to put data into an empty problem object (that is, to populate your problemobject).◆You can make a sequence of calls, in any convenient order, to these routines:●●●●●●●●●CPXaddcolsCPXaddqconstrCPXaddrowsCPXchgcoeflistCPXcopyctypeCPXcopyqsepCPXcopyquadCPXnewcolsCPXnewrows112 <strong>ILOG</strong> <strong>CPLEX</strong> <strong>11.0</strong> — USER’ S MANUAL

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!