http://codereview.appspot.com/5626052/diff/30003/lily/skyline.cc File lily/skyline.cc (right):
http://codereview.appspot.com/5626052/diff/30003/lily/skyline.cc#newcode393 lily/skyline.cc:393: Skyline::Skyline (Building b, Real start, Axis horizon_axis, Direction sky) On 2012/02/22 09:34:43, joeneeman wrote:
This isn't quite what I had in mind (for one thing, it means that the
caller has
to be aware of buildings, calculating their slope, etc.)
what about Skyline::Skyline (vector<pair<Point, Point> > const& segments, Axis,
Direction)?
it works similarly to Skyline::Skyline(vector<Box>...) except that the
resulting
skyline shows the outline of the given set of line segments.
Done. http://codereview.appspot.com/5626052/diff/30003/lily/skyline.cc#newcode647 lily/skyline.cc:647: out.merge (to_merge); On 2012/02/22 09:34:43, joeneeman wrote:
merge is linear, so this loop is quadratic.
It should now be n*log(n). http://codereview.appspot.com/5626052/diff/34001/lily/skyline.cc File lily/skyline.cc (right): http://codereview.appspot.com/5626052/diff/34001/lily/skyline.cc#newcode362 lily/skyline.cc:362: result.push_front (Building (last_end, -infinity_f, -infinity_f, iv[LEFT] - 2 * horizon_padding)); On 2012/02/23 11:11:47, joeneeman wrote:
push_back is constant time for STL lists. No need to push_front and
then
reverse.
I'm not not in favor of this, but why is there a reverse in the other non_overlapping_skyline function? I tried to copy it as closely as possible. http://codereview.appspot.com/5626052/ _______________________________________________ lilypond-devel mailing list lilypond-devel@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-devel