The SDL Component Suite is an industry leading collection of components supporting scientific and engineering computing. Please visit the SDL Web site for more information....



CheckLinearity


Unit:SDL_openarrays
Class: none
Declaration: [1] function CheckLinearity (Data: TIntArray; var Discont: TIntArray): integer;
[2] function CheckLinearity (Data: TDoubleArray; Tol: double; var Discont: TIntArray): integer;

The function CheckLinearity tests whether the individual elements of the array Data form a series of equidistant values. For version [2] any discontinuity is detected with a tolerance given by the parameter Tol. The indices of the discontinuities are returned in the variable array parameter Discont. The return value of the function indicates the number of found boundaries.

The following figure shows two examples in graphical representation: the upper diagram shows one discontinuity, the lower one shows two. In the case of the upper scenario the function returns a value of 1 and the parameter Discont is a single-element array [7]. In the lower scenario the returned value is 2 and the Discont array contains [3,4].



Last Update: 2023-Feb-06