Test if a point is contained inside the union of convex sets.
[isin, inwhich, closest] = contains(U, x, fastbreak)
[isin, inwhich, closest] = U.contains(x)
[isin, inwhich, closest] = U.contains(x, fastbreak)
U |
Single union object that holds sets derived from the ConvexSet class.
If Uis an array, use U.forEach().
Class: Union |
x |
A point in the same dimension as all the sets in the union. Class: double |
fastbreak |
Do a quick stop in the consecutive search when x is contained in the first set it founds. Class: logical Allowed values:
Default: false |
isin |
True if ![]() Class: logical Allowed values:
|
inwhich |
Indices of sets that contain ![]() Class: double |
closest |
If the point is not contained inside the union, this output indicates the index of the set that is the closest to the point x.
Note: since this computation is expensive, do not ask for the third output unless you really need it.
Class: double |
x = sdpvar(2,1);
Y(1) = YSet(x,[randn(8,2)*x<=ones(8,1)]);
Y(2) = YSet(x,[randn(8,2)*x<=ones(8,1)]);Create an union of the sets
U = Union(Y);Check if the point
x = [1; 0];
[isin, inwhich, closest] = U.contains(x)
isin = 1 inwhich = 1 2 closest = []
◀ | hasfunction | add | ▶ |
© 2010-2013 Martin Herceg: ETH Zurich, herceg@control.ee.ethz.ch
© 2003-2013 Michal Kvasnica: STU Bratislava, michal.kvasnica@stuba.sk