diff options
author | Quincey Koziol <koziol@koziol.gov> | 2020-06-05 17:36:20 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@koziol.gov> | 2020-06-07 21:22:40 (GMT) |
commit | 95916c8936cf1340125195bf3066cd14c74cec12 (patch) | |
tree | d66e1c5b6f5c2b5f729ce6930606d0b92ecf0f73 | |
parent | 1030a7ac9a2a77e03f6fc496ccc88b8bceae203a (diff) | |
download | hdf5-95916c8936cf1340125195bf3066cd14c74cec12.zip hdf5-95916c8936cf1340125195bf3066cd14c74cec12.tar.gz hdf5-95916c8936cf1340125195bf3066cd14c74cec12.tar.bz2 |
Detect when there's the same-shaped selection of a single block of elements on
both selections, but with different selection types (i.e. one selection defined
as an 'all' type and the other as a hyperslab or point type), without falling
into the generic selection iteration case.
-rw-r--r-- | src/H5Sselect.c | 9 | ||||
-rw-r--r-- | test/tselect.c | 14 |
2 files changed, 16 insertions, 7 deletions
diff --git a/src/H5Sselect.c b/src/H5Sselect.c index e433dc1..47909f5 100644 --- a/src/H5Sselect.c +++ b/src/H5Sselect.c @@ -1885,6 +1885,15 @@ H5S_select_shape_same(const H5S_t *space1, const H5S_t *space2) space_a_dim--; } /* end while */ + + /* Check for a single block in each selection */ + if(H5S_SELECT_IS_SINGLE(space_a) && H5S_SELECT_IS_SINGLE(space_b)) { + /* If both selections are a single block and their bounds are + * the same, then the selections are the same, even if the + * selection types are different. + */ + HGOTO_DONE(TRUE) + } /* end if */ } /* end if */ /* If the dataspaces have the same selection type, use the selection's diff --git a/test/tselect.c b/test/tselect.c index 492a917..cadd350 100644 --- a/test/tselect.c +++ b/test/tselect.c @@ -9388,15 +9388,15 @@ test_shape_same_dr__smoke_check_1(void) ** a "checker board" hyperslab as follows: ** ** * * - - * * - - * * -** * * - - * * - - * * -** - - * * - - * * - - -** - - * * - - * * - - ** * * - - * * - - * * -** * * - - * * - - * * -** - - * * - - * * - - -** - - * * - - * * - - +** - - * * - - * * - - +** - - * * - - * * - - +** * * - - * * - - * * +** * * - - * * - - * * +** - - * * - - * * - - +** - - * * - - * * - - +** * * - - * * - - * * ** * * - - * * - - * * -** * * - - * * - - * * ** ** where asterisks indicate selected elements, and dashes ** indicate unselected elements. |