|
fitpack
Modern Fortran library for curve and surface fitting with splines
|
OOP wrappers for parametric curve fitting in \( \mathbb{R}^d \). More...
Data Types | |
| type | fitpack_closed_curve |
| Closed (periodic) parametric curve fitter. More... | |
| type | fitpack_constrained_curve |
| Parametric curve fitter with derivative constraints at the endpoints. More... | |
| interface | fitpack_parametric_curve |
| Open parametric curve fitter in \( \mathbb{R}^d \). More... | |
Functions/Subroutines | |
| type(fitpack_parametric_curve) function | new_from_points (x, u, w, ierr) |
| Construct a parametric curve from data points and perform a default fit. | |
| integer function | new_fit (this, x, u, w, smoothing, order) |
| Load new data points and perform a fresh fit. | |
| elemental subroutine | destroy (this) |
| Destroy a parametric curve object and release all allocated memory. | |
| elemental subroutine | con_destroy (this) |
| Destroy a constrained parametric curve, including endpoint constraints. | |
| subroutine | new_points (this, x, u, w) |
| Load new data points into the parametric curve and allocate workspace. | |
| elemental subroutine | clean_constraints (this) |
| Remove all endpoint derivative constraints. | |
| subroutine | set_constraints (this, ddx_begin, ddx_end, ierr) |
| Set or reset endpoint derivative constraints for a constrained parametric curve. | |
| real(fp_real) function, dimension(this%idim) | curve_eval_one (this, u, ierr) |
| Evaluate the parametric curve at a single parameter value. | |
| real(fp_real) function, dimension(this%idim, size(u)) | curve_eval_many (this, u, ierr) |
| Evaluate the parametric curve at multiple parameter values. | |
| integer function | interpolating_curve (this, order, reset_knots) |
| Fit an interpolating parametric spline ( \( s = 0 \)) through the data points. | |
| integer function | parcur_fit_least_squares (this, smoothing, reset_knots) |
| Fit a least-squares parametric spline with fixed knots. | |
| integer function | curve_fit_automatic_knots (this, smoothing, order, keep_knots) |
| Fit a smoothing parametric spline with automatic knot placement. | |
| real(fp_real) function, dimension(this%idim) | curve_derivative (this, u, order, ierr) |
| Evaluate the k-th derivative of the parametric curve at a single parameter value. | |
| real(fp_real) function, dimension(this%idim, 0:this%order) | curve_all_derivatives (this, u, ierr) |
| Evaluate all derivatives \( \mathbf{s}^{(j)}(u) \) for \( j = 0, \ldots, k \). | |
| subroutine | set_default_parameters (this) |
| Compute default parameter values from cumulative chord lengths. | |
| real(fp_real) function, dimension(this%idim, size(u)) | curve_derivatives (this, u, order, ierr) |
| Evaluate the k-th derivative at multiple parameter values. | |
| elemental integer(fp_size) function | parcur_comm_size (this) |
| Return the communication buffer size for the parametric curve. | |
| pure subroutine | parcur_comm_pack (this, buffer) |
| Pack parametric curve data into a communication buffer. | |
| pure subroutine | parcur_comm_expand (this, buffer) |
| Expand parametric curve data from a communication buffer. | |
| elemental integer(fp_size) function | concur_comm_size (this) |
| Return the communication buffer size for the constrained curve. | |
| pure subroutine | concur_comm_pack (this, buffer) |
| Pack constrained curve data into a communication buffer. | |
| pure subroutine | concur_comm_expand (this, buffer) |
| Expand constrained curve data from a communication buffer. | |
Variables | |
| integer, parameter | max_k = 5 |
OOP wrappers for parametric curve fitting in \( \mathbb{R}^d \).
Provides three types for fitting parametric curves through data points in \( d \)-dimensional space ( \( d \geq 1 \)):
Each component \( s_j(u) \) of the curve is represented as a B-spline of degree \( k \) over a common knot vector, with the parameter \( u \) either user-supplied or automatically computed from cumulative chord lengths.
|
private |
Remove all endpoint derivative constraints.
|
private |
Destroy a constrained parametric curve, including endpoint constraints.

|
private |
Expand constrained curve data from a communication buffer.

|
private |
Pack constrained curve data into a communication buffer.

|
private |
Return the communication buffer size for the constrained curve.

|
private |
Evaluate all derivatives \( \mathbf{s}^{(j)}(u) \) for \( j = 0, \ldots, k \).
| [in,out] | this | The fitted parametric curve. |
| [in] | u | Parameter value. |
| [out] | ierr | Optional error flag. |
u.
|
private |
Evaluate the k-th derivative of the parametric curve at a single parameter value.
| [in,out] | this | The fitted parametric curve. |
| [in] | u | Parameter value. |
| [in] | order | Derivative order ( \( 0 \leq \text{order} \leq k \)). |
| [out] | ierr | Optional error flag. |
|
private |
Evaluate the k-th derivative at multiple parameter values.
| [in,out] | this | The fitted parametric curve. |
| [in] | u | Array of parameter values. |
| [in] | order | Derivative order. |
| [out] | ierr | Optional error flag. |

|
private |
Evaluate the parametric curve at multiple parameter values.
| [in,out] | this | The fitted parametric curve. |
| [in] | u | Array of parameter values. |
| [out] | ierr | Optional error flag. |
|
private |
Evaluate the parametric curve at a single parameter value.
| [in,out] | this | The fitted parametric curve. |
| [in] | u | Parameter value. |
| [out] | ierr | Optional error flag. |

|
private |
|
private |
Destroy a parametric curve object and release all allocated memory.
|
private |
|
private |
|
private |
Construct a parametric curve from data points and perform a default fit.
| [in] | x | Data points \( (d \times m) \): each column is a point in \( \mathbb{R}^d \). |
| [in] | u | Optional parameter values (must be strictly increasing). If omitted, computed from cumulative chord lengths. |
| [in] | w | Optional positive weights, one per data point. |
| [out] | ierr | Optional error flag. |
|
private |
Load new data points into the parametric curve and allocate workspace.
| [in,out] | this | The parametric curve (destroyed and reinitialized). |
| [in] | x | Data points \( (d \times m) \): each column is a point. |
| [in] | u | Optional parameter values. If omitted, computed from chord lengths. |
| [in] | w | Optional positive weights. |

|
private |
Expand parametric curve data from a communication buffer.
|
private |
Pack parametric curve data into a communication buffer.
|
private |
Return the communication buffer size for the parametric curve.

|
private |
|
private |
Set or reset endpoint derivative constraints for a constrained parametric curve.
Resets all constraints, then applies the supplied left and/or right boundary conditions. Omitting ddx_begin or ddx_end removes constraints at that endpoint.
| [in,out] | this | The constrained curve object. |
| [in] | ddx_begin | Left endpoint constraints: column 0 = function value, column \( \ell \) = \( \ell \)-th derivative ( \( d \times (ib) \)). |
| [in] | ddx_end | Right endpoint constraints (same layout as ddx_begin). |
| [out] | ierr | Error flag (optional). |

|
private |
Compute default parameter values from cumulative chord lengths.
Sets \( u_i \) to normalized cumulative Euclidean distances between consecutive data points, so that \( u_1 = 0 \) and \( u_m = 1 \).
|
private |