Lines Matching refs:c_
54 * @param c_ Pointer to coefficients
57 inline T bernstein_value_at(double t, T const *c_, unsigned n) {
61 T tmp = c_[0]*u;
65 tmp = (tmp + tn*bc*c_[i])*u;
67 return (tmp + tn*t*c_[n]);
130 std::valarray<Coord> c_;
143 : c_(c, ord+1)
147 unsigned order() const { return c_.size()-1;}
149 unsigned size() const { return c_.size();}
152 Bezier(const Bezier& b) :c_(b.c_) {}
154 if ( c_.size() != other.c_.size() ) {
155 c_.resize(other.c_.size());
157 c_ = other.c_;
169 Bezier(Order ord) : c_(0., ord.order+1) {
175 explicit Bezier(Coord c0) : c_(0., 1) {
176 c_[0] = c0;
178 Bezier(Coord c0, Coord c1) : c_(0., 2) {
179 c_[0] = c0; c_[1] = c1;
181 Bezier(Coord c0, Coord c1, Coord c2) : c_(0., 3) {
182 c_[0] = c0; c_[1] = c1; c_[2] = c2;
184 Bezier(Coord c0, Coord c1, Coord c2, Coord c3) : c_(0., 4) {
185 c_[0] = c0; c_[1] = c1; c_[2] = c2; c_[3] = c3;
187 Bezier(Coord c0, Coord c1, Coord c2, Coord c3, Coord c4) : c_(0., 5) {
188 c_[0] = c0; c_[1] = c1; c_[2] = c2; c_[3] = c3; c_[4] = c4;
191 Coord c5) : c_(0., 6) {
192 c_[0] = c0; c_[1] = c1; c_[2] = c2; c_[3] = c3; c_[4] = c4;
193 c_[5] = c5;
196 Coord c5, Coord c6) : c_(0., 7) {
197 c_[0] = c0; c_[1] = c1; c_[2] = c2; c_[3] = c3; c_[4] = c4;
198 c_[5] = c5; c_[6] = c6;
201 Coord c5, Coord c6, Coord c7) : c_(0., 8) {
202 c_[0] = c0; c_[1] = c1; c_[2] = c2; c_[3] = c3; c_[4] = c4;
203 c_[5] = c5; c_[6] = c6; c_[7] = c7;
206 Coord c5, Coord c6, Coord c7, Coord c8) : c_(0., 9) {
207 c_[0] = c0; c_[1] = c1; c_[2] = c2; c_[3] = c3; c_[4] = c4;
208 c_[5] = c5; c_[6] = c6; c_[7] = c7; c_[8] = c8;
211 Coord c5, Coord c6, Coord c7, Coord c8, Coord c9) : c_(0., 10) {
212 c_[0] = c0; c_[1] = c1; c_[2] = c2; c_[3] = c3; c_[4] = c4;
213 c_[5] = c5; c_[6] = c6; c_[7] = c7; c_[8] = c8; c_[9] = c9;
218 c_.resize(std::distance(first, last));
220 c_[i] = *first;
224 : c_(&vec[0], vec.size())
229 c_.resize (n, v);
232 c_.resize(0);
239 if( ! are_near(c_[i], 0., eps) ) return false;
245 if( ! are_near(c_[i], c_[0], eps) ) return false;
251 if(!IS_FINITE(c_[i])) return false;
255 Coord at0() const { return c_[0]; }
256 Coord &at0() { return c_[0]; }
257 Coord at1() const { return c_[order()]; }
258 Coord &at1() { return c_[order()]; }
261 return bernstein_value_at(t, &c_[0], order());
267 Coord &operator[](unsigned ix) { return c_[ix]; }
268 Coord const &operator[](unsigned ix) const { return const_cast<std::valarray<Coord>&>(c_)[ix]; }
270 void setCoeff(unsigned ix, double val) { c_[ix] = val; }
289 c_ += v;
293 c_ -= v;
297 c_ *= v;
301 c_ /= v;