Page tree

 

JAVA

FORTRAN

C++

C

 

Link

H5S_GET_SIMPLE_EXTENT_NPOINTS

Determines the number of elements in a dataspace.

Procedure:

H5S_GET_SIMPLE_EXTENT_NPOINTS ( space_id )

Signature:

hssize_t H5Sget_simple_extent_npoints(
            hid_t space_id
        )

Fortran90 Interface: h5sget_simple_extent_npoints_f
    
SUBROUTINE h5sget_simple_extent_npoints_f(space_id, npoints, hdferr) 
  IMPLICIT NONE
  INTEGER(HID_T), INTENT(IN) :: space_id    ! Dataspace identifier 
  INTEGER(HSIZE_T), INTENT(OUT) :: npoints  ! Number of elements in dataspace
  INTEGER, INTENT(OUT) :: hdferr            ! Error code
                                            ! 0 on success and -1 on failure
END SUBROUTINE h5sget_simple_extent_npoints_f 

Parameters:

hid_t space_id     IN: Identifier of the dataspace object to query

Description:

H5Sget_simple_extent_npoints determines the number of elements in a dataspace. For example, a simple 3-dimensional dataspace with dimensions 2, 3, and 4 would have 24 elements.

Returns:

Returns the number of elements in the dataspace if successful; otherwise returns a negative value.

Example:

examples / h5_attribute.c [272:282]  1.10/master  HDFFV/hdf5
    if (H5T_FLOAT == H5Tget_class(atype)) {
        printf("Type : FLOAT \n");
        npoints = H5Sget_simple_extent_npoints(aspace);
        float_array = (float *)malloc(sizeof(float)*(int)npoints);
        ret = H5Aread(attr, atype, float_array);
        printf("Values : ");
        for( i = 0; i < (int)npoints; i++)
            printf("%f ", float_array[i]);
        printf("\n");
        free(float_array);
    }

Coming Soon!

History:

None

--- Last Modified: December 04, 2017 | 08:06 AM