|
fitpack
Modern Fortran library for curve and surface fitting with splines
|
Parametric curve fitter with derivative constraints at the endpoints. More...


Public Member Functions | |
| procedure | destroy (this) |
| Clear memory. | |
| procedure | clean_constraints (this) |
| Curve constraints. | |
| procedure | set_constraints (this, ddx_begin, ddx_end, ierr) |
| Set or reset endpoint derivative constraints for a constrained parametric curve. | |
| procedure | comm_size (this) |
| Override comm to include constraint fields. | |
| procedure | comm_pack (this, buffer) |
| Pack constrained curve data into a communication buffer. | |
| procedure | comm_expand (this, buffer) |
| Expand constrained curve data from a communication buffer. | |
Public Member Functions inherited from fitpack_parametric_curves::fitpack_parametric_curve | |
| procedure | destroy (this) |
| Clean memory. | |
| procedure | new_points (this, x, u, w) |
| Set new points. | |
| procedure | set_default_parameters (this) |
| Compute default parameter values from cumulative chord lengths. | |
| procedure | new_fit (this, x, u, w, smoothing, order) |
| Generate new fit. | |
| procedure | fit (this, smoothing, order, keep_knots) |
| Generate/update fitting curve, with optional smoothing. | |
| procedure | interpolate (this, order, reset_knots) |
| Fit an interpolating parametric spline ( \( s = 0 \)) through the data points. | |
| procedure | least_squares (this, smoothing, reset_knots) |
| Fit a least-squares parametric spline with fixed knots. | |
| procedure | eval_one (this, u, ierr) |
| Evaluate curve at given coordinates. | |
| procedure | eval_many (this, u, ierr) |
| Evaluate the parametric curve at multiple parameter values. | |
| generic | eval (this, u, ierr) |
| Evaluate curve at given coordinates. | |
| generic | eval (this, u, ierr) |
| Evaluate the parametric curve at multiple parameter values. | |
| generic | dfdx (this, u, order, ierr) |
| Evaluate derivative at given coordinates. | |
| generic | dfdx (this, u, order, ierr) |
| Evaluate the k-th derivative at multiple parameter values. | |
| generic | dfdx_all (this, u, ierr) |
| Evaluate all derivatives \( \mathbf{s}^{(j)}(u) \) for \( j = 0, \ldots, k \). | |
| procedure | comm_size (this) |
| Parallel communication interface (size/pack/expand) | |
| procedure | comm_pack (this, buffer) |
| Pack parametric curve data into a communication buffer. | |
| procedure | comm_expand (this, buffer) |
| Expand parametric curve data from a communication buffer. | |
| type(fitpack_parametric_curve) function | new_from_points (x, u, w, ierr) |
| Construct a parametric curve from data points and perform a default fit. | |
Public Member Functions inherited from fitpack_fitters::fitpack_fitter | |
| procedure, non_overridable | mse (this) |
| MSE accessor (shared by all types) | |
| procedure, non_overridable | core_comm_size (this) |
| Base field helpers for comm (non-overridable, called by subtypes) | |
| procedure, non_overridable | core_comm_pack (this, buffer) |
| Pack base fields into communication buffer. | |
| procedure, non_overridable | core_comm_expand (this, buffer) |
| Expand base fields from communication buffer. | |
| procedure, non_overridable | destroy_base (this) |
| Base field reset (called by subtype destroy methods) | |
| procedure(comm_size_if), deferred | comm_size (this) |
| Deferred communication interface. | |
| procedure(comm_pack_if), deferred | comm_pack (this, buffer) |
| procedure(comm_expand_if), deferred | comm_expand (this, buffer) |
Public Attributes | |
| integer | ib = 0 |
| Left boundary derivatives. | |
| real(fp_real), dimension(:,:), allocatable | deriv_begin |
| integer | ie = 0 |
| Right boundary derivatives. | |
| real(fp_real), dimension(:,:), allocatable | deriv_end |
| real(fp_real), dimension(:,:), allocatable | xx |
| On exit xx contains the coordinates of the data points to which a spline curve with zero derivative constraints has been determined. if the computation mode iopt =1 is used xx should be left unchanged between calls. | |
| real(fp_real), dimension(:,:), allocatable | cp |
| On exit cp contains the b-spline coefficients of a polynomial curve which satisfies the boundary constraints. if the computation mode iopt =1 is used cp should be left unchanged between calls. | |
Public Attributes inherited from fitpack_parametric_curves::fitpack_parametric_curve | |
| integer | m = 0 |
| Number of points. | |
| integer | idim = 0 |
| Number of dimensions. | |
| real(fp_real), dimension(:,:), allocatable | x |
| The data points. | |
| logical | has_params = .false. |
| Parameter values: one for each point. They may be optional, in which case, they will be internally calculated by fitpack. | |
| real(fp_real), dimension(:), allocatable | u |
| integer | order = 3 |
| Spline degree. | |
| real(fp_real) | ubegin = zero |
| Interval boundaries. | |
| real(fp_real) | uend = zero |
| real(fp_real), dimension(:), allocatable | sp |
| real(fp_real), dimension(:), allocatable | w |
| integer | nest = 0 |
| real(fp_real), dimension(:,:), allocatable | dd |
| integer | knots = 0 |
| real(fp_real), dimension(:), allocatable | t |
Public Attributes inherited from fitpack_fitters::fitpack_fitter | |
| integer(fp_flag) | iopt = IOPT_NEW_SMOOTHING |
| Fitting state flag. | |
| real(fp_real) | smoothing = 1000.0_FP_REAL |
| Smoothing parameter. | |
| real(fp_real) | fp = zero |
| Weighted sum of squared residuals. | |
| real(fp_real), dimension(:), allocatable | c |
| B-spline coefficients. | |
| integer(fp_size) | lwrk = 0 |
| Real workspace and its size. | |
| real(fp_real), dimension(:), allocatable | wrk |
| integer(fp_size) | liwrk = 0 |
| Integer workspace and its size. | |
| integer(fp_size), dimension(:), allocatable | iwrk |
Parametric curve fitter with derivative constraints at the endpoints.
Extension of fitpack_parametric_curve that enforces prescribed values of derivatives at the left and/or right boundaries. For each component \( s_j(u) \), the constraints are:
\[ s_j^{(\ell)}(u_1) = \text{db}(j, \ell), \quad \ell = 0, \ldots, \text{ib} - 1 \]
\[ s_j^{(\ell)}(u_m) = \text{de}(j, \ell), \quad \ell = 0, \ldots, \text{ie} - 1 \]
Uses the concur core routine.
| procedure fitpack_parametric_curves::fitpack_constrained_curve::clean_constraints | ( | class(fitpack_constrained_curve), intent(inout) | this | ) |
Curve constraints.
| procedure fitpack_parametric_curves::fitpack_constrained_curve::comm_expand | ( | class(fitpack_constrained_curve), intent(inout) | this, |
| real(fp_comm), dimension(:), intent(in) | buffer ) |
Expand constrained curve data from a communication buffer.

| procedure fitpack_parametric_curves::fitpack_constrained_curve::comm_pack | ( | class(fitpack_constrained_curve), intent(in) | this, |
| real(fp_comm), dimension(:), intent(out) | buffer ) |
Pack constrained curve data into a communication buffer.
| procedure fitpack_parametric_curves::fitpack_constrained_curve::comm_size | ( | class(fitpack_constrained_curve), intent(in) | this | ) |
Override comm to include constraint fields.
| procedure fitpack_parametric_curves::fitpack_constrained_curve::destroy | ( | class(fitpack_constrained_curve), intent(inout) | this | ) |
Clear memory.
| procedure fitpack_parametric_curves::fitpack_constrained_curve::set_constraints | ( | class(fitpack_constrained_curve), intent(inout) | this, |
| real(fp_real), dimension(:,0:), intent(in), optional | ddx_begin, | ||
| real(fp_real), dimension (:,0:), intent(in), optional | ddx_end, | ||
| integer, intent(out), optional | ierr ) |
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). |
| real(fp_real), dimension(:,:), allocatable fitpack_parametric_curves::fitpack_constrained_curve::cp |
On exit cp contains the b-spline coefficients of a polynomial curve which satisfies the boundary constraints. if the computation mode iopt =1 is used cp should be left unchanged between calls.
| real(fp_real), dimension(:,:), allocatable fitpack_parametric_curves::fitpack_constrained_curve::deriv_begin |
| real(fp_real), dimension(:,:), allocatable fitpack_parametric_curves::fitpack_constrained_curve::deriv_end |
| integer fitpack_parametric_curves::fitpack_constrained_curve::ib = 0 |
Left boundary derivatives.
| integer fitpack_parametric_curves::fitpack_constrained_curve::ie = 0 |
Right boundary derivatives.
| real(fp_real), dimension(:,:), allocatable fitpack_parametric_curves::fitpack_constrained_curve::xx |
On exit xx contains the coordinates of the data points to which a spline curve with zero derivative constraints has been determined. if the computation mode iopt =1 is used xx should be left unchanged between calls.