Closed
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
fitpack_tree_nodederived type with 4 integer fields (info,up,left,right) replacing 4 parallel integer arrays for the triply-linked binary tree used by the Theil-Van de Panne (TVdP) convexity-constrained spline fitting procedure (Book §7.2, Fig. 7.1)fpcospto allocate the tree locally as an automatic array, removing 4 array arguments from its signaturefpadno,fpdeno,fpfrno,fpseno) to take a singletree(maxtr)array instead of 4 separate arrayscocospandfpcocoto remove tree workspace slicing fromiwrk, reducingiwrkrequirement by4*maxtrintegersTest plan
fpm build --flag "-Wall -Wextra"— clean, no warningsfpm test— 49 passed, 0 failed (theconcon/cocosptests exercise this code path)