Sets (with project method)¶
AbstractSet¶
Box¶
- class disropt.constraints.projection_sets.Box(lower_bound=None, upper_bound=None)[source]¶
Bases:
disropt.constraints.projection_sets.AbstractSet
Box set
\(X = \{x\mid l\leq x \leq u\}\) with \(l,x,u\in \mathbb{R}^{n}\)
- Parameters
lower_bound (numpy.ndarray, optional) – array with lower bounds for each axis. Defaults to None.
upper_bound (numpy.ndarray, optional) – array with upper bounds for each axis. Defaults to None.
- lower_bound¶
lower bounds
- Type
- upper_bound¶
upper bounds
- Type
- intersection(box)[source]¶
Compute the intersection with another box
- Parameters
box (Box) – box to compute the intersection with
- Raises
ValueError – Only intersection with another box is supported
ValueError – The two boxex must have the same input_shape
- projection(x)[source]¶
Project a point onto the box
- Parameters
x (numpy.ndarray) – Point to be projected
- Returns
projected point
- Return type
Strip¶
- class disropt.constraints.projection_sets.Strip(regressor, shift, width)[source]¶
Bases:
disropt.constraints.projection_sets.AbstractSet
Strip set
\(X = \{x\mid -w<=|a^\top x - s|<=w\}\) with \(a,x\in \mathbb{R}^{n}\) and \(w\in\mathbb{R}\)
- Parameters
regressor (numpy.ndarray) – regressor of the strip
shift (float) – shift from the origin
width (float) – width of the strip
- regressor¶
regressor of the strip
- Type
- intersection(strip)[source]¶
Compute the intersection with another strip
- Parameters
strip (Strip) – strip to compute the intersection with
- Raises
ValueError – Only intersection with another strip is supported
ValueError – The two strips must have the same regressor
- projection(x)[source]¶
Project a point onto the strip
- Parameters
x (numpy.ndarray) – Point to be projected
- Returns
projected point
- Return type
Circle¶
- class disropt.constraints.projection_sets.Circle(center, radius)[source]¶
Bases:
disropt.constraints.projection_sets.AbstractSet
Circle set
\(X = \{x\mid \|x - c\|<= r\}\) with \(x,c\in \mathbb{R}^{n}\) and \(r\in\mathbb{R}\)
- Parameters
center (numpy.ndarray) – center of the circle
radius (float) – radius of the circle
- center¶
center of the circle
- Type
- intersection(circle)[source]¶
Compute the intersection with another circle
- Parameters
circle (Circle) – circle to compute the intersection with
- Raises
ValueError – Only intersection with another circle is supported
ValueError – The two circles must have the same center
- projection(x)[source]¶
Project a point onto the circle
- Parameters
x (numpy.ndarray) – Point to be projected
- Returns
projected point
- Return type
CircularSector¶
- class disropt.constraints.projection_sets.CircularSector(vertex, angle, radius, width)[source]¶
Bases:
disropt.constraints.projection_sets.AbstractSet
Circular sector set.
- Parameters
vertex (numpy.ndarray) – vertex of the circular sector
angle (float) – direction of the circular sector (in rad)
radius (float) – radius of the circular sector
width (float) – width of the circular sector (in rad)
- vertex¶
vertex of the circular sector
- Type
- intersection(circular_sector)[source]¶
Compute the intersection with another circular sector
- Parameters
circular_sector (CircularSector) – circula sector to compute the intersection with
- Raises
ValueError – Only intersection with another circular_sector is supported
ValueError – The two circular_sector must have the same vertex
- projection(x)[source]¶
Project a point onto the ciruclar sector
- Parameters
x (numpy.ndarray) – Point to be projected
- Returns
projected point
- Return type