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