87 double d = (double)direction;
90 std::set<double> brakepoints;
91 for(
auto i =
I.begin();i!=
I.end(); i++)
93 brakepoints.emplace(i->x0);
94 brakepoints.emplace(i->x1);
95 for(
auto j=i;j!=
I.end(); j++)
101 j->x0, j->y0, j->x1, j->y1,
106 brakepoints.emplace(i->x0 + (i->x1-i->x0) * i_intersect);
112 std::vector<std::pair<double,double>> points;
113 for(
auto b = brakepoints.begin();b!=brakepoints.end();b++)
121 for(
auto i=
I.begin();i!=
I.end();i++)
123 if(i->x0<=xl && i->x1>=xl)
125 double yi = (*i)(xl);
126 if(!lfound || d*yi>d*yl)
132 if(i->x0<=xu && i->x1>=xu)
134 double yi = (*i)(xu);
135 if(!ufound || d*yi>d*yu)
142 if(lfound)points.push_back(std::make_pair(xl,yl));
143 if(ufound)points.push_back(std::make_pair(xu,yu));
146 fun->
getData().set_size(2,points.size());
147 for(
unsigned int i=0;i<points.size();i++)
149 fun->
getData()(0,i) = points[i].first;
150 fun->
getData()(1,i) = points[i].second;
adoreMatrix< T, n+1, 0 > & getData()
Definition: llinearpiecewisefunction.h:147
Definition: linearconstraintset.h:30
void clear()
Definition: linearconstraintset.h:76
std::vector< Line > I
Definition: linearconstraintset.h:47
Direction
Definition: linearconstraintset.h:50
@ LOWER
Definition: linearconstraintset.h:51
@ UPPER
Definition: linearconstraintset.h:52
void bound(function_type_scalar *fun, Direction direction)
Definition: linearconstraintset.h:85
bool hasConstraints() const
utility function, returns if the set contain any constraints
Definition: linearconstraintset.h:61
std::vector< Line > getPossiblyIntersectingSet() const
Definition: linearconstraintset.h:157
void insert(double x0, double y0, double x1, double y1)
Definition: linearconstraintset.h:69
const double eps
Definition: cubic_piecewise_function.cpp:16
bool intersectLines2(T a, T b, T c, T d, T e, T f, T g, T h, T &x0, T &x1, T eps)
Definition: adoremath.h:546
x0
Definition: adore_set_goal.py:25
x
Definition: adore_set_goal.py:30
y0
Definition: adore_set_goal.py:26
y1
Definition: adore_set_pose.py:29
x1
Definition: adore_set_pose.py:28
Definition: areaofeffectconverter.h:20
Definition: linearconstraintset.h:33
double operator()(double x)
Definition: linearconstraintset.h:42
double y0
Definition: linearconstraintset.h:35
double x1
Definition: linearconstraintset.h:35
double y1
Definition: linearconstraintset.h:35
double x0
Definition: linearconstraintset.h:34
bool operator<(const Line &rhs) const
Definition: linearconstraintset.h:37
Line(double x0, double y0, double x1, double y1)
Definition: linearconstraintset.h:36