baronRead
Read a BARON model from a .bar file into MATLAB
Syntax
[fun,lb,ub] = baronRead(filename)
[fun,lb,ub,nlcon,cl,cu] = baronRead(filename)
[fun,lb,ub,nlcon,cl,cu,xtype] = baronRead(filename)
[fun,...,xtype,x0] = baronRead(filename)
[fun,...,x0,opts] = baronRead(filename)
[fun,...,opts,maps] = baronRead(filename)
baronRead(filename,writeM)
baronRead(filename,writeM,dispBar)
Description
This function was designed primarily to read BARON .bar models generated by GAMS. The function allows for very limited syntax in the .bar file in comparison to what BARON's own parser allows. As a result, this function does not accept the full BARON syntax and will not be able to read every possible .bar file (but hopefully most). The function is offered only as a courtesy to users of the BARON/MATLAB interface.
[fun,lb,ub] = baronRead(filename) reads a BARON .bar model into MATLAB. filename is the name of a BARON .bar file on the MATLAB path or an absolute path to the .bar file. If the extension '.bar' is not used, it will be automatically appended. Returned will be an anonymous function fun with the objective, and the decision variable bounds lb and ub.
[fun,lb,ub,nlcon,cl,cu] = baronRead(filename) also returns a vector anonymous function of the constraints (both nonlinear and linear), together with the lower and upper constraint bounds.
[fun,lb,ub,nlcon,cl,cu,xtype] = baronRead(filename) also returns a character string of the integrality of the decision variables. 'C' is continuous, 'I' is integer and 'B' is binary.
[fun,...,xtype,x0] = baronRead(filename) also returns the starting point of the model.
[fun,...,x0,opts] = baronRead(filename) also returns an options structure with four fields; opts.probname with the filename, opts.sense with the objective sense, opts.eqtype for the equation types, and opts.brvarpr for the branching variable priorities.
[fun,...,opts,maps) = baronRead(filename) returns a structure with two fields; vars and eqs. Both are containers.Map objects which contain the original model variable and equation names, respectively, and their index in MATLAB assigned by the interface.
baronRead(filename,writeM) will write a MATLAB MAT file of the model read when writeM = 1, or a MATLAB M file if writeM = 2. If the model was called ex1.bar, it will be saved as ex1.mat (or .m) in the current directory.
baronRead(filename,writeM,dispBar) will create a progress bar so the user can track the reading of large files. The default is dispbar = 0.