/// Select a slice (known as a 'hyperslab' in HDF5 terminology) of the Dataspace.
/// Returns the shape of array that is capable of holding the resulting slice.
/// Useful when you want to read a subset of a dataset.
Select a slice (known as a 'hyperslab' in HDF5 terminology) of the Dataspace.
Returns the shape of array that is capable of holding the resulting slice.
Useful when you want to read a subset of a dataset.
Select a slice ( known as a ' hyperslab ' in HDF5 terminology ) of the Dataspace . Returns the shape of array that is capable of holding the resulting slice . Useful when you want to read a subset of a dataset .
pub fn select_slice<S>(&self, slice: S) -> Result<Vec<Ix>>
    where
        S: AsRef<[SliceOrIndex]>,
    {
        let shape = self.dims();
        let ss: &[SliceOrIndex] = slice.as_ref();
        let mut start_vec = Vec::with_capacity(ss.len());
        let mut stride_vec = Vec::with_capacity(ss.len());
        let mut count_vec = Vec::with_capacity(ss.len());
        let mut shape_vec = Vec::with_capacity(ss.len());
        for i in 0..ss.len() {
            let (start, stride, count) = Self::get_start_stride_count(&ss[i], shape[i])?;
            start_vec.push(start);
            stride_vec.push(stride);
            count_vec.push(count);
            shape_vec.push(count as Ix);
        }
        h5try!(H5Sselect_hyperslab(
            self.id(),
            H5S_SELECT_SET,
            start_vec.as_ptr(),
            stride_vec.as_ptr(),
            count_vec.as_ptr(),
            ptr::null()
        ));
        Ok(shape_vec)
    }
pub fn select_slice < S > ( & self , slice : S ) -> Result < Vec < Ix > > where S : AsRef < [ SliceOrIndex ] > , { let shape = self . dims ( ) ; let ss : & [ SliceOrIndex ] = slice . as_ref ( ) ; let mut start_vec = Vec :: with_capacity ( ss . len ( ) ) ; let mut stride_vec = Vec :: with_capacity ( ss . len ( ) ) ; let mut count_vec = Vec :: with_capacity ( ss . len ( ) ) ; let mut shape_vec = Vec :: with_capacity ( ss . len ( ) ) ; for i in 0 .. ss . len ( ) { let ( start , stride , count ) = Self :: get_start_stride_count ( & ss [ i ] , shape [ i ] ) ? ; start_vec . push ( start ) ; stride_vec . push ( stride ) ; count_vec . push ( count ) ; shape_vec . push ( count as Ix ) ; } h5try ! ( H5Sselect_hyperslab ( self id ( ) H5S_SELECT_SET start_vec as_ptr ( ) stride_vec as_ptr ( ) count_vec as_ptr ( ) ptr null ( ) ) ) ; Ok ( shape_vec ) }
Select a slice (known as a 'hyperslab' in HDF5 terminology) of the Dataspace.
Select a slice ( known as a ' hyperslab ' in HDF5 terminology ) of the Dataspace .
&self
slice
S