diff options
author | Leon Arber <larber@ncsa.uiuc.edu> | 2004-09-16 18:11:31 (GMT) |
---|---|---|
committer | Leon Arber <larber@ncsa.uiuc.edu> | 2004-09-16 18:11:31 (GMT) |
commit | 0df4bee9318927c3f229871bf5460ad6258c5382 (patch) | |
tree | 273db4199fbfd84726d94d9bab4a62520dd30afb /src/H5Pdxpl.c | |
parent | b540f551b39d067938bea37d378156b5fc8e8566 (diff) | |
download | hdf5-0df4bee9318927c3f229871bf5460ad6258c5382.zip hdf5-0df4bee9318927c3f229871bf5460ad6258c5382.tar.gz hdf5-0df4bee9318927c3f229871bf5460ad6258c5382.tar.bz2 |
[svn-r9267] Purpose:
Added H5Pget_data_transform
Added support for polynomial data transforms
Description:
There is now support for polynomial data transforms (ie, (2+x)*(x-5)) instead
of just linear ones.
Note that, in order to compute a polynomial transform, one temporary copy of
the original data must be stored for each occurence of "x" in the transform
expression. This can result in very high memory usage for expressions of high
order.
Platforms tested:
sol + eirene
Misc. update:
Diffstat (limited to 'src/H5Pdxpl.c')
-rw-r--r-- | src/H5Pdxpl.c | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/src/H5Pdxpl.c b/src/H5Pdxpl.c index 3994d98..67dba0b 100644 --- a/src/H5Pdxpl.c +++ b/src/H5Pdxpl.c @@ -80,6 +80,59 @@ done: FUNC_LEAVE_API(ret_value); } +/*------------------------------------------------------------------------- + * Function: H5Pget_data_transform + * + * Purpose: + * Gets data transform expression. + * + * + * Return: Returns a non-negative value if successful; otherwise returns a negative value. + * + * + * Programmer: Leon Arber + * August 27, 2004 + * + * Modifications: + * + *------------------------------------------------------------------------- + */ +herr_t H5Pget_data_transform(hid_t plist_id, char** expression) +{ + H5P_genplist_t *plist; /* Property list pointer */ + H5Z_data_xform_t *data_xform_prop=NULL; /* New data xform property */ + herr_t ret_value=SUCCEED; /* return value */ + + + FUNC_ENTER_API(H5Pget_data_transform, FAIL); + + /* Check arguments */ + if (expression == NULL) + HGOTO_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, "expression cannot be NULL"); + + /* Get the plist structure */ + if(NULL == (plist = H5P_object_verify(plist_id,H5P_DATASET_XFER))) + HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID"); + + if(H5P_get(plist, H5D_XFER_XFORM_NAME, &data_xform_prop)<0) + HGOTO_ERROR (H5E_PLIST, H5E_CANTSET, FAIL, "Error setting data transform expression"); + + /* Get the data transform string */ + *expression = H5Z_xform_extract_xform_str(data_xform_prop); + +done: + if(ret_value<0) { + if(data_xform_prop) + if(H5Z_xform_destroy(data_xform_prop)<0) + HDONE_ERROR(H5E_PLINE, H5E_CLOSEERROR, FAIL, "unable to release data transform expression") + } /* end if */ + + FUNC_LEAVE_API(ret_value); +} + + + + /*------------------------------------------------------------------------- * Function: H5Pset_buffer |