static inline void add_to_hull(point_type const& p, container_type& output) { typedef typename strategy::side::services::default_strategy<cs_tag>::type side; output.push_back(p); std::size_t output_size = output.size(); while (output_size >= 3) { rev_iterator rit = output.rbegin(); point_type const last = *rit++; point_type const& last2 = *rit++; if (Factor * side::apply(*rit, last, last2) <= 0) { // Remove last two points from stack, and add last again // This is much faster then erasing the one but last. output.pop_back(); output.pop_back(); output.push_back(last); output_size--; } else { return; } } }
/// <summary> /// Enqueues the given value into our thread-safe blocking queue. The programmer becomes /// responsible for the lifetime of the parameter while it is within the queue; before the /// queue is disposed, the programmer must empty it and dispose of its contents. /// </summary> void push(T const& value) { { lock_type lock(m_mutex); m_queue.push_back(value); } m_condition.notify_one(); }
node * create_node (value_type const & value , priority_value_type priority , node * left , node * right) { _d.push_back(node(value, priority, left, right)); return & _d.back(); }
static inline void build_half_hull(container_type const& input, container_type& output, point_type const& left, point_type const& right) { output.push_back(left); for(iterator it = input.begin(); it != input.end(); ++it) { add_to_hull<Factor>(*it, output); } add_to_hull<Factor>(right, output); }
static void push_back(container_type& cont, const PointExpr& p) { cont.push_back(p); }
void add(request_spec *spec, request_handler *handler) { request_handlers_.push_back(std::make_pair(spec, handler)); }
void make_next(void) { container.push_back(fact()); }
void deltaFml (const container_type& positions, container_type& forces) { forces.clear (); forces.push_back (2*(positions.at (0)+20)); forces.push_back (2*(positions.at (1)-43)); }
void push_vertex(value_type x, value_type y, CommandType c) { cont_.push_back(x,y,c); }
void move_to(value_type x,value_type y) { cont_.push_back(x,y,SEG_MOVETO); }
void line_to(value_type x,value_type y) { cont_.push_back(x,y,SEG_LINETO); }
void push_vertex(coord_type x, coord_type y, CommandType c) { cont_.push_back(x,y,c); }