source: proiecte/pmake3d/make3d_original/Make3dSingleImageStanford_version0.1/third_party/opt/yalmip/modules/global/evaluate_nonlinear.m @ 37

Last change on this file since 37 was 37, checked in by (none), 14 years ago

Added original make3d

File size: 805 bytes
Line 
1function x = evaluate_nonlinear(p,x)
2
3if ~isempty(p.bilinears)
4    x(p.bilinears(:,1)) = x(p.bilinears(:,2)).*x(p.bilinears(:,3));
5
6    badones = find(sum(p.monomtable(p.bilinears(:,1),:),2)>2);
7    if ~isempty(badones)
8        redo = p.bilinears(badones,1);
9        for i = 1:length(redo)
10            these =  find(p.monomtable(redo(i),:));
11            x(redo(i)) = prod(x(these).^((p.monomtable(redo(i),these))'));
12        end
13    end
14else
15    x = x(1:length(p.c));
16    nonlinear = find(p.variabletype);
17    x(nonlinear) = prod(repmat(x(:)',length(nonlinear),1).^p.monomtable(nonlinear,:),2);
18end
19
20for i = 1:length(p.evalMap)
21    arguments = {p.evalMap{i}.fcn,x(p.evalMap{i}.variableIndex)};
22    arguments = {arguments{:},p.evalMap{i}.arg{2:end-1}};
23    x(p.evalVariables(i)) = feval(arguments{:});
24end
Note: See TracBrowser for help on using the repository browser.