Page tree

 

JAVA

FORTRAN

C++

C

 

Link

H5S_GET_SELECT_NPOINTS

Determines the number of elements in a dataspace selection

Procedure:

H5S_GET_SELECT_NPOINTS ( space_id )

Signature:

hssize_t H5Sget_select_npoints(
            hid_t space_id
        )

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

Parameters:

hid_t space_id     IN: Dataspace identifier

Description:

H5S_GET_SELECT_NPOINTS determines the number of elements in the current selection of a dataspace. It works with any selection type, and is the correct way to retrieve the number of elements in a selection.

 

Returns:

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

Example:

         * Allocate space for the read buffer.  We will only allocate
         * enough space for the selection, plus a null terminator.  The
         * read buffer will be 1-dimensional.
         */
        npoints = H5Sget_select_npoints (space);
        rdata2 = (char *) malloc (npoints + 1);

     ! Allocate space for the read buffer.
     !
     CALL H5Sget_select_npoints_f(space, npoints, hdferr)

History:

None

--- Last Modified: September 27, 2018 | 11:44 AM