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....



Diff


Unit: SDL_matrix
Class: TMatrix
Declaration: function Diff (Order: integer; Mode: TApplyColRow): integer;

The function Diff calculates the finite differences of all columns or all rows (depending on the parameter Mode). The order of the differences is controlled by the parameter Order.

Please note that the algorithm removes all rows/columns which do not contain valid results. Thus, in order to align the finite differences with the original data series, the resulting matrix data have to be shifted by (Order div 2):

The function Diff returns the following error codes:
 0 ... everything is OK
-1 ... invalid order (valid range: 1..10)
-2 ... too few columns/rows


Last Update: 2023-Feb-06