source: proiecte/pmake3d/make3d_original/Make3dSingleImageStanford_version0.1/third_party/opt/yalmip/extras/linearize.m @ 37

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

Added original make3d

File size: 700 bytes
Line 
1function plin = linearize(p)
2% LINEARIZE Linearize SDPVAR object
3%
4% h = LINEARIZE(p)
5%
6% Returns linearization p(double(x)) + dp(double(x))*(x-double(x))
7% where x is the SDPVAR variables defining the polynomial p(x)
8%
9% See also SDPVAR, JACOBIAN
10
11% Author Johan Löfberg
12% $Id: linearize.m,v 1.2 2004/07/02 08:17:31 johanl Exp $
13
14if isa(p,'double')
15    plin = zeros(size(p));
16    return
17end
18
19if is(p,'linear')
20    plin = p;
21    return
22end
23
24x = recover(depends(p));
25x0 = double(x);
26p0 = double(p);
27
28n = size(p,1);
29m = size(p,2);
30
31if min(n,m)>1
32    plin = [];
33    for i = 1:m
34        plin = [plin p0(:,i)+double(jacobian(p(:,i),x))*(x-x0)];
35    end
36else
37    plin = p0+double(jacobian(p,x))*(x-x0);
38end
Note: See TracBrowser for help on using the repository browser.