0

Where can I find the implementation of barrier function in Matlab? I am trying to see how the algorithm interior-point is implemented, and this is what I found in the end of fmincon.m

elseif strcmpi(OUTPUT.algorithm,interiorPoint)
    defaultopt.MaxIter = 1000; defaultopt.MaxFunEvals = 3000; defaultopt.TolX = 1e-10;
    defaultopt.Hessian = 'bfgs';
    mEq = lin_eq + sizes.mNonlinEq + nnz(xIndices.fixed); % number of equalities
    % Interior-point-specific options. Default values for lbfgs memory is 10, and 
    % ldl pivot threshold is 0.01
    options = getIpOptions(options,sizes.nVar,mEq,flags.constr,defaultopt,10,0.01); 

    [X,FVAL,EXITFLAG,OUTPUT,LAMBDA,GRAD,HESSIAN] = barrier(funfcn,X,A,B,Aeq,Beq,l,u,confcn,options.HessFcn, ...
        initVals.f,initVals.g,initVals.ncineq,initVals.nceq,initVals.gnc,initVals.gnceq,HESSIAN, ...
        xIndices,options,optionFeedback,finDiffFlags,varargin{:});

So I want to see what's in barrier but failed.

edit barrier.m

I got: enter image description here

Hong
  • 151
  • 1
  • 2
  • 13

1 Answers1

1

The barrier function is defined in a p-file (precisely located in MATLABROOT/toolbox/optim/optim/barrier.p).

Unfortunately the point of p-files is exactly that they are obfuscated, i.e. you cannot read the source code. This is a recurent questio on SO, see this thread for instance.

I'm afraid you cannot read what's inside barrier. Maybe if you ask the Mathworks kindly they can give you some information on the content.

Best

Community
  • 1
  • 1
Ratbert
  • 5,463
  • 2
  • 18
  • 37
  • Thanks. But where can I find barrier? Thanks. – Hong Jun 16 '15 at 04:51
  • Not a problem at all. Thank you for your reply. Do you know where I could get some descriptions for barrier at least? I mainly want to see how the three algorithms are implemented. Is there any way I can do that? Thank you so much. – Hong Jun 16 '15 at 06:26
  • I am also having the same problem with `sqpLineSearch` for algorithm "sqp"..... : ( – Hong Jun 16 '15 at 06:37