Line | |
---|
1 | function df = fmincon_fun(x,params) |
---|
2 | |
---|
3 | xevaled = zeros(1,length(params.interfacedata.c)); |
---|
4 | xevaled(params.linearindicies) = x; |
---|
5 | |
---|
6 | % Experimental support for arbitrary functions |
---|
7 | if ~isempty(params.interfacedata.evalMap) |
---|
8 | for i = 1:length(params.interfacedata.evalMap) |
---|
9 | xevaled(params.interfacedata.evalVariables(i)) = feval( params.interfacedata.evalMap{i}.fcn,xevaled(params.interfacedata.evalMap{i}.variableIndex)); |
---|
10 | end |
---|
11 | end |
---|
12 | |
---|
13 | if nnz(params.interfacedata.c(params.nonlinearindicies)) == 0 & isempty(params.interfacedata.evalMap) |
---|
14 | %At most quadratic! |
---|
15 | df = params.interfacedata.c(params.linearindicies) + 2*params.interfacedata.Q(params.linearindicies,params.linearindicies)*x; |
---|
16 | else |
---|
17 | error('not implmented') |
---|
18 | end |
---|
19 | |
---|
Note: See
TracBrowser
for help on using the repository browser.