carray 3.0.6 → 3.1.0
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 +1 -1
- data/CHANGELOG.md +7 -1830
- data/README.md +62 -35
- data/carray.gemspec +16 -4
- data/docs/changelogs/CHANGELOG-3.0.md +2464 -0
- data/ext/ca_array_pool.c +4 -5
- data/ext/ca_axis_descriptor.h +45 -30
- data/ext/ca_axis_dispatch.c +7 -4
- data/ext/ca_axis_group.c +12 -15
- data/ext/ca_bincmp_dispatch.h +16 -38
- data/ext/ca_binop_dispatch.c +35 -0
- data/ext/ca_binop_dispatch.h +22 -46
- data/ext/ca_categorical_iterator.c +36 -34
- data/ext/ca_compare.c +0 -1
- data/ext/ca_compare.h +8 -1
- data/ext/ca_composite_dispatch.h +6 -0
- data/ext/ca_for_buffer.h +6 -1
- data/ext/ca_group_iter.c +17 -18
- data/ext/ca_iter_state_fields.h +196 -0
- data/ext/ca_iter_substrate.h +84 -103
- data/ext/ca_kernel_iterator.c +125 -89
- data/ext/ca_kernel_iterator.h +229 -1504
- data/ext/ca_kernel_iterator_internal.h +1167 -0
- data/ext/ca_moncmp_dispatch.h +17 -24
- data/ext/ca_monop_dispatch.h +25 -74
- data/ext/ca_obj_array.c +92 -165
- data/ext/ca_obj_bincmp.c +65 -48
- data/ext/ca_obj_binop.c +74 -49
- data/ext/ca_obj_bitarray.c +7 -21
- data/ext/ca_obj_bitfield.c +93 -26
- data/ext/ca_obj_block.c +11 -12
- data/ext/ca_obj_byte_swap.c +34 -34
- data/ext/ca_obj_const_string.c +464 -304
- data/ext/ca_obj_face.c +167 -121
- data/ext/ca_obj_face.h +32 -170
- data/ext/ca_obj_fake.c +127 -34
- data/ext/ca_obj_farray.c +13 -9
- data/ext/ca_obj_field.c +17 -13
- data/ext/ca_obj_fixlen_string.c +57 -34
- data/ext/ca_obj_grid.c +149 -113
- data/ext/ca_obj_meld.c +28 -26
- data/ext/ca_obj_moncmp.c +10 -21
- data/ext/ca_obj_monop.c +88 -73
- data/ext/ca_obj_object.c +60 -46
- data/ext/ca_obj_record.c +74 -22
- data/ext/ca_obj_reduce.c +10 -14
- data/ext/ca_obj_refer.c +146 -39
- data/ext/ca_obj_remap.c +11 -29
- data/ext/ca_obj_repeat.c +41 -23
- data/ext/ca_obj_roll.c +20 -28
- data/ext/ca_obj_select.c +17 -27
- data/ext/ca_obj_select_axis.c +35 -42
- data/ext/ca_obj_shift.c +22 -42
- data/ext/ca_obj_source.c +1 -5
- data/ext/ca_obj_stack.c +33 -29
- data/ext/ca_obj_stride.c +99 -62
- data/ext/ca_obj_string.c +8 -20
- data/ext/ca_obj_tile.c +14 -16
- data/ext/ca_obj_time.c +12 -23
- data/ext/ca_obj_timedelta.c +12 -23
- data/ext/ca_obj_transpose.c +8 -10
- data/ext/ca_obj_triop.c +48 -49
- data/ext/ca_obj_window.c +87 -99
- data/ext/ca_op_cmplx64.h +4 -0
- data/ext/ca_op_ipower.c +97 -27
- data/ext/ca_op_powi.h +9 -28
- data/ext/ca_pow5_table.h +2 -1
- data/ext/ca_rng_normal.h +4 -0
- data/ext/ca_rng_xoshiro256pp.h +3 -0
- data/ext/ca_sort_kernels.h +23 -26
- data/ext/ca_sweep_engine.c +92 -26
- data/ext/ca_sweep_engine.h +22 -15
- data/ext/ca_transform_common.c +3 -8
- data/ext/ca_triop_dispatch.h +20 -32
- data/ext/caframe_csv_reader.c +12 -12
- data/ext/carray.h +300 -1009
- data/ext/carray_access.c +320 -207
- data/ext/carray_address_basis.c +128 -59
- data/ext/carray_attribute.c +81 -104
- data/ext/carray_bincount.c +12 -14
- data/ext/carray_broadcast.c +31 -27
- data/ext/carray_call_cfunc.c +174 -285
- data/ext/carray_call_cfunc.h +36 -28
- data/ext/carray_cast.c +1191 -351
- data/ext/carray_cast_func.rb +68 -8
- data/ext/carray_class.c +6 -11
- data/ext/carray_conversion.c +98 -39
- data/ext/carray_copy.c +52 -26
- data/ext/carray_core.c +286 -132
- data/ext/carray_count.c +53 -22
- data/ext/carray_element.c +49 -28
- data/ext/carray_factorize.c +64 -63
- data/ext/carray_generate.c +26 -19
- data/ext/carray_histogram.c +9 -11
- data/ext/carray_hold.c +7 -9
- data/ext/carray_index_classifier.c +127 -230
- data/ext/carray_index_classifier.h +11 -10
- data/ext/carray_integer_total.c +523 -0
- data/ext/carray_internal.h +1364 -156
- data/ext/carray_key_windows.c +3 -3
- data/ext/carray_lazy.c +37 -37
- data/ext/carray_loop.c +27 -23
- data/ext/carray_mask.c +235 -150
- data/ext/carray_math_kernel.h +23 -47
- data/ext/carray_mathfunc.c +10 -3
- data/ext/carray_median_percentile.c +106 -100
- data/ext/carray_memory_view.c +83 -69
- data/ext/carray_operator.c +490 -128
- data/ext/carray_order.c +163 -84
- data/ext/carray_partition.c +14 -16
- data/ext/carray_random.c +48 -42
- data/ext/carray_round.c +33 -5
- data/ext/carray_scatter.c +57 -39
- data/ext/carray_segment.c +42 -46
- data/ext/carray_slab.c +77 -51
- data/ext/carray_slab.h +44 -33
- data/ext/carray_sort.c +37 -31
- data/ext/carray_sort_kernel.c +36 -10
- data/ext/carray_struct.c +44 -34
- data/ext/carray_test.c +131 -81
- data/ext/carray_time_text.c +30 -31
- data/ext/carray_undef.c +50 -7
- data/ext/carray_utils.c +373 -139
- data/ext/extconf.rb +24 -17
- data/ext/mk_call_cfunc.rb +25 -31
- data/ext/mk_pow5_table.rb +2 -1
- data/ext/mkkernel.rb +819 -488
- data/ext/ruby_carray.c +47 -42
- data/ext/version.h +7 -5
- data/lib/carray/attribute.rb +19 -18
- data/lib/carray/autoload_carray.rb +20 -15
- data/lib/carray/autoload_method_extension.rb +64 -57
- data/lib/carray/axis_group.rb +272 -185
- data/lib/carray/basics.rb +298 -56
- data/lib/carray/bincount_nd.rb +41 -18
- data/lib/carray/block_iterator.rb +167 -119
- data/lib/carray/boolean_reduce.rb +7 -4
- data/lib/carray/categorical.rb +84 -59
- data/lib/carray/categorical_iterator.rb +90 -67
- data/lib/carray/complex.rb +61 -41
- data/lib/carray/conditional.rb +98 -23
- data/lib/carray/const_string.rb +112 -46
- data/lib/carray/core_extensions.rb +20 -69
- data/lib/carray/distance_limit.rb +7 -5
- data/lib/carray/factories.rb +269 -0
- data/lib/carray/fixlen_string.rb +95 -12
- data/lib/carray/frame/column_verbs.rb +76 -9
- data/lib/carray/frame/concat.rb +51 -7
- data/lib/carray/frame/convert.rb +2 -1
- data/lib/carray/frame/csv_parser.rb +20 -5
- data/lib/carray/frame/frame.rb +73 -31
- data/lib/carray/frame/group.rb +247 -187
- data/lib/carray/frame/io.rb +36 -12
- data/lib/carray/frame/join.rb +56 -17
- data/lib/carray/frame/records.rb +7 -5
- data/lib/carray/frame/reshape.rb +27 -7
- data/lib/carray/frame/sort.rb +10 -8
- data/lib/carray/frame/verbs.rb +217 -134
- data/lib/carray/frame/windows.rb +254 -19
- data/lib/carray/frame.rb +1 -2
- data/lib/carray/fuse_source.rb +28 -23
- data/lib/carray/fusion.rb +30 -30
- data/lib/carray/histogram.rb +35 -16
- data/lib/carray/inspect.rb +7 -7
- data/lib/carray/iterator.rb +104 -23
- data/lib/carray/key_windows.rb +93 -61
- data/lib/carray/lazy.rb +208 -111
- data/lib/carray/limits.rb +80 -0
- data/lib/carray/mask_gap_fill.rb +21 -16
- data/lib/carray/math.rb +87 -50
- data/lib/carray/meld_reduce.rb +30 -8
- data/lib/carray/methods/align_addr.rb +29 -17
- data/lib/carray/methods/bin.rb +8 -1
- data/lib/carray/methods/bincount.rb +4 -2
- data/lib/carray/methods/bit_string.rb +19 -31
- data/lib/carray/methods/broadcast.rb +8 -3
- data/lib/carray/methods/choose.rb +5 -5
- data/lib/carray/methods/composition.rb +73 -72
- data/lib/carray/methods/{index.rb → coordinate.rb} +13 -13
- data/lib/carray/methods/discovery_along.rb +3 -3
- data/lib/carray/methods/factorize.rb +2 -0
- data/lib/carray/methods/gather_nd.rb +106 -103
- data/lib/carray/methods/insert_block.rb +2 -2
- data/lib/carray/methods/is_between.rb +6 -4
- data/lib/carray/methods/is_in.rb +183 -143
- data/lib/carray/methods/join.rb +2 -1
- data/lib/carray/methods/lag.rb +6 -2
- data/lib/carray/methods/locate_addr.rb +157 -94
- data/lib/carray/methods/mask_duplicates.rb +1 -1
- data/lib/carray/methods/meshgrid.rb +28 -16
- data/lib/carray/methods/mode.rb +67 -67
- data/lib/carray/methods/nunique.rb +9 -7
- data/lib/carray/methods/repeat.rb +23 -13
- data/lib/carray/methods/resize.rb +1 -1
- data/lib/carray/methods/snap.rb +24 -20
- data/lib/carray/methods/string_format.rb +2 -2
- data/lib/carray/methods/unique.rb +4 -2
- data/lib/carray/methods/value_counts.rb +1 -1
- data/lib/carray/mkmf.rb +25 -28
- data/lib/carray/percentile_arguments.rb +82 -0
- data/lib/carray/record_order.rb +50 -20
- data/lib/carray/rng.rb +1 -0
- data/lib/carray/runtime.rb +195 -17
- data/lib/carray/segment_iterator.rb +262 -137
- data/lib/carray/serialize.rb +635 -566
- data/lib/carray/slab_iterator.rb +114 -114
- data/lib/carray/stack.rb +14 -15
- data/lib/carray/string.rb +16 -22
- data/lib/carray/string_operation_extension.rb +97 -52
- data/lib/carray/struct.rb +122 -164
- data/lib/carray/struct_builder.rb +247 -73
- data/lib/carray/time.rb +663 -365
- data/lib/carray/window_iterator.rb +232 -155
- data/lib/carray.rb +6 -11
- data/yard-stubs/ca_obj_array.rb +20 -135
- data/yard-stubs/ca_obj_bitarray.rb +1 -8
- data/yard-stubs/ca_obj_bitfield.rb +6 -2
- data/yard-stubs/ca_obj_byte_swap.rb +21 -7
- data/yard-stubs/ca_obj_fake.rb +3 -1
- data/yard-stubs/ca_obj_farray.rb +1 -1
- data/yard-stubs/ca_obj_field.rb +8 -6
- data/yard-stubs/ca_obj_refer.rb +10 -5
- data/yard-stubs/ca_obj_roll.rb +7 -6
- data/yard-stubs/ca_obj_shift.rb +2 -3
- data/yard-stubs/ca_obj_stride.rb +5 -7
- data/yard-stubs/ca_obj_tile.rb +1 -1
- data/yard-stubs/ca_obj_time.rb +43 -0
- data/yard-stubs/ca_obj_transpose.rb +1 -1
- data/yard-stubs/ca_obj_window.rb +28 -16
- data/yard-stubs/carray_access.rb +55 -6
- data/yard-stubs/carray_attribute.rb +26 -38
- data/yard-stubs/carray_cast.rb +121 -162
- data/yard-stubs/carray_class.rb +3 -4
- data/yard-stubs/carray_conversion.rb +6 -7
- data/yard-stubs/carray_copy.rb +2 -1
- data/yard-stubs/carray_count.rb +10 -5
- data/yard-stubs/carray_element.rb +4 -3
- data/yard-stubs/carray_limits.rb +100 -0
- data/yard-stubs/carray_loop.rb +0 -20
- data/yard-stubs/carray_mask.rb +59 -41
- data/yard-stubs/carray_math.rb +162 -100
- data/yard-stubs/carray_mathfunc.rb +415 -3
- data/yard-stubs/carray_median_percentile.rb +29 -11
- data/yard-stubs/carray_memory_view.rb +2 -2
- data/yard-stubs/carray_order.rb +72 -33
- data/yard-stubs/carray_random.rb +6 -6
- data/yard-stubs/carray_reduce.rb +353 -0
- data/yard-stubs/carray_rng.rb +92 -0
- data/yard-stubs/carray_scatter.rb +12 -3
- data/yard-stubs/carray_slab.rb +7 -4
- data/yard-stubs/carray_sort.rb +7 -6
- data/yard-stubs/carray_test.rb +18 -5
- data/yard-stubs/carray_undef.rb +44 -5
- data/yard-stubs/ruby_carray.rb +75 -40
- metadata +63 -25
- data/CHANGELOG.v1.md +0 -126
- data/ext/carray_build_flags.h +0 -3
- data/ext/carray_config.h +0 -28
- data/ext/carray_data_type.c +0 -90
- data/ext/carray_kernels_bincmp.c +0 -6457
- data/ext/carray_kernels_binop.c +0 -31534
- data/ext/carray_kernels_init.c +0 -1734
- data/ext/carray_kernels_moncmp.c +0 -2104
- data/ext/carray_kernels_monop.c +0 -25387
- data/ext/carray_kernels_reduce_aggregate.c +0 -27545
- data/ext/carray_kernels_reduce_boolean.c +0 -1924
- data/ext/carray_kernels_reduce_cumulative.c +0 -11646
- data/ext/carray_kernels_reduce_extreme.c +0 -21631
- data/ext/carray_kernels_reduce_variance.c +0 -5981
- data/ext/carray_kernels_scan.c +0 -4302
- data/ext/carray_kernels_search.c +0 -37776
- data/ext/carray_kernels_sort.c +0 -10814
- data/ext/carray_kernels_triop.c +0 -1864
- data/lib/carray/construct.rb +0 -360
- data/lib/carray/data_type_extension.rb +0 -261
- data/lib/carray/data_type_limits.rb +0 -91
data/CHANGELOG.v1.md
DELETED
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
ChangeLog of Ruby/CArray
|
|
2
|
-
========================
|
|
3
|
-
|
|
4
|
-
Releases from 3.0.0 onward are in [CHANGELOG.md](CHANGELOG.md).
|
|
5
|
-
What follows is the history up to the 2.0.0 release; 2.0.1 went unrecorded.
|
|
6
|
-
|
|
7
|
-
1.6.0 -> 2.0.0
|
|
8
|
-
--------------
|
|
9
|
-
|
|
10
|
-
* Data -> TypedData
|
|
11
|
-
|
|
12
|
-
1.5.9 -> 1.6.0
|
|
13
|
-
--------------
|
|
14
|
-
|
|
15
|
-
* Remove taint check in CArray#inspect
|
|
16
|
-
|
|
17
|
-
1.5.8 -> 1.5.9
|
|
18
|
-
--------------
|
|
19
|
-
|
|
20
|
-
* [New] Add new method 'CArray#vectorized_find_linear_addr'
|
|
21
|
-
* [Fix] Fixed invalid return value type in CArray##stddev
|
|
22
|
-
|
|
23
|
-
1.5.7 -> 1.5.8
|
|
24
|
-
--------------
|
|
25
|
-
|
|
26
|
-
* [New] Add new method 'CArray#vectorized_section'
|
|
27
|
-
* [New] Add new method 'CArray#fetch_linear_addr'
|
|
28
|
-
* [New] Add new method 'CArray#vectorized_fetch_linear_addr'
|
|
29
|
-
* [New] Add new method 'CArray#str_format'
|
|
30
|
-
* [Fix] Fixed SEGV in loading binary data from the piped input in CArray#load_binary
|
|
31
|
-
|
|
32
|
-
1.5.6 -> 1.5.7
|
|
33
|
-
--------------
|
|
34
|
-
|
|
35
|
-
* [Mod] Modify the methods 'CArray#first' and 'CArray#last' to return nil when the number of elements is zero
|
|
36
|
-
* [Fix] Add check of having ArithmeticSeuqence in ruby_carray.c
|
|
37
|
-
|
|
38
|
-
1.5.5 -> 1.5.6
|
|
39
|
-
--------------
|
|
40
|
-
|
|
41
|
-
* [Mod] Modify CArray access methods to accept Enumerator::ArithmeticSequence for index, address
|
|
42
|
-
* [Mod] Remove some gem autoloading (io_csv, io_sqlite3, rmagick, cairo, opencv, ffi)
|
|
43
|
-
* [Mod] Modify 'CArray#valid_index?' and 'CArray#valid_addr?' to accept negative integers
|
|
44
|
-
* [Mod] Modify the methods 'CArray#double' etc not to raise error for invalid string in conversion into float
|
|
45
|
-
|
|
46
|
-
1.5.4 -> 1.5.5
|
|
47
|
-
--------------
|
|
48
|
-
|
|
49
|
-
* [Fix] Fix recognition of "atan2", ... in "math.h"
|
|
50
|
-
* [Fix] Fix serialize.rb of keyword parameters for Ruby2.7
|
|
51
|
-
|
|
52
|
-
1.5.3 -> 1.5.4
|
|
53
|
-
--------------
|
|
54
|
-
|
|
55
|
-
* [New] Import method 'CArray#section' from gem 'carray-calculus'
|
|
56
|
-
* [New] Add new method 'CArray#pull', 'CArray#pulled'
|
|
57
|
-
* [New] Add new option 'expand_scalar' to 'CArray.broadcast'
|
|
58
|
-
* [Mod] Modify the method 'CArray.broadcast' to accept block.
|
|
59
|
-
* [Mod] Modify the method 'CArray.meshgrid' to accept block.
|
|
60
|
-
* [Mod] Modify 'CScalar#broadcast_to' to return CArray
|
|
61
|
-
* [Mod] Modify 'CScalar#is_masked' and 'CScalar#is_masked' to return CScalar
|
|
62
|
-
* [Fix] Fix order of repetitive dimensions in 'CArray#meshgrid'
|
|
63
|
-
* [Fix] Fix errors in installing on MinGW+msys2
|
|
64
|
-
|
|
65
|
-
1.5.2 -> 1.5.3
|
|
66
|
-
--------------
|
|
67
|
-
|
|
68
|
-
* [New] Add new method 'CArray#exp2'
|
|
69
|
-
* [New] Add new method 'CArray#log2'
|
|
70
|
-
* [New] Add new method 'CArray#logb'
|
|
71
|
-
* [New] Add new method 'CArray#remainder'
|
|
72
|
-
* [New] Add new method 'CArray.guard_undef'
|
|
73
|
-
* [New] Add new method 'CArray#data_class='
|
|
74
|
-
* [New] Add new method 'CArray.data_class?'
|
|
75
|
-
* [Mod] Modify 'CArray#pmax' to use 'fmax' for float type
|
|
76
|
-
* [Mod] Modify 'CArray#pmin' to use 'fmin' for float type
|
|
77
|
-
* [Mod] Remove method 'Object#undef?'
|
|
78
|
-
* [Mod] Remove method '::nan', '::inf'
|
|
79
|
-
* [Mod] Remove method 'TrueClass#*', 'FalseClass#*' (unknown origin)
|
|
80
|
-
* [Fix] Fix invalid access for CAUnboundRepeat using index
|
|
81
|
-
* [Fix] Fix treatment of extra :* in operation between CAUnboundRepeat objects
|
|
82
|
-
* [Fix] Fix to accept Symbol for the name of data_class member
|
|
83
|
-
* [Fix] Fix 'CArray#uniq' to accept the array with the dimension more than 2.
|
|
84
|
-
* [Fix] Fix for CArray serialization to include data_class
|
|
85
|
-
* [Fix] Fix data_class inheritance in some methods in which new CArray is created.
|
|
86
|
-
* [Fix] Fix 'CArray#broadcast_to' to accept the case of dimension extension.
|
|
87
|
-
|
|
88
|
-
1.5.1 -> 1.5.2
|
|
89
|
-
--------------
|
|
90
|
-
|
|
91
|
-
* [New] Add new method 'CArray#sorted_with'
|
|
92
|
-
* [New] Add new method 'CArray#sort_with'
|
|
93
|
-
* [New] Add new method 'CArray#max_with'
|
|
94
|
-
* [New] Add new method 'CArray#min_with'
|
|
95
|
-
* [New] Add new method 'CArray.broadcast'
|
|
96
|
-
* [New] Add new method 'CArray#broadcast_to', 'CScalar#broadcast_to'
|
|
97
|
-
* [New] Add new API function `rb_ca_wrap_new`
|
|
98
|
-
* [Mod] Modify 'CArray#linspace' to return float64 array for integer arguments
|
|
99
|
-
* [Mod] Modify CAUnboundRepeat to have `ndim` same as the bounded array (before `ndim` same as parent array)
|
|
100
|
-
* [Mod] Remove the obsolete mothod 'CArray#dump'.
|
|
101
|
-
* [Mod] Remove the obsolete mothod 'CArray#load'.
|
|
102
|
-
* [Mod] Modify CArray.wrap_readonly to wrap string as array.
|
|
103
|
-
* [Fix] Add support for Integer (same as for Fixnum, Bignum)
|
|
104
|
-
|
|
105
|
-
1.5.0 -> 1.5.1
|
|
106
|
-
--------------
|
|
107
|
-
|
|
108
|
-
* [New] Add data type classes like 'Float64' ... to provide the methods like 'CArray::Float64.linspace'
|
|
109
|
-
* [Mod] Modify 'CArray.float64' ... without aruguments to return the corresponding data type class
|
|
110
|
-
* [Mod] Set obsolete flag to 'CAIterator#sort_with'
|
|
111
|
-
* [Fix] Move C extension files into 'ext/'
|
|
112
|
-
* [Fix] Rename member 'rank' to 'ndim' in struct CArray in C extension
|
|
113
|
-
* [Fix] Remove 'CArray#shuffle' (gone to 'carray-random' gem)
|
|
114
|
-
* [Fix] Remove dependencies on 'rb_secure()' and 'rb_safe_level()'
|
|
115
|
-
* [Fix] Modify 'CArray#span' to handle fractional step for integer array
|
|
116
|
-
|
|
117
|
-
1.4.0 -> 1.5.0
|
|
118
|
-
--------------
|
|
119
|
-
|
|
120
|
-
* [Mod] Remove 'Carray#random!' (gone to 'carray-random' gem)
|
|
121
|
-
* [Mod] Relocate file 'lib/carray/io/table.rb' to 'lib/carray/table.rb'
|
|
122
|
-
* [Mod] Rename class 'CA::TableMethods' to 'CArray::TableMethods'
|
|
123
|
-
* [Mod] Rename method 'CArray#cast_other' to 'CArray#cast_with'
|
|
124
|
-
* [Mod] Change license from "Ruby's" to "MIT"
|
|
125
|
-
* [Mod] Remove files 'COPYING', 'LEGAL'(for MT), 'GPL'
|
|
126
|
-
* [Fix] Fix bug lib/carray/struct.rb
|
data/ext/carray_build_flags.h
DELETED
data/ext/carray_config.h
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
#ifndef CARRAY_CONFIG_H
|
|
2
|
-
#define CARRAY_CONFIG_H
|
|
3
|
-
#define HAVE_SYS_TYPES_H 1
|
|
4
|
-
#define HAVE_STDINT_H 1
|
|
5
|
-
#define HAVE_TYPE_INT8_T 1
|
|
6
|
-
#define HAVE_TYPE_UINT8_T 1
|
|
7
|
-
#define HAVE_TYPE_INT16_T 1
|
|
8
|
-
#define HAVE_TYPE_UINT16_T 1
|
|
9
|
-
#define HAVE_TYPE_INT32_T 1
|
|
10
|
-
#define HAVE_TYPE_UINT32_T 1
|
|
11
|
-
#define HAVE_TYPE_INT64_T 1
|
|
12
|
-
#define HAVE_TYPE_UINT64_T 1
|
|
13
|
-
#define HAVE_TYPE_LONG_LONG 1
|
|
14
|
-
#define HAVE_TYPE_FLOAT 1
|
|
15
|
-
#define HAVE_TYPE_DOUBLE 1
|
|
16
|
-
#define HAVE_COMPLEX_H 1
|
|
17
|
-
#define HAVE_TYPE_FLOAT_COMPLEX 1
|
|
18
|
-
#define HAVE_TYPE_DOUBLE_COMPLEX 1
|
|
19
|
-
#define HAVE_TGMATH_H 1
|
|
20
|
-
#define HAVE_ATAN2 1
|
|
21
|
-
#define HAVE_HYPOT 1
|
|
22
|
-
#define HAVE_LGAMMA 1
|
|
23
|
-
#define HAVE_EXPM1 1
|
|
24
|
-
#define HAVE_MERGESORT 1
|
|
25
|
-
#define HAVE_STRPTIME 1
|
|
26
|
-
#define HAVE_RB_ARITHMETIC_SEQUENCE_EXTRACT 1
|
|
27
|
-
#define HAVE_RUBY_MEMORY_VIEW_H 1
|
|
28
|
-
#endif
|
data/ext/carray_data_type.c
DELETED
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
/* ---------------------------------------------------------------------------
|
|
2
|
-
|
|
3
|
-
Per-data_type Ruby class shells: registers `CArray::Boolean`,
|
|
4
|
-
`CArray::Int8`, ..., `CArray::Object`, `CArray::Fixlen` (= the
|
|
5
|
-
15 type-tag classes) and exposes `ca_data_type_class` which maps
|
|
6
|
-
a data_type id back to its class.
|
|
7
|
-
|
|
8
|
-
The classes themselves are bare shells at the C level (no methods
|
|
9
|
-
defined here). Three companion files complete the surface:
|
|
10
|
-
|
|
11
|
-
lib/carray/construct.rb reopens each typed class to
|
|
12
|
-
add the `TypeSymbol` / `DataType` constants and extends them
|
|
13
|
-
with `DataTypeNewConstructor` (`.new(*shape)`,
|
|
14
|
-
`.from_memory_view`, `.wrap_memory_view`).
|
|
15
|
-
lib/carray/data_type_extension.rb fills in the
|
|
16
|
-
`DataTypeExtension` module with Numo-style constructor
|
|
17
|
-
methods (`.zeros`, `.full`, `.ones`, `.linspace`, ...)
|
|
18
|
-
that get attached onto every typed class.
|
|
19
|
-
ext/carray_cast.c defines the paired
|
|
20
|
-
polymorphic cast functions (`CA_INT8(data)`,
|
|
21
|
-
`CA_FLOAT64(data)`, ..., `CA_OBJECT(data)`,
|
|
22
|
-
`CA_FIXLEN(...)`) as global functions.
|
|
23
|
-
|
|
24
|
-
---------------------------------------------------------------------------- */
|
|
25
|
-
|
|
26
|
-
#include "carray.h"
|
|
27
|
-
|
|
28
|
-
VALUE rb_cCArrayBoolean;
|
|
29
|
-
VALUE rb_cCArrayUInt8;
|
|
30
|
-
VALUE rb_cCArrayUInt16;
|
|
31
|
-
VALUE rb_cCArrayUInt32;
|
|
32
|
-
VALUE rb_cCArrayUInt64;
|
|
33
|
-
VALUE rb_cCArrayInt8;
|
|
34
|
-
VALUE rb_cCArrayInt16;
|
|
35
|
-
VALUE rb_cCArrayInt32;
|
|
36
|
-
VALUE rb_cCArrayInt64;
|
|
37
|
-
VALUE rb_cCArrayFloat32;
|
|
38
|
-
VALUE rb_cCArrayFloat64;
|
|
39
|
-
VALUE rb_cCArrayCmplx64;
|
|
40
|
-
VALUE rb_cCArrayCmplx128;
|
|
41
|
-
VALUE rb_cCArrayObject;
|
|
42
|
-
VALUE rb_cCArrayFixlen;
|
|
43
|
-
|
|
44
|
-
/* Returns the type class for a given data_type id. CA_FIXLEN is
|
|
45
|
-
* intentionally omitted because Fixlen requires a `bytes:` parameter
|
|
46
|
-
* and cannot be identified by data_type alone.
|
|
47
|
-
*
|
|
48
|
-
* Called from rb_ca_s_body macro (ca_obj_array.c), which dispatches
|
|
49
|
-
* `CArray.<type>()` no-arg calls to the corresponding type class. */
|
|
50
|
-
VALUE
|
|
51
|
-
ca_data_type_class (int8_t data_type)
|
|
52
|
-
{
|
|
53
|
-
switch ( data_type ) {
|
|
54
|
-
case CA_BOOLEAN: return rb_cCArrayBoolean; break;
|
|
55
|
-
case CA_INT8: return rb_cCArrayInt8; break;
|
|
56
|
-
case CA_UINT8: return rb_cCArrayUInt8; break;
|
|
57
|
-
case CA_INT16: return rb_cCArrayInt16; break;
|
|
58
|
-
case CA_UINT16: return rb_cCArrayUInt16; break;
|
|
59
|
-
case CA_INT32: return rb_cCArrayInt32; break;
|
|
60
|
-
case CA_UINT32: return rb_cCArrayUInt32; break;
|
|
61
|
-
case CA_INT64: return rb_cCArrayInt64; break;
|
|
62
|
-
case CA_UINT64: return rb_cCArrayUInt64; break;
|
|
63
|
-
case CA_FLOAT32: return rb_cCArrayFloat32; break;
|
|
64
|
-
case CA_FLOAT64: return rb_cCArrayFloat64; break;
|
|
65
|
-
case CA_CMPLX64: return rb_cCArrayCmplx64; break;
|
|
66
|
-
case CA_CMPLX128: return rb_cCArrayCmplx128; break;
|
|
67
|
-
case CA_OBJECT: return rb_cCArrayObject; break;
|
|
68
|
-
default: rb_raise(rb_eRuntimeError, "invalid data type");
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
void
|
|
73
|
-
Init_carray_data_type (void)
|
|
74
|
-
{
|
|
75
|
-
rb_cCArrayBoolean = rb_define_class_under(rb_cCArray, "Boolean", rb_cObject);
|
|
76
|
-
rb_cCArrayUInt8 = rb_define_class_under(rb_cCArray, "UInt8", rb_cObject);
|
|
77
|
-
rb_cCArrayUInt16 = rb_define_class_under(rb_cCArray, "UInt16", rb_cObject);
|
|
78
|
-
rb_cCArrayUInt32 = rb_define_class_under(rb_cCArray, "UInt32", rb_cObject);
|
|
79
|
-
rb_cCArrayUInt64 = rb_define_class_under(rb_cCArray, "UInt64", rb_cObject);
|
|
80
|
-
rb_cCArrayInt8 = rb_define_class_under(rb_cCArray, "Int8", rb_cObject);
|
|
81
|
-
rb_cCArrayInt16 = rb_define_class_under(rb_cCArray, "Int16", rb_cObject);
|
|
82
|
-
rb_cCArrayInt32 = rb_define_class_under(rb_cCArray, "Int32", rb_cObject);
|
|
83
|
-
rb_cCArrayInt64 = rb_define_class_under(rb_cCArray, "Int64", rb_cObject);
|
|
84
|
-
rb_cCArrayFloat32 = rb_define_class_under(rb_cCArray, "Float32", rb_cObject);
|
|
85
|
-
rb_cCArrayFloat64 = rb_define_class_under(rb_cCArray, "Float64", rb_cObject);
|
|
86
|
-
rb_cCArrayCmplx64 = rb_define_class_under(rb_cCArray, "Cmplx64", rb_cObject);
|
|
87
|
-
rb_cCArrayCmplx128 = rb_define_class_under(rb_cCArray, "Cmplx128", rb_cObject);
|
|
88
|
-
rb_cCArrayObject = rb_define_class_under(rb_cCArray, "Object", rb_cObject);
|
|
89
|
-
rb_cCArrayFixlen = rb_define_class_under(rb_cCArray, "Fixlen", rb_cObject);
|
|
90
|
-
}
|