carray 1.5.1 → 1.5.6
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 +4 -4
- data/.yardopts +32 -0
- data/{LICENSES → LICENSE} +0 -0
- data/NEWS.md +83 -0
- data/README.md +34 -18
- data/Rakefile +1 -1
- data/TODO.md +17 -0
- data/carray.gemspec +10 -7
- data/ext/ca_iter_block.c +3 -5
- data/ext/ca_iter_dimension.c +4 -5
- data/ext/ca_iter_window.c +2 -4
- data/ext/ca_obj_array.c +394 -124
- data/ext/ca_obj_bitarray.c +6 -11
- data/ext/ca_obj_bitfield.c +5 -9
- data/ext/ca_obj_block.c +5 -12
- data/ext/ca_obj_fake.c +3 -5
- data/ext/ca_obj_farray.c +3 -5
- data/ext/ca_obj_field.c +15 -17
- data/ext/ca_obj_grid.c +5 -6
- data/ext/ca_obj_mapping.c +2 -4
- data/ext/ca_obj_object.c +3 -5
- data/ext/ca_obj_reduce.c +2 -4
- data/ext/ca_obj_refer.c +11 -15
- data/ext/ca_obj_repeat.c +2 -4
- data/ext/ca_obj_select.c +2 -4
- data/ext/ca_obj_shift.c +3 -5
- data/ext/ca_obj_transpose.c +3 -5
- data/ext/ca_obj_unbound_repeat.c +68 -122
- data/ext/ca_obj_window.c +7 -9
- data/ext/carray.h +17 -8
- data/ext/carray_access.c +183 -58
- data/ext/carray_attribute.c +151 -197
- data/ext/carray_call_cfunc.c +1 -3
- data/ext/carray_cast.c +345 -144
- data/ext/carray_cast_func.rb +1 -2
- data/ext/carray_class.c +28 -36
- data/ext/carray_conversion.c +56 -59
- data/ext/carray_copy.c +16 -32
- data/ext/carray_core.c +73 -60
- data/ext/carray_element.c +25 -44
- data/ext/carray_generate.c +74 -53
- data/ext/carray_iterator.c +13 -15
- data/ext/carray_loop.c +53 -82
- data/ext/carray_mask.c +99 -119
- data/ext/carray_math.rb +28 -12
- data/ext/carray_mathfunc.c +1 -3
- data/ext/carray_numeric.c +42 -45
- data/ext/carray_operator.c +45 -32
- data/ext/carray_order.c +231 -65
- data/ext/carray_sort_addr.c +14 -21
- data/ext/carray_stat.c +1 -3
- data/ext/carray_stat_proc.rb +2 -4
- data/ext/carray_test.c +41 -30
- data/ext/carray_undef.c +1 -11
- data/ext/carray_utils.c +138 -51
- data/ext/extconf.rb +14 -2
- data/ext/mkmath.rb +2 -2
- data/ext/ruby_carray.c +15 -7
- data/ext/ruby_ccomplex.c +2 -4
- data/ext/ruby_float_func.c +1 -3
- data/ext/version.h +5 -7
- data/lib/carray.rb +9 -9
- data/lib/carray/autoload.rb +0 -2
- data/lib/carray/autoload/autoload_gem_numo_narray.rb +6 -6
- data/lib/carray/basic.rb +1 -3
- data/lib/carray/broadcast.rb +101 -0
- data/lib/carray/compose.rb +34 -10
- data/lib/carray/construct.rb +57 -18
- data/lib/carray/info.rb +1 -3
- data/lib/carray/inspect.rb +3 -5
- data/lib/carray/io/imagemagick.rb +1 -3
- data/lib/carray/iterator.rb +3 -3
- data/lib/carray/mask.rb +18 -7
- data/lib/carray/math.rb +4 -6
- data/lib/carray/math/histogram.rb +1 -3
- data/lib/carray/math/recurrence.rb +1 -3
- data/lib/carray/mkmf.rb +1 -3
- data/lib/carray/object/ca_obj_iterator.rb +1 -3
- data/lib/carray/object/ca_obj_link.rb +1 -3
- data/lib/carray/object/ca_obj_pack.rb +1 -3
- data/lib/carray/obsolete.rb +1 -17
- data/lib/carray/ordering.rb +29 -5
- data/lib/carray/serialize.rb +34 -25
- data/lib/carray/string.rb +1 -3
- data/lib/carray/struct.rb +3 -5
- data/lib/carray/testing.rb +5 -10
- data/lib/carray/time.rb +1 -3
- data/lib/carray/transform.rb +12 -3
- data/misc/NOTE +16 -38
- data/spec/Classes/CABitfield_spec.rb +58 -0
- data/spec/Classes/CABlockIterator_spec.rb +114 -0
- data/spec/Classes/CABlock_spec.rb +205 -0
- data/spec/Classes/CAField_spec.rb +39 -0
- data/spec/Classes/CAGrid_spec.rb +75 -0
- data/spec/Classes/CAMap_spec.rb +0 -0
- data/{test/test_CAMapping.rb → spec/Classes/CAMapping_spec.rb} +35 -36
- data/spec/Classes/CAObject_attribute_spec.rb +33 -0
- data/spec/Classes/CAObject_spec.rb +33 -0
- data/spec/Classes/CARefer_spec.rb +93 -0
- data/spec/Classes/CARepeat_spec.rb +65 -0
- data/spec/Classes/CASelect_spec.rb +22 -0
- data/spec/Classes/CAShift_spec.rb +16 -0
- data/spec/Classes/CAStruct_spec.rb +71 -0
- data/{test/test_CATranspose.rb → spec/Classes/CATranspose_spec.rb} +20 -21
- data/spec/Classes/CAUnboudRepeat_spec.rb +102 -0
- data/spec/Classes/CAWindow_spec.rb +54 -0
- data/spec/Classes/CAWrap_spec.rb +8 -0
- data/{test/test_CArray.rb → spec/Classes/CArray_spec.rb} +48 -92
- data/spec/Classes/CScalar_spec.rb +55 -0
- data/spec/Features/feature_130_spec.rb +19 -0
- data/spec/Features/feature_attributes_spec.rb +280 -0
- data/spec/Features/feature_boolean_spec.rb +98 -0
- data/spec/Features/feature_broadcast.rb +116 -0
- data/spec/Features/feature_cast_function.rb +19 -0
- data/spec/Features/feature_cast_spec.rb +33 -0
- data/spec/Features/feature_class_spec.rb +84 -0
- data/spec/Features/feature_complex_spec.rb +42 -0
- data/{test/test_composite.rb → spec/Features/feature_composite_spec.rb} +17 -18
- data/spec/Features/feature_convert_spec.rb +46 -0
- data/spec/Features/feature_copy_spec.rb +123 -0
- data/spec/Features/feature_creation_spec.rb +84 -0
- data/spec/Features/feature_element_spec.rb +144 -0
- data/spec/Features/feature_extream_spec.rb +54 -0
- data/spec/Features/feature_generate_spec.rb +74 -0
- data/spec/Features/feature_index_spec.rb +69 -0
- data/spec/Features/feature_mask_spec.rb +580 -0
- data/spec/Features/feature_math_spec.rb +97 -0
- data/spec/Features/feature_order_spec.rb +146 -0
- data/spec/Features/feature_ref_store_spec.rb +209 -0
- data/spec/Features/feature_serialization_spec.rb +125 -0
- data/spec/Features/feature_stat_spec.rb +397 -0
- data/spec/Features/feature_virtual_spec.rb +48 -0
- data/spec/Features/method_eq_spec.rb +81 -0
- data/spec/Features/method_is_nan_spec.rb +12 -0
- data/spec/Features/method_map_spec.rb +54 -0
- data/spec/Features/method_max_with.rb +20 -0
- data/spec/Features/method_min_with.rb +19 -0
- data/spec/Features/method_ne_spec.rb +18 -0
- data/spec/Features/method_project_spec.rb +188 -0
- data/spec/Features/method_ref_spec.rb +27 -0
- data/spec/Features/method_round_spec.rb +11 -0
- data/spec/Features/method_s_linspace_spec.rb +48 -0
- data/spec/Features/method_s_span_spec.rb +14 -0
- data/spec/Features/method_seq_spec.rb +47 -0
- data/spec/Features/method_sort_with.rb +43 -0
- data/spec/Features/method_sorted_with.rb +29 -0
- data/spec/Features/method_span_spec.rb +42 -0
- data/spec/Features/method_wrap_readonly_spec.rb +43 -0
- data/{test → spec/UnitTest}/test_CAVirtual.rb +0 -0
- data/spec/spec_all.rb +0 -1
- data/utils/convert_test.rb +73 -0
- data/utils/{extract_rdoc.rb → extract_yard.rb} +7 -12
- metadata +74 -58
- data/spec/CABlockIterator/CABlockIterator_spec.rb +0 -113
- data/spec/CArray/bug/store_spec.rb +0 -27
- data/spec/CArray/index/repeat_spec.rb +0 -10
- data/spec/CArray/method/eq_spec.rb +0 -80
- data/spec/CArray/method/is_nan_spec.rb +0 -12
- data/spec/CArray/method/ne_spec.rb +0 -18
- data/spec/CArray/method/round_spec.rb +0 -11
- data/spec/CArray/object/_attribute_spec.rb +0 -32
- data/spec/CArray/object/s_new_spec.rb +0 -31
- data/spec/CArray/serialize/Serialization_spec.rb +0 -89
- data/test/test_130.rb +0 -23
- data/test/test_ALL.rb +0 -49
- data/test/test_CABitfield.rb +0 -59
- data/test/test_CABlock.rb +0 -208
- data/test/test_CAField.rb +0 -40
- data/test/test_CAGrid.rb +0 -76
- data/test/test_CAMmap.rb +0 -11
- data/test/test_CARefer.rb +0 -94
- data/test/test_CARepeat.rb +0 -66
- data/test/test_CASelect.rb +0 -23
- data/test/test_CAShift.rb +0 -17
- data/test/test_CAWindow.rb +0 -55
- data/test/test_CAWrap.rb +0 -9
- data/test/test_CComplex.rb +0 -83
- data/test/test_CScalar.rb +0 -91
- data/test/test_attribute.rb +0 -281
- data/test/test_block_iterator.rb +0 -17
- data/test/test_boolean.rb +0 -99
- data/test/test_cast.rb +0 -33
- data/test/test_class.rb +0 -85
- data/test/test_complex.rb +0 -43
- data/test/test_convert.rb +0 -79
- data/test/test_copy.rb +0 -141
- data/test/test_creation.rb +0 -85
- data/test/test_element.rb +0 -146
- data/test/test_extream.rb +0 -55
- data/test/test_generate.rb +0 -75
- data/test/test_index.rb +0 -71
- data/test/test_mask.rb +0 -578
- data/test/test_math.rb +0 -98
- data/test/test_order.rb +0 -147
- data/test/test_ref_store.rb +0 -211
- data/test/test_stat.rb +0 -406
- data/test/test_struct.rb +0 -72
- data/test/test_virtual.rb +0 -49
data/ext/carray_element.c
CHANGED
@@ -3,10 +3,8 @@
|
|
3
3
|
carray_element.c
|
4
4
|
|
5
5
|
This file is part of Ruby/CArray extension library.
|
6
|
-
You can redistribute it and/or modify it under the terms of
|
7
|
-
the Ruby Licence.
|
8
6
|
|
9
|
-
Copyright (C) 2005 Hiroki Motoyoshi
|
7
|
+
Copyright (C) 2005-2020 Hiroki Motoyoshi
|
10
8
|
|
11
9
|
---------------------------------------------------------------------------- */
|
12
10
|
|
@@ -15,11 +13,9 @@
|
|
15
13
|
|
16
14
|
/* ------------------------------------------------------------------- */
|
17
15
|
|
18
|
-
/*
|
19
|
-
|
20
|
-
|
21
|
-
end
|
22
|
-
end
|
16
|
+
/* @overload elem_swap (idx1, idx2)
|
17
|
+
|
18
|
+
(Element) Swaps the values at the elements which are specified by arguments.
|
23
19
|
*/
|
24
20
|
|
25
21
|
VALUE
|
@@ -127,11 +123,9 @@ rb_ca_elem_swap (VALUE self, VALUE ridx1, VALUE ridx2)
|
|
127
123
|
return self;
|
128
124
|
}
|
129
125
|
|
130
|
-
/*
|
131
|
-
|
132
|
-
|
133
|
-
end
|
134
|
-
end
|
126
|
+
/* @overload elem_copy (idx1, idx2)
|
127
|
+
|
128
|
+
(Element) Copies the value of the element of idx1 to the element of idx2
|
135
129
|
*/
|
136
130
|
|
137
131
|
VALUE
|
@@ -207,11 +201,9 @@ rb_ca_elem_copy (VALUE self, VALUE ridx1, VALUE ridx2)
|
|
207
201
|
return self;
|
208
202
|
}
|
209
203
|
|
210
|
-
/*
|
211
|
-
|
212
|
-
|
213
|
-
end
|
214
|
-
end
|
204
|
+
/* @overload elem_store (idx, obj)
|
205
|
+
|
206
|
+
(Element) Stores the object value in the element of idx.
|
215
207
|
*/
|
216
208
|
|
217
209
|
VALUE
|
@@ -245,11 +237,9 @@ rb_ca_elem_store (VALUE self, VALUE ridx, VALUE obj)
|
|
245
237
|
return obj;
|
246
238
|
}
|
247
239
|
|
248
|
-
/*
|
249
|
-
|
250
|
-
|
251
|
-
end
|
252
|
-
end
|
240
|
+
/* @overload elem_fetch (idx)
|
241
|
+
|
242
|
+
(Element) Fetches the object value at the element of idx.
|
253
243
|
*/
|
254
244
|
|
255
245
|
VALUE
|
@@ -279,11 +269,9 @@ rb_ca_elem_fetch (VALUE self, VALUE ridx)
|
|
279
269
|
}
|
280
270
|
}
|
281
271
|
|
282
|
-
/*
|
283
|
-
|
284
|
-
|
285
|
-
end
|
286
|
-
end
|
272
|
+
/* @overload elem_incr (idx)
|
273
|
+
|
274
|
+
(Element) Increments the value by 1 at the element of idx.
|
287
275
|
*/
|
288
276
|
|
289
277
|
VALUE
|
@@ -366,11 +354,9 @@ rb_ca_elem_incr (VALUE self, VALUE ridx1)
|
|
366
354
|
return out;
|
367
355
|
}
|
368
356
|
|
369
|
-
/*
|
370
|
-
|
371
|
-
|
372
|
-
end
|
373
|
-
end
|
357
|
+
/* @overload elem_decr (idx)
|
358
|
+
|
359
|
+
(Element) Decrements the value by 1 at the element of idx.
|
374
360
|
*/
|
375
361
|
|
376
362
|
VALUE
|
@@ -453,11 +439,9 @@ rb_ca_elem_decr (VALUE self, VALUE ridx1)
|
|
453
439
|
return out;
|
454
440
|
}
|
455
441
|
|
456
|
-
/*
|
457
|
-
|
458
|
-
|
459
|
-
end
|
460
|
-
end
|
442
|
+
/* @overload elem_masked? (idx)
|
443
|
+
|
444
|
+
(Masking, Element) Returns true if the element at given idx is masked.
|
461
445
|
*/
|
462
446
|
|
463
447
|
VALUE
|
@@ -498,12 +482,9 @@ rb_ca_elem_test_masked (VALUE self, VALUE ridx1)
|
|
498
482
|
|
499
483
|
/* ----------------------------------------------------------------- */
|
500
484
|
|
501
|
-
/*
|
502
|
-
|
503
|
-
|
504
|
-
def incr_addr
|
505
|
-
end
|
506
|
-
end
|
485
|
+
/* @overload incr_addr (addr)
|
486
|
+
|
487
|
+
(Element) Increment the value at the element of addr.
|
507
488
|
*/
|
508
489
|
|
509
490
|
static VALUE
|
data/ext/carray_generate.c
CHANGED
@@ -3,10 +3,8 @@
|
|
3
3
|
carray_generate.c
|
4
4
|
|
5
5
|
This file is part of Ruby/CArray extension library.
|
6
|
-
You can redistribute it and/or modify it under the terms of
|
7
|
-
the Ruby Licence.
|
8
6
|
|
9
|
-
Copyright (C) 2005 Hiroki Motoyoshi
|
7
|
+
Copyright (C) 2005-2020 Hiroki Motoyoshi
|
10
8
|
|
11
9
|
---------------------------------------------------------------------------- */
|
12
10
|
|
@@ -15,17 +13,11 @@
|
|
15
13
|
|
16
14
|
/* ----------------------------------------------------------------- */
|
17
15
|
|
18
|
-
/*
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
end
|
24
|
-
# Sets false at the given index for the boolean array and returns self.
|
25
|
-
# It accept the arguments same as for CArray#[].
|
26
|
-
def unset (*argv)
|
27
|
-
end
|
28
|
-
end
|
16
|
+
/* @overload set (*idx)
|
17
|
+
|
18
|
+
(Boolean, Modification)
|
19
|
+
Sets true at the given index for the boolean array and returns self.
|
20
|
+
It accept the arguments same as for CArray#[].
|
29
21
|
*/
|
30
22
|
|
31
23
|
static VALUE
|
@@ -40,6 +32,13 @@ rb_ca_boolean_set (int argc, VALUE *argv, VALUE self)
|
|
40
32
|
return self;
|
41
33
|
}
|
42
34
|
|
35
|
+
/* @overload unset (*idx)
|
36
|
+
|
37
|
+
(Boolean, Modification)
|
38
|
+
Sets false at the given index for the boolean array and returns self.
|
39
|
+
It accept the arguments same as for CArray#[].
|
40
|
+
*/
|
41
|
+
|
43
42
|
static VALUE
|
44
43
|
rb_ca_boolean_unset (int argc, VALUE *argv, VALUE self)
|
45
44
|
{
|
@@ -54,26 +53,24 @@ rb_ca_boolean_unset (int argc, VALUE *argv, VALUE self)
|
|
54
53
|
|
55
54
|
/* ----------------------------------------------------------------- */
|
56
55
|
|
57
|
-
/*
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
end
|
62
|
-
end
|
56
|
+
/* @overload where
|
57
|
+
|
58
|
+
(Conversion)
|
59
|
+
Returns the 1d index array for non-zero elements of self
|
63
60
|
*/
|
64
61
|
|
65
62
|
VALUE
|
66
63
|
rb_ca_where (VALUE self)
|
67
64
|
{
|
68
|
-
volatile VALUE
|
65
|
+
volatile VALUE bool0, obj;
|
69
66
|
CArray *ca, *co;
|
70
67
|
boolean8_t *p, *m;
|
71
68
|
ca_size_t *q;
|
72
69
|
ca_size_t i, count;
|
73
70
|
|
74
|
-
|
71
|
+
bool0 = ( ! rb_ca_is_boolean_type(self) ) ? rb_ca_to_boolean(self) : self;
|
75
72
|
|
76
|
-
Data_Get_Struct(
|
73
|
+
Data_Get_Struct(bool0, CArray, ca);
|
77
74
|
|
78
75
|
ca_attach(ca);
|
79
76
|
|
@@ -245,8 +242,13 @@ rb_ca_seq_bang_object (int argc, VALUE *argv, VALUE self)
|
|
245
242
|
return self;
|
246
243
|
}
|
247
244
|
|
248
|
-
/*
|
249
|
-
|
245
|
+
/* @overload seq! (init_val=0, step=1) {|elem| ... }
|
246
|
+
|
247
|
+
(Conversion, Destructive)
|
248
|
+
Generates sequential data with initial value `init_val`
|
249
|
+
and step value `step`. For object array, if the second argument
|
250
|
+
is Symbol object, it will be interpreted as stepping method and
|
251
|
+
it is called for the last element in each step.
|
250
252
|
# call-seq:
|
251
253
|
# seq (init_val=0, step=1)
|
252
254
|
# seq (init_val=0, step=1) {|x| ... }
|
@@ -258,12 +260,6 @@ rb_ca_seq_bang_object (int argc, VALUE *argv, VALUE self)
|
|
258
260
|
# is Symbol object, it will be interpreted as stepping method and
|
259
261
|
# it is called for the last element in each step.
|
260
262
|
#
|
261
|
-
def seq (init_val=0, step=1)
|
262
|
-
end
|
263
|
-
#
|
264
|
-
def seq! (init_val=0, step=1)
|
265
|
-
end
|
266
|
-
end
|
267
263
|
*/
|
268
264
|
|
269
265
|
static VALUE
|
@@ -339,6 +335,26 @@ rb_ca_seq_bang_method (int argc, VALUE *argv, VALUE self)
|
|
339
335
|
return self;
|
340
336
|
}
|
341
337
|
|
338
|
+
/* @overload seq (init_val=0, step=1) {|elem| ... }
|
339
|
+
|
340
|
+
(Conversion)
|
341
|
+
Generates sequential data with initial value `init_val`
|
342
|
+
and step value `step`. For object array, if the second argument
|
343
|
+
is Symbol object, it will be interpreted as stepping method and
|
344
|
+
it is called for the last element in each step.
|
345
|
+
# call-seq:
|
346
|
+
# seq (init_val=0, step=1)
|
347
|
+
# seq (init_val=0, step=1) {|x| ... }
|
348
|
+
# seq (init_val=0, step=A_symbol) ### for object array
|
349
|
+
# seq (init_val=0, step=A_symbol) {|x| ...} ### for object array
|
350
|
+
#
|
351
|
+
# Generates sequential data with initial value `init_val`
|
352
|
+
# and step value `step`. For object array, if the second argument
|
353
|
+
# is Symbol object, it will be interpreted as stepping method and
|
354
|
+
# it is called for the last element in each step.
|
355
|
+
#
|
356
|
+
*/
|
357
|
+
|
342
358
|
static VALUE
|
343
359
|
rb_ca_seq_method (int argc, VALUE *argv, VALUE self)
|
344
360
|
{
|
@@ -456,15 +472,10 @@ ca_swap_bytes (char *ptr, ca_size_t bytes, ca_size_t elements)
|
|
456
472
|
|
457
473
|
}
|
458
474
|
|
459
|
-
/*
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
end
|
464
|
-
#
|
465
|
-
def swap_bytes!
|
466
|
-
end
|
467
|
-
end
|
475
|
+
/* @overload swap_bytes!
|
476
|
+
|
477
|
+
(Conversion, Destructive)
|
478
|
+
Swaps the byte order of each element.
|
468
479
|
*/
|
469
480
|
|
470
481
|
VALUE
|
@@ -553,6 +564,12 @@ rb_ca_swap_bytes_bang (VALUE self)
|
|
553
564
|
return self;
|
554
565
|
}
|
555
566
|
|
567
|
+
/* @overload swap_bytes
|
568
|
+
|
569
|
+
(Conversion)
|
570
|
+
Swaps the byte order of each element.
|
571
|
+
*/
|
572
|
+
|
556
573
|
VALUE
|
557
574
|
rb_ca_swap_bytes (VALUE self)
|
558
575
|
{
|
@@ -664,20 +681,17 @@ rb_ca_swap_bytes (VALUE self)
|
|
664
681
|
} \
|
665
682
|
} \
|
666
683
|
} \
|
667
|
-
}
|
684
|
+
} \
|
668
685
|
}
|
669
686
|
|
670
|
-
|
671
|
-
|
672
|
-
|
673
|
-
|
674
|
-
|
675
|
-
|
676
|
-
|
677
|
-
|
678
|
-
def trim! (min, max, fill_value=nil)
|
679
|
-
end
|
680
|
-
end
|
687
|
+
|
688
|
+
|
689
|
+
/* @overload trim! (min, max, fill_value=nil)
|
690
|
+
|
691
|
+
(Conversion)
|
692
|
+
Trims the data into the range between min and max. If `fill_value`
|
693
|
+
is given, the element out of the range between min and max is filled
|
694
|
+
by `fill_value`
|
681
695
|
*/
|
682
696
|
|
683
697
|
static VALUE
|
@@ -720,6 +734,14 @@ rb_ca_trim_bang (int argc, VALUE *argv, VALUE self)
|
|
720
734
|
return self;
|
721
735
|
}
|
722
736
|
|
737
|
+
/* @overload trim (min, max, fill_value=nil)
|
738
|
+
|
739
|
+
(Conversion)
|
740
|
+
Trims the data into the range between min and max. If `fill_value`
|
741
|
+
is given, the element out of the range between min and max is filled
|
742
|
+
by `fill_value`
|
743
|
+
*/
|
744
|
+
|
723
745
|
static VALUE
|
724
746
|
rb_ca_trim (int argc, VALUE *argv, VALUE self)
|
725
747
|
{
|
@@ -727,7 +749,6 @@ rb_ca_trim (int argc, VALUE *argv, VALUE self)
|
|
727
749
|
return rb_ca_trim_bang(argc, argv, out);
|
728
750
|
}
|
729
751
|
|
730
|
-
|
731
752
|
void
|
732
753
|
Init_carray_generate ()
|
733
754
|
{
|
data/ext/carray_iterator.c
CHANGED
@@ -3,10 +3,8 @@
|
|
3
3
|
carray_iterator.c
|
4
4
|
|
5
5
|
This file is part of Ruby/CArray extension library.
|
6
|
-
You can redistribute it and/or modify it under the terms of
|
7
|
-
the Ruby Licence.
|
8
6
|
|
9
|
-
Copyright (C) 2005 Hiroki Motoyoshi
|
7
|
+
Copyright (C) 2005-2020 Hiroki Motoyoshi
|
10
8
|
|
11
9
|
---------------------------------------------------------------------------- */
|
12
10
|
|
@@ -209,7 +207,7 @@ ca_iter_prepare_output (VALUE self, VALUE rtype, VALUE rbytes)
|
|
209
207
|
|
210
208
|
/* -------------------------------------------------------------------- */
|
211
209
|
|
212
|
-
/*
|
210
|
+
/* yard:
|
213
211
|
class CAIterator
|
214
212
|
def ndim
|
215
213
|
end
|
@@ -223,7 +221,7 @@ rb_ca_iter_ndim (VALUE self)
|
|
223
221
|
return LONG2NUM(ca_iter_ndim(self));
|
224
222
|
}
|
225
223
|
|
226
|
-
/*
|
224
|
+
/* yard:
|
227
225
|
class CAIterator
|
228
226
|
def dim
|
229
227
|
end
|
@@ -245,7 +243,7 @@ rb_ca_iter_dim (VALUE self)
|
|
245
243
|
return rdim;
|
246
244
|
}
|
247
245
|
|
248
|
-
/*
|
246
|
+
/* yard:
|
249
247
|
class CAIterator
|
250
248
|
def elements
|
251
249
|
end
|
@@ -258,7 +256,7 @@ rb_ca_iter_elements (VALUE self)
|
|
258
256
|
return SIZE2NUM(ca_iter_elements(self));
|
259
257
|
}
|
260
258
|
|
261
|
-
/*
|
259
|
+
/* yard:
|
262
260
|
class CAIterator
|
263
261
|
def reference
|
264
262
|
end
|
@@ -271,7 +269,7 @@ rb_ca_iter_reference (VALUE self)
|
|
271
269
|
return ca_iter_reference(self);
|
272
270
|
}
|
273
271
|
|
274
|
-
/*
|
272
|
+
/* yard:
|
275
273
|
class CAIterator
|
276
274
|
def kernel_at_addr
|
277
275
|
end
|
@@ -289,7 +287,7 @@ rb_ca_iter_kernel_at_addr (int argc, VALUE *argv, VALUE self)
|
|
289
287
|
return ca_iter_kernel_at_addr(self, NUM2SIZE(raddr), rcarray);
|
290
288
|
}
|
291
289
|
|
292
|
-
/*
|
290
|
+
/* yard:
|
293
291
|
class CAIterator
|
294
292
|
def kernel_at_index
|
295
293
|
end
|
@@ -317,7 +315,7 @@ rb_ca_iter_kernel_at_index (int argc, VALUE *argv, VALUE self)
|
|
317
315
|
return ca_iter_kernel_at_index(self, idx, rcarray);
|
318
316
|
}
|
319
317
|
|
320
|
-
/*
|
318
|
+
/* yard:
|
321
319
|
class CAIterator
|
322
320
|
def kernel_move_to_addr
|
323
321
|
end
|
@@ -330,7 +328,7 @@ rb_ca_iter_kernel_move_to_addr (VALUE self, VALUE raddr, VALUE rker)
|
|
330
328
|
return ca_iter_kernel_move_to_addr(self, NUM2SIZE(raddr), rker);
|
331
329
|
}
|
332
330
|
|
333
|
-
/*
|
331
|
+
/* yard:
|
334
332
|
class CAIterator
|
335
333
|
def kernel_move_to_index
|
336
334
|
end
|
@@ -351,7 +349,7 @@ rb_ca_iter_kernel_move_to_index (VALUE self, VALUE rindex, VALUE rker)
|
|
351
349
|
return ca_iter_kernel_move_to_index(self, idx, rker);
|
352
350
|
}
|
353
351
|
|
354
|
-
/*
|
352
|
+
/* yard:
|
355
353
|
class CAIterator
|
356
354
|
def prepare_output
|
357
355
|
end
|
@@ -371,7 +369,7 @@ rb_ca_iter_prepare_output (int argc, VALUE *argv, VALUE self)
|
|
371
369
|
|
372
370
|
/* -------------------------------------------------------------------- */
|
373
371
|
|
374
|
-
/*
|
372
|
+
/* yard:
|
375
373
|
class CAIterator
|
376
374
|
def calculate
|
377
375
|
end
|
@@ -470,7 +468,7 @@ rb_ca_iter_calculate (int argc, VALUE *argv, VALUE self)
|
|
470
468
|
return routput;
|
471
469
|
}
|
472
470
|
|
473
|
-
/*
|
471
|
+
/* yard:
|
474
472
|
class CAIterator
|
475
473
|
def filter
|
476
474
|
end
|
@@ -547,7 +545,7 @@ rb_ca_iter_filter (int argc, VALUE *argv, VALUE self)
|
|
547
545
|
return routput;
|
548
546
|
}
|
549
547
|
|
550
|
-
/*
|
548
|
+
/* yard:
|
551
549
|
class CAIterator
|
552
550
|
def evaluate
|
553
551
|
end
|