Lines Matching defs:segs
76 std::vector<T> segs;
77 //segs[i] stretches from cuts[i] to cuts[i+1].
97 inline void reserve(unsigned i) { segs.reserve(i); cuts.reserve(i + 1); }
99 inline T const& operator[](unsigned i) const { return segs[i]; }
100 inline T& operator[](unsigned i) { return segs[i]; }
104 return segs[n](segT(t, n));
118 std::vector<output_type> ret, val = segs[n].valueAndDerivatives(segT(t, n), n_derivs);
131 inline unsigned size() const { return segs.size(); }
132 inline bool empty() const { return segs.empty(); }
134 segs.clear();
142 assert(cuts.size() - segs.size() == 1);
148 assert(cuts.size() - segs.size() == 1);
159 inline void push_seg(const T &s) { segs.push_back(s); }
161 inline void push_seg(T &&s) { segs.emplace_back(s); }
211 cuts.clear(); segs.clear();
226 cuts.clear(); segs.clear();
243 cuts = other.cuts; segs = other.segs;
247 segs.insert(segs.end(), other.segs.begin(), other.segs.end());
259 if(empty()) { segs = other.segs; cuts = other.cuts; return; }
261 typename T::output_type y = segs.back().at1() - other.segs.front().at0();
270 // segs between cuts
271 if(!(segs.size() + 1 == cuts.size() || (segs.empty() && cuts.empty())))
274 for(unsigned i = 0; i < segs.size(); i++)
390 //Should have the cuts = segs + 1 invariant
393 ret.segs.insert(ret.segs.end(), pw.segs.begin() + si, pw.segs.end());
452 ret.segs.insert(ret.segs.end(), pw.segs.begin() + i, pw.segs.begin() + fi); //copy segs
530 ret.segs.reserve(a.size());
541 ret.segs.reserve(a.size());
579 ret.segs.reserve(a.size());
597 ret.segs.reserve(a.size());
615 ret.segs.reserve(a.size());
634 ret.segs.reserve(a.size());
672 ret.segs.reserve(pa.size());
690 ret.segs.reserve(pa.size());
721 ret.segs.reserve(pa.size());
772 return (Piecewise<T>) compose(f.segs[0],compose(Linear(-t0 / width, (1-t0) / width), g));
780 return (Piecewise<T>) compose(f.segs[idx],compose(Linear(-t0 / width, (1-t0) / width), g));
822 for(unsigned i = 0; i < g.segs.size(); i++){
823 Piecewise<T> fgi=compose(f, g.segs[i]);
864 result.segs.resize(a.segs.size());
866 typename T::output_type c = a.segs[0].at0();
867 for(unsigned i = 0; i < a.segs.size(); i++){
868 result.segs[i] = integral(a.segs[i])*(a.cuts[i+1]-a.cuts[i]);
869 result.segs[i]+= c-result.segs[i].at0();
870 c = result.segs[i].at1();
883 result.segs.resize(a.segs.size());
885 for(unsigned i = 0; i < a.segs.size(); i++){
886 result.segs[i] = derivative(a.segs[i])/(a.cuts[i+1]-a.cuts[i]);
918 for (unsigned i = 0; i < f.segs.size(); i++)
919 ret.push_seg(reverse(f[f.segs.size() - i - 1]));