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

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

Added original make3d

File size: 934 bytes
Line 
1function y = cone(Axplusb,cxplusd)
2%CONE Defines a second order cone constraint ||z||<x
3%
4% Input
5%    z       : column vector SDPVAR object.
6%    h       : scalar double or SDPVAR object
7%
8% Example
9%    F = set(cone(z,x))
10%
11% An alternative syntax with only one argument is also possible
12%    F = set(cone(z))
13% This command is equivalent to set(cone(z(2:end),z(1))
14%
15
16%
17% See also  SET, RCONE, @SDPVAR/NORM
18
19% Author Johan Löfberg
20% $Id: cone.m,v 1.1 2006/08/10 18:00:19 joloef Exp $
21
22[n,m] = size(Axplusb);
23if min(n,m)>1
24    error('z must be a  vector')
25end
26
27if nargin == 2
28    if prod(size(cxplusd))>1
29        error('x must be a scalar')
30    end
31else
32end
33
34if n<m
35    Axplusb = Axplusb';
36end
37
38try
39    if nargin == 2
40        y = [cxplusd;Axplusb];
41    else
42        y = [Axplusb];
43    end
44    if is(y,'linear')
45        y.typeflag = 4;
46    else
47        y = (Axplusb'*Axplusb < cxplusd*cxplusd);
48    end
49catch
50    error(lasterr)
51end
Note: See TracBrowser for help on using the repository browser.