Skip to content

Commit 09270c7

Browse files
committed
TVdP tree node type (#39)
Replace 4 parallel integer arrays (info, up, left, right) with a single fitpack_tree_node derived type for the triply-linked binary tree used by the Theil-Van de Panne convexity-constrained spline fitting procedure. - Add fitpack_tree_node type with 4 integer fields - Refactor fpcosp: tree is now a local automatic array (4 fewer arguments) - Refactor fpadno, fpdeno, fpfrno, fpseno to take tree(maxtr) - Update callers cocosp and fpcoco: remove tree workspace from iwrk - Reduce iwrk requirement by 4*maxtr integers
1 parent 0890bb1 commit 09270c7

File tree

2 files changed

+104
-109
lines changed

2 files changed

+104
-109
lines changed

docs/refactoring/00_refactoring_summary.md

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -77,22 +77,20 @@ Removed unused variables: `cos`, `sin`, `piv`, `i3`, `iq`, `ic` from `fpgrre`;
7777
`cos`, `sin`, `piv`, `i2`, `i3` from `fptrnp`;
7878
`co`, `si`, `piv`, `i2`, `ij` from `fptrpe`.
7979

80-
---
81-
82-
## Remaining Plan
83-
84-
Each item below is a separate PR. PRs are ordered by dependency; documentation (PR 10+) can
85-
proceed in parallel with any code PR.
80+
### PR 9: TVdP Tree Node Type (DONE)
8681

87-
### PR 9: Back-Substitution Interface
88-
89-
**Scope**: Unify `fpback` and `fpbacp` under a generic `fp_backsolve` interface
90-
**Occurrences**: ~25 call sites
91-
**Difficulty**: Low — clean abstraction, no logic changes
92-
**Book references**: Ch. 4 Eq. 4.14 (R₁·c = z₁), Ch. 5 Eq. 5.15 (R₁*·c = z₁*)
82+
**Changes**: Introduced `fitpack_tree_node` derived type with 4 integer fields (`info`,
83+
`up`, `left`, `right`) replacing 4 parallel integer arrays for the triply-linked binary
84+
tree used by the Theil-Van de Panne (TVdP) convexity-constrained spline fitting procedure.
85+
Refactored `fpcosp` to allocate the tree locally (removing 4 array arguments from its
86+
signature), and updated all 4 helper routines (`fpadno`, `fpdeno`, `fpfrno`, `fpseno`) to
87+
take a single `tree(maxtr)` array. Updated callers `cocosp` and `fpcoco` to remove tree
88+
workspace slicing from `iwrk`, reducing `iwrk` requirement by `4*maxtr` integers.
9389

9490
---
9591

92+
## Remaining Plan
93+
9694
### PR 10+: Doxygen + MathJax Documentation
9795

9896
**Scope**: Add structured documentation headers to all core routines in `fitpack_core.F90`

0 commit comments

Comments
 (0)