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

update_bsplines method #27

Closed dewittpe closed 7 years ago

dewittpe commented 7 years ago

Currently there are functions newknots and newdf. Replace these methods with an method update_bspline and update_btensor (made to be synonyms) method.

general idea:

update_bspline <- update_btensor <- function(object, iknots, df, bknots, order) {
  UseMethod("update_bspline")
}

update_bspline.formula <- function(object, iknots, df, bknots, order) {
  # Modify the code in the newknots and newdf calls.  See updatebspline that is currently in the predict.R file.
}

update_bspline.cpr_cp <- update_bspline.cpr_cn <- function (object, iknots, df, bknots, order) {
  update(object, formula = update_bsplines.formula(formula(object), iknots, df, bknots, order))
}

Use this method in the cpr and cnr calls. Likely will be used elsewhere.

dewittpe commented 7 years ago

Need to run testing and extend the documentation.

dewittpe commented 7 years ago

Provide examples for updating each of the types objects for which a S3 method has been provided.

It is important to note that the update_bsplines.X and update.btensor.X are synonyms for the X method.