Function lupnt::cheby_verify

Function Documentation

int lupnt::cheby_verify(double *seg, long len)

Verify that the provided segment meets the constraints of a uniform set of coefficient records. Return 0 on success or 1 if the segment is invalid. This should be done before using the segment in order to avoid segfaults on invalid data.

Verify that a raw SPK Chebyshev segment has the expected uniform-record structure before it is used by cheby_posvel/cheby_posvel_ad.

Called by cheby_segment immediately after reading each segment from a DAF/SPK file, to guard against segfaults on malformed data.

Parameters:
  • seg – Raw SPK Chebyshev segment data

  • len – Length of seg in doubles

Returns:

0 if seg is a valid uniform set of coefficient records, 1 otherwise