numo-narray-alt 0.10.2 → 0.10.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c9f1a4b6eb9f968492070e5e771bf6defe4071f2d1d3921a8cca91929bba0efc
4
- data.tar.gz: 4a7551a31e4295e8a6ee71553badb806d9357628a13a089e7ff08e26768f173f
3
+ metadata.gz: 3add9ba11a05a8f7e149d5cc4f00b15b870cedc1ae8dd20a603213c9fa9f87bc
4
+ data.tar.gz: d2faa61ca233802311b7a77ec70bf1049cde822123d177274f27d667a5aa570b
5
5
  SHA512:
6
- metadata.gz: 1a4139ded4b31051d36bae153848b0b744ae97274c5aa71f2083083840c38551d387d6cb0adf64ce370ec12b7a7a849f25840b08f0bde18e9a72e473b120aec1
7
- data.tar.gz: 217f922077020d3b65d783a1a842fbea7fa910a625b3439a7c1cc9699a6e91803606e31713f9c2cda1802e7603a882a338f57c06a0b7b2c5cc8d7d54ca238ee4
6
+ metadata.gz: aceb6275928c5da4b8b2d2ca47faada75eec985ff762740954f76c9620fe73b7edc2346359336c2dd79ad9433998fdf425fbe5ceef8d760fd5d9f0718e2aa653
7
+ data.tar.gz: ef431dd49b3470c4ffdf5c4eeafa8faee4d2e66b9167c4d0dd4a5816ed8e83ad3e8590701cba491a6265453e9bcbfb6f2612d9f8ef3495a833b79736e08d5aa6
@@ -519,27 +519,33 @@ static void na_index_aref_naview(
519
519
  ssize_t total = 1;
520
520
 
521
521
  for (i = j = 0; i < ndim; i++) {
522
- stridx_t sdx1 = na1->stridx[q[i].orig_dim];
523
- ssize_t size;
524
-
525
- // numeric index -- trim dimension
526
- if (!keep_dim && q[i].n == 1 && q[i].step == 0) {
527
- if (SDX_IS_INDEX(sdx1)) {
528
- na2->offset += SDX_GET_INDEX(sdx1)[q[i].beg];
529
- } else {
530
- na2->offset += SDX_GET_STRIDE(sdx1) * q[i].beg;
522
+ stridx_t sdx1;
523
+ sdx1.stride = 0;
524
+ sdx1.index = NULL;
525
+ const int qi_orig_dim = q[i].orig_dim;
526
+ if (qi_orig_dim < na1->base.ndim) {
527
+ sdx1 = na1->stridx[qi_orig_dim];
528
+
529
+ // numeric index -- trim dimension
530
+ if (!keep_dim && q[i].n == 1 && q[i].step == 0) {
531
+ if (SDX_IS_INDEX(sdx1)) {
532
+ na2->offset += SDX_GET_INDEX(sdx1)[q[i].beg];
533
+ } else {
534
+ na2->offset += SDX_GET_STRIDE(sdx1) * q[i].beg;
535
+ }
536
+ continue;
531
537
  }
532
- continue;
533
538
  }
534
539
 
535
- na2->base.shape[j] = size = q[i].n;
540
+ const ssize_t size = q[i].n;
541
+ na2->base.shape[j] = size;
536
542
 
537
543
  if (q[i].reduce != 0) {
538
544
  VALUE m = rb_funcall(INT2FIX(1), id_shift_left, 1, INT2FIX(j));
539
545
  na2->base.reduce = rb_funcall(m, '|', 1, na2->base.reduce);
540
546
  }
541
547
 
542
- if (q[i].orig_dim >= na1->base.ndim) {
548
+ if (qi_orig_dim >= na1->base.ndim) {
543
549
  // new dimension
544
550
  SDX_SET_STRIDE(na2->stridx[j], elmsz);
545
551
  } else if (q[i].idx != NULL && SDX_IS_INDEX(sdx1)) {
@@ -13,10 +13,10 @@ extern "C" {
13
13
  #endif
14
14
  #endif
15
15
 
16
- #define NARRAY_VERSION "0.10.2"
16
+ #define NARRAY_VERSION "0.10.3"
17
17
  #define NARRAY_VERSION_MAJOR 0
18
18
  #define NARRAY_VERSION_MINOR 10
19
- #define NARRAY_VERSION_PATCH 2
19
+ #define NARRAY_VERSION_PATCH 3
20
20
  #define NARRAY_VERSION_CODE \
21
21
  (NARRAY_VERSION_MAJOR * 10000 + NARRAY_VERSION_MINOR * 100 + NARRAY_VERSION_PATCH)
22
22
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: numo-narray-alt
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.2
4
+ version: 0.10.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - yoshoku
@@ -214,7 +214,7 @@ licenses:
214
214
  metadata:
215
215
  homepage_uri: https://github.com/yoshoku/numo-narray-alt
216
216
  changelog_uri: https://github.com/yoshoku/numo-narray-alt/blob/main/CHANGELOG.md
217
- documentation_uri: https://gemdocs.org/gems/numo-narray-alt/0.10.2/
217
+ documentation_uri: https://gemdocs.org/gems/numo-narray-alt/0.10.3/
218
218
  rubygems_mfa_required: 'true'
219
219
  post_install_message: |
220
220
  ===