hpp-spline
4.10.0
template based classes for creating and manipulating spline and bezier curves. Comes with extra options specific to end-effector trajectories in robotics.
|
Go to the documentation of this file.
9 #ifndef _CLASS_BERNSTEIN
10 #define _CLASS_BERNSTEIN
24 inline unsigned int fact(
const unsigned int n) {
26 for (
unsigned int i = 2; i <= n; ++i) res *= i;
33 inline unsigned int bin(
const unsigned int n,
const unsigned int k) {
return fact(n) / (
fact(k) *
fact(n - k)); }
38 template <
typename Numeric =
double>
45 assert(u >= 0. && u <= 1.);
57 template <
typename Numeric>
59 std::vector<Bern<Numeric> > res;
60 for (
unsigned int i = 0; i <= n; ++i) res.push_back(
Bern<Numeric>(n, i));
64 #endif //_CLASS_BERNSTEIN
Numeric i_
Definition: bernstein.h:50
~Bern()
Definition: bernstein.h:42
Numeric bin_m_i_
Definition: bernstein.h:51
std::vector< Bern< Numeric > > makeBernstein(const unsigned int n)
Computes all Bernstein polynomes for a certain degree.
Definition: bernstein.h:58
double Numeric
Definition: effector_spline.h:26
Numeric operator()(const Numeric u) const
Definition: bernstein.h:44
Definition: bernstein.h:39
interface for a Curve of arbitrary dimension.
unsigned int bin(const unsigned int n, const unsigned int k)
Computes a binomal coefficient.
Definition: bernstein.h:33
Bern(const unsigned int m, const unsigned int i)
Definition: bernstein.h:40
unsigned int fact(const unsigned int n)
Computes factorial of a number.
Definition: bernstein.h:24
Numeric m_minus_i
Definition: bernstein.h:49
Definition: bernstein.h:20