Difference between revisions of "StepInterp"
m (adding doc status category stub page) |
|||
Line 7: | Line 7: | ||
StepInterp( D,A,X,I) | StepInterp( D,A,X,I) | ||
+ | |||
+ | = Notes = | ||
+ | |||
+ | StepInterp uses a "left-step" -- the step up takes place at the left side of each interval. Sometimes you might want a "right-step", using the previous value smaller than or equal to X, rather than the next value greater than or equal to X. One implementation of this other variant is a [[User-Defined Functions|UDF]]: | ||
+ | |||
+ | Function RStepInterp(D:ascending[I] ; R:Array[I] ; X ; I : Index ) | ||
+ | Definition: | ||
+ | Var pos := StepInterp(D,@I,X,I); | ||
+ | R[@I= if X=D[@I=pos] then pos else max([1,pos-1]) ] | ||
= See Also = | = See Also = |
Revision as of 20:25, 5 October 2007
(stub)
Declaration
StepInterp( D,A,X,I)
Notes
StepInterp uses a "left-step" -- the step up takes place at the left side of each interval. Sometimes you might want a "right-step", using the previous value smaller than or equal to X, rather than the next value greater than or equal to X. One implementation of this other variant is a UDF:
Function RStepInterp(D:ascending[I] ; R:Array[I] ; X ; I : Index ) Definition: Var pos := StepInterp(D,@I,X,I); R[@I= if X=D[@I=pos] then pos else max([1,pos-1]) ]
See Also
Comments
Enable comment auto-refresher