numo-narray-alt 0.9.4 → 0.9.5

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.
Files changed (43) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +9 -3
  3. data/Rakefile +8 -0
  4. data/ext/numo/narray/SFMT-params19937.h +16 -12
  5. data/ext/numo/narray/SFMT.c +12 -5
  6. data/ext/numo/narray/array.c +25 -19
  7. data/ext/numo/narray/data.c +74 -70
  8. data/ext/numo/narray/extconf.rb +1 -0
  9. data/ext/numo/narray/index.c +49 -26
  10. data/ext/numo/narray/kwargs.c +11 -9
  11. data/ext/numo/narray/math.c +4 -2
  12. data/ext/numo/narray/narray.c +17 -10
  13. data/ext/numo/narray/ndloop.c +52 -63
  14. data/ext/numo/narray/numo/intern.h +9 -3
  15. data/ext/numo/narray/numo/narray.h +20 -20
  16. data/ext/numo/narray/numo/ndloop.h +1 -1
  17. data/ext/numo/narray/numo/template.h +85 -81
  18. data/ext/numo/narray/numo/types/complex.h +7 -3
  19. data/ext/numo/narray/numo/types/complex_macro.h +27 -25
  20. data/ext/numo/narray/numo/types/float_macro.h +20 -17
  21. data/ext/numo/narray/numo/types/real_accum.h +22 -22
  22. data/ext/numo/narray/numo/types/robj_macro.h +19 -12
  23. data/ext/numo/narray/numo/types/xint_macro.h +9 -8
  24. data/ext/numo/narray/src/t_bit.c +97 -88
  25. data/ext/numo/narray/src/t_dcomplex.c +336 -307
  26. data/ext/numo/narray/src/t_dfloat.c +522 -456
  27. data/ext/numo/narray/src/t_int16.c +351 -308
  28. data/ext/numo/narray/src/t_int32.c +351 -308
  29. data/ext/numo/narray/src/t_int64.c +351 -308
  30. data/ext/numo/narray/src/t_int8.c +309 -288
  31. data/ext/numo/narray/src/t_mean.c +105 -0
  32. data/ext/numo/narray/src/t_robject.c +323 -296
  33. data/ext/numo/narray/src/t_scomplex.c +327 -302
  34. data/ext/numo/narray/src/t_sfloat.c +515 -451
  35. data/ext/numo/narray/src/t_uint16.c +351 -308
  36. data/ext/numo/narray/src/t_uint32.c +351 -308
  37. data/ext/numo/narray/src/t_uint64.c +351 -308
  38. data/ext/numo/narray/src/t_uint8.c +311 -288
  39. data/ext/numo/narray/step.c +7 -2
  40. data/ext/numo/narray/struct.c +24 -22
  41. data/lib/numo/narray/extra.rb +66 -25
  42. data/numo-narray-alt.gemspec +38 -0
  43. metadata +7 -1
@@ -233,8 +233,8 @@ static void iter_dcomplex_store_bit(na_loop_t* const lp) {
233
233
  }
234
234
 
235
235
  static VALUE dcomplex_store_bit(VALUE self, VALUE obj) {
236
- ndfunc_arg_in_t ain[2] = {{OVERWRITE, 0}, {Qnil, 0}};
237
- ndfunc_t ndf = {iter_dcomplex_store_bit, FULL_LOOP, 2, 0, ain, 0};
236
+ ndfunc_arg_in_t ain[2] = { { OVERWRITE, 0 }, { Qnil, 0 } };
237
+ ndfunc_t ndf = { iter_dcomplex_store_bit, FULL_LOOP, 2, 0, ain, 0 };
238
238
 
239
239
  na_ndloop(&ndf, 2, self, obj);
240
240
  return self;
@@ -282,8 +282,8 @@ static void iter_dcomplex_store_dcomplex(na_loop_t* const lp) {
282
282
  }
283
283
 
284
284
  static VALUE dcomplex_store_dcomplex(VALUE self, VALUE obj) {
285
- ndfunc_arg_in_t ain[2] = {{OVERWRITE, 0}, {Qnil, 0}};
286
- ndfunc_t ndf = {iter_dcomplex_store_dcomplex, FULL_LOOP, 2, 0, ain, 0};
285
+ ndfunc_arg_in_t ain[2] = { { OVERWRITE, 0 }, { Qnil, 0 } };
286
+ ndfunc_t ndf = { iter_dcomplex_store_dcomplex, FULL_LOOP, 2, 0, ain, 0 };
287
287
 
288
288
  na_ndloop(&ndf, 2, self, obj);
289
289
  return self;
@@ -331,8 +331,8 @@ static void iter_dcomplex_store_scomplex(na_loop_t* const lp) {
331
331
  }
332
332
 
333
333
  static VALUE dcomplex_store_scomplex(VALUE self, VALUE obj) {
334
- ndfunc_arg_in_t ain[2] = {{OVERWRITE, 0}, {Qnil, 0}};
335
- ndfunc_t ndf = {iter_dcomplex_store_scomplex, FULL_LOOP, 2, 0, ain, 0};
334
+ ndfunc_arg_in_t ain[2] = { { OVERWRITE, 0 }, { Qnil, 0 } };
335
+ ndfunc_t ndf = { iter_dcomplex_store_scomplex, FULL_LOOP, 2, 0, ain, 0 };
336
336
 
337
337
  na_ndloop(&ndf, 2, self, obj);
338
338
  return self;
@@ -380,8 +380,8 @@ static void iter_dcomplex_store_dfloat(na_loop_t* const lp) {
380
380
  }
381
381
 
382
382
  static VALUE dcomplex_store_dfloat(VALUE self, VALUE obj) {
383
- ndfunc_arg_in_t ain[2] = {{OVERWRITE, 0}, {Qnil, 0}};
384
- ndfunc_t ndf = {iter_dcomplex_store_dfloat, FULL_LOOP, 2, 0, ain, 0};
383
+ ndfunc_arg_in_t ain[2] = { { OVERWRITE, 0 }, { Qnil, 0 } };
384
+ ndfunc_t ndf = { iter_dcomplex_store_dfloat, FULL_LOOP, 2, 0, ain, 0 };
385
385
 
386
386
  na_ndloop(&ndf, 2, self, obj);
387
387
  return self;
@@ -429,8 +429,8 @@ static void iter_dcomplex_store_sfloat(na_loop_t* const lp) {
429
429
  }
430
430
 
431
431
  static VALUE dcomplex_store_sfloat(VALUE self, VALUE obj) {
432
- ndfunc_arg_in_t ain[2] = {{OVERWRITE, 0}, {Qnil, 0}};
433
- ndfunc_t ndf = {iter_dcomplex_store_sfloat, FULL_LOOP, 2, 0, ain, 0};
432
+ ndfunc_arg_in_t ain[2] = { { OVERWRITE, 0 }, { Qnil, 0 } };
433
+ ndfunc_t ndf = { iter_dcomplex_store_sfloat, FULL_LOOP, 2, 0, ain, 0 };
434
434
 
435
435
  na_ndloop(&ndf, 2, self, obj);
436
436
  return self;
@@ -478,8 +478,8 @@ static void iter_dcomplex_store_int64(na_loop_t* const lp) {
478
478
  }
479
479
 
480
480
  static VALUE dcomplex_store_int64(VALUE self, VALUE obj) {
481
- ndfunc_arg_in_t ain[2] = {{OVERWRITE, 0}, {Qnil, 0}};
482
- ndfunc_t ndf = {iter_dcomplex_store_int64, FULL_LOOP, 2, 0, ain, 0};
481
+ ndfunc_arg_in_t ain[2] = { { OVERWRITE, 0 }, { Qnil, 0 } };
482
+ ndfunc_t ndf = { iter_dcomplex_store_int64, FULL_LOOP, 2, 0, ain, 0 };
483
483
 
484
484
  na_ndloop(&ndf, 2, self, obj);
485
485
  return self;
@@ -527,8 +527,8 @@ static void iter_dcomplex_store_int32(na_loop_t* const lp) {
527
527
  }
528
528
 
529
529
  static VALUE dcomplex_store_int32(VALUE self, VALUE obj) {
530
- ndfunc_arg_in_t ain[2] = {{OVERWRITE, 0}, {Qnil, 0}};
531
- ndfunc_t ndf = {iter_dcomplex_store_int32, FULL_LOOP, 2, 0, ain, 0};
530
+ ndfunc_arg_in_t ain[2] = { { OVERWRITE, 0 }, { Qnil, 0 } };
531
+ ndfunc_t ndf = { iter_dcomplex_store_int32, FULL_LOOP, 2, 0, ain, 0 };
532
532
 
533
533
  na_ndloop(&ndf, 2, self, obj);
534
534
  return self;
@@ -576,8 +576,8 @@ static void iter_dcomplex_store_int16(na_loop_t* const lp) {
576
576
  }
577
577
 
578
578
  static VALUE dcomplex_store_int16(VALUE self, VALUE obj) {
579
- ndfunc_arg_in_t ain[2] = {{OVERWRITE, 0}, {Qnil, 0}};
580
- ndfunc_t ndf = {iter_dcomplex_store_int16, FULL_LOOP, 2, 0, ain, 0};
579
+ ndfunc_arg_in_t ain[2] = { { OVERWRITE, 0 }, { Qnil, 0 } };
580
+ ndfunc_t ndf = { iter_dcomplex_store_int16, FULL_LOOP, 2, 0, ain, 0 };
581
581
 
582
582
  na_ndloop(&ndf, 2, self, obj);
583
583
  return self;
@@ -625,8 +625,8 @@ static void iter_dcomplex_store_int8(na_loop_t* const lp) {
625
625
  }
626
626
 
627
627
  static VALUE dcomplex_store_int8(VALUE self, VALUE obj) {
628
- ndfunc_arg_in_t ain[2] = {{OVERWRITE, 0}, {Qnil, 0}};
629
- ndfunc_t ndf = {iter_dcomplex_store_int8, FULL_LOOP, 2, 0, ain, 0};
628
+ ndfunc_arg_in_t ain[2] = { { OVERWRITE, 0 }, { Qnil, 0 } };
629
+ ndfunc_t ndf = { iter_dcomplex_store_int8, FULL_LOOP, 2, 0, ain, 0 };
630
630
 
631
631
  na_ndloop(&ndf, 2, self, obj);
632
632
  return self;
@@ -674,8 +674,8 @@ static void iter_dcomplex_store_uint64(na_loop_t* const lp) {
674
674
  }
675
675
 
676
676
  static VALUE dcomplex_store_uint64(VALUE self, VALUE obj) {
677
- ndfunc_arg_in_t ain[2] = {{OVERWRITE, 0}, {Qnil, 0}};
678
- ndfunc_t ndf = {iter_dcomplex_store_uint64, FULL_LOOP, 2, 0, ain, 0};
677
+ ndfunc_arg_in_t ain[2] = { { OVERWRITE, 0 }, { Qnil, 0 } };
678
+ ndfunc_t ndf = { iter_dcomplex_store_uint64, FULL_LOOP, 2, 0, ain, 0 };
679
679
 
680
680
  na_ndloop(&ndf, 2, self, obj);
681
681
  return self;
@@ -723,8 +723,8 @@ static void iter_dcomplex_store_uint32(na_loop_t* const lp) {
723
723
  }
724
724
 
725
725
  static VALUE dcomplex_store_uint32(VALUE self, VALUE obj) {
726
- ndfunc_arg_in_t ain[2] = {{OVERWRITE, 0}, {Qnil, 0}};
727
- ndfunc_t ndf = {iter_dcomplex_store_uint32, FULL_LOOP, 2, 0, ain, 0};
726
+ ndfunc_arg_in_t ain[2] = { { OVERWRITE, 0 }, { Qnil, 0 } };
727
+ ndfunc_t ndf = { iter_dcomplex_store_uint32, FULL_LOOP, 2, 0, ain, 0 };
728
728
 
729
729
  na_ndloop(&ndf, 2, self, obj);
730
730
  return self;
@@ -772,8 +772,8 @@ static void iter_dcomplex_store_uint16(na_loop_t* const lp) {
772
772
  }
773
773
 
774
774
  static VALUE dcomplex_store_uint16(VALUE self, VALUE obj) {
775
- ndfunc_arg_in_t ain[2] = {{OVERWRITE, 0}, {Qnil, 0}};
776
- ndfunc_t ndf = {iter_dcomplex_store_uint16, FULL_LOOP, 2, 0, ain, 0};
775
+ ndfunc_arg_in_t ain[2] = { { OVERWRITE, 0 }, { Qnil, 0 } };
776
+ ndfunc_t ndf = { iter_dcomplex_store_uint16, FULL_LOOP, 2, 0, ain, 0 };
777
777
 
778
778
  na_ndloop(&ndf, 2, self, obj);
779
779
  return self;
@@ -821,8 +821,8 @@ static void iter_dcomplex_store_uint8(na_loop_t* const lp) {
821
821
  }
822
822
 
823
823
  static VALUE dcomplex_store_uint8(VALUE self, VALUE obj) {
824
- ndfunc_arg_in_t ain[2] = {{OVERWRITE, 0}, {Qnil, 0}};
825
- ndfunc_t ndf = {iter_dcomplex_store_uint8, FULL_LOOP, 2, 0, ain, 0};
824
+ ndfunc_arg_in_t ain[2] = { { OVERWRITE, 0 }, { Qnil, 0 } };
825
+ ndfunc_t ndf = { iter_dcomplex_store_uint8, FULL_LOOP, 2, 0, ain, 0 };
826
826
 
827
827
  na_ndloop(&ndf, 2, self, obj);
828
828
  return self;
@@ -870,8 +870,8 @@ static void iter_dcomplex_store_robject(na_loop_t* const lp) {
870
870
  }
871
871
 
872
872
  static VALUE dcomplex_store_robject(VALUE self, VALUE obj) {
873
- ndfunc_arg_in_t ain[2] = {{OVERWRITE, 0}, {Qnil, 0}};
874
- ndfunc_t ndf = {iter_dcomplex_store_robject, FULL_LOOP, 2, 0, ain, 0};
873
+ ndfunc_arg_in_t ain[2] = { { OVERWRITE, 0 }, { Qnil, 0 } };
874
+ ndfunc_t ndf = { iter_dcomplex_store_robject, FULL_LOOP, 2, 0, ain, 0 };
875
875
 
876
876
  na_ndloop(&ndf, 2, self, obj);
877
877
  return self;
@@ -979,8 +979,8 @@ loop_end:
979
979
  }
980
980
 
981
981
  static VALUE dcomplex_store_array(VALUE self, VALUE rary) {
982
- ndfunc_arg_in_t ain[2] = {{OVERWRITE, 0}, {rb_cArray, 0}};
983
- ndfunc_t ndf = {iter_dcomplex_store_array, FULL_LOOP, 2, 0, ain, 0};
982
+ ndfunc_arg_in_t ain[2] = { { OVERWRITE, 0 }, { rb_cArray, 0 } };
983
+ ndfunc_t ndf = { iter_dcomplex_store_array, FULL_LOOP, 2, 0, ain, 0 };
984
984
 
985
985
  na_ndloop_store_rarray(&ndf, self, rary);
986
986
  return self;
@@ -1085,8 +1085,10 @@ static VALUE dcomplex_store(VALUE self, VALUE obj) {
1085
1085
  }
1086
1086
  }
1087
1087
 
1088
- rb_raise(nary_eCastError, "unknown conversion from %s to %s", rb_class2name(rb_obj_class(obj)),
1089
- rb_class2name(rb_obj_class(self)));
1088
+ rb_raise(
1089
+ nary_eCastError, "unknown conversion from %s to %s", rb_class2name(rb_obj_class(obj)),
1090
+ rb_class2name(rb_obj_class(self))
1091
+ );
1090
1092
 
1091
1093
  return self;
1092
1094
  }
@@ -1196,7 +1198,10 @@ static dtype dcomplex_extract_data(VALUE obj) {
1196
1198
  return dcomplex_extract_data(r);
1197
1199
  }
1198
1200
 
1199
- rb_raise(nary_eCastError, "unknown conversion from %s to %s", rb_class2name(rb_obj_class(obj)), rb_class2name(cT));
1201
+ rb_raise(
1202
+ nary_eCastError, "unknown conversion from %s to %s", rb_class2name(rb_obj_class(obj)),
1203
+ rb_class2name(cT)
1204
+ );
1200
1205
  }
1201
1206
  if (TYPE(obj) == T_ARRAY) {
1202
1207
  if (RARRAY_LEN(obj) != 1) {
@@ -1265,8 +1270,8 @@ static VALUE dcomplex_s_cast(VALUE type, VALUE obj) {
1265
1270
  /*
1266
1271
  Multi-dimensional element reference.
1267
1272
  @overload [](dim0,...,dimL)
1268
- @param [Numeric,Range,Array,Numo::Int32,Numo::Int64,Numo::Bit,TrueClass,FalseClass,Symbol] dim0,...,dimL multi-dimensional
1269
- indices.
1273
+ @param [Numeric,Range,Array,Numo::Int32,Numo::Int64,Numo::Bit,TrueClass,FalseClass,Symbol]
1274
+ dim0,...,dimL multi-dimensional indices.
1270
1275
  @return [Numeric,Numo::DComplex] an element or NArray view.
1271
1276
  @see Numo::NArray#[]
1272
1277
  @see #[]=
@@ -1288,8 +1293,8 @@ static VALUE dcomplex_aref(int argc, VALUE* argv, VALUE self) {
1288
1293
  /*
1289
1294
  Multi-dimensional element assignment.
1290
1295
  @overload []=(dim0,...,dimL,val)
1291
- @param [Numeric,Range,Array,Numo::Int32,Numo::Int64,Numo::Bit,TrueClass,FalseClass,Symbol] dim0,...,dimL multi-dimensional
1292
- indices.
1296
+ @param [Numeric,Range,Array,Numo::Int32,Numo::Int64,Numo::Bit,TrueClass,FalseClass,Symbol]
1297
+ dim0,...,dimL multi-dimensional indices.
1293
1298
  @param [Numeric,Numo::NArray,Array] val Value(s) to be set to self.
1294
1299
  @return [Numeric,Numo::NArray,Array] returns `val` (last argument).
1295
1300
  @see Numo::NArray#[]=
@@ -1360,9 +1365,9 @@ static void iter_dcomplex_to_a(na_loop_t* const lp) {
1360
1365
  @return [Array]
1361
1366
  */
1362
1367
  static VALUE dcomplex_to_a(VALUE self) {
1363
- ndfunc_arg_in_t ain[3] = {{Qnil, 0}, {sym_loop_opt}, {sym_option}};
1364
- ndfunc_arg_out_t aout[1] = {{rb_cArray, 0}}; // dummy?
1365
- ndfunc_t ndf = {iter_dcomplex_to_a, FULL_LOOP_NIP, 3, 1, ain, aout};
1368
+ ndfunc_arg_in_t ain[3] = { { Qnil, 0 }, { sym_loop_opt }, { sym_option } };
1369
+ ndfunc_arg_out_t aout[1] = { { rb_cArray, 0 } }; // dummy?
1370
+ ndfunc_t ndf = { iter_dcomplex_to_a, FULL_LOOP_NIP, 3, 1, ain, aout };
1366
1371
  return na_ndloop_cast_narray_to_rarray(&ndf, self, Qnil);
1367
1372
  }
1368
1373
 
@@ -1394,8 +1399,8 @@ static void iter_dcomplex_fill(na_loop_t* const lp) {
1394
1399
  @return [Numo::DComplex] self.
1395
1400
  */
1396
1401
  static VALUE dcomplex_fill(VALUE self, VALUE val) {
1397
- ndfunc_arg_in_t ain[2] = {{OVERWRITE, 0}, {sym_option}};
1398
- ndfunc_t ndf = {iter_dcomplex_fill, FULL_LOOP, 2, 0, ain, 0};
1402
+ ndfunc_arg_in_t ain[2] = { { OVERWRITE, 0 }, { sym_option } };
1403
+ ndfunc_t ndf = { iter_dcomplex_fill, FULL_LOOP, 2, 0, ain, 0 };
1399
1404
 
1400
1405
  na_ndloop(&ndf, 2, self, val);
1401
1406
  return self;
@@ -1450,9 +1455,9 @@ static void iter_dcomplex_format(na_loop_t* const lp) {
1450
1455
  static VALUE dcomplex_format(int argc, VALUE* argv, VALUE self) {
1451
1456
  VALUE fmt = Qnil;
1452
1457
 
1453
- ndfunc_arg_in_t ain[2] = {{Qnil, 0}, {sym_option}};
1454
- ndfunc_arg_out_t aout[1] = {{numo_cRObject, 0}};
1455
- ndfunc_t ndf = {iter_dcomplex_format, FULL_LOOP_NIP, 2, 1, ain, aout};
1458
+ ndfunc_arg_in_t ain[2] = { { Qnil, 0 }, { sym_option } };
1459
+ ndfunc_arg_out_t aout[1] = { { numo_cRObject, 0 } };
1460
+ ndfunc_t ndf = { iter_dcomplex_format, FULL_LOOP_NIP, 2, 1, ain, aout };
1456
1461
 
1457
1462
  rb_scan_args(argc, argv, "01", &fmt);
1458
1463
  return na_ndloop(&ndf, 2, self, fmt);
@@ -1496,9 +1501,9 @@ static void iter_dcomplex_format_to_a(na_loop_t* const lp) {
1496
1501
  */
1497
1502
  static VALUE dcomplex_format_to_a(int argc, VALUE* argv, VALUE self) {
1498
1503
  VALUE fmt = Qnil;
1499
- ndfunc_arg_in_t ain[3] = {{Qnil, 0}, {sym_loop_opt}, {sym_option}};
1500
- ndfunc_arg_out_t aout[1] = {{rb_cArray, 0}}; // dummy?
1501
- ndfunc_t ndf = {iter_dcomplex_format_to_a, FULL_LOOP_NIP, 3, 1, ain, aout};
1504
+ ndfunc_arg_in_t ain[3] = { { Qnil, 0 }, { sym_loop_opt }, { sym_option } };
1505
+ ndfunc_arg_out_t aout[1] = { { rb_cArray, 0 } }; // dummy?
1506
+ ndfunc_t ndf = { iter_dcomplex_format_to_a, FULL_LOOP_NIP, 3, 1, ain, aout };
1502
1507
 
1503
1508
  rb_scan_args(argc, argv, "01", &fmt);
1504
1509
  return na_ndloop_cast_narray_to_rarray(&ndf, self, fmt);
@@ -1552,8 +1557,8 @@ static void iter_dcomplex_each(na_loop_t* const lp) {
1552
1557
  @see #map
1553
1558
  */
1554
1559
  static VALUE dcomplex_each(VALUE self) {
1555
- ndfunc_arg_in_t ain[1] = {{Qnil, 0}};
1556
- ndfunc_t ndf = {iter_dcomplex_each, FULL_LOOP_NIP, 1, 0, ain, 0};
1560
+ ndfunc_arg_in_t ain[1] = { { Qnil, 0 } };
1561
+ ndfunc_t ndf = { iter_dcomplex_each, FULL_LOOP_NIP, 1, 0, ain, 0 };
1557
1562
 
1558
1563
  na_ndloop(&ndf, 1, self);
1559
1564
  return self;
@@ -1627,9 +1632,9 @@ static void iter_dcomplex_map(na_loop_t* const lp) {
1627
1632
  @return [Numo::DComplex] map of self.
1628
1633
  */
1629
1634
  static VALUE dcomplex_map(VALUE self) {
1630
- ndfunc_arg_in_t ain[1] = {{cT, 0}};
1631
- ndfunc_arg_out_t aout[1] = {{cT, 0}};
1632
- ndfunc_t ndf = {iter_dcomplex_map, FULL_LOOP, 1, 1, ain, aout};
1635
+ ndfunc_arg_in_t ain[1] = { { cT, 0 } };
1636
+ ndfunc_arg_out_t aout[1] = { { cT, 0 } };
1637
+ ndfunc_t ndf = { iter_dcomplex_map, FULL_LOOP, 1, 1, ain, aout };
1633
1638
 
1634
1639
  return na_ndloop(&ndf, 1, self);
1635
1640
  }
@@ -1691,8 +1696,8 @@ static void iter_dcomplex_each_with_index(na_loop_t* const lp) {
1691
1696
  @see #map_with_index
1692
1697
  */
1693
1698
  static VALUE dcomplex_each_with_index(VALUE self) {
1694
- ndfunc_arg_in_t ain[1] = {{Qnil, 0}};
1695
- ndfunc_t ndf = {iter_dcomplex_each_with_index, FULL_LOOP_NIP, 1, 0, ain, 0};
1699
+ ndfunc_arg_in_t ain[1] = { { Qnil, 0 } };
1700
+ ndfunc_t ndf = { iter_dcomplex_each_with_index, FULL_LOOP_NIP, 1, 0, ain, 0 };
1696
1701
 
1697
1702
  na_ndloop_with_index(&ndf, 1, self);
1698
1703
  return self;
@@ -1782,9 +1787,9 @@ static void iter_dcomplex_map_with_index(na_loop_t* const lp) {
1782
1787
  @see #each_with_index
1783
1788
  */
1784
1789
  static VALUE dcomplex_map_with_index(VALUE self) {
1785
- ndfunc_arg_in_t ain[1] = {{Qnil, 0}};
1786
- ndfunc_arg_out_t aout[1] = {{cT, 0}};
1787
- ndfunc_t ndf = {iter_dcomplex_map_with_index, FULL_LOOP, 1, 1, ain, aout};
1790
+ ndfunc_arg_in_t ain[1] = { { Qnil, 0 } };
1791
+ ndfunc_arg_out_t aout[1] = { { cT, 0 } };
1792
+ ndfunc_t ndf = { iter_dcomplex_map_with_index, FULL_LOOP, 1, 1, ain, aout };
1788
1793
 
1789
1794
  return na_ndloop_with_index(&ndf, 1, self);
1790
1795
  }
@@ -1836,14 +1841,14 @@ static void iter_dcomplex_abs(na_loop_t* const lp) {
1836
1841
  @return [Numo::DFloat] abs of self.
1837
1842
  */
1838
1843
  static VALUE dcomplex_abs(VALUE self) {
1839
- ndfunc_arg_in_t ain[1] = {{cT, 0}};
1840
- ndfunc_arg_out_t aout[1] = {{cRT, 0}};
1841
- ndfunc_t ndf = {iter_dcomplex_abs, FULL_LOOP, 1, 1, ain, aout};
1844
+ ndfunc_arg_in_t ain[1] = { { cT, 0 } };
1845
+ ndfunc_arg_out_t aout[1] = { { cRT, 0 } };
1846
+ ndfunc_t ndf = { iter_dcomplex_abs, FULL_LOOP, 1, 1, ain, aout };
1842
1847
 
1843
1848
  return na_ndloop(&ndf, 1, self);
1844
1849
  }
1845
1850
 
1846
- #define check_intdivzero(y) \
1851
+ #define check_intdivzero(y) \
1847
1852
  {}
1848
1853
 
1849
1854
  static void iter_dcomplex_add(na_loop_t* const lp) {
@@ -1858,7 +1863,8 @@ static void iter_dcomplex_add(na_loop_t* const lp) {
1858
1863
  INIT_PTR(lp, 2, p3, s3);
1859
1864
 
1860
1865
  //
1861
- if (is_aligned(p1, sizeof(dtype)) && is_aligned(p2, sizeof(dtype)) && is_aligned(p3, sizeof(dtype))) {
1866
+ if (is_aligned(p1, sizeof(dtype)) && is_aligned(p2, sizeof(dtype)) &&
1867
+ is_aligned(p3, sizeof(dtype))) {
1862
1868
 
1863
1869
  if (s1 == sizeof(dtype) && s2 == sizeof(dtype) && s3 == sizeof(dtype)) {
1864
1870
  if (p1 == p3) { // inplace case
@@ -1875,7 +1881,8 @@ static void iter_dcomplex_add(na_loop_t* const lp) {
1875
1881
  return;
1876
1882
  }
1877
1883
 
1878
- if (is_aligned_step(s1, sizeof(dtype)) && is_aligned_step(s2, sizeof(dtype)) && is_aligned_step(s3, sizeof(dtype))) {
1884
+ if (is_aligned_step(s1, sizeof(dtype)) && is_aligned_step(s2, sizeof(dtype)) &&
1885
+ is_aligned_step(s3, sizeof(dtype))) {
1879
1886
  //
1880
1887
 
1881
1888
  if (s2 == 0) { // Broadcasting from scalar value.
@@ -1933,9 +1940,9 @@ static void iter_dcomplex_add(na_loop_t* const lp) {
1933
1940
  #undef check_intdivzero
1934
1941
 
1935
1942
  static VALUE dcomplex_add_self(VALUE self, VALUE other) {
1936
- ndfunc_arg_in_t ain[2] = {{cT, 0}, {cT, 0}};
1937
- ndfunc_arg_out_t aout[1] = {{cT, 0}};
1938
- ndfunc_t ndf = {iter_dcomplex_add, STRIDE_LOOP, 2, 1, ain, aout};
1943
+ ndfunc_arg_in_t ain[2] = { { cT, 0 }, { cT, 0 } };
1944
+ ndfunc_arg_out_t aout[1] = { { cT, 0 } };
1945
+ ndfunc_t ndf = { iter_dcomplex_add, STRIDE_LOOP, 2, 1, ain, aout };
1939
1946
 
1940
1947
  return na_ndloop(&ndf, 2, self, other);
1941
1948
  }
@@ -1959,7 +1966,7 @@ static VALUE dcomplex_add(VALUE self, VALUE other) {
1959
1966
  }
1960
1967
  }
1961
1968
 
1962
- #define check_intdivzero(y) \
1969
+ #define check_intdivzero(y) \
1963
1970
  {}
1964
1971
 
1965
1972
  static void iter_dcomplex_sub(na_loop_t* const lp) {
@@ -1974,7 +1981,8 @@ static void iter_dcomplex_sub(na_loop_t* const lp) {
1974
1981
  INIT_PTR(lp, 2, p3, s3);
1975
1982
 
1976
1983
  //
1977
- if (is_aligned(p1, sizeof(dtype)) && is_aligned(p2, sizeof(dtype)) && is_aligned(p3, sizeof(dtype))) {
1984
+ if (is_aligned(p1, sizeof(dtype)) && is_aligned(p2, sizeof(dtype)) &&
1985
+ is_aligned(p3, sizeof(dtype))) {
1978
1986
 
1979
1987
  if (s1 == sizeof(dtype) && s2 == sizeof(dtype) && s3 == sizeof(dtype)) {
1980
1988
  if (p1 == p3) { // inplace case
@@ -1991,7 +1999,8 @@ static void iter_dcomplex_sub(na_loop_t* const lp) {
1991
1999
  return;
1992
2000
  }
1993
2001
 
1994
- if (is_aligned_step(s1, sizeof(dtype)) && is_aligned_step(s2, sizeof(dtype)) && is_aligned_step(s3, sizeof(dtype))) {
2002
+ if (is_aligned_step(s1, sizeof(dtype)) && is_aligned_step(s2, sizeof(dtype)) &&
2003
+ is_aligned_step(s3, sizeof(dtype))) {
1995
2004
  //
1996
2005
 
1997
2006
  if (s2 == 0) { // Broadcasting from scalar value.
@@ -2049,9 +2058,9 @@ static void iter_dcomplex_sub(na_loop_t* const lp) {
2049
2058
  #undef check_intdivzero
2050
2059
 
2051
2060
  static VALUE dcomplex_sub_self(VALUE self, VALUE other) {
2052
- ndfunc_arg_in_t ain[2] = {{cT, 0}, {cT, 0}};
2053
- ndfunc_arg_out_t aout[1] = {{cT, 0}};
2054
- ndfunc_t ndf = {iter_dcomplex_sub, STRIDE_LOOP, 2, 1, ain, aout};
2061
+ ndfunc_arg_in_t ain[2] = { { cT, 0 }, { cT, 0 } };
2062
+ ndfunc_arg_out_t aout[1] = { { cT, 0 } };
2063
+ ndfunc_t ndf = { iter_dcomplex_sub, STRIDE_LOOP, 2, 1, ain, aout };
2055
2064
 
2056
2065
  return na_ndloop(&ndf, 2, self, other);
2057
2066
  }
@@ -2075,7 +2084,7 @@ static VALUE dcomplex_sub(VALUE self, VALUE other) {
2075
2084
  }
2076
2085
  }
2077
2086
 
2078
- #define check_intdivzero(y) \
2087
+ #define check_intdivzero(y) \
2079
2088
  {}
2080
2089
 
2081
2090
  static void iter_dcomplex_mul(na_loop_t* const lp) {
@@ -2090,7 +2099,8 @@ static void iter_dcomplex_mul(na_loop_t* const lp) {
2090
2099
  INIT_PTR(lp, 2, p3, s3);
2091
2100
 
2092
2101
  //
2093
- if (is_aligned(p1, sizeof(dtype)) && is_aligned(p2, sizeof(dtype)) && is_aligned(p3, sizeof(dtype))) {
2102
+ if (is_aligned(p1, sizeof(dtype)) && is_aligned(p2, sizeof(dtype)) &&
2103
+ is_aligned(p3, sizeof(dtype))) {
2094
2104
 
2095
2105
  if (s1 == sizeof(dtype) && s2 == sizeof(dtype) && s3 == sizeof(dtype)) {
2096
2106
  if (p1 == p3) { // inplace case
@@ -2107,7 +2117,8 @@ static void iter_dcomplex_mul(na_loop_t* const lp) {
2107
2117
  return;
2108
2118
  }
2109
2119
 
2110
- if (is_aligned_step(s1, sizeof(dtype)) && is_aligned_step(s2, sizeof(dtype)) && is_aligned_step(s3, sizeof(dtype))) {
2120
+ if (is_aligned_step(s1, sizeof(dtype)) && is_aligned_step(s2, sizeof(dtype)) &&
2121
+ is_aligned_step(s3, sizeof(dtype))) {
2111
2122
  //
2112
2123
 
2113
2124
  if (s2 == 0) { // Broadcasting from scalar value.
@@ -2165,9 +2176,9 @@ static void iter_dcomplex_mul(na_loop_t* const lp) {
2165
2176
  #undef check_intdivzero
2166
2177
 
2167
2178
  static VALUE dcomplex_mul_self(VALUE self, VALUE other) {
2168
- ndfunc_arg_in_t ain[2] = {{cT, 0}, {cT, 0}};
2169
- ndfunc_arg_out_t aout[1] = {{cT, 0}};
2170
- ndfunc_t ndf = {iter_dcomplex_mul, STRIDE_LOOP, 2, 1, ain, aout};
2179
+ ndfunc_arg_in_t ain[2] = { { cT, 0 }, { cT, 0 } };
2180
+ ndfunc_arg_out_t aout[1] = { { cT, 0 } };
2181
+ ndfunc_t ndf = { iter_dcomplex_mul, STRIDE_LOOP, 2, 1, ain, aout };
2171
2182
 
2172
2183
  return na_ndloop(&ndf, 2, self, other);
2173
2184
  }
@@ -2191,7 +2202,7 @@ static VALUE dcomplex_mul(VALUE self, VALUE other) {
2191
2202
  }
2192
2203
  }
2193
2204
 
2194
- #define check_intdivzero(y) \
2205
+ #define check_intdivzero(y) \
2195
2206
  {}
2196
2207
 
2197
2208
  static void iter_dcomplex_div(na_loop_t* const lp) {
@@ -2206,7 +2217,8 @@ static void iter_dcomplex_div(na_loop_t* const lp) {
2206
2217
  INIT_PTR(lp, 2, p3, s3);
2207
2218
 
2208
2219
  //
2209
- if (is_aligned(p1, sizeof(dtype)) && is_aligned(p2, sizeof(dtype)) && is_aligned(p3, sizeof(dtype))) {
2220
+ if (is_aligned(p1, sizeof(dtype)) && is_aligned(p2, sizeof(dtype)) &&
2221
+ is_aligned(p3, sizeof(dtype))) {
2210
2222
 
2211
2223
  if (s1 == sizeof(dtype) && s2 == sizeof(dtype) && s3 == sizeof(dtype)) {
2212
2224
  if (p1 == p3) { // inplace case
@@ -2223,7 +2235,8 @@ static void iter_dcomplex_div(na_loop_t* const lp) {
2223
2235
  return;
2224
2236
  }
2225
2237
 
2226
- if (is_aligned_step(s1, sizeof(dtype)) && is_aligned_step(s2, sizeof(dtype)) && is_aligned_step(s3, sizeof(dtype))) {
2238
+ if (is_aligned_step(s1, sizeof(dtype)) && is_aligned_step(s2, sizeof(dtype)) &&
2239
+ is_aligned_step(s3, sizeof(dtype))) {
2227
2240
  //
2228
2241
 
2229
2242
  if (s2 == 0) { // Broadcasting from scalar value.
@@ -2281,9 +2294,9 @@ static void iter_dcomplex_div(na_loop_t* const lp) {
2281
2294
  #undef check_intdivzero
2282
2295
 
2283
2296
  static VALUE dcomplex_div_self(VALUE self, VALUE other) {
2284
- ndfunc_arg_in_t ain[2] = {{cT, 0}, {cT, 0}};
2285
- ndfunc_arg_out_t aout[1] = {{cT, 0}};
2286
- ndfunc_t ndf = {iter_dcomplex_div, STRIDE_LOOP, 2, 1, ain, aout};
2297
+ ndfunc_arg_in_t ain[2] = { { cT, 0 }, { cT, 0 } };
2298
+ ndfunc_arg_out_t aout[1] = { { cT, 0 } };
2299
+ ndfunc_t ndf = { iter_dcomplex_div, STRIDE_LOOP, 2, 1, ain, aout };
2287
2300
 
2288
2301
  return na_ndloop(&ndf, 2, self, other);
2289
2302
  }
@@ -2343,11 +2356,11 @@ static void iter_dcomplex_pow_int32(na_loop_t* const lp) {
2343
2356
  }
2344
2357
 
2345
2358
  static VALUE dcomplex_pow_self(VALUE self, VALUE other) {
2346
- ndfunc_arg_in_t ain[2] = {{cT, 0}, {cT, 0}};
2347
- ndfunc_arg_in_t ain_i[2] = {{cT, 0}, {numo_cInt32, 0}};
2348
- ndfunc_arg_out_t aout[1] = {{cT, 0}};
2349
- ndfunc_t ndf = {iter_dcomplex_pow, STRIDE_LOOP, 2, 1, ain, aout};
2350
- ndfunc_t ndf_i = {iter_dcomplex_pow_int32, STRIDE_LOOP, 2, 1, ain_i, aout};
2359
+ ndfunc_arg_in_t ain[2] = { { cT, 0 }, { cT, 0 } };
2360
+ ndfunc_arg_in_t ain_i[2] = { { cT, 0 }, { numo_cInt32, 0 } };
2361
+ ndfunc_arg_out_t aout[1] = { { cT, 0 } };
2362
+ ndfunc_t ndf = { iter_dcomplex_pow, STRIDE_LOOP, 2, 1, ain, aout };
2363
+ ndfunc_t ndf_i = { iter_dcomplex_pow_int32, STRIDE_LOOP, 2, 1, ain_i, aout };
2351
2364
 
2352
2365
  // fixme : use na.integer?
2353
2366
  if (FIXNUM_P(other) || rb_obj_is_kind_of(other, numo_cInt32)) {
@@ -2443,9 +2456,9 @@ static void iter_dcomplex_minus(na_loop_t* const lp) {
2443
2456
  @return [Numo::DComplex] minus of self.
2444
2457
  */
2445
2458
  static VALUE dcomplex_minus(VALUE self) {
2446
- ndfunc_arg_in_t ain[1] = {{cT, 0}};
2447
- ndfunc_arg_out_t aout[1] = {{cT, 0}};
2448
- ndfunc_t ndf = {iter_dcomplex_minus, FULL_LOOP, 1, 1, ain, aout};
2459
+ ndfunc_arg_in_t ain[1] = { { cT, 0 } };
2460
+ ndfunc_arg_out_t aout[1] = { { cT, 0 } };
2461
+ ndfunc_t ndf = { iter_dcomplex_minus, FULL_LOOP, 1, 1, ain, aout };
2449
2462
 
2450
2463
  return na_ndloop(&ndf, 1, self);
2451
2464
  }
@@ -2518,9 +2531,9 @@ static void iter_dcomplex_reciprocal(na_loop_t* const lp) {
2518
2531
  @return [Numo::DComplex] reciprocal of self.
2519
2532
  */
2520
2533
  static VALUE dcomplex_reciprocal(VALUE self) {
2521
- ndfunc_arg_in_t ain[1] = {{cT, 0}};
2522
- ndfunc_arg_out_t aout[1] = {{cT, 0}};
2523
- ndfunc_t ndf = {iter_dcomplex_reciprocal, FULL_LOOP, 1, 1, ain, aout};
2534
+ ndfunc_arg_in_t ain[1] = { { cT, 0 } };
2535
+ ndfunc_arg_out_t aout[1] = { { cT, 0 } };
2536
+ ndfunc_t ndf = { iter_dcomplex_reciprocal, FULL_LOOP, 1, 1, ain, aout };
2524
2537
 
2525
2538
  return na_ndloop(&ndf, 1, self);
2526
2539
  }
@@ -2593,9 +2606,9 @@ static void iter_dcomplex_sign(na_loop_t* const lp) {
2593
2606
  @return [Numo::DComplex] sign of self.
2594
2607
  */
2595
2608
  static VALUE dcomplex_sign(VALUE self) {
2596
- ndfunc_arg_in_t ain[1] = {{cT, 0}};
2597
- ndfunc_arg_out_t aout[1] = {{cT, 0}};
2598
- ndfunc_t ndf = {iter_dcomplex_sign, FULL_LOOP, 1, 1, ain, aout};
2609
+ ndfunc_arg_in_t ain[1] = { { cT, 0 } };
2610
+ ndfunc_arg_out_t aout[1] = { { cT, 0 } };
2611
+ ndfunc_t ndf = { iter_dcomplex_sign, FULL_LOOP, 1, 1, ain, aout };
2599
2612
 
2600
2613
  return na_ndloop(&ndf, 1, self);
2601
2614
  }
@@ -2668,9 +2681,9 @@ static void iter_dcomplex_square(na_loop_t* const lp) {
2668
2681
  @return [Numo::DComplex] square of self.
2669
2682
  */
2670
2683
  static VALUE dcomplex_square(VALUE self) {
2671
- ndfunc_arg_in_t ain[1] = {{cT, 0}};
2672
- ndfunc_arg_out_t aout[1] = {{cT, 0}};
2673
- ndfunc_t ndf = {iter_dcomplex_square, FULL_LOOP, 1, 1, ain, aout};
2684
+ ndfunc_arg_in_t ain[1] = { { cT, 0 } };
2685
+ ndfunc_arg_out_t aout[1] = { { cT, 0 } };
2686
+ ndfunc_t ndf = { iter_dcomplex_square, FULL_LOOP, 1, 1, ain, aout };
2674
2687
 
2675
2688
  return na_ndloop(&ndf, 1, self);
2676
2689
  }
@@ -2743,9 +2756,9 @@ static void iter_dcomplex_conj(na_loop_t* const lp) {
2743
2756
  @return [Numo::DComplex] conj of self.
2744
2757
  */
2745
2758
  static VALUE dcomplex_conj(VALUE self) {
2746
- ndfunc_arg_in_t ain[1] = {{cT, 0}};
2747
- ndfunc_arg_out_t aout[1] = {{cT, 0}};
2748
- ndfunc_t ndf = {iter_dcomplex_conj, FULL_LOOP, 1, 1, ain, aout};
2759
+ ndfunc_arg_in_t ain[1] = { { cT, 0 } };
2760
+ ndfunc_arg_out_t aout[1] = { { cT, 0 } };
2761
+ ndfunc_t ndf = { iter_dcomplex_conj, FULL_LOOP, 1, 1, ain, aout };
2749
2762
 
2750
2763
  return na_ndloop(&ndf, 1, self);
2751
2764
  }
@@ -2818,9 +2831,9 @@ static void iter_dcomplex_im(na_loop_t* const lp) {
2818
2831
  @return [Numo::DComplex] im of self.
2819
2832
  */
2820
2833
  static VALUE dcomplex_im(VALUE self) {
2821
- ndfunc_arg_in_t ain[1] = {{cT, 0}};
2822
- ndfunc_arg_out_t aout[1] = {{cT, 0}};
2823
- ndfunc_t ndf = {iter_dcomplex_im, FULL_LOOP, 1, 1, ain, aout};
2834
+ ndfunc_arg_in_t ain[1] = { { cT, 0 } };
2835
+ ndfunc_arg_out_t aout[1] = { { cT, 0 } };
2836
+ ndfunc_t ndf = { iter_dcomplex_im, FULL_LOOP, 1, 1, ain, aout };
2824
2837
 
2825
2838
  return na_ndloop(&ndf, 1, self);
2826
2839
  }
@@ -2872,9 +2885,9 @@ static void iter_dcomplex_real(na_loop_t* const lp) {
2872
2885
  @return [Numo::DFloat] real of self.
2873
2886
  */
2874
2887
  static VALUE dcomplex_real(VALUE self) {
2875
- ndfunc_arg_in_t ain[1] = {{cT, 0}};
2876
- ndfunc_arg_out_t aout[1] = {{cRT, 0}};
2877
- ndfunc_t ndf = {iter_dcomplex_real, FULL_LOOP, 1, 1, ain, aout};
2888
+ ndfunc_arg_in_t ain[1] = { { cT, 0 } };
2889
+ ndfunc_arg_out_t aout[1] = { { cRT, 0 } };
2890
+ ndfunc_t ndf = { iter_dcomplex_real, FULL_LOOP, 1, 1, ain, aout };
2878
2891
 
2879
2892
  return na_ndloop(&ndf, 1, self);
2880
2893
  }
@@ -2926,9 +2939,9 @@ static void iter_dcomplex_imag(na_loop_t* const lp) {
2926
2939
  @return [Numo::DFloat] imag of self.
2927
2940
  */
2928
2941
  static VALUE dcomplex_imag(VALUE self) {
2929
- ndfunc_arg_in_t ain[1] = {{cT, 0}};
2930
- ndfunc_arg_out_t aout[1] = {{cRT, 0}};
2931
- ndfunc_t ndf = {iter_dcomplex_imag, FULL_LOOP, 1, 1, ain, aout};
2942
+ ndfunc_arg_in_t ain[1] = { { cT, 0 } };
2943
+ ndfunc_arg_out_t aout[1] = { { cRT, 0 } };
2944
+ ndfunc_t ndf = { iter_dcomplex_imag, FULL_LOOP, 1, 1, ain, aout };
2932
2945
 
2933
2946
  return na_ndloop(&ndf, 1, self);
2934
2947
  }
@@ -2980,9 +2993,9 @@ static void iter_dcomplex_arg(na_loop_t* const lp) {
2980
2993
  @return [Numo::DFloat] arg of self.
2981
2994
  */
2982
2995
  static VALUE dcomplex_arg(VALUE self) {
2983
- ndfunc_arg_in_t ain[1] = {{cT, 0}};
2984
- ndfunc_arg_out_t aout[1] = {{cRT, 0}};
2985
- ndfunc_t ndf = {iter_dcomplex_arg, FULL_LOOP, 1, 1, ain, aout};
2996
+ ndfunc_arg_in_t ain[1] = { { cT, 0 } };
2997
+ ndfunc_arg_out_t aout[1] = { { cRT, 0 } };
2998
+ ndfunc_t ndf = { iter_dcomplex_arg, FULL_LOOP, 1, 1, ain, aout };
2986
2999
 
2987
3000
  return na_ndloop(&ndf, 1, self);
2988
3001
  }
@@ -3033,8 +3046,8 @@ static void iter_dcomplex_set_imag(na_loop_t* const lp) {
3033
3046
  }
3034
3047
 
3035
3048
  static VALUE dcomplex_set_imag(VALUE self, VALUE a1) {
3036
- ndfunc_arg_in_t ain[2] = {{OVERWRITE, 0}, {cRT, 0}};
3037
- ndfunc_t ndf = {iter_dcomplex_set_imag, FULL_LOOP, 2, 0, ain, 0};
3049
+ ndfunc_arg_in_t ain[2] = { { OVERWRITE, 0 }, { cRT, 0 } };
3050
+ ndfunc_t ndf = { iter_dcomplex_set_imag, FULL_LOOP, 2, 0, ain, 0 };
3038
3051
 
3039
3052
  na_ndloop(&ndf, 2, self, a1);
3040
3053
  return a1;
@@ -3086,8 +3099,8 @@ static void iter_dcomplex_set_real(na_loop_t* const lp) {
3086
3099
  }
3087
3100
 
3088
3101
  static VALUE dcomplex_set_real(VALUE self, VALUE a1) {
3089
- ndfunc_arg_in_t ain[2] = {{OVERWRITE, 0}, {cRT, 0}};
3090
- ndfunc_t ndf = {iter_dcomplex_set_real, FULL_LOOP, 2, 0, ain, 0};
3102
+ ndfunc_arg_in_t ain[2] = { { OVERWRITE, 0 }, { cRT, 0 } };
3103
+ ndfunc_t ndf = { iter_dcomplex_set_real, FULL_LOOP, 2, 0, ain, 0 };
3091
3104
 
3092
3105
  na_ndloop(&ndf, 2, self, a1);
3093
3106
  return a1;
@@ -3115,9 +3128,9 @@ static void iter_dcomplex_eq(na_loop_t* const lp) {
3115
3128
  }
3116
3129
 
3117
3130
  static VALUE dcomplex_eq_self(VALUE self, VALUE other) {
3118
- ndfunc_arg_in_t ain[2] = {{cT, 0}, {cT, 0}};
3119
- ndfunc_arg_out_t aout[1] = {{numo_cBit, 0}};
3120
- ndfunc_t ndf = {iter_dcomplex_eq, STRIDE_LOOP, 2, 1, ain, aout};
3131
+ ndfunc_arg_in_t ain[2] = { { cT, 0 }, { cT, 0 } };
3132
+ ndfunc_arg_out_t aout[1] = { { numo_cBit, 0 } };
3133
+ ndfunc_t ndf = { iter_dcomplex_eq, STRIDE_LOOP, 2, 1, ain, aout };
3121
3134
 
3122
3135
  return na_ndloop(&ndf, 2, self, other);
3123
3136
  }
@@ -3162,9 +3175,9 @@ static void iter_dcomplex_ne(na_loop_t* const lp) {
3162
3175
  }
3163
3176
 
3164
3177
  static VALUE dcomplex_ne_self(VALUE self, VALUE other) {
3165
- ndfunc_arg_in_t ain[2] = {{cT, 0}, {cT, 0}};
3166
- ndfunc_arg_out_t aout[1] = {{numo_cBit, 0}};
3167
- ndfunc_t ndf = {iter_dcomplex_ne, STRIDE_LOOP, 2, 1, ain, aout};
3178
+ ndfunc_arg_in_t ain[2] = { { cT, 0 }, { cT, 0 } };
3179
+ ndfunc_arg_out_t aout[1] = { { numo_cBit, 0 } };
3180
+ ndfunc_t ndf = { iter_dcomplex_ne, STRIDE_LOOP, 2, 1, ain, aout };
3168
3181
 
3169
3182
  return na_ndloop(&ndf, 2, self, other);
3170
3183
  }
@@ -3209,9 +3222,9 @@ static void iter_dcomplex_nearly_eq(na_loop_t* const lp) {
3209
3222
  }
3210
3223
 
3211
3224
  static VALUE dcomplex_nearly_eq_self(VALUE self, VALUE other) {
3212
- ndfunc_arg_in_t ain[2] = {{cT, 0}, {cT, 0}};
3213
- ndfunc_arg_out_t aout[1] = {{numo_cBit, 0}};
3214
- ndfunc_t ndf = {iter_dcomplex_nearly_eq, STRIDE_LOOP, 2, 1, ain, aout};
3225
+ ndfunc_arg_in_t ain[2] = { { cT, 0 }, { cT, 0 } };
3226
+ ndfunc_arg_out_t aout[1] = { { numo_cBit, 0 } };
3227
+ ndfunc_t ndf = { iter_dcomplex_nearly_eq, STRIDE_LOOP, 2, 1, ain, aout };
3215
3228
 
3216
3229
  return na_ndloop(&ndf, 2, self, other);
3217
3230
  }
@@ -3302,9 +3315,9 @@ static void iter_dcomplex_floor(na_loop_t* const lp) {
3302
3315
  @return [Numo::DComplex] floor of self.
3303
3316
  */
3304
3317
  static VALUE dcomplex_floor(VALUE self) {
3305
- ndfunc_arg_in_t ain[1] = {{cT, 0}};
3306
- ndfunc_arg_out_t aout[1] = {{cT, 0}};
3307
- ndfunc_t ndf = {iter_dcomplex_floor, FULL_LOOP, 1, 1, ain, aout};
3318
+ ndfunc_arg_in_t ain[1] = { { cT, 0 } };
3319
+ ndfunc_arg_out_t aout[1] = { { cT, 0 } };
3320
+ ndfunc_t ndf = { iter_dcomplex_floor, FULL_LOOP, 1, 1, ain, aout };
3308
3321
 
3309
3322
  return na_ndloop(&ndf, 1, self);
3310
3323
  }
@@ -3377,9 +3390,9 @@ static void iter_dcomplex_round(na_loop_t* const lp) {
3377
3390
  @return [Numo::DComplex] round of self.
3378
3391
  */
3379
3392
  static VALUE dcomplex_round(VALUE self) {
3380
- ndfunc_arg_in_t ain[1] = {{cT, 0}};
3381
- ndfunc_arg_out_t aout[1] = {{cT, 0}};
3382
- ndfunc_t ndf = {iter_dcomplex_round, FULL_LOOP, 1, 1, ain, aout};
3393
+ ndfunc_arg_in_t ain[1] = { { cT, 0 } };
3394
+ ndfunc_arg_out_t aout[1] = { { cT, 0 } };
3395
+ ndfunc_t ndf = { iter_dcomplex_round, FULL_LOOP, 1, 1, ain, aout };
3383
3396
 
3384
3397
  return na_ndloop(&ndf, 1, self);
3385
3398
  }
@@ -3452,9 +3465,9 @@ static void iter_dcomplex_ceil(na_loop_t* const lp) {
3452
3465
  @return [Numo::DComplex] ceil of self.
3453
3466
  */
3454
3467
  static VALUE dcomplex_ceil(VALUE self) {
3455
- ndfunc_arg_in_t ain[1] = {{cT, 0}};
3456
- ndfunc_arg_out_t aout[1] = {{cT, 0}};
3457
- ndfunc_t ndf = {iter_dcomplex_ceil, FULL_LOOP, 1, 1, ain, aout};
3468
+ ndfunc_arg_in_t ain[1] = { { cT, 0 } };
3469
+ ndfunc_arg_out_t aout[1] = { { cT, 0 } };
3470
+ ndfunc_t ndf = { iter_dcomplex_ceil, FULL_LOOP, 1, 1, ain, aout };
3458
3471
 
3459
3472
  return na_ndloop(&ndf, 1, self);
3460
3473
  }
@@ -3527,9 +3540,9 @@ static void iter_dcomplex_trunc(na_loop_t* const lp) {
3527
3540
  @return [Numo::DComplex] trunc of self.
3528
3541
  */
3529
3542
  static VALUE dcomplex_trunc(VALUE self) {
3530
- ndfunc_arg_in_t ain[1] = {{cT, 0}};
3531
- ndfunc_arg_out_t aout[1] = {{cT, 0}};
3532
- ndfunc_t ndf = {iter_dcomplex_trunc, FULL_LOOP, 1, 1, ain, aout};
3543
+ ndfunc_arg_in_t ain[1] = { { cT, 0 } };
3544
+ ndfunc_arg_out_t aout[1] = { { cT, 0 } };
3545
+ ndfunc_t ndf = { iter_dcomplex_trunc, FULL_LOOP, 1, 1, ain, aout };
3533
3546
 
3534
3547
  return na_ndloop(&ndf, 1, self);
3535
3548
  }
@@ -3602,14 +3615,14 @@ static void iter_dcomplex_rint(na_loop_t* const lp) {
3602
3615
  @return [Numo::DComplex] rint of self.
3603
3616
  */
3604
3617
  static VALUE dcomplex_rint(VALUE self) {
3605
- ndfunc_arg_in_t ain[1] = {{cT, 0}};
3606
- ndfunc_arg_out_t aout[1] = {{cT, 0}};
3607
- ndfunc_t ndf = {iter_dcomplex_rint, FULL_LOOP, 1, 1, ain, aout};
3618
+ ndfunc_arg_in_t ain[1] = { { cT, 0 } };
3619
+ ndfunc_arg_out_t aout[1] = { { cT, 0 } };
3620
+ ndfunc_t ndf = { iter_dcomplex_rint, FULL_LOOP, 1, 1, ain, aout };
3608
3621
 
3609
3622
  return na_ndloop(&ndf, 1, self);
3610
3623
  }
3611
3624
 
3612
- #define check_intdivzero(y) \
3625
+ #define check_intdivzero(y) \
3613
3626
  {}
3614
3627
 
3615
3628
  static void iter_dcomplex_copysign(na_loop_t* const lp) {
@@ -3624,7 +3637,8 @@ static void iter_dcomplex_copysign(na_loop_t* const lp) {
3624
3637
  INIT_PTR(lp, 2, p3, s3);
3625
3638
 
3626
3639
  //
3627
- if (is_aligned(p1, sizeof(dtype)) && is_aligned(p2, sizeof(dtype)) && is_aligned(p3, sizeof(dtype))) {
3640
+ if (is_aligned(p1, sizeof(dtype)) && is_aligned(p2, sizeof(dtype)) &&
3641
+ is_aligned(p3, sizeof(dtype))) {
3628
3642
 
3629
3643
  if (s1 == sizeof(dtype) && s2 == sizeof(dtype) && s3 == sizeof(dtype)) {
3630
3644
  if (p1 == p3) { // inplace case
@@ -3641,7 +3655,8 @@ static void iter_dcomplex_copysign(na_loop_t* const lp) {
3641
3655
  return;
3642
3656
  }
3643
3657
 
3644
- if (is_aligned_step(s1, sizeof(dtype)) && is_aligned_step(s2, sizeof(dtype)) && is_aligned_step(s3, sizeof(dtype))) {
3658
+ if (is_aligned_step(s1, sizeof(dtype)) && is_aligned_step(s2, sizeof(dtype)) &&
3659
+ is_aligned_step(s3, sizeof(dtype))) {
3645
3660
  //
3646
3661
 
3647
3662
  if (s2 == 0) { // Broadcasting from scalar value.
@@ -3699,9 +3714,9 @@ static void iter_dcomplex_copysign(na_loop_t* const lp) {
3699
3714
  #undef check_intdivzero
3700
3715
 
3701
3716
  static VALUE dcomplex_copysign_self(VALUE self, VALUE other) {
3702
- ndfunc_arg_in_t ain[2] = {{cT, 0}, {cT, 0}};
3703
- ndfunc_arg_out_t aout[1] = {{cT, 0}};
3704
- ndfunc_t ndf = {iter_dcomplex_copysign, STRIDE_LOOP, 2, 1, ain, aout};
3717
+ ndfunc_arg_in_t ain[2] = { { cT, 0 }, { cT, 0 } };
3718
+ ndfunc_arg_out_t aout[1] = { { cT, 0 } };
3719
+ ndfunc_t ndf = { iter_dcomplex_copysign, STRIDE_LOOP, 2, 1, ain, aout };
3705
3720
 
3706
3721
  return na_ndloop(&ndf, 2, self, other);
3707
3722
  }
@@ -3760,9 +3775,9 @@ static void iter_dcomplex_isnan(na_loop_t* const lp) {
3760
3775
  @return [Numo::Bit] Condition of isnan.
3761
3776
  */
3762
3777
  static VALUE dcomplex_isnan(VALUE self) {
3763
- ndfunc_arg_in_t ain[1] = {{cT, 0}};
3764
- ndfunc_arg_out_t aout[1] = {{numo_cBit, 0}};
3765
- ndfunc_t ndf = {iter_dcomplex_isnan, FULL_LOOP, 1, 1, ain, aout};
3778
+ ndfunc_arg_in_t ain[1] = { { cT, 0 } };
3779
+ ndfunc_arg_out_t aout[1] = { { numo_cBit, 0 } };
3780
+ ndfunc_t ndf = { iter_dcomplex_isnan, FULL_LOOP, 1, 1, ain, aout };
3766
3781
 
3767
3782
  return na_ndloop(&ndf, 1, self);
3768
3783
  }
@@ -3802,9 +3817,9 @@ static void iter_dcomplex_isinf(na_loop_t* const lp) {
3802
3817
  @return [Numo::Bit] Condition of isinf.
3803
3818
  */
3804
3819
  static VALUE dcomplex_isinf(VALUE self) {
3805
- ndfunc_arg_in_t ain[1] = {{cT, 0}};
3806
- ndfunc_arg_out_t aout[1] = {{numo_cBit, 0}};
3807
- ndfunc_t ndf = {iter_dcomplex_isinf, FULL_LOOP, 1, 1, ain, aout};
3820
+ ndfunc_arg_in_t ain[1] = { { cT, 0 } };
3821
+ ndfunc_arg_out_t aout[1] = { { numo_cBit, 0 } };
3822
+ ndfunc_t ndf = { iter_dcomplex_isinf, FULL_LOOP, 1, 1, ain, aout };
3808
3823
 
3809
3824
  return na_ndloop(&ndf, 1, self);
3810
3825
  }
@@ -3844,9 +3859,9 @@ static void iter_dcomplex_isposinf(na_loop_t* const lp) {
3844
3859
  @return [Numo::Bit] Condition of isposinf.
3845
3860
  */
3846
3861
  static VALUE dcomplex_isposinf(VALUE self) {
3847
- ndfunc_arg_in_t ain[1] = {{cT, 0}};
3848
- ndfunc_arg_out_t aout[1] = {{numo_cBit, 0}};
3849
- ndfunc_t ndf = {iter_dcomplex_isposinf, FULL_LOOP, 1, 1, ain, aout};
3862
+ ndfunc_arg_in_t ain[1] = { { cT, 0 } };
3863
+ ndfunc_arg_out_t aout[1] = { { numo_cBit, 0 } };
3864
+ ndfunc_t ndf = { iter_dcomplex_isposinf, FULL_LOOP, 1, 1, ain, aout };
3850
3865
 
3851
3866
  return na_ndloop(&ndf, 1, self);
3852
3867
  }
@@ -3886,9 +3901,9 @@ static void iter_dcomplex_isneginf(na_loop_t* const lp) {
3886
3901
  @return [Numo::Bit] Condition of isneginf.
3887
3902
  */
3888
3903
  static VALUE dcomplex_isneginf(VALUE self) {
3889
- ndfunc_arg_in_t ain[1] = {{cT, 0}};
3890
- ndfunc_arg_out_t aout[1] = {{numo_cBit, 0}};
3891
- ndfunc_t ndf = {iter_dcomplex_isneginf, FULL_LOOP, 1, 1, ain, aout};
3904
+ ndfunc_arg_in_t ain[1] = { { cT, 0 } };
3905
+ ndfunc_arg_out_t aout[1] = { { numo_cBit, 0 } };
3906
+ ndfunc_t ndf = { iter_dcomplex_isneginf, FULL_LOOP, 1, 1, ain, aout };
3892
3907
 
3893
3908
  return na_ndloop(&ndf, 1, self);
3894
3909
  }
@@ -3928,9 +3943,9 @@ static void iter_dcomplex_isfinite(na_loop_t* const lp) {
3928
3943
  @return [Numo::Bit] Condition of isfinite.
3929
3944
  */
3930
3945
  static VALUE dcomplex_isfinite(VALUE self) {
3931
- ndfunc_arg_in_t ain[1] = {{cT, 0}};
3932
- ndfunc_arg_out_t aout[1] = {{numo_cBit, 0}};
3933
- ndfunc_t ndf = {iter_dcomplex_isfinite, FULL_LOOP, 1, 1, ain, aout};
3946
+ ndfunc_arg_in_t ain[1] = { { cT, 0 } };
3947
+ ndfunc_arg_out_t aout[1] = { { numo_cBit, 0 } };
3948
+ ndfunc_t ndf = { iter_dcomplex_isfinite, FULL_LOOP, 1, 1, ain, aout };
3934
3949
 
3935
3950
  return na_ndloop(&ndf, 1, self);
3936
3951
  }
@@ -3961,16 +3976,18 @@ static void iter_dcomplex_sum_nan(na_loop_t* const lp) {
3961
3976
  /*
3962
3977
  sum of self.
3963
3978
  @overload sum(axis:nil, keepdims:false, nan:false)
3964
- @param [TrueClass] nan If true, apply NaN-aware algorithm (avoid NaN for sum/mean etc, or, return NaN for min/max etc).
3979
+ @param [TrueClass] nan If true, apply NaN-aware algorithm (avoid NaN for sum/mean etc, or,
3980
+ return NaN for min/max etc).
3965
3981
  @param [Numeric,Array,Range] axis Performs sum along the axis.
3966
- @param [TrueClass] keepdims If true, the reduced axes are left in the result array as dimensions with size one.
3982
+ @param [TrueClass] keepdims If true, the reduced axes are left in the result array as
3983
+ dimensions with size one.
3967
3984
  @return [Numo::DComplex] returns result of sum.
3968
3985
  */
3969
3986
  static VALUE dcomplex_sum(int argc, VALUE* argv, VALUE self) {
3970
3987
  VALUE v, reduce;
3971
- ndfunc_arg_in_t ain[2] = {{cT, 0}, {sym_reduce, 0}};
3972
- ndfunc_arg_out_t aout[1] = {{cT, 0}};
3973
- ndfunc_t ndf = {iter_dcomplex_sum, STRIDE_LOOP_NIP | NDF_FLAT_REDUCE, 2, 1, ain, aout};
3988
+ ndfunc_arg_in_t ain[2] = { { cT, 0 }, { sym_reduce, 0 } };
3989
+ ndfunc_arg_out_t aout[1] = { { cT, 0 } };
3990
+ ndfunc_t ndf = { iter_dcomplex_sum, STRIDE_LOOP_NIP | NDF_FLAT_REDUCE, 2, 1, ain, aout };
3974
3991
 
3975
3992
  reduce = na_reduce_dimension(argc, argv, 1, &self, &ndf, iter_dcomplex_sum_nan);
3976
3993
 
@@ -4005,16 +4022,18 @@ static void iter_dcomplex_prod_nan(na_loop_t* const lp) {
4005
4022
  /*
4006
4023
  prod of self.
4007
4024
  @overload prod(axis:nil, keepdims:false, nan:false)
4008
- @param [TrueClass] nan If true, apply NaN-aware algorithm (avoid NaN for sum/mean etc, or, return NaN for min/max etc).
4025
+ @param [TrueClass] nan If true, apply NaN-aware algorithm (avoid NaN for sum/mean etc, or,
4026
+ return NaN for min/max etc).
4009
4027
  @param [Numeric,Array,Range] axis Performs prod along the axis.
4010
- @param [TrueClass] keepdims If true, the reduced axes are left in the result array as dimensions with size one.
4028
+ @param [TrueClass] keepdims If true, the reduced axes are left in the result array as
4029
+ dimensions with size one.
4011
4030
  @return [Numo::DComplex] returns result of prod.
4012
4031
  */
4013
4032
  static VALUE dcomplex_prod(int argc, VALUE* argv, VALUE self) {
4014
4033
  VALUE v, reduce;
4015
- ndfunc_arg_in_t ain[2] = {{cT, 0}, {sym_reduce, 0}};
4016
- ndfunc_arg_out_t aout[1] = {{cT, 0}};
4017
- ndfunc_t ndf = {iter_dcomplex_prod, STRIDE_LOOP_NIP | NDF_FLAT_REDUCE, 2, 1, ain, aout};
4034
+ ndfunc_arg_in_t ain[2] = { { cT, 0 }, { sym_reduce, 0 } };
4035
+ ndfunc_arg_out_t aout[1] = { { cT, 0 } };
4036
+ ndfunc_t ndf = { iter_dcomplex_prod, STRIDE_LOOP_NIP | NDF_FLAT_REDUCE, 2, 1, ain, aout };
4018
4037
 
4019
4038
  reduce = na_reduce_dimension(argc, argv, 1, &self, &ndf, iter_dcomplex_prod_nan);
4020
4039
 
@@ -4049,16 +4068,20 @@ static void iter_dcomplex_kahan_sum_nan(na_loop_t* const lp) {
4049
4068
  /*
4050
4069
  kahan_sum of self.
4051
4070
  @overload kahan_sum(axis:nil, keepdims:false, nan:false)
4052
- @param [TrueClass] nan If true, apply NaN-aware algorithm (avoid NaN for sum/mean etc, or, return NaN for min/max etc).
4071
+ @param [TrueClass] nan If true, apply NaN-aware algorithm (avoid NaN for sum/mean etc, or,
4072
+ return NaN for min/max etc).
4053
4073
  @param [Numeric,Array,Range] axis Performs kahan_sum along the axis.
4054
- @param [TrueClass] keepdims If true, the reduced axes are left in the result array as dimensions with size one.
4074
+ @param [TrueClass] keepdims If true, the reduced axes are left in the result array as
4075
+ dimensions with size one.
4055
4076
  @return [Numo::DComplex] returns result of kahan_sum.
4056
4077
  */
4057
4078
  static VALUE dcomplex_kahan_sum(int argc, VALUE* argv, VALUE self) {
4058
4079
  VALUE v, reduce;
4059
- ndfunc_arg_in_t ain[2] = {{cT, 0}, {sym_reduce, 0}};
4060
- ndfunc_arg_out_t aout[1] = {{cT, 0}};
4061
- ndfunc_t ndf = {iter_dcomplex_kahan_sum, STRIDE_LOOP_NIP | NDF_FLAT_REDUCE, 2, 1, ain, aout};
4080
+ ndfunc_arg_in_t ain[2] = { { cT, 0 }, { sym_reduce, 0 } };
4081
+ ndfunc_arg_out_t aout[1] = { { cT, 0 } };
4082
+ ndfunc_t ndf = {
4083
+ iter_dcomplex_kahan_sum, STRIDE_LOOP_NIP | NDF_FLAT_REDUCE, 2, 1, ain, aout
4084
+ };
4062
4085
 
4063
4086
  reduce = na_reduce_dimension(argc, argv, 1, &self, &ndf, iter_dcomplex_kahan_sum_nan);
4064
4087
 
@@ -4093,16 +4116,18 @@ static void iter_dcomplex_mean_nan(na_loop_t* const lp) {
4093
4116
  /*
4094
4117
  mean of self.
4095
4118
  @overload mean(axis:nil, keepdims:false, nan:false)
4096
- @param [TrueClass] nan If true, apply NaN-aware algorithm (avoid NaN for sum/mean etc, or, return NaN for min/max etc).
4119
+ @param [TrueClass] nan If true, apply NaN-aware algorithm (avoid NaN for sum/mean etc, or,
4120
+ return NaN for min/max etc).
4097
4121
  @param [Numeric,Array,Range] axis Performs mean along the axis.
4098
- @param [TrueClass] keepdims If true, the reduced axes are left in the result array as dimensions with size one.
4122
+ @param [TrueClass] keepdims If true, the reduced axes are left in the result array as
4123
+ dimensions with size one.
4099
4124
  @return [Numo::DComplex] returns result of mean.
4100
4125
  */
4101
4126
  static VALUE dcomplex_mean(int argc, VALUE* argv, VALUE self) {
4102
4127
  VALUE v, reduce;
4103
- ndfunc_arg_in_t ain[2] = {{cT, 0}, {sym_reduce, 0}};
4104
- ndfunc_arg_out_t aout[1] = {{cT, 0}};
4105
- ndfunc_t ndf = {iter_dcomplex_mean, STRIDE_LOOP_NIP | NDF_FLAT_REDUCE, 2, 1, ain, aout};
4128
+ ndfunc_arg_in_t ain[2] = { { cT, 0 }, { sym_reduce, 0 } };
4129
+ ndfunc_arg_out_t aout[1] = { { cT, 0 } };
4130
+ ndfunc_t ndf = { iter_dcomplex_mean, STRIDE_LOOP_NIP | NDF_FLAT_REDUCE, 2, 1, ain, aout };
4106
4131
 
4107
4132
  reduce = na_reduce_dimension(argc, argv, 1, &self, &ndf, iter_dcomplex_mean_nan);
4108
4133
 
@@ -4137,16 +4162,18 @@ static void iter_dcomplex_stddev_nan(na_loop_t* const lp) {
4137
4162
  /*
4138
4163
  stddev of self.
4139
4164
  @overload stddev(axis:nil, keepdims:false, nan:false)
4140
- @param [TrueClass] nan If true, apply NaN-aware algorithm (avoid NaN for sum/mean etc, or, return NaN for min/max etc).
4165
+ @param [TrueClass] nan If true, apply NaN-aware algorithm (avoid NaN for sum/mean etc, or,
4166
+ return NaN for min/max etc).
4141
4167
  @param [Numeric,Array,Range] axis Performs stddev along the axis.
4142
- @param [TrueClass] keepdims If true, the reduced axes are left in the result array as dimensions with size one.
4168
+ @param [TrueClass] keepdims If true, the reduced axes are left in the result array as
4169
+ dimensions with size one.
4143
4170
  @return [Numo::DComplex] returns result of stddev.
4144
4171
  */
4145
4172
  static VALUE dcomplex_stddev(int argc, VALUE* argv, VALUE self) {
4146
4173
  VALUE v, reduce;
4147
- ndfunc_arg_in_t ain[2] = {{cT, 0}, {sym_reduce, 0}};
4148
- ndfunc_arg_out_t aout[1] = {{cRT, 0}};
4149
- ndfunc_t ndf = {iter_dcomplex_stddev, STRIDE_LOOP_NIP | NDF_FLAT_REDUCE, 2, 1, ain, aout};
4174
+ ndfunc_arg_in_t ain[2] = { { cT, 0 }, { sym_reduce, 0 } };
4175
+ ndfunc_arg_out_t aout[1] = { { cRT, 0 } };
4176
+ ndfunc_t ndf = { iter_dcomplex_stddev, STRIDE_LOOP_NIP | NDF_FLAT_REDUCE, 2, 1, ain, aout };
4150
4177
 
4151
4178
  reduce = na_reduce_dimension(argc, argv, 1, &self, &ndf, iter_dcomplex_stddev_nan);
4152
4179
 
@@ -4181,16 +4208,18 @@ static void iter_dcomplex_var_nan(na_loop_t* const lp) {
4181
4208
  /*
4182
4209
  var of self.
4183
4210
  @overload var(axis:nil, keepdims:false, nan:false)
4184
- @param [TrueClass] nan If true, apply NaN-aware algorithm (avoid NaN for sum/mean etc, or, return NaN for min/max etc).
4211
+ @param [TrueClass] nan If true, apply NaN-aware algorithm (avoid NaN for sum/mean etc, or,
4212
+ return NaN for min/max etc).
4185
4213
  @param [Numeric,Array,Range] axis Performs var along the axis.
4186
- @param [TrueClass] keepdims If true, the reduced axes are left in the result array as dimensions with size one.
4214
+ @param [TrueClass] keepdims If true, the reduced axes are left in the result array as
4215
+ dimensions with size one.
4187
4216
  @return [Numo::DComplex] returns result of var.
4188
4217
  */
4189
4218
  static VALUE dcomplex_var(int argc, VALUE* argv, VALUE self) {
4190
4219
  VALUE v, reduce;
4191
- ndfunc_arg_in_t ain[2] = {{cT, 0}, {sym_reduce, 0}};
4192
- ndfunc_arg_out_t aout[1] = {{cRT, 0}};
4193
- ndfunc_t ndf = {iter_dcomplex_var, STRIDE_LOOP_NIP | NDF_FLAT_REDUCE, 2, 1, ain, aout};
4220
+ ndfunc_arg_in_t ain[2] = { { cT, 0 }, { sym_reduce, 0 } };
4221
+ ndfunc_arg_out_t aout[1] = { { cRT, 0 } };
4222
+ ndfunc_t ndf = { iter_dcomplex_var, STRIDE_LOOP_NIP | NDF_FLAT_REDUCE, 2, 1, ain, aout };
4194
4223
 
4195
4224
  reduce = na_reduce_dimension(argc, argv, 1, &self, &ndf, iter_dcomplex_var_nan);
4196
4225
 
@@ -4225,16 +4254,18 @@ static void iter_dcomplex_rms_nan(na_loop_t* const lp) {
4225
4254
  /*
4226
4255
  rms of self.
4227
4256
  @overload rms(axis:nil, keepdims:false, nan:false)
4228
- @param [TrueClass] nan If true, apply NaN-aware algorithm (avoid NaN for sum/mean etc, or, return NaN for min/max etc).
4257
+ @param [TrueClass] nan If true, apply NaN-aware algorithm (avoid NaN for sum/mean etc, or,
4258
+ return NaN for min/max etc).
4229
4259
  @param [Numeric,Array,Range] axis Performs rms along the axis.
4230
- @param [TrueClass] keepdims If true, the reduced axes are left in the result array as dimensions with size one.
4260
+ @param [TrueClass] keepdims If true, the reduced axes are left in the result array as
4261
+ dimensions with size one.
4231
4262
  @return [Numo::DComplex] returns result of rms.
4232
4263
  */
4233
4264
  static VALUE dcomplex_rms(int argc, VALUE* argv, VALUE self) {
4234
4265
  VALUE v, reduce;
4235
- ndfunc_arg_in_t ain[2] = {{cT, 0}, {sym_reduce, 0}};
4236
- ndfunc_arg_out_t aout[1] = {{cRT, 0}};
4237
- ndfunc_t ndf = {iter_dcomplex_rms, STRIDE_LOOP_NIP | NDF_FLAT_REDUCE, 2, 1, ain, aout};
4266
+ ndfunc_arg_in_t ain[2] = { { cT, 0 }, { sym_reduce, 0 } };
4267
+ ndfunc_arg_out_t aout[1] = { { cRT, 0 } };
4268
+ ndfunc_t ndf = { iter_dcomplex_rms, STRIDE_LOOP_NIP | NDF_FLAT_REDUCE, 2, 1, ain, aout };
4238
4269
 
4239
4270
  reduce = na_reduce_dimension(argc, argv, 1, &self, &ndf, iter_dcomplex_rms_nan);
4240
4271
 
@@ -4252,16 +4283,13 @@ static void iter_dcomplex_cumsum(na_loop_t* const lp) {
4252
4283
  INIT_COUNTER(lp, i);
4253
4284
  INIT_PTR(lp, 0, p1, s1);
4254
4285
  INIT_PTR(lp, 1, p2, s2);
4255
- // printf("i=%lu p1=%lx s1=%lu p2=%lx s2=%lu\n",i,(size_t)p1,s1,(size_t)p2,s2);
4256
4286
 
4257
4287
  GET_DATA_STRIDE(p1, s1, dtype, x);
4258
4288
  SET_DATA_STRIDE(p2, s2, dtype, x);
4259
- // printf("i=%lu x=%f\n",i,x);
4260
4289
  for (i--; i--;) {
4261
4290
  GET_DATA_STRIDE(p1, s1, dtype, y);
4262
4291
  m_cumsum(x, y);
4263
4292
  SET_DATA_STRIDE(p2, s2, dtype, x);
4264
- // printf("i=%lu x=%f\n",i,x);
4265
4293
  }
4266
4294
  }
4267
4295
  static void iter_dcomplex_cumsum_nan(na_loop_t* const lp) {
@@ -4273,16 +4301,13 @@ static void iter_dcomplex_cumsum_nan(na_loop_t* const lp) {
4273
4301
  INIT_COUNTER(lp, i);
4274
4302
  INIT_PTR(lp, 0, p1, s1);
4275
4303
  INIT_PTR(lp, 1, p2, s2);
4276
- // printf("i=%lu p1=%lx s1=%lu p2=%lx s2=%lu\n",i,(size_t)p1,s1,(size_t)p2,s2);
4277
4304
 
4278
4305
  GET_DATA_STRIDE(p1, s1, dtype, x);
4279
4306
  SET_DATA_STRIDE(p2, s2, dtype, x);
4280
- // printf("i=%lu x=%f\n",i,x);
4281
4307
  for (i--; i--;) {
4282
4308
  GET_DATA_STRIDE(p1, s1, dtype, y);
4283
4309
  m_cumsum_nan(x, y);
4284
4310
  SET_DATA_STRIDE(p2, s2, dtype, x);
4285
- // printf("i=%lu x=%f\n",i,x);
4286
4311
  }
4287
4312
  }
4288
4313
 
@@ -4295,9 +4320,11 @@ static void iter_dcomplex_cumsum_nan(na_loop_t* const lp) {
4295
4320
  */
4296
4321
  static VALUE dcomplex_cumsum(int argc, VALUE* argv, VALUE self) {
4297
4322
  VALUE reduce;
4298
- ndfunc_arg_in_t ain[2] = {{cT, 0}, {sym_reduce, 0}};
4299
- ndfunc_arg_out_t aout[1] = {{cT, 0}};
4300
- ndfunc_t ndf = {iter_dcomplex_cumsum, STRIDE_LOOP | NDF_FLAT_REDUCE | NDF_CUM, 2, 1, ain, aout};
4323
+ ndfunc_arg_in_t ain[2] = { { cT, 0 }, { sym_reduce, 0 } };
4324
+ ndfunc_arg_out_t aout[1] = { { cT, 0 } };
4325
+ ndfunc_t ndf = {
4326
+ iter_dcomplex_cumsum, STRIDE_LOOP | NDF_FLAT_REDUCE | NDF_CUM, 2, 1, ain, aout
4327
+ };
4301
4328
 
4302
4329
  reduce = na_reduce_dimension(argc, argv, 1, &self, &ndf, iter_dcomplex_cumsum_nan);
4303
4330
 
@@ -4313,16 +4340,13 @@ static void iter_dcomplex_cumprod(na_loop_t* const lp) {
4313
4340
  INIT_COUNTER(lp, i);
4314
4341
  INIT_PTR(lp, 0, p1, s1);
4315
4342
  INIT_PTR(lp, 1, p2, s2);
4316
- // printf("i=%lu p1=%lx s1=%lu p2=%lx s2=%lu\n",i,(size_t)p1,s1,(size_t)p2,s2);
4317
4343
 
4318
4344
  GET_DATA_STRIDE(p1, s1, dtype, x);
4319
4345
  SET_DATA_STRIDE(p2, s2, dtype, x);
4320
- // printf("i=%lu x=%f\n",i,x);
4321
4346
  for (i--; i--;) {
4322
4347
  GET_DATA_STRIDE(p1, s1, dtype, y);
4323
4348
  m_cumprod(x, y);
4324
4349
  SET_DATA_STRIDE(p2, s2, dtype, x);
4325
- // printf("i=%lu x=%f\n",i,x);
4326
4350
  }
4327
4351
  }
4328
4352
  static void iter_dcomplex_cumprod_nan(na_loop_t* const lp) {
@@ -4334,16 +4358,13 @@ static void iter_dcomplex_cumprod_nan(na_loop_t* const lp) {
4334
4358
  INIT_COUNTER(lp, i);
4335
4359
  INIT_PTR(lp, 0, p1, s1);
4336
4360
  INIT_PTR(lp, 1, p2, s2);
4337
- // printf("i=%lu p1=%lx s1=%lu p2=%lx s2=%lu\n",i,(size_t)p1,s1,(size_t)p2,s2);
4338
4361
 
4339
4362
  GET_DATA_STRIDE(p1, s1, dtype, x);
4340
4363
  SET_DATA_STRIDE(p2, s2, dtype, x);
4341
- // printf("i=%lu x=%f\n",i,x);
4342
4364
  for (i--; i--;) {
4343
4365
  GET_DATA_STRIDE(p1, s1, dtype, y);
4344
4366
  m_cumprod_nan(x, y);
4345
4367
  SET_DATA_STRIDE(p2, s2, dtype, x);
4346
- // printf("i=%lu x=%f\n",i,x);
4347
4368
  }
4348
4369
  }
4349
4370
 
@@ -4356,9 +4377,11 @@ static void iter_dcomplex_cumprod_nan(na_loop_t* const lp) {
4356
4377
  */
4357
4378
  static VALUE dcomplex_cumprod(int argc, VALUE* argv, VALUE self) {
4358
4379
  VALUE reduce;
4359
- ndfunc_arg_in_t ain[2] = {{cT, 0}, {sym_reduce, 0}};
4360
- ndfunc_arg_out_t aout[1] = {{cT, 0}};
4361
- ndfunc_t ndf = {iter_dcomplex_cumprod, STRIDE_LOOP | NDF_FLAT_REDUCE | NDF_CUM, 2, 1, ain, aout};
4380
+ ndfunc_arg_in_t ain[2] = { { cT, 0 }, { sym_reduce, 0 } };
4381
+ ndfunc_arg_out_t aout[1] = { { cT, 0 } };
4382
+ ndfunc_t ndf = {
4383
+ iter_dcomplex_cumprod, STRIDE_LOOP | NDF_FLAT_REDUCE | NDF_CUM, 2, 1, ain, aout
4384
+ };
4362
4385
 
4363
4386
  reduce = na_reduce_dimension(argc, argv, 1, &self, &ndf, iter_dcomplex_cumprod_nan);
4364
4387
 
@@ -4438,9 +4461,9 @@ static void iter_dcomplex_mulsum_nan(na_loop_t* const lp) {
4438
4461
  static VALUE dcomplex_mulsum_self(int argc, VALUE* argv, VALUE self) {
4439
4462
  VALUE v, reduce;
4440
4463
  VALUE naryv[2];
4441
- ndfunc_arg_in_t ain[4] = {{cT, 0}, {cT, 0}, {sym_reduce, 0}, {sym_init, 0}};
4442
- ndfunc_arg_out_t aout[1] = {{cT, 0}};
4443
- ndfunc_t ndf = {iter_dcomplex_mulsum, STRIDE_LOOP_NIP, 4, 1, ain, aout};
4464
+ ndfunc_arg_in_t ain[4] = { { cT, 0 }, { cT, 0 }, { sym_reduce, 0 }, { sym_init, 0 } };
4465
+ ndfunc_arg_out_t aout[1] = { { cT, 0 } };
4466
+ ndfunc_t ndf = { iter_dcomplex_mulsum, STRIDE_LOOP_NIP, 4, 1, ain, aout };
4444
4467
 
4445
4468
  if (argc < 1) {
4446
4469
  rb_raise(rb_eArgError, "wrong number of arguments (%d for >=1)", argc);
@@ -4462,7 +4485,8 @@ static VALUE dcomplex_mulsum_self(int argc, VALUE* argv, VALUE self) {
4462
4485
  @overload mulsum(other, axis:nil, keepdims:false, nan:false)
4463
4486
  @param [Numo::NArray,Numeric] other
4464
4487
  @param [Numeric,Array,Range] axis Performs mulsum along the axis.
4465
- @param [TrueClass] keepdims (keyword) If true, the reduced axes are left in the result array as dimensions with size one.
4488
+ @param [TrueClass] keepdims (keyword) If true, the reduced axes are left in the result array
4489
+ as dimensions with size one.
4466
4490
  @param [TrueClass] nan (keyword) If true, apply NaN-aware algorithm (avoid NaN if exists).
4467
4491
  @return [Numo::NArray] mulsum of self and other.
4468
4492
  */
@@ -4548,8 +4572,8 @@ static void iter_dcomplex_seq(na_loop_t* const lp) {
4548
4572
  static VALUE dcomplex_seq(int argc, VALUE* args, VALUE self) {
4549
4573
  seq_opt_t* g;
4550
4574
  VALUE vbeg = Qnil, vstep = Qnil;
4551
- ndfunc_arg_in_t ain[1] = {{OVERWRITE, 0}};
4552
- ndfunc_t ndf = {iter_dcomplex_seq, FULL_LOOP, 1, 0, ain, 0};
4575
+ ndfunc_arg_in_t ain[1] = { { OVERWRITE, 0 } };
4576
+ ndfunc_t ndf = { iter_dcomplex_seq, FULL_LOOP, 1, 0, ain, 0 };
4553
4577
 
4554
4578
  g = ALLOCA_N(seq_opt_t, 1);
4555
4579
  g->beg = m_zero;
@@ -4631,8 +4655,8 @@ static void iter_dcomplex_logseq(na_loop_t* const lp) {
4631
4655
  static VALUE dcomplex_logseq(int argc, VALUE* args, VALUE self) {
4632
4656
  logseq_opt_t* g;
4633
4657
  VALUE vbeg, vstep, vbase;
4634
- ndfunc_arg_in_t ain[1] = {{OVERWRITE, 0}};
4635
- ndfunc_t ndf = {iter_dcomplex_logseq, FULL_LOOP, 1, 0, ain, 0};
4658
+ ndfunc_arg_in_t ain[1] = { { OVERWRITE, 0 } };
4659
+ ndfunc_t ndf = { iter_dcomplex_logseq, FULL_LOOP, 1, 0, ain, 0 };
4636
4660
 
4637
4661
  g = ALLOCA_N(logseq_opt_t, 1);
4638
4662
  rb_scan_args(argc, args, "21", &vbeg, &vstep, &vbase);
@@ -4686,8 +4710,8 @@ static void iter_dcomplex_eye(na_loop_t* const lp) {
4686
4710
  @return [Numo::DComplex] eye of self.
4687
4711
  */
4688
4712
  static VALUE dcomplex_eye(int argc, VALUE* argv, VALUE self) {
4689
- ndfunc_arg_in_t ain[1] = {{OVERWRITE, 2}};
4690
- ndfunc_t ndf = {iter_dcomplex_eye, NO_LOOP, 1, 0, ain, 0};
4713
+ ndfunc_arg_in_t ain[1] = { { OVERWRITE, 2 } };
4714
+ ndfunc_t ndf = { iter_dcomplex_eye, NO_LOOP, 1, 0, ain, 0 };
4691
4715
  ssize_t kofs;
4692
4716
  dtype data;
4693
4717
  char* g;
@@ -4717,17 +4741,21 @@ static VALUE dcomplex_eye(int argc, VALUE* argv, VALUE self) {
4717
4741
  // Diagonal offset from the main diagonal.
4718
4742
  if (kofs >= 0) {
4719
4743
  if ((size_t)(kofs) >= na->shape[nd - 1]) {
4720
- rb_raise(rb_eArgError,
4721
- "invalid diagonal offset(%" SZF "d) for "
4722
- "last dimension size(%" SZF "d)",
4723
- kofs, na->shape[nd - 1]);
4744
+ rb_raise(
4745
+ rb_eArgError,
4746
+ "invalid diagonal offset(%" SZF "d) for "
4747
+ "last dimension size(%" SZF "d)",
4748
+ kofs, na->shape[nd - 1]
4749
+ );
4724
4750
  }
4725
4751
  } else {
4726
4752
  if ((size_t)(-kofs) >= na->shape[nd - 2]) {
4727
- rb_raise(rb_eArgError,
4728
- "invalid diagonal offset(%" SZF "d) for "
4729
- "last-1 dimension size(%" SZF "d)",
4730
- kofs, na->shape[nd - 2]);
4753
+ rb_raise(
4754
+ rb_eArgError,
4755
+ "invalid diagonal offset(%" SZF "d) for "
4756
+ "last-1 dimension size(%" SZF "d)",
4757
+ kofs, na->shape[nd - 2]
4758
+ );
4731
4759
  }
4732
4760
  }
4733
4761
 
@@ -4777,7 +4805,8 @@ static void iter_dcomplex_rand(na_loop_t* const lp) {
4777
4805
  Generate uniformly distributed random numbers on self narray.
4778
4806
  @overload rand([[low],high])
4779
4807
  @param [Numeric] low lower inclusive boundary of random numbers. (default=0)
4780
- @param [Numeric] high upper exclusive boundary of random numbers. (default=1 or 1+1i for complex types)
4808
+ @param [Numeric] high upper exclusive boundary of random numbers. (default=1 or 1+1i for
4809
+ complex types)
4781
4810
  @return [Numo::DComplex] self.
4782
4811
  @example
4783
4812
  Numo::DFloat.new(6).rand
@@ -4796,8 +4825,8 @@ static VALUE dcomplex_rand(int argc, VALUE* args, VALUE self) {
4796
4825
  rand_opt_t g;
4797
4826
  VALUE v1 = Qnil, v2 = Qnil;
4798
4827
  dtype high;
4799
- ndfunc_arg_in_t ain[1] = {{OVERWRITE, 0}};
4800
- ndfunc_t ndf = {iter_dcomplex_rand, FULL_LOOP, 1, 0, ain, 0};
4828
+ ndfunc_arg_in_t ain[1] = { { OVERWRITE, 0 } };
4829
+ ndfunc_t ndf = { iter_dcomplex_rand, FULL_LOOP, 1, 0, ain, 0 };
4801
4830
 
4802
4831
  rb_scan_args(argc, args, "02", &v1, &v2);
4803
4832
  if (v2 == Qnil) {
@@ -4895,8 +4924,8 @@ static VALUE dcomplex_rand_norm(int argc, VALUE* args, VALUE self) {
4895
4924
  int n;
4896
4925
  randn_opt_t g;
4897
4926
  VALUE v1 = Qnil, v2 = Qnil;
4898
- ndfunc_arg_in_t ain[1] = {{OVERWRITE, 0}};
4899
- ndfunc_t ndf = {iter_dcomplex_rand_norm, FULL_LOOP, 1, 0, ain, 0};
4927
+ ndfunc_arg_in_t ain[1] = { { OVERWRITE, 0 } };
4928
+ ndfunc_t ndf = { iter_dcomplex_rand_norm, FULL_LOOP, 1, 0, ain, 0 };
4900
4929
 
4901
4930
  n = rb_scan_args(argc, args, "02", &v1, &v2);
4902
4931
  if (n == 0) {
@@ -4940,8 +4969,8 @@ static VALUE dcomplex_poly(VALUE self, VALUE args) {
4940
4969
  int argc, i;
4941
4970
  VALUE* argv;
4942
4971
  volatile VALUE v, a;
4943
- ndfunc_arg_out_t aout[1] = {{cT, 0}};
4944
- ndfunc_t ndf = {iter_dcomplex_poly, NO_LOOP, 0, 1, 0, aout};
4972
+ ndfunc_arg_out_t aout[1] = { { cT, 0 } };
4973
+ ndfunc_t ndf = { iter_dcomplex_poly, NO_LOOP, 0, 1, 0, aout };
4945
4974
 
4946
4975
  argc = (int)RARRAY_LEN(args);
4947
4976
  ndf.nin = argc + 1;
@@ -5036,9 +5065,9 @@ static void iter_dcomplex_math_s_sqrt(na_loop_t* const lp) {
5036
5065
  @return [Numo::DComplex] result of sqrt(x).
5037
5066
  */
5038
5067
  static VALUE dcomplex_math_s_sqrt(VALUE mod, VALUE a1) {
5039
- ndfunc_arg_in_t ain[1] = {{cT, 0}};
5040
- ndfunc_arg_out_t aout[1] = {{cT, 0}};
5041
- ndfunc_t ndf = {iter_dcomplex_math_s_sqrt, FULL_LOOP, 1, 1, ain, aout};
5068
+ ndfunc_arg_in_t ain[1] = { { cT, 0 } };
5069
+ ndfunc_arg_out_t aout[1] = { { cT, 0 } };
5070
+ ndfunc_t ndf = { iter_dcomplex_math_s_sqrt, FULL_LOOP, 1, 1, ain, aout };
5042
5071
 
5043
5072
  return na_ndloop(&ndf, 1, a1);
5044
5073
  }
@@ -5114,9 +5143,9 @@ static void iter_dcomplex_math_s_cbrt(na_loop_t* const lp) {
5114
5143
  @return [Numo::DComplex] result of cbrt(x).
5115
5144
  */
5116
5145
  static VALUE dcomplex_math_s_cbrt(VALUE mod, VALUE a1) {
5117
- ndfunc_arg_in_t ain[1] = {{cT, 0}};
5118
- ndfunc_arg_out_t aout[1] = {{cT, 0}};
5119
- ndfunc_t ndf = {iter_dcomplex_math_s_cbrt, FULL_LOOP, 1, 1, ain, aout};
5146
+ ndfunc_arg_in_t ain[1] = { { cT, 0 } };
5147
+ ndfunc_arg_out_t aout[1] = { { cT, 0 } };
5148
+ ndfunc_t ndf = { iter_dcomplex_math_s_cbrt, FULL_LOOP, 1, 1, ain, aout };
5120
5149
 
5121
5150
  return na_ndloop(&ndf, 1, a1);
5122
5151
  }
@@ -5192,9 +5221,9 @@ static void iter_dcomplex_math_s_log(na_loop_t* const lp) {
5192
5221
  @return [Numo::DComplex] result of log(x).
5193
5222
  */
5194
5223
  static VALUE dcomplex_math_s_log(VALUE mod, VALUE a1) {
5195
- ndfunc_arg_in_t ain[1] = {{cT, 0}};
5196
- ndfunc_arg_out_t aout[1] = {{cT, 0}};
5197
- ndfunc_t ndf = {iter_dcomplex_math_s_log, FULL_LOOP, 1, 1, ain, aout};
5224
+ ndfunc_arg_in_t ain[1] = { { cT, 0 } };
5225
+ ndfunc_arg_out_t aout[1] = { { cT, 0 } };
5226
+ ndfunc_t ndf = { iter_dcomplex_math_s_log, FULL_LOOP, 1, 1, ain, aout };
5198
5227
 
5199
5228
  return na_ndloop(&ndf, 1, a1);
5200
5229
  }
@@ -5270,9 +5299,9 @@ static void iter_dcomplex_math_s_log2(na_loop_t* const lp) {
5270
5299
  @return [Numo::DComplex] result of log2(x).
5271
5300
  */
5272
5301
  static VALUE dcomplex_math_s_log2(VALUE mod, VALUE a1) {
5273
- ndfunc_arg_in_t ain[1] = {{cT, 0}};
5274
- ndfunc_arg_out_t aout[1] = {{cT, 0}};
5275
- ndfunc_t ndf = {iter_dcomplex_math_s_log2, FULL_LOOP, 1, 1, ain, aout};
5302
+ ndfunc_arg_in_t ain[1] = { { cT, 0 } };
5303
+ ndfunc_arg_out_t aout[1] = { { cT, 0 } };
5304
+ ndfunc_t ndf = { iter_dcomplex_math_s_log2, FULL_LOOP, 1, 1, ain, aout };
5276
5305
 
5277
5306
  return na_ndloop(&ndf, 1, a1);
5278
5307
  }
@@ -5348,9 +5377,9 @@ static void iter_dcomplex_math_s_log10(na_loop_t* const lp) {
5348
5377
  @return [Numo::DComplex] result of log10(x).
5349
5378
  */
5350
5379
  static VALUE dcomplex_math_s_log10(VALUE mod, VALUE a1) {
5351
- ndfunc_arg_in_t ain[1] = {{cT, 0}};
5352
- ndfunc_arg_out_t aout[1] = {{cT, 0}};
5353
- ndfunc_t ndf = {iter_dcomplex_math_s_log10, FULL_LOOP, 1, 1, ain, aout};
5380
+ ndfunc_arg_in_t ain[1] = { { cT, 0 } };
5381
+ ndfunc_arg_out_t aout[1] = { { cT, 0 } };
5382
+ ndfunc_t ndf = { iter_dcomplex_math_s_log10, FULL_LOOP, 1, 1, ain, aout };
5354
5383
 
5355
5384
  return na_ndloop(&ndf, 1, a1);
5356
5385
  }
@@ -5426,9 +5455,9 @@ static void iter_dcomplex_math_s_exp(na_loop_t* const lp) {
5426
5455
  @return [Numo::DComplex] result of exp(x).
5427
5456
  */
5428
5457
  static VALUE dcomplex_math_s_exp(VALUE mod, VALUE a1) {
5429
- ndfunc_arg_in_t ain[1] = {{cT, 0}};
5430
- ndfunc_arg_out_t aout[1] = {{cT, 0}};
5431
- ndfunc_t ndf = {iter_dcomplex_math_s_exp, FULL_LOOP, 1, 1, ain, aout};
5458
+ ndfunc_arg_in_t ain[1] = { { cT, 0 } };
5459
+ ndfunc_arg_out_t aout[1] = { { cT, 0 } };
5460
+ ndfunc_t ndf = { iter_dcomplex_math_s_exp, FULL_LOOP, 1, 1, ain, aout };
5432
5461
 
5433
5462
  return na_ndloop(&ndf, 1, a1);
5434
5463
  }
@@ -5504,9 +5533,9 @@ static void iter_dcomplex_math_s_exp2(na_loop_t* const lp) {
5504
5533
  @return [Numo::DComplex] result of exp2(x).
5505
5534
  */
5506
5535
  static VALUE dcomplex_math_s_exp2(VALUE mod, VALUE a1) {
5507
- ndfunc_arg_in_t ain[1] = {{cT, 0}};
5508
- ndfunc_arg_out_t aout[1] = {{cT, 0}};
5509
- ndfunc_t ndf = {iter_dcomplex_math_s_exp2, FULL_LOOP, 1, 1, ain, aout};
5536
+ ndfunc_arg_in_t ain[1] = { { cT, 0 } };
5537
+ ndfunc_arg_out_t aout[1] = { { cT, 0 } };
5538
+ ndfunc_t ndf = { iter_dcomplex_math_s_exp2, FULL_LOOP, 1, 1, ain, aout };
5510
5539
 
5511
5540
  return na_ndloop(&ndf, 1, a1);
5512
5541
  }
@@ -5582,9 +5611,9 @@ static void iter_dcomplex_math_s_exp10(na_loop_t* const lp) {
5582
5611
  @return [Numo::DComplex] result of exp10(x).
5583
5612
  */
5584
5613
  static VALUE dcomplex_math_s_exp10(VALUE mod, VALUE a1) {
5585
- ndfunc_arg_in_t ain[1] = {{cT, 0}};
5586
- ndfunc_arg_out_t aout[1] = {{cT, 0}};
5587
- ndfunc_t ndf = {iter_dcomplex_math_s_exp10, FULL_LOOP, 1, 1, ain, aout};
5614
+ ndfunc_arg_in_t ain[1] = { { cT, 0 } };
5615
+ ndfunc_arg_out_t aout[1] = { { cT, 0 } };
5616
+ ndfunc_t ndf = { iter_dcomplex_math_s_exp10, FULL_LOOP, 1, 1, ain, aout };
5588
5617
 
5589
5618
  return na_ndloop(&ndf, 1, a1);
5590
5619
  }
@@ -5660,9 +5689,9 @@ static void iter_dcomplex_math_s_sin(na_loop_t* const lp) {
5660
5689
  @return [Numo::DComplex] result of sin(x).
5661
5690
  */
5662
5691
  static VALUE dcomplex_math_s_sin(VALUE mod, VALUE a1) {
5663
- ndfunc_arg_in_t ain[1] = {{cT, 0}};
5664
- ndfunc_arg_out_t aout[1] = {{cT, 0}};
5665
- ndfunc_t ndf = {iter_dcomplex_math_s_sin, FULL_LOOP, 1, 1, ain, aout};
5692
+ ndfunc_arg_in_t ain[1] = { { cT, 0 } };
5693
+ ndfunc_arg_out_t aout[1] = { { cT, 0 } };
5694
+ ndfunc_t ndf = { iter_dcomplex_math_s_sin, FULL_LOOP, 1, 1, ain, aout };
5666
5695
 
5667
5696
  return na_ndloop(&ndf, 1, a1);
5668
5697
  }
@@ -5738,9 +5767,9 @@ static void iter_dcomplex_math_s_cos(na_loop_t* const lp) {
5738
5767
  @return [Numo::DComplex] result of cos(x).
5739
5768
  */
5740
5769
  static VALUE dcomplex_math_s_cos(VALUE mod, VALUE a1) {
5741
- ndfunc_arg_in_t ain[1] = {{cT, 0}};
5742
- ndfunc_arg_out_t aout[1] = {{cT, 0}};
5743
- ndfunc_t ndf = {iter_dcomplex_math_s_cos, FULL_LOOP, 1, 1, ain, aout};
5770
+ ndfunc_arg_in_t ain[1] = { { cT, 0 } };
5771
+ ndfunc_arg_out_t aout[1] = { { cT, 0 } };
5772
+ ndfunc_t ndf = { iter_dcomplex_math_s_cos, FULL_LOOP, 1, 1, ain, aout };
5744
5773
 
5745
5774
  return na_ndloop(&ndf, 1, a1);
5746
5775
  }
@@ -5816,9 +5845,9 @@ static void iter_dcomplex_math_s_tan(na_loop_t* const lp) {
5816
5845
  @return [Numo::DComplex] result of tan(x).
5817
5846
  */
5818
5847
  static VALUE dcomplex_math_s_tan(VALUE mod, VALUE a1) {
5819
- ndfunc_arg_in_t ain[1] = {{cT, 0}};
5820
- ndfunc_arg_out_t aout[1] = {{cT, 0}};
5821
- ndfunc_t ndf = {iter_dcomplex_math_s_tan, FULL_LOOP, 1, 1, ain, aout};
5848
+ ndfunc_arg_in_t ain[1] = { { cT, 0 } };
5849
+ ndfunc_arg_out_t aout[1] = { { cT, 0 } };
5850
+ ndfunc_t ndf = { iter_dcomplex_math_s_tan, FULL_LOOP, 1, 1, ain, aout };
5822
5851
 
5823
5852
  return na_ndloop(&ndf, 1, a1);
5824
5853
  }
@@ -5894,9 +5923,9 @@ static void iter_dcomplex_math_s_asin(na_loop_t* const lp) {
5894
5923
  @return [Numo::DComplex] result of asin(x).
5895
5924
  */
5896
5925
  static VALUE dcomplex_math_s_asin(VALUE mod, VALUE a1) {
5897
- ndfunc_arg_in_t ain[1] = {{cT, 0}};
5898
- ndfunc_arg_out_t aout[1] = {{cT, 0}};
5899
- ndfunc_t ndf = {iter_dcomplex_math_s_asin, FULL_LOOP, 1, 1, ain, aout};
5926
+ ndfunc_arg_in_t ain[1] = { { cT, 0 } };
5927
+ ndfunc_arg_out_t aout[1] = { { cT, 0 } };
5928
+ ndfunc_t ndf = { iter_dcomplex_math_s_asin, FULL_LOOP, 1, 1, ain, aout };
5900
5929
 
5901
5930
  return na_ndloop(&ndf, 1, a1);
5902
5931
  }
@@ -5972,9 +6001,9 @@ static void iter_dcomplex_math_s_acos(na_loop_t* const lp) {
5972
6001
  @return [Numo::DComplex] result of acos(x).
5973
6002
  */
5974
6003
  static VALUE dcomplex_math_s_acos(VALUE mod, VALUE a1) {
5975
- ndfunc_arg_in_t ain[1] = {{cT, 0}};
5976
- ndfunc_arg_out_t aout[1] = {{cT, 0}};
5977
- ndfunc_t ndf = {iter_dcomplex_math_s_acos, FULL_LOOP, 1, 1, ain, aout};
6004
+ ndfunc_arg_in_t ain[1] = { { cT, 0 } };
6005
+ ndfunc_arg_out_t aout[1] = { { cT, 0 } };
6006
+ ndfunc_t ndf = { iter_dcomplex_math_s_acos, FULL_LOOP, 1, 1, ain, aout };
5978
6007
 
5979
6008
  return na_ndloop(&ndf, 1, a1);
5980
6009
  }
@@ -6050,9 +6079,9 @@ static void iter_dcomplex_math_s_atan(na_loop_t* const lp) {
6050
6079
  @return [Numo::DComplex] result of atan(x).
6051
6080
  */
6052
6081
  static VALUE dcomplex_math_s_atan(VALUE mod, VALUE a1) {
6053
- ndfunc_arg_in_t ain[1] = {{cT, 0}};
6054
- ndfunc_arg_out_t aout[1] = {{cT, 0}};
6055
- ndfunc_t ndf = {iter_dcomplex_math_s_atan, FULL_LOOP, 1, 1, ain, aout};
6082
+ ndfunc_arg_in_t ain[1] = { { cT, 0 } };
6083
+ ndfunc_arg_out_t aout[1] = { { cT, 0 } };
6084
+ ndfunc_t ndf = { iter_dcomplex_math_s_atan, FULL_LOOP, 1, 1, ain, aout };
6056
6085
 
6057
6086
  return na_ndloop(&ndf, 1, a1);
6058
6087
  }
@@ -6128,9 +6157,9 @@ static void iter_dcomplex_math_s_sinh(na_loop_t* const lp) {
6128
6157
  @return [Numo::DComplex] result of sinh(x).
6129
6158
  */
6130
6159
  static VALUE dcomplex_math_s_sinh(VALUE mod, VALUE a1) {
6131
- ndfunc_arg_in_t ain[1] = {{cT, 0}};
6132
- ndfunc_arg_out_t aout[1] = {{cT, 0}};
6133
- ndfunc_t ndf = {iter_dcomplex_math_s_sinh, FULL_LOOP, 1, 1, ain, aout};
6160
+ ndfunc_arg_in_t ain[1] = { { cT, 0 } };
6161
+ ndfunc_arg_out_t aout[1] = { { cT, 0 } };
6162
+ ndfunc_t ndf = { iter_dcomplex_math_s_sinh, FULL_LOOP, 1, 1, ain, aout };
6134
6163
 
6135
6164
  return na_ndloop(&ndf, 1, a1);
6136
6165
  }
@@ -6206,9 +6235,9 @@ static void iter_dcomplex_math_s_cosh(na_loop_t* const lp) {
6206
6235
  @return [Numo::DComplex] result of cosh(x).
6207
6236
  */
6208
6237
  static VALUE dcomplex_math_s_cosh(VALUE mod, VALUE a1) {
6209
- ndfunc_arg_in_t ain[1] = {{cT, 0}};
6210
- ndfunc_arg_out_t aout[1] = {{cT, 0}};
6211
- ndfunc_t ndf = {iter_dcomplex_math_s_cosh, FULL_LOOP, 1, 1, ain, aout};
6238
+ ndfunc_arg_in_t ain[1] = { { cT, 0 } };
6239
+ ndfunc_arg_out_t aout[1] = { { cT, 0 } };
6240
+ ndfunc_t ndf = { iter_dcomplex_math_s_cosh, FULL_LOOP, 1, 1, ain, aout };
6212
6241
 
6213
6242
  return na_ndloop(&ndf, 1, a1);
6214
6243
  }
@@ -6284,9 +6313,9 @@ static void iter_dcomplex_math_s_tanh(na_loop_t* const lp) {
6284
6313
  @return [Numo::DComplex] result of tanh(x).
6285
6314
  */
6286
6315
  static VALUE dcomplex_math_s_tanh(VALUE mod, VALUE a1) {
6287
- ndfunc_arg_in_t ain[1] = {{cT, 0}};
6288
- ndfunc_arg_out_t aout[1] = {{cT, 0}};
6289
- ndfunc_t ndf = {iter_dcomplex_math_s_tanh, FULL_LOOP, 1, 1, ain, aout};
6316
+ ndfunc_arg_in_t ain[1] = { { cT, 0 } };
6317
+ ndfunc_arg_out_t aout[1] = { { cT, 0 } };
6318
+ ndfunc_t ndf = { iter_dcomplex_math_s_tanh, FULL_LOOP, 1, 1, ain, aout };
6290
6319
 
6291
6320
  return na_ndloop(&ndf, 1, a1);
6292
6321
  }
@@ -6362,9 +6391,9 @@ static void iter_dcomplex_math_s_asinh(na_loop_t* const lp) {
6362
6391
  @return [Numo::DComplex] result of asinh(x).
6363
6392
  */
6364
6393
  static VALUE dcomplex_math_s_asinh(VALUE mod, VALUE a1) {
6365
- ndfunc_arg_in_t ain[1] = {{cT, 0}};
6366
- ndfunc_arg_out_t aout[1] = {{cT, 0}};
6367
- ndfunc_t ndf = {iter_dcomplex_math_s_asinh, FULL_LOOP, 1, 1, ain, aout};
6394
+ ndfunc_arg_in_t ain[1] = { { cT, 0 } };
6395
+ ndfunc_arg_out_t aout[1] = { { cT, 0 } };
6396
+ ndfunc_t ndf = { iter_dcomplex_math_s_asinh, FULL_LOOP, 1, 1, ain, aout };
6368
6397
 
6369
6398
  return na_ndloop(&ndf, 1, a1);
6370
6399
  }
@@ -6440,9 +6469,9 @@ static void iter_dcomplex_math_s_acosh(na_loop_t* const lp) {
6440
6469
  @return [Numo::DComplex] result of acosh(x).
6441
6470
  */
6442
6471
  static VALUE dcomplex_math_s_acosh(VALUE mod, VALUE a1) {
6443
- ndfunc_arg_in_t ain[1] = {{cT, 0}};
6444
- ndfunc_arg_out_t aout[1] = {{cT, 0}};
6445
- ndfunc_t ndf = {iter_dcomplex_math_s_acosh, FULL_LOOP, 1, 1, ain, aout};
6472
+ ndfunc_arg_in_t ain[1] = { { cT, 0 } };
6473
+ ndfunc_arg_out_t aout[1] = { { cT, 0 } };
6474
+ ndfunc_t ndf = { iter_dcomplex_math_s_acosh, FULL_LOOP, 1, 1, ain, aout };
6446
6475
 
6447
6476
  return na_ndloop(&ndf, 1, a1);
6448
6477
  }
@@ -6518,9 +6547,9 @@ static void iter_dcomplex_math_s_atanh(na_loop_t* const lp) {
6518
6547
  @return [Numo::DComplex] result of atanh(x).
6519
6548
  */
6520
6549
  static VALUE dcomplex_math_s_atanh(VALUE mod, VALUE a1) {
6521
- ndfunc_arg_in_t ain[1] = {{cT, 0}};
6522
- ndfunc_arg_out_t aout[1] = {{cT, 0}};
6523
- ndfunc_t ndf = {iter_dcomplex_math_s_atanh, FULL_LOOP, 1, 1, ain, aout};
6550
+ ndfunc_arg_in_t ain[1] = { { cT, 0 } };
6551
+ ndfunc_arg_out_t aout[1] = { { cT, 0 } };
6552
+ ndfunc_t ndf = { iter_dcomplex_math_s_atanh, FULL_LOOP, 1, 1, ain, aout };
6524
6553
 
6525
6554
  return na_ndloop(&ndf, 1, a1);
6526
6555
  }
@@ -6596,9 +6625,9 @@ static void iter_dcomplex_math_s_sinc(na_loop_t* const lp) {
6596
6625
  @return [Numo::DComplex] result of sinc(x).
6597
6626
  */
6598
6627
  static VALUE dcomplex_math_s_sinc(VALUE mod, VALUE a1) {
6599
- ndfunc_arg_in_t ain[1] = {{cT, 0}};
6600
- ndfunc_arg_out_t aout[1] = {{cT, 0}};
6601
- ndfunc_t ndf = {iter_dcomplex_math_s_sinc, FULL_LOOP, 1, 1, ain, aout};
6628
+ ndfunc_arg_in_t ain[1] = { { cT, 0 } };
6629
+ ndfunc_arg_out_t aout[1] = { { cT, 0 } };
6630
+ ndfunc_t ndf = { iter_dcomplex_math_s_sinc, FULL_LOOP, 1, 1, ain, aout };
6602
6631
 
6603
6632
  return na_ndloop(&ndf, 1, a1);
6604
6633
  }