|
fitpack
Modern Fortran library for curve and surface fitting with splines
|
OOP wrapper for constrained-convexity curve fitting. More...
Data Types | |
| interface | fitpack_convex_curve |
| Cubic spline fitter with pointwise convexity/concavity constraints. More... | |
Functions/Subroutines | |
| type(fitpack_convex_curve) function | convex_new_from_points (x, y, v, w, smoothing, ierr) |
| Construct a convex curve from data points with convexity constraints and fit it. | |
| elemental subroutine | convex_destroy (this) |
| Destroy the convex curve object and release all allocated memory. | |
| subroutine | convex_new_points (this, x, y, w) |
| Load new data points and allocate workspace for convex fitting. | |
| integer(fp_flag) function | set_convexity (this, v) |
| Set pointwise convexity constraints. | |
| elemental integer(fp_flag) function | remap_concon_error (ier) |
| integer(fp_flag) function | convex_fit_automatic_knots (this, smoothing, order, keep_knots) |
| Fit a smoothing spline with convexity constraints and automatic knot placement. | |
| integer(fp_flag) function | convex_fit_least_squares (this, smoothing, reset_knots) |
| Fit a least-squares spline with convexity constraints on the current knots. | |
| pure real(fp_real) function | nearest_constraint (t_knot, x, v, m) |
| elemental integer(fp_size) function | convex_comm_size (this) |
| Return the communication buffer size for the convex curve. | |
| pure subroutine | convex_comm_pack (this, buffer) |
| Pack convex curve data into a communication buffer. | |
| pure subroutine | convex_comm_expand (this, buffer) |
| Expand convex curve data from a communication buffer. | |
OOP wrapper for constrained-convexity curve fitting.
Provides fitpack_convex_curve, an extension of fitpack_curve that enforces local convexity or concavity constraints during spline fitting. Always uses cubic splines ( \( k = 3 \)). The underlying core routines are concon (automatic knot placement) and cocosp (least-squares with user-supplied knots).
|
private |
Expand convex curve data from a communication buffer.
|
private |
Pack convex curve data into a communication buffer.
|
private |
Return the communication buffer size for the convex curve.

|
private |
Destroy the convex curve object and release all allocated memory.
|
private |
Fit a smoothing spline with convexity constraints and automatic knot placement.
Uses the concon core routine which solves a constrained quadratic programming problem to place knots while respecting local convexity/concavity constraints.
| [in,out] | this | The convex curve object. |
| [in] | smoothing | Optional smoothing factor. |
| [in] | order | Ignored (always cubic). |
| [in] | keep_knots | If .true., continue from current knot set. |

|
private |
Fit a least-squares spline with convexity constraints on the current knots.
Uses the cocosp core routine. Constraint values at interior knots are derived from the nearest data-point convexity flags.
| [in,out] | this | The convex curve object. |
| [in] | smoothing | Optional smoothing for initial knot placement (if reset_knots). |
| [in] | reset_knots | If .true., recompute knots via concon first. |

|
private |
Construct a convex curve from data points with convexity constraints and fit it.
| [in] | x | Independent variable values. |
| [in] | y | Dependent variable values, same size as x. |
| [in] | v | Convexity constraints: 1=concave, -1=convex, 0=unconstrained. |
| [in] | w | Optional weights (positive), same size as x. |
| [in] | smoothing | Optional smoothing factor. |
| [out] | ierr | Optional error flag. |
|
private |
|
private |
|
private |
|
private |
Set pointwise convexity constraints.
| [in,out] | this | The convex curve object. |
| [in] | v | Constraint values: 1=concave, -1=convex, 0=unconstrained. Must have size m. |