Compute the projection of the point onto this set.
s = S.project(x)
s = project(S, x)
S |
A convex set described as YSet object. Class: YSet |
x |
A point given as vector. Note that for YSet with symmetric matrix variable,
the point x must be given as vector with symmetric terms. Class: double |
s |
The output structure with the information about the projected point and the exit status from the optimization. Class: struct |
s.exitflag |
Exit status from the optimization, i.e. an integer value that informs
if the result was feasible (1), or otherwise (different from 1). Class: double |
s.how |
A string that informs if the result was feasible ('ok'), or if any problem appeared through optimization. Class: char |
s.x |
Projected point that lies inside the set S. Class: double |
s.dist |
The distance between the projected point and the given point x.
Class: double |
x = sdpvar(2,1);
F = [x'*x-2*x<=1];
S = YSet(x,F);Compute the projection of the point v=[-0.5; 1.5].
v = [-0.5; 1.5];
s = S.project(v);The computed extreme point is lying the edge of the set and it is obviously the point [0;1] We can plot the set and the points s.x, v.
S.plot; hold on; text(s.x(1),s.x(2),'\bf x'); axis([-1 1.5 -0.5 2]); text(v(1),v(2),'\bf x');
Plotting... 26 of 40
norm(s.x-v)
ans = 0.707106781189978which equals the computed distance
s.dist
ans = 0.707106781189978
◀ | yset | shoot | ▶ |
© 2010-2013 Colin Neil Jones: EPF Lausanne, colin.jones@epfl.ch
© 2010-2013 Martin Herceg: ETH Zurich, herceg@control.ee.ethz.ch