NAME
dssubset.h - DATASET_METHOD subset type
SYNOPSIS
Given an existing DATASET, one can define a new subset of the first data set. The actual subset is determined by a user specifed range. This is useful for incremental techniques applied to huge amounts of data.
#include <dssubset.h>
DSM_SUBSET *dsm_subset(DATASET *dset,
unsigned start, unsigned len,
unsigned skip);
void dsm_destroy_subset(DSM_SUBSET *subset);
DESCRIPTION
Type Declarations
The following types are defined in the header file dssubset.h.
DSM_SUBSET
typedef struct DSM_SUBSET {
DATASET *dset;
unsigned start;
unsigned len;
unsigned skip;
} DSM_SUBSET;
A DSM_SUBSET specifies how to reference a subset of the data in dset. If you were to ask for the i'th pattern of the DATASET wrapped by this structure, in reality you would get the start + i * skip pattern of dset. Also, in the subset, you can only reference len patterns, so the values in these fields should make sense for {dset.}
Function Definitions
The following function prototypes are given in the header file dssubset.h.
DSM_SUBSET *dsm_subset(DATASET *dset,
unsigned start, unsigned len,
unsigned skip);
Allocates a new subset, fills up the appropriate fields of the structure, and does a quick sanity check on the supplied values.
void dsm_destroy_subset(DSM_SUBSET *subset);
Free up any memory that was allocated with the allocation routine. The original DATASET that is passed to dsm_subset() is left intact; hence, it is your job to free them up.
AUTHOR
Gary William Flake (gary.flake@usa.net).
SEE ALSO
dsmethod(3), and dataset(3).