Add bezier curve promote_to routines for multiple-degree promotion.

Unlike the existing curve promotion code, promote_to can increase the
order of a bezier curve by one or more orders in a single call.  The
promoted curve is identical to the original curve.

The degree of the final promoted curve is inferred from the size of the
passed-in control point matrix.  Rather than allocate an incrementally
larger matrix at each step (and then calling the incremental promotion
routine), the low-order control points are copied to the target matrix
and then promotion occurs in-place.  Doing so without extra storage
requires that the new control points are calculated from end to start.

Two tests of promote_to are introduced.  The first performs a single-order
promotion and compares that the resulting control points are identically
equal to those from the standard incremental promotion routine.  The
second test promotes the same curve by five orders and then evaluates
the point, derivative, second derivative, and curvature at the first, last,
and an intermediate point.  This is the same test that was used for the
incremental promotion routines.

Some of the tests are failing due to insufficient slack in the floating
point comparisons.  The tolerances were manually increased until the
'float' tests passed.  Double and other data types still have failed tests.
Add bezier curve degree_to_cubic routines to cubically approximate curves.

Calculate cubic 'equivalent' to bezier curve.  If input curve has degree
less than cubic, the curve is promoted to an exactly equivalent cubic
curve.  If the input curve is cubic, the output curve is copied from the
input.  If the input curve is higher order, the output curve is a cubic
bezier curve that will match the input curve in endpoint position and
slopes.  This approximation is used because it is very simple and fast.
This curve may be a terrible approximation of the original curve, but
through successive subdivision, a piecewise cubic approximation of any
curve to any accuracy should be possible.

Unlike the current promotion/demotion routines, this routine will
promote/do-nothing/demote as needed.  In addition, unlike the sophisticated
incremental constrained demotion routine using Eck's algorithm, this
approach directly calculates the control points to achieve a cubic curve
that C1 matches the input curve (no matter the order of the input curve).

The code has three main branches.  Promotion, do-nothing, and demotion.
Tests are added for each of these branches.

Promotion from both linear and quadratic curves are tested by evaluating
the point, derivative, second derivative, and curvature at start, end,
and an intermediate point.

The cubic input do-nothing case is tested with exact comparison of the
output control points.

The demotion case is tested by comparing only the point and derivative at
the start and end points.

Some of the tests are failing due to insufficient slack in the floating
point comparisons.  The tolerances were manually increased until the
'float' tests passed.  Double and other data types still have failed tests.
Expose matrix type and add get_control_points() method to bezier curve.

This change is required to allow another curve to get the control point
matrix of this curve.  The control point matrix is needed to calculate
the upper bound of the distance between the curves.
Add bezier curve equiparametric maximum distance routines.

Calculate upper bound of equiparametric distance between bezier curves.
This routine efficiently calculates an upper bound of the distance between
equal parameter points on two bezier curves.  While not useful for
calculating distances between arbitrary curves, this is just the ticket
for judging the quality of one curve meant to approximate another.

This algorithm requires that both curves have identical order, so the
lower order curve is first promoted to match the higher order curve.
Then, the control points of the curves are differenced, resulting in
the control points of the curve that is the equiparametric difference
between the curves.  Since the control points provide a convex hull of
a curve, they represent the worst-case difference between curves.  The
maximum distance between the origin and a control point of this curve
is an upper bound of the equipmarametric distance between the input
curves.

Four tests of these routines are introduced.  The first test checks for
zero distance between a curve and iself.  The second test checks for zero
distance between a curve and an identical promoted version of itself.  The
third test checks for known distance between a curve and an offset version
of itself.  The final test checks for known distance between a curve and
a reversed-parameter version of itself; the curve was constructed such
that the maximum distance would be between the endpoints.
Add private segment-wise splitting routines to piecewise curve.

The outside-facing interface of piecewise curves restricts access to the
parameter t.  However, internally, algorithms can work on a particular
segment.

This change introduces private split_seg methods to split a given
segment at a specified (segment-wise) parameter.  If no parameter is
specified, the segment is bisected.  A further version is introduced
that returns an iterator to the newly added segment.

The existing split routine is refactored to use split_seg.
A minimum/maximum degree method is added to piecewise curves.

Analogous to bezier.degree(), this routine returns the maximum and minimum
degree of any segment in a piecewise curve.
Add adaptive to_cubic converter for piecewise curves.

This routine converts each segment of a piecewise bezier curve to a cubic
bezier with the same parameterization.  Each segment is adaptively
bisected as required to ensure the maximum distance between the exact
and cubic curves is less than the specified tolerance.

Numerous tests are introduced.  Degenerate cases (where the order of the
input curve is <= 3) result in an exact cubic with no subdivision.
Single-segment and multi-segment piecewise curves are tested.
Approximation of high order curves is tested.  A cubic curve promoted to
high order returns an exact cubic with no subdivision.
Allow 'promotion' to same order without exception.
Merge commit '60881ab89cd9103b0a918e62791d8f36b7f47a2a' into feature/Curve_Demotion_to_3rd_Degree

# By Rob McDonald
# Via Rob McDonald
* commit '60881ab89cd9103b0a918e62791d8f36b7f47a2a':
  Allow 'promotion' to same order without exception.
  Add adaptive to_cubic converter for piecewise curves.
  A minimum/maximum degree method is added to piecewise curves.
  Add private segment-wise splitting routines to piecewise curve.
  Add bezier curve equiparametric maximum distance routines.
  Expose matrix type and add get_control_points() method to bezier curve.
  Add bezier curve degree_to_cubic routines to cubically approximate curves.
  Add bezier curve promote_to routines for multiple-degree promotion.
Removed default parameter value for split_seg() method call.
Removed the exposing of control points data structure from bezier curve class.
Added data initialization to appease gcc compiler in release mode.
Removed unused variables.
Corrected type cast data type.
Code pretti-fying.
Removed unused variable.
Fixed test failures for various data types.
Factored out common variable from two sections of code.
Merge branch 'feature/Curve_Demotion_to_3rd_Degree' into develop