Lodestar
An integrated real-time control package in C++
|
|
5 #ifndef LODESTAR_SETUNION_HPP
6 #define LODESTAR_SETUNION_HPP
8 #include "SetExpression.hpp"
13 namespace primitives {
27 template<
typename TTypeLeft,
typename TTypeRight>
50 SetUnion(
const TTypeLeft &left,
const TTypeRight &right,
bool empty =
false) : left_(left),
57 this->sEnum_ = SetEnum::Union;
79 template<
typename TElementType>
82 return left_.contains(el) ||
right_.contains(el);
94 template<
typename TOtherExpr>
110 template<
typename Derived>
111 double sdf(Eigen::MatrixBase<Derived> &p)
const
114 return std::numeric_limits<double>::infinity();
116 return std::min(left_.sdf(p),
right_.sdf(p));
140 const TTypeLeft &left_;
148 #endif //LODESTAR_SETUNION_HPP
const TTypeRight & getRight() const
Gets the right expression.
Definition: SetUnion.hpp:134
bool isEmpty() const
Returns true if the expression is the empty set.
Definition: SetUnion.hpp:65
Definition: SetExpression.hpp:15
const TTypeRight & right_
Left constant reference.
Definition: SetUnion.hpp:141
Main Lodestar code.
Definition: BilinearTransformation.hpp:12
SetUnion< type, TOtherExpr > unionize(const SetExpression< TOtherExpr > &expr)
Creates a union between this expression and another SetExpression.
Definition: SetUnion.hpp:95
TTypeLeft ltype
Base class.
Definition: SetUnion.hpp:32
double sdf(Eigen::MatrixBase< Derived > &p) const
Returns signed distance to p.
Definition: SetUnion.hpp:111
Union of two SetExpressions.
Definition: SetUnion.hpp:28
const TTypeLeft & getLeft() const
Gets the left expression.
Definition: SetUnion.hpp:124
SetUnion(const TTypeLeft &left, const TTypeRight &right, bool empty=false)
Expression type.
Definition: SetUnion.hpp:50
TTypeRight rtype
Left type.
Definition: SetUnion.hpp:33
bool empty_
Right constant reference.
Definition: SetUnion.hpp:142
bool contains(const TElementType &el) const
Returns true if this expression contains el.
Definition: SetUnion.hpp:80