Code covered by the BSD License  

Highlights from
OpenOpt

image thumbnail

OpenOpt

by

 

25 Nov 2006 (Updated )

nonSmoothSolve (similar to fsolve), non-smooth & noisy local + some global solvers; works in Octave

lin2nonlinDH(x, prob, h)
function dh = lin2nonlinDH(x, prob, h)

if nargin<3
    h = prob.h(x, prob);
end

%todo: enhance me!
% dh = prob.lin2nonlin.dh(x, prob, h);
dh = prob.lin2nonlin.dh(x, prob);
if size(dh,2) < length(h)%analitical dh
    Aeq = prob.lin2nonlin.Aeq;
%     beq = prob.lin2nonlin.beq;
%     s = Aeq * x - beq;
%     ind = find(s<0);
%     Aeq(ind,:) = -Aeq(ind,:);
    switch prob.env
        case 'matlab'
            dh(:,end+1:end+length(prob.lin2nonlin.beq)) = Aeq.';
        case 'octave'
            dh = sparse([dh Aeq.']);
        otherwise
            prob.err('unknown environment')
    end
end

Contact us