4 #ifndef __2GEOM_SBASIS_CURVE_H
5 #define __2GEOM_SBASIS_CURVE_H
16 inline D2<SBasis> compose(D2<SBasis>
const & a, SBasis
const & b) {
17 return D2<SBasis>(compose(a[X], b), compose(a[Y], b));
20 SBasis L2(D2<SBasis>
const & a,
unsigned k);
21 double L2(D2<double>
const & a);
23 D2<SBasis> multiply(Linear
const & a, D2<SBasis>
const & b);
24 inline D2<SBasis> operator*(Linear
const & a, D2<SBasis>
const & b) {
return multiply(a, b); }
25 D2<SBasis> multiply(SBasis
const & a, D2<SBasis>
const & b);
26 inline D2<SBasis> operator*(SBasis
const & a, D2<SBasis>
const & b) {
return multiply(a, b); }
27 D2<SBasis> truncate(D2<SBasis>
const & a,
unsigned terms);
29 unsigned sbasis_size(D2<SBasis>
const & a);
30 double tail_error(D2<SBasis>
const & a,
unsigned tail);
34 Piecewise<D2<SBasis> > sectionize(D2<Piecewise<SBasis> >
const &a);
35 D2<Piecewise<SBasis> > make_cuts_independant(Piecewise<D2<SBasis> >
const &a);
36 Piecewise<D2<SBasis> > rot90(Piecewise<D2<SBasis> >
const &a);
37 Piecewise<SBasis> dot(Piecewise<D2<SBasis> >
const &a, Piecewise<D2<SBasis> >
const &b);
38 Piecewise<SBasis> cross(Piecewise<D2<SBasis> >
const &a, Piecewise<D2<SBasis> >
const &b);
40 Piecewise<D2<SBasis> > operator*(Piecewise<D2<SBasis> >
const &a, Matrix
const &m);
42 Piecewise<D2<SBasis> > force_continuity(Piecewise<D2<SBasis> >
const &f,
47 :
public std::iterator<std::input_iterator_tag, SBasis const>
50 CoordIterator(std::vector<D2<SBasis> >::const_iterator
const &iter,
unsigned d) : impl_(iter), ix_(d) {}
52 inline bool operator==(CoordIterator
const &other) {
return other.impl_ == impl_; }
53 inline bool operator!=(CoordIterator
const &other) {
return other.impl_ != impl_; }
55 inline SBasis operator*()
const {
59 inline CoordIterator &operator++() {
63 inline CoordIterator operator++(
int) {
64 CoordIterator old=*
this;
70 std::vector<D2<SBasis> >::const_iterator impl_;
74 inline CoordIterator iterateCoord(Piecewise<D2<SBasis> >
const &a,
unsigned d) {
75 return CoordIterator(a.segs.begin(), d);
79 inline Rect bounds_fast(D2<SBasis>
const & s,
unsigned order=0) {
80 return Rect(bounds_fast(s[X], order),
81 bounds_fast(s[Y], order));
83 inline Rect bounds_local(D2<SBasis>
const & s, Interval i,
unsigned order=0) {
84 return Rect(bounds_local(s[X], i, order),
85 bounds_local(s[Y], i, order));