/* C */ struct sidl_double__array * sidl_double__array_slice(struct sidl_double__array *src, int32_t dimen, const int32_t numElem[], const int32_t *srcStart, const int32_t *srcStride, const int32_t *newStart); // // C++ array<double> sidl::array<double>::slice(int dimen, const int32_t numElem[], const int32_t *srcStart = 0, const int32_t *srcStride = 0, const int32_t *newStart = 0); C C FORTRAN 77 subroutine sidl_double__array_slice_f(src, dimen, numElem, srcStart, $ srcStride, newStart, result) integer*8 src, result integer*4 dimen integer*4 numElem(srcDimen), srcStart(srcDimen) integer*4 srcStride(srcDimen), newStart(dimen) ! ! FORTRAN 90 subroutine slice(src, dimen, numElem, srcStart, srcStride, newStart, result) type(sidl_double_3d), intent(in) :: src ! type depends on dimension type(sidl_double_2d), intent(out) :: result ! type depends on dimension integer (selected_int_kind(9)), intent(in) :: dimen integer (selected_int_kind(9)), intent(in), dimension(:) :: & numElem, srcStart, srcStride, newStart // Java public native Array _slice(int dimen, int[] numElem, int[] srcStart, int[] srcStride, int[] newStart);
This method will create a sub-array of another array. The resulting array shares data with the original array. The new array can be of the same dimension or potentially less than the original array. If you are removing a dimension, indicate the dimensions to remove by setting numElem[i] to zero for any dimension i that should go away in the new array. The meaning of each argument is covered below.
srcStart[i] + numElem[i] * srcStride[i] | ![]() |
upper[i], or |
srcStart[i] + numElem[i] * srcStride[i] | ![]() |
lower[i] |
If src is not a borrowed array (i.e., it manages its own data), the returned array can manage its by keeping a reference to src. It is not considered a borrowed array for purposes of smartCopy.