38 template<
typename T,
int N>
39 LLinearPiecewiseFunctionM<T, N>*
sample_adaptive(
ALFunction<T, adoreMatrix<T, N, 1>>* f,
ALFunction<T, adoreMatrix<T, N, 1>>* df, T edes, T emax, T xmin, T xmax, T xstep, T precision=(T)0.0001)
43 std::vector<adoreMatrix<T, N + 1, 1>> buffer;
44 adoreMatrix<T, N + 1, 1> element;
46 adoreMatrix<T, N, 1>
y0,
y1, dymin, dymax, ymin, ymax;
47 if(f->limitHi()-f->limitLo()>precision)
49 x0 =(
std::min)(f->limitLo()+precision,f->limitHi());
54 set_rowm(element, dlib::range(1, N)) =
y0;
55 buffer.push_back(element);
62 xstep = (xstep + edes / dedx) / (T)2;
69 df->bound(
x0,
x1, dymin, dymax);
77 }
while (e > emax && xstep > xmin);
81 set_rowm(element, dlib::range(1, N)) =
y0;
82 buffer.push_back(element);
83 if (
x0 >= f->limitHi()-precision*(T)2)
break;
87 result->
getData().set_size(N + 1, buffer.size());
89 for (
auto it = buffer.begin(); it != buffer.end(); it++)
91 set_colm(result->
getData(), i++) = *it;
Definition: alfunction.h:74
Definition: llinearpiecewisefunction.h:139
adoreMatrix< T, n+1, 0 > & getData()
Definition: llinearpiecewisefunction.h:147
LLinearPiecewiseFunctionM< T, N > * sample_adaptive(ALFunction< T, adoreMatrix< T, N, 1 >> *f, ALFunction< T, adoreMatrix< T, N, 1 >> *df, T edes, T emax, T xmin, T xmax, T xstep, T precision=(T) 0.0001)
Definition: adaptivesampling.h:39
T min(T a, T b, T c, T d)
Definition: adoremath.h:663
adoreMatrix< T, N, M > max(adoreMatrix< T, N, M > a, const adoreMatrix< T, N, M > &b)
Definition: adoremath.h:686
x0
Definition: adore_set_goal.py:25
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