cplex_options

cplex_options(overrides, mpopt)

cplex_options() - Sets options for CPLEX.

OPT = CPLEX_OPTIONS
OPT = CPLEX_OPTIONS(OVERRIDES)
OPT = CPLEX_OPTIONS(OVERRIDES, FNAME)
OPT = CPLEX_OPTIONS(OVERRIDES, MPOPT)

Sets the values for the options struct normally passed to
CPLEXOPTIMSET.

Inputs are all optional, second argument must be either a string
(FNAME) or a struct (MPOPT):

    OVERRIDES - struct containing values to override the defaults
    FNAME - name of user-supplied function called after default
        options are set to modify them. Calling syntax is:
                MODIFIED_OPT = FNAME(DEFAULT_OPT);
    MPOPT - MATPOWER options struct, uses the following fields:
        opf.violation    - used to set opt.simplex.tolerances.feasibility
        verbose          - used to set opt.barrier.display,
            opt.conflict.display, opt.mip.display, opt.sifting.display,
            opt.simplex.display, opt.tune.display
        cplex.lpmethod   - used to set opt.lpmethod
        cplex.qpmethod   - used to set opt.qpmethod
        cplex.opts       - struct containing values to use as OVERRIDES
        cplex.opt_fname  - name of user-supplied function used as FNAME,
            except with calling syntax:
                MODIFIED_OPT = FNAME(DEFAULT_OPT, MPOPT);
        cplex.opt        - numbered user option function, if and only if
            cplex.opt_fname is empty and cplex.opt is non-zero, the value
            of cplex.opt_fname is generated by appending cplex.opt to
            'cplex_user_options_' (for backward compatibility with old
            MATPOWER option CPLEX_OPT).

Output is an options struct to pass to CPLEXOPTIMSET.

There are multiple ways of providing values to override the default
options. Their precedence and order of application are as follows:

With inputs OVERRIDES and FNAME
    1. FNAME is called
    2. OVERRIDES are applied
With inputs OVERRIDES and MPOPT
    1. FNAME (from cplex.opt_fname or cplex.opt) is called
    2. cplex.opts (if not empty) are applied
    3. OVERRIDES are applied

Example:

If cplex.opt = 3, then after setting the default CPLEX options,
CPLEX_OPTIONS will execute the following user-defined function
to allow option overrides:

    opt = cplex_user_options_3(opt, mpopt);

The contents of cplex_user_options_3.m, could be something like:

    function opt = cplex_user_options_3(opt, mpopt)
    opt.threads          = 2;
    opt.simplex.refactor = 1;
    opt.timelimit        = 10000;

For details on the available options, see the "Parameters of CPLEX"
section of the CPLEX documentation at:

    http://www.ibm.com/support/knowledgecenter/SSSA5P

See also cplexlp, cplexqp, mpoption().