简体   繁体   English

Matlab中的屏障函数

[英]Barrier Function in Matlab

Where can I find the implementation of barrier function in Matlab? 在哪里可以找到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 我试图查看如何实现算法的interior-point ,这就是我在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: 我有: 在此处输入图片说明

The barrier function is defined in a p-file (precisely located in MATLABROOT/toolbox/optim/optim/barrier.p ). 屏障函数在p文件中定义(精确位于MATLABROOT/toolbox/optim/optim/barrier.p )。

Unfortunately the point of p-files is exactly that they are obfuscated, ie you cannot read the source code. 不幸的是,p文件的要点恰恰是它们被混淆了, 您无法阅读源代码。 This is a recurent questio on SO, see this thread for instance. 这是关于SO的递归问题,例如参见此线程

I'm afraid you cannot read what's inside barrier . 恐怕你看不懂barrier里面的东西。 Maybe if you ask the Mathworks kindly they can give you some information on the content. 也许如果您对Mathworks提出友好的要求,他们可以为您提供一些有关内容的信息。

Best 最好

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM