dewittpe / cpr

Control Polygon Reduction: Methods for quick and efficient placement of internal knots for B-splines and tensor products of B-splines.
http://www.peteredewitt.com/cpr/
2 stars 0 forks source link

Feature: function to report the influence of a knot and plot the original, coarsened, and re-inserted control polygons #19

Closed dewittpe closed 8 years ago

dewittpe commented 8 years ago

A very helpful graphic used to show the influence of a knot on a (uni-variable) spline function has been a plot of three control polygons:

  1. The original control polygon with ξ and θ
  2. The coarsened control polygon with ξ \ ξj and (WTW)-1 WT θ
  3. The control polygon after reinserting ξj, i.e., with ξ and W(WTW)-1 WT θ

The function influence_weights already exists for finding the influence weight. This function will need a good name, perhaps influence_of?.

Initial thoughts for the API is:

influence_of(x, j)

where x would be a cpr_cp object and j is the index of attr(x, "xi") to omit.

A warning should be given if j is the index of a boundary knot.

The return should be a graphic and some other information, the index j, the value of the knot (the abscissa), the influence weight and rank.

Perhaps a vector of indices can be passed and a facetted graphic will be returned with a table of information, the index, abscissa, and the influence weight, and rank.

dewittpe commented 8 years ago

To make this a viable tool you'll need to reconsider how the spline data is used in plot.cpr_cp so that it can be extracted and used in plot.cpr_influence_of.