DATAMANIP (ksegops) functions


LIBRARY ROUTINE

lksegcmp - compare two data segments

LIBRARY CALL

int lksegcmp_attributes(
    kobject obj1,
    kobject obj2,
    char   *segment,
    kfile  *outfile,
    int     run_silent)

INPUT

none

OUTPUT

none

RETURN VALUE

TRUE (1) if the objects are tolerably identical, FALSE (0) otherwise

DESCRIPTION

This routine will compare the data contained in two data segments point by point, allowing for precise comparisons of data objects independent of file format or machine architecture.

The segments will first be compared to see if they are of the same size and dimensionality. If the data types are different, a comparison can still be done in the higher of the two data types if the cast argument is set.

A +/- comparison tolerance to use when comparing each data point may also be passed in. In cases where a complex comparison is performed, this tolerance will be applied to both the real and imaginary parts of the values.

A summary of the differences found between the segments can be printed to a given summary file. This file will contain the names of the two segments, and will specify if the segments are the same or different. If the sizes, dimensionality, or data types are different, then the differing attributes are printed. If the sizes and dimensionality match, then the number of differing points is printed. The segment level attributes may optionally be compared and printed as part of the summary.

Specific differences found between the segments can be printed to a difference file. This file will contain an entry for each differing point printed in the following format:

[POSITION] < Input #1 Value (Input #1 Data Type) > Input #2 Value (Input #2 Data Type)

Each component of this data point difference may optionally be left out by passing in the appropriate arguments.

Note that the specific differences are generated and printed to the difference file first. The summary is then generated and printed.

If no output is desired in either file, this routine can be told to run silent by setting the run_silent argument.

This routine will compare data "intelligently", never reading in more than a line at a time from both data objects. This allows very large data objects to be compared on machines with limited virtual memory.

ADDITIONAL INFORMATION

none

EXAMPLES

none

SIDE EFFECTS

none

RESTRICTIONS

Data types can not be printed to the difference file without their corresponding values.

MODIFICATION

none

FILES

$DATAMANIP/objects/library/ksegops/src/lksegcmp.c

SEE ALSO

ksegops(3)

COPYRIGHT

Copyright (C) 1993 - 1997, Khoral Research, Inc. ("KRI") All rights reserved.