nmatrix 0.0.8 → 0.0.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +3 -8
- data/.rspec +1 -1
- data/.travis.yml +12 -0
- data/CONTRIBUTING.md +27 -12
- data/Gemfile +1 -0
- data/History.txt +38 -0
- data/Manifest.txt +15 -15
- data/README.rdoc +7 -6
- data/Rakefile +40 -5
- data/ext/nmatrix/data/data.cpp +2 -37
- data/ext/nmatrix/data/data.h +19 -121
- data/ext/nmatrix/data/meta.h +70 -0
- data/ext/nmatrix/extconf.rb +40 -12
- data/ext/nmatrix/math/math.h +13 -103
- data/ext/nmatrix/nmatrix.cpp +10 -2018
- data/ext/nmatrix/nmatrix.h +16 -13
- data/ext/nmatrix/ruby_constants.cpp +12 -1
- data/ext/nmatrix/ruby_constants.h +7 -1
- data/ext/nmatrix/ruby_nmatrix.c +2169 -0
- data/ext/nmatrix/storage/dense.cpp +123 -14
- data/ext/nmatrix/storage/dense.h +10 -4
- data/ext/nmatrix/storage/list.cpp +265 -48
- data/ext/nmatrix/storage/list.h +6 -9
- data/ext/nmatrix/storage/storage.cpp +44 -54
- data/ext/nmatrix/storage/storage.h +2 -2
- data/ext/nmatrix/storage/yale/class.h +1070 -0
- data/ext/nmatrix/storage/yale/iterators/base.h +142 -0
- data/ext/nmatrix/storage/yale/iterators/iterator.h +130 -0
- data/ext/nmatrix/storage/yale/iterators/row.h +449 -0
- data/ext/nmatrix/storage/yale/iterators/row_stored.h +139 -0
- data/ext/nmatrix/storage/yale/iterators/row_stored_nd.h +167 -0
- data/ext/nmatrix/storage/yale/iterators/stored_diagonal.h +123 -0
- data/ext/nmatrix/storage/yale/math/transpose.h +110 -0
- data/ext/nmatrix/storage/yale/yale.cpp +1785 -0
- data/ext/nmatrix/storage/{yale.h → yale/yale.h} +23 -55
- data/ext/nmatrix/types.h +2 -0
- data/ext/nmatrix/util/io.cpp +27 -45
- data/ext/nmatrix/util/io.h +0 -2
- data/ext/nmatrix/util/sl_list.cpp +169 -28
- data/ext/nmatrix/util/sl_list.h +9 -3
- data/lib/nmatrix/blas.rb +20 -20
- data/lib/nmatrix/enumerate.rb +1 -1
- data/lib/nmatrix/io/mat5_reader.rb +8 -14
- data/lib/nmatrix/lapack.rb +3 -3
- data/lib/nmatrix/math.rb +3 -3
- data/lib/nmatrix/nmatrix.rb +19 -5
- data/lib/nmatrix/nvector.rb +2 -0
- data/lib/nmatrix/shortcuts.rb +90 -125
- data/lib/nmatrix/version.rb +1 -1
- data/nmatrix.gemspec +7 -8
- data/spec/{nmatrix_spec.rb → 00_nmatrix_spec.rb} +45 -208
- data/spec/01_enum_spec.rb +184 -0
- data/spec/{slice_spec.rb → 02_slice_spec.rb} +55 -39
- data/spec/blas_spec.rb +22 -54
- data/spec/elementwise_spec.rb +9 -8
- data/spec/io_spec.rb +6 -4
- data/spec/lapack_spec.rb +26 -26
- data/spec/math_spec.rb +9 -5
- data/spec/nmatrix_yale_spec.rb +29 -61
- data/spec/shortcuts_spec.rb +34 -22
- data/spec/slice_set_spec.rb +157 -0
- data/spec/spec_helper.rb +42 -2
- data/spec/stat_spec.rb +192 -0
- metadata +52 -55
- data/ext/nmatrix/storage/yale.cpp +0 -2284
- data/spec/nmatrix_list_spec.rb +0 -113
- data/spec/nvector_spec.rb +0 -112
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3c50cbab8bbd44023c4e72abd2592b3412e47710
|
4
|
+
data.tar.gz: b5dafe0a32a6547e2b723b36f463c5eed8840293
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1adaef4aaf34a6c24e3c3e815fc18305a174f781ec648b12942b54bc2ba40314558b4e900e6128af2fe13a921d4255e25dca2af278603a1e9b8c9d270c681061
|
7
|
+
data.tar.gz: ac48bdf4e1f3ff45386a02dc43a0ab2f379e39541f7eb60b6f304d7706d1829b15c8d282ead396a47d9644a6984dc64d8549534c8e1ceb150c9e422566643e42
|
data/.gitignore
CHANGED
@@ -20,13 +20,8 @@ spec/*.mtx
|
|
20
20
|
*.log
|
21
21
|
/tags
|
22
22
|
*.gem
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
ext/nmatrix/*.log
|
27
|
-
ext/nmatrix/**/*.o
|
28
|
-
ext/nmatrix/Makefile
|
29
|
-
ext/nmatrix/**/Makefile
|
30
|
-
ext/nmatrix/nmatrix_config.h
|
23
|
+
html/
|
24
|
+
doc/
|
25
|
+
docs/
|
31
26
|
pkg/
|
32
27
|
.autotest
|
data/.rspec
CHANGED
@@ -1,2 +1,2 @@
|
|
1
1
|
--color
|
2
|
-
--format
|
2
|
+
--format RSpec::Longrun::Formatter
|
data/.travis.yml
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
language: ruby
|
2
|
+
env:
|
3
|
+
- CPLUS_INCLUDE_PATH=/usr/include/atlas C_INCLUDE_PATH=/usr/include/atlas
|
4
|
+
rvm:
|
5
|
+
- "1.9.2"
|
6
|
+
- "1.9.3"
|
7
|
+
- "2.0.0"
|
8
|
+
before_install:
|
9
|
+
- sudo apt-get update -qq
|
10
|
+
- sudo apt-get install -qq libatlas-base-dev
|
11
|
+
script: bundle exec rake compile && bundle exec rake spec
|
12
|
+
|
data/CONTRIBUTING.md
CHANGED
@@ -1,4 +1,5 @@
|
|
1
|
-
NMatrix is part of SciRuby, a collaborative effort to bring scientific computation to Ruby. If you want to help, please
|
1
|
+
NMatrix is part of SciRuby, a collaborative effort to bring scientific computation to Ruby. If you want to help, please
|
2
|
+
do so!
|
2
3
|
|
3
4
|
This guide covers ways in which you can contribute to the development of SciRuby and, more specifically, NMatrix.
|
4
5
|
|
@@ -6,17 +7,26 @@ This guide covers ways in which you can contribute to the development of SciRuby
|
|
6
7
|
|
7
8
|
There are various ways to help NMatrix: bug reports, coding and documentation. All of them are important.
|
8
9
|
|
9
|
-
First, you can help implement new features or bug fixes. To do that, visit our
|
10
|
+
First, you can help implement new features or bug fixes. To do that, visit our
|
11
|
+
[roadmap](https://github.com/SciRuby/nmatrix/wiki/Roadmap) or our [issue tracker][2]. If you find something that you
|
12
|
+
want to work on, post it in the issue or on our [mailing list][1].
|
10
13
|
|
11
|
-
You need to send tests together with your code. No exceptions. You can ask
|
14
|
+
You need to send tests together with your code. No exceptions. You can ask for our opinion, but we won't accept patches
|
15
|
+
without good spec coverage.
|
12
16
|
|
13
|
-
We use RSpec for testing. If you aren't familiar with it, there's a good
|
17
|
+
We use RSpec for testing. If you aren't familiar with it, there's a good
|
18
|
+
[guide to better specs with RSpec](http://betterspecs.org/) that shows a bit of the syntax and how to use it properly.
|
19
|
+
However, the best resource is probably the specs that already exist -- so just read them.
|
14
20
|
|
15
|
-
And don't forget to write documentation. It's necessary to allow others to know what's available in the
|
21
|
+
And don't forget to write documentation (we use RDoc). It's necessary to allow others to know what's available in the
|
22
|
+
library. There's a section on it later in this guide.
|
16
23
|
|
17
|
-
We only accept bug reports and pull requests in GitHub. You'll need to create a new (free) account if you don't have one
|
24
|
+
We only accept bug reports and pull requests in GitHub. You'll need to create a new (free) account if you don't have one
|
25
|
+
already. To learn how to create a pull request, please see
|
26
|
+
[this guide on collaborating](https://help.github.com/categories/63/articles).
|
18
27
|
|
19
|
-
If you have a question about how to use NMatrix or SciRuby in general or a feature/change in mind, please ask the
|
28
|
+
If you have a question about how to use NMatrix or SciRuby in general or a feature/change in mind, please ask the
|
29
|
+
[sciruby-dev mailing list][1].
|
20
30
|
|
21
31
|
Thanks!
|
22
32
|
|
@@ -40,7 +50,8 @@ Now, you need to clone the git repository:
|
|
40
50
|
|
41
51
|
This will install all dependencies, compile the extension and run the specs.
|
42
52
|
|
43
|
-
As of now (12/31/2012), there should be 25 specs failing, in elementwise\_spec, lapack\_spec and math\_spec. If you see
|
53
|
+
As of now (12/31/2012), there should be 25 specs failing, in elementwise\_spec, lapack\_spec and math\_spec. If you see
|
54
|
+
more than 25 or from different specs, please report on the [mailing list][1] or on the [issue tracker][2].
|
44
55
|
|
45
56
|
If everything's fine until now, you can create a new branch to work on your feature:
|
46
57
|
|
@@ -52,15 +63,19 @@ Before commiting any code, please read our
|
|
52
63
|
|
53
64
|
## Documentation
|
54
65
|
|
55
|
-
There are two ways in which NMatrix is being documented: guides and comments, which are converted with RDoc into the
|
66
|
+
There are two ways in which NMatrix is being documented: guides and comments, which are converted with RDoc into the
|
67
|
+
documentation seen in [sciruby.com](http://sciruby.com).
|
56
68
|
|
57
|
-
If you want to write a guide on how to use NMatrix to solve some problem or simply showing how to use one of its
|
69
|
+
If you want to write a guide on how to use NMatrix to solve some problem or simply showing how to use one of its
|
70
|
+
features, write it as a wiki page and send an e-mail on the [mailing list][1]. We're working to improve this process.
|
58
71
|
|
59
|
-
If you aren't familiar with RDoc syntax,
|
72
|
+
If you aren't familiar with RDoc syntax,
|
73
|
+
[this is the official documentation](http://docs.seattlerb.org/rdoc/RDoc/Markup.html).
|
60
74
|
|
61
75
|
## Conclusion
|
62
76
|
|
63
|
-
This guide was heavily based on the
|
77
|
+
This guide was heavily based on the
|
78
|
+
[Contributing to Ruby on Rails guide](http://edgeguides.rubyonrails.org/contributing_to_ruby_on_rails.html).
|
64
79
|
|
65
80
|
[1]: https://groups.google.com/forum/?fromgroups#!forum/sciruby-dev
|
66
81
|
[2]: https://github.com/sciruby/nmatrix/issues?sort=created&state=open
|
data/Gemfile
CHANGED
data/History.txt
CHANGED
@@ -389,3 +389,41 @@
|
|
389
389
|
* Fixed pry version error which manifests on some systems but not
|
390
390
|
others
|
391
391
|
|
392
|
+
=== 0.0.9 / 2013-09-18
|
393
|
+
|
394
|
+
* 5 major enhancements:
|
395
|
+
|
396
|
+
* Re-factored NMatrix constructor
|
397
|
+
|
398
|
+
* Improved usability of NMatrix shortcut constructor options
|
399
|
+
(e.g., #zeros, #ones, #random, etc.) using new NMatrix
|
400
|
+
constructor
|
401
|
+
|
402
|
+
* Left-assignment of slices for all matrix storage types (uses a
|
403
|
+
dense cast, or accepts an array or single value)
|
404
|
+
|
405
|
+
* Re-factored Yale into a more object-oriented and less confusing
|
406
|
+
set of header files
|
407
|
+
|
408
|
+
* Enabled Travis CI (by @cjfuller)
|
409
|
+
|
410
|
+
* 4 minor enhancements:
|
411
|
+
|
412
|
+
* Renamed some specs in order to change their test order, so that
|
413
|
+
critical tests fail first (particularly in the case of
|
414
|
+
segmentation faults)
|
415
|
+
|
416
|
+
* Default dtype is now :object when no initial values are
|
417
|
+
specified
|
418
|
+
|
419
|
+
* Deprecated NVector#initialize and a number of other unnecessary
|
420
|
+
NVector functionality
|
421
|
+
|
422
|
+
* Made Ubuntu compilation significantly easier (by @cjfuller)
|
423
|
+
|
424
|
+
* 2 bug fixes:
|
425
|
+
|
426
|
+
* nil values in matrices are now pretty printed as "nil"
|
427
|
+
|
428
|
+
* Casting from dense to Yale now properly accepts the default
|
429
|
+
value option
|
data/Manifest.txt
CHANGED
@@ -7,19 +7,7 @@ Rakefile
|
|
7
7
|
Gemfile
|
8
8
|
Guardfile
|
9
9
|
nmatrix.gemspec
|
10
|
-
|
11
|
-
spec/elementwise_spec.rb
|
12
|
-
spec/io_spec.rb
|
13
|
-
spec/lapack_spec.rb
|
14
|
-
spec/math_spec.rb
|
15
|
-
spec/nmatrix_list_spec.rb
|
16
|
-
spec/nmatrix_spec.rb
|
17
|
-
spec/nmatrix_yale_spec.rb
|
18
|
-
spec/nvector_spec.rb
|
19
|
-
spec/rspec_spec.rb
|
20
|
-
spec/shortcuts_spec.rb
|
21
|
-
spec/slice_spec.rb
|
22
|
-
spec/spec_helper.rb
|
10
|
+
.travis.yml
|
23
11
|
lib/nmatrix.rb
|
24
12
|
lib/nmatrix/rspec.rb
|
25
13
|
lib/nmatrix/io/market.rb
|
@@ -39,6 +27,7 @@ lib/nmatrix/yale_functions.rb
|
|
39
27
|
ext/nmatrix/data/complex.h
|
40
28
|
ext/nmatrix/data/data.cpp
|
41
29
|
ext/nmatrix/data/data.h
|
30
|
+
ext/nmatrix/data/meta.h
|
42
31
|
ext/nmatrix/data/rational.h
|
43
32
|
ext/nmatrix/data/ruby_object.h
|
44
33
|
ext/nmatrix/storage/common.cpp
|
@@ -49,8 +38,18 @@ ext/nmatrix/storage/list.cpp
|
|
49
38
|
ext/nmatrix/storage/list.h
|
50
39
|
ext/nmatrix/storage/storage.cpp
|
51
40
|
ext/nmatrix/storage/storage.h
|
52
|
-
ext/nmatrix/storage/yale.cpp
|
53
|
-
ext/nmatrix/storage/yale.h
|
41
|
+
ext/nmatrix/storage/yale/yale.cpp
|
42
|
+
ext/nmatrix/storage/yale/yale.h
|
43
|
+
ext/nmatrix/storage/yale/class.h
|
44
|
+
ext/nmatrix/storage/yale/iterators/base.h
|
45
|
+
ext/nmatrix/storage/yale/iterators/iterator.h
|
46
|
+
ext/nmatrix/storage/yale/iterators/row.h
|
47
|
+
ext/nmatrix/storage/yale/iterators/row_stored.h
|
48
|
+
ext/nmatrix/storage/yale/iterators/row_stored_nd.h
|
49
|
+
ext/nmatrix/storage/yale/iterators/stored_diagonal.h
|
50
|
+
ext/nmatrix/storage/yale/math/transpose.h
|
51
|
+
ext/nmatrix/util/io.cpp
|
52
|
+
ext/nmatrix/util/io.h
|
54
53
|
ext/nmatrix/util/sl_list.cpp
|
55
54
|
ext/nmatrix/util/sl_list.h
|
56
55
|
ext/nmatrix/util/util.h
|
@@ -82,6 +81,7 @@ ext/nmatrix/nmatrix.cpp
|
|
82
81
|
ext/nmatrix/nmatrix.h
|
83
82
|
ext/nmatrix/ruby_constants.cpp
|
84
83
|
ext/nmatrix/ruby_constants.h
|
84
|
+
ext/nmatrix/ruby_nmatrix.c
|
85
85
|
ext/nmatrix/types.h
|
86
86
|
ext/nmatrix/extconf.rb
|
87
87
|
|
data/README.rdoc
CHANGED
@@ -27,7 +27,7 @@ However, you will need to install {ATLAS}[http://math-atlas.sourceforge.net/] wi
|
|
27
27
|
* ATLAS
|
28
28
|
* LAPACK, probably ({see here for details}[https://github.com/SciRuby/nmatrix/wiki/Installation])
|
29
29
|
* a version of GCC or clang which supports C++0x or C++11
|
30
|
-
* Ruby 1.9+
|
30
|
+
* Ruby 1.9.3+
|
31
31
|
* {packable}[http://github.com/marcandre/packable] 1.3.5 (used for I/O)
|
32
32
|
|
33
33
|
If you want to obtain the latest (development) code, you should generally do:
|
@@ -37,7 +37,7 @@ If you want to obtain the latest (development) code, you should generally do:
|
|
37
37
|
bundle install
|
38
38
|
bundle exec rake compile
|
39
39
|
bundle exec rake repackage
|
40
|
-
gem install pkg/nmatrix-0.0.
|
40
|
+
gem install pkg/nmatrix-0.1.0.gem
|
41
41
|
|
42
42
|
Detailed instructions are available for {Mac}[https://github.com/SciRuby/nmatrix/wiki/Installation#mac-os-x] and {Linux}[https://github.com/SciRuby/nmatrix/wiki/Installation#linux].
|
43
43
|
|
@@ -50,12 +50,12 @@ Carlos Agarie (@agarie) is currently working to improve the documentation. The b
|
|
50
50
|
|
51
51
|
You can find the complete API documentation {on our website}[http://sciruby.com/nmatrix/docs/].
|
52
52
|
|
53
|
-
==
|
53
|
+
== Examples
|
54
54
|
|
55
55
|
Create a new NMatrix from a ruby array:
|
56
56
|
|
57
57
|
>> require 'nmatrix'
|
58
|
-
>> NMatrix.new([2, 3], [0, 1, 2, 3, 4, 5], :int64).pp
|
58
|
+
>> NMatrix.new([2, 3], [0, 1, 2, 3, 4, 5], dtype: :int64).pp
|
59
59
|
[0, 1, 2]
|
60
60
|
[3, 4, 5]
|
61
61
|
=> nil
|
@@ -113,7 +113,7 @@ The following features exist in the current version of NMatrix (0.0.8):
|
|
113
113
|
* Matrix inversions (requires LAPACK; BLAS dtypes only)
|
114
114
|
* Determinant calculation for BLAS dtypes
|
115
115
|
* Vector 2-norms
|
116
|
-
* Ruby/GSL interoperability (requires
|
116
|
+
* Ruby/GSL interoperability (requires {SciRuby's fork of rb-gsl}(http://github.com/SciRuby/rb-gsl))
|
117
117
|
|
118
118
|
=== Planned Features (Short-to-Medium Term)
|
119
119
|
|
@@ -121,7 +121,8 @@ We are nearly the release of NMatrix 0.1.0, our first beta.
|
|
121
121
|
|
122
122
|
These are features planned for NMatrix 0.2.0:
|
123
123
|
|
124
|
-
* slice assignments
|
124
|
+
* slice assignments, e.g.,
|
125
|
+
x[1..3,0..4] = some_other_matrix
|
125
126
|
* LAPACK-free calculation of determinant, trace, and eigenvalues (characteristic polynomial)
|
126
127
|
* LAPACK-free matrix inversions
|
127
128
|
* tensor products
|
data/Rakefile
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
# -*- ruby -*-
|
2
2
|
|
3
3
|
require 'rubygems'
|
4
|
+
require 'rubygems/package_task'
|
4
5
|
require 'bundler'
|
5
6
|
begin
|
6
7
|
Bundler.setup(:default, :development)
|
@@ -21,8 +22,7 @@ end
|
|
21
22
|
|
22
23
|
gemspec = eval(IO.read("nmatrix.gemspec"))
|
23
24
|
|
24
|
-
|
25
|
-
Rake::GemPackageTask.new(gemspec).define
|
25
|
+
Gem::PackageTask.new(gemspec).define
|
26
26
|
|
27
27
|
desc "install the gem locally"
|
28
28
|
task :install => [:package] do
|
@@ -33,10 +33,10 @@ require 'rspec/core/rake_task'
|
|
33
33
|
require 'rspec/core'
|
34
34
|
require 'rspec/core/rake_task'
|
35
35
|
RSpec::Core::RakeTask.new(:spec) do |spec|
|
36
|
-
|
37
|
-
spec.pattern = FileList['spec/nmatrix_spec.rb', 'spec/**/*_spec.rb'].uniq
|
36
|
+
spec.pattern = FileList['spec/**/*_spec.rb'].uniq
|
38
37
|
end
|
39
38
|
|
39
|
+
|
40
40
|
BASEDIR = Pathname( __FILE__ ).dirname.relative_path_from( Pathname.pwd )
|
41
41
|
SPECDIR = BASEDIR + 'spec'
|
42
42
|
|
@@ -107,7 +107,7 @@ namespace :spec do
|
|
107
107
|
# spurious (and eminently ignorable) warnings from the ruby
|
108
108
|
# interpreter
|
109
109
|
|
110
|
-
RSPEC_CMD = [ 'ruby', '-S', 'rspec', '-Ilib:ext',
|
110
|
+
RSPEC_CMD = [ 'ruby', '-S', 'rspec', '-Ilib:ext', SPECDIR.to_s ]
|
111
111
|
|
112
112
|
#desc "Run the spec for generator.rb"
|
113
113
|
#task :generator do |task|
|
@@ -163,4 +163,39 @@ namespace :clean do
|
|
163
163
|
end
|
164
164
|
end
|
165
165
|
|
166
|
+
|
167
|
+
desc "Check the manifest for correctness"
|
168
|
+
task :check_manifest do |task|
|
169
|
+
manifest_files = File.read("Manifest.txt").split
|
170
|
+
|
171
|
+
git_files = `git ls-files |grep -v 'spec/'`.split
|
172
|
+
ignore_files = %w{.gitignore .rspec ext/nmatrix/binary_format.txt ext/nmatrix/ttable_helper.rb scripts/mac-brew-gcc.sh}
|
173
|
+
|
174
|
+
possible_files = git_files - ignore_files
|
175
|
+
|
176
|
+
missing_files = possible_files - manifest_files
|
177
|
+
extra_files = manifest_files - possible_files
|
178
|
+
|
179
|
+
unless missing_files.empty?
|
180
|
+
STDERR.puts "The following files are in the git repo but not the Manifest:"
|
181
|
+
missing_files.each { |f| STDERR.puts " -- #{f}"}
|
182
|
+
end
|
183
|
+
|
184
|
+
unless extra_files.empty?
|
185
|
+
STDERR.puts "The following files are in the Manifest but may not be necessary:"
|
186
|
+
extra_files.each { |f| STDERR.puts " -- #{f}"}
|
187
|
+
end
|
188
|
+
|
189
|
+
if extra_files.empty? && missing_files.empty?
|
190
|
+
STDERR.puts "Manifest looks good!"
|
191
|
+
end
|
192
|
+
|
193
|
+
end
|
194
|
+
|
195
|
+
require "rdoc/task"
|
196
|
+
RDoc::Task.new do |rdoc|
|
197
|
+
rdoc.main = "README.rdoc"
|
198
|
+
rdoc.rdoc_files.include(%w{README.rdoc History.txt LICENSE.txt CONTRIBUTING.md ext/nmatrix/binary_format.txt lib/nmatrix/**/*.rb ext/nmatrix/**/*.cpp ext/nmatrix/**/*.c ext/nmatrix/**/*.h})
|
199
|
+
end
|
200
|
+
|
166
201
|
# vim: syntax=ruby
|
data/ext/nmatrix/data/data.cpp
CHANGED
@@ -115,6 +115,7 @@ namespace nm {
|
|
115
115
|
}
|
116
116
|
}
|
117
117
|
|
118
|
+
|
118
119
|
} // end of namespace nm
|
119
120
|
extern "C" {
|
120
121
|
|
@@ -134,13 +135,6 @@ const char* const DTYPE_NAMES[nm::NUM_DTYPES] = {
|
|
134
135
|
"object"
|
135
136
|
};
|
136
137
|
|
137
|
-
const char* const ITYPE_NAMES[nm::NUM_ITYPES] = {
|
138
|
-
"uint8",
|
139
|
-
"uint16",
|
140
|
-
"uint32",
|
141
|
-
"uint64"
|
142
|
-
};
|
143
|
-
|
144
138
|
|
145
139
|
const size_t DTYPE_SIZES[nm::NUM_DTYPES] = {
|
146
140
|
sizeof(uint8_t),
|
@@ -158,12 +152,6 @@ const size_t DTYPE_SIZES[nm::NUM_DTYPES] = {
|
|
158
152
|
sizeof(nm::RubyObject)
|
159
153
|
};
|
160
154
|
|
161
|
-
const size_t ITYPE_SIZES[nm::NUM_ITYPES] = {
|
162
|
-
sizeof(uint8_t),
|
163
|
-
sizeof(uint16_t),
|
164
|
-
sizeof(uint32_t),
|
165
|
-
sizeof(uint64_t),
|
166
|
-
};
|
167
155
|
|
168
156
|
const nm::dtype_t Upcast[nm::NUM_DTYPES][nm::NUM_DTYPES] = {
|
169
157
|
{ nm::BYTE, nm::INT16, nm::INT16, nm::INT32, nm::INT64, nm::FLOAT32, nm::FLOAT64, nm::COMPLEX64, nm::COMPLEX128, nm::RATIONAL32, nm::RATIONAL64, nm::RATIONAL128, nm::RUBYOBJ},
|
@@ -306,30 +294,6 @@ nm::RubyObject rubyobj_from_cval(void* val, nm::dtype_t dtype) {
|
|
306
294
|
}
|
307
295
|
|
308
296
|
|
309
|
-
/*
|
310
|
-
* Convert from itype instead of dtype
|
311
|
-
*/
|
312
|
-
nm::RubyObject rubyobj_from_cval_by_itype(void* val, nm::itype_t itype) {
|
313
|
-
using namespace nm;
|
314
|
-
switch (itype) {
|
315
|
-
case UINT8:
|
316
|
-
return RubyObject(*reinterpret_cast<uint8_t*>(val));
|
317
|
-
|
318
|
-
case UINT16:
|
319
|
-
return RubyObject((int16_t)(*reinterpret_cast<uint16_t*>(val)));
|
320
|
-
|
321
|
-
case UINT32:
|
322
|
-
return RubyObject((int32_t)(*reinterpret_cast<uint32_t*>(val)));
|
323
|
-
|
324
|
-
case UINT64:
|
325
|
-
return RubyObject((int64_t)(*reinterpret_cast<uint64_t*>(val)));
|
326
|
-
|
327
|
-
default:
|
328
|
-
rb_raise(nm_eDataTypeError, "Conversion to RubyObject requested from unknown data type");
|
329
|
-
}
|
330
|
-
return Qnil;
|
331
|
-
}
|
332
|
-
|
333
297
|
|
334
298
|
/*
|
335
299
|
* Allocate and return a piece of data of the correct dtype, converted from a
|
@@ -344,6 +308,7 @@ void* rubyobj_to_cval(VALUE val, nm::dtype_t dtype) {
|
|
344
308
|
return ret_val;
|
345
309
|
}
|
346
310
|
|
311
|
+
|
347
312
|
void nm_init_data() {
|
348
313
|
nm::RubyObject obj(INT2FIX(1));
|
349
314
|
nm::Rational32 x(obj);
|
data/ext/nmatrix/data/data.h
CHANGED
@@ -76,6 +76,7 @@ namespace nm {
|
|
76
76
|
extern const char* const EWOP_OPS[nm::NUM_EWOPS];
|
77
77
|
extern const std::string EWOP_NAMES[nm::NUM_EWOPS];
|
78
78
|
|
79
|
+
|
79
80
|
} // end of namespace nm
|
80
81
|
|
81
82
|
/*
|
@@ -83,7 +84,7 @@ namespace nm {
|
|
83
84
|
*/
|
84
85
|
|
85
86
|
#define STYPE_MARK_TABLE(name) \
|
86
|
-
static void (*(name)[nm::NUM_STYPES])(
|
87
|
+
static void (*(name)[nm::NUM_STYPES])(STORAGE*) = { \
|
87
88
|
nm_dense_storage_mark, \
|
88
89
|
nm_list_storage_mark, \
|
89
90
|
nm_yale_storage_mark \
|
@@ -119,6 +120,23 @@ namespace nm {
|
|
119
120
|
fun<nm::RubyObject> \
|
120
121
|
};
|
121
122
|
|
123
|
+
#define DTYPE_OBJECT_STATIC_TABLE(obj, fun, ret, ...) \
|
124
|
+
static ret (*(ttable)[nm::NUM_DTYPES])(__VA_ARGS__) = { \
|
125
|
+
obj<uint8_t>::fun, \
|
126
|
+
obj<int8_t>::fun, \
|
127
|
+
obj<int16_t>::fun, \
|
128
|
+
obj<int32_t>::fun, \
|
129
|
+
obj<int64_t>::fun, \
|
130
|
+
obj<float32_t>::fun, \
|
131
|
+
obj<float64_t>::fun, \
|
132
|
+
obj<nm::Complex64>::fun, \
|
133
|
+
obj<nm::Complex128>::fun, \
|
134
|
+
obj<nm::Rational32>::fun, \
|
135
|
+
obj<nm::Rational64>::fun, \
|
136
|
+
obj<nm::Rational128>::fun, \
|
137
|
+
obj<nm::RubyObject>::fun \
|
138
|
+
};
|
139
|
+
|
122
140
|
#define NAMED_DTYPE_TEMPLATE_TABLE_NO_ROBJ(name, fun, ret, ...) \
|
123
141
|
static ret (*(name)[nm::NUM_DTYPES])(__VA_ARGS__) = { \
|
124
142
|
fun<uint8_t>, \
|
@@ -135,29 +153,6 @@ namespace nm {
|
|
135
153
|
fun<nm::Rational128> \
|
136
154
|
};
|
137
155
|
|
138
|
-
/*
|
139
|
-
* Defines a static array that holds function pointers to itype templated
|
140
|
-
* versions of the specified function.
|
141
|
-
*/
|
142
|
-
#define ITYPE_TEMPLATE_TABLE(fun, ret, ...) NAMED_ITYPE_TEMPLATE_TABLE(ttable, fun, ret, __VA_ARGS__)
|
143
|
-
|
144
|
-
#define NAMED_ITYPE_TEMPLATE_TABLE(name, fun, ret, ...) \
|
145
|
-
static ret (*(name)[nm::NUM_ITYPES])(__VA_ARGS__) = { \
|
146
|
-
fun<uint8_t>, \
|
147
|
-
fun<uint16_t>, \
|
148
|
-
fun<uint32_t>, \
|
149
|
-
fun<uint64_t> \
|
150
|
-
};
|
151
|
-
|
152
|
-
#define ITYPE_TEMPLATE_TABLE(fun, ret, ...) NAMED_ITYPE_TEMPLATE_TABLE(ttable, fun, ret, __VA_ARGS__)
|
153
|
-
|
154
|
-
#define NAMED_LR_ITYPE_TEMPLATE_TABLE(name, fun, ret, ...) \
|
155
|
-
static ret (*(name)[nm::NUM_ITYPES][nm::NUM_ITYPES])(__VA_ARGS__) = { \
|
156
|
-
{ fun<uint8_t,uint8_t>, fun<uint8_t, uint16_t>, fun<uint8_t, uint32_t>, fun<uint8_t, uint64_t> }, \
|
157
|
-
{ fun<uint16_t,uint8_t>, fun<uint16_t, uint16_t>, fun<uint16_t, uint32_t>, fun<uint16_t, uint64_t> }, \
|
158
|
-
{ fun<uint32_t,uint8_t>, fun<uint32_t, uint16_t>, fun<uint32_t, uint32_t>, fun<uint32_t, uint64_t> }, \
|
159
|
-
{ fun<uint64_t,uint8_t>, fun<uint64_t, uint16_t>, fun<uint64_t, uint32_t>, fun<uint64_t, uint64_t> } \
|
160
|
-
};
|
161
156
|
|
162
157
|
/*
|
163
158
|
* Same as DTYPE_TEMPLATE_TABLE but for functions that have two template
|
@@ -658,98 +653,6 @@ namespace nm {
|
|
658
653
|
{fun<nm::EW_GEQ, uint64_t, uint8_t>,fun<nm::EW_GEQ, uint64_t, int8_t>,fun<nm::EW_GEQ, uint64_t, int16_t>,fun<nm::EW_GEQ, uint64_t, int32_t>,fun<nm::EW_GEQ, uint64_t, int64_t>,fun<nm::EW_GEQ, uint64_t, float32_t>,fun<nm::EW_GEQ, uint64_t, float64_t>,fun<nm::EW_GEQ, uint64_t, nm::Complex64>,fun<nm::EW_GEQ, uint64_t, nm::Complex128>,fun<nm::EW_GEQ, uint64_t, nm::Rational32>,fun<nm::EW_GEQ, uint64_t, nm::Rational64>,fun<nm::EW_GEQ, uint64_t, nm::Rational128>,fun<nm::EW_GEQ, uint64_t, nm::RubyObject>}}};
|
659
654
|
|
660
655
|
|
661
|
-
|
662
|
-
/*
|
663
|
-
* Defines a static array that holds function pointers to left dtype, right
|
664
|
-
* dtype, and itype templated versions of the specified function.
|
665
|
-
*/
|
666
|
-
#define LRI_DTYPE_TEMPLATE_TABLE(fun, ret, ...) NAMED_LRI_DTYPE_TEMPLATE_TABLE(ttable, fun, ret, __VA_ARGS__)
|
667
|
-
|
668
|
-
#define NAMED_LRI_DTYPE_TEMPLATE_TABLE(name, fun, ret, ...) \
|
669
|
-
static ret (*(name)[nm::NUM_DTYPES][nm::NUM_DTYPES][nm::NUM_ITYPES])(__VA_ARGS__) = { \
|
670
|
-
{ \
|
671
|
-
{fun<uint8_t, uint8_t, uint8_t>, fun<uint8_t, uint8_t, uint16_t>, fun<uint8_t, uint8_t, uint32_t>, fun<uint8_t, uint8_t, uint64_t> }, \
|
672
|
-
{fun<uint8_t, int8_t, uint8_t>, fun<uint8_t, int8_t, uint16_t>, fun<uint8_t, int8_t, uint32_t>, fun<uint8_t, int8_t, uint64_t> }, \
|
673
|
-
{fun<uint8_t, int16_t, uint8_t>, fun<uint8_t, int16_t, uint16_t>, fun<uint8_t, int16_t, uint32_t>, fun<uint8_t, int16_t, uint64_t> }, \
|
674
|
-
{fun<uint8_t, int32_t, uint8_t>, fun<uint8_t, int32_t, uint16_t>, fun<uint8_t, int32_t, uint32_t>, fun<uint8_t, int32_t, uint64_t> }, \
|
675
|
-
{fun<uint8_t, int64_t, uint8_t>, fun<uint8_t, int64_t, uint16_t>, fun<uint8_t, int64_t, uint32_t>, fun<uint8_t, int64_t, uint64_t> }, \
|
676
|
-
{fun<uint8_t, float32_t, uint8_t>, fun<uint8_t, float32_t, uint16_t>, fun<uint8_t, float32_t, uint32_t>, fun<uint8_t, float32_t, uint64_t> }, \
|
677
|
-
{fun<uint8_t, float64_t, uint8_t>, fun<uint8_t, float64_t, uint16_t>, fun<uint8_t, float64_t, uint32_t>, fun<uint8_t, float64_t, uint64_t> }, \
|
678
|
-
{fun<uint8_t, nm::Complex64, uint8_t>, fun<uint8_t, nm::Complex64, uint16_t>, fun<uint8_t, nm::Complex64, uint32_t>, fun<uint8_t, nm::Complex64, uint64_t> }, \
|
679
|
-
{fun<uint8_t, nm::Complex128, uint8_t>, fun<uint8_t, nm::Complex128, uint16_t>, fun<uint8_t, nm::Complex128, uint32_t>, fun<uint8_t, nm::Complex128, uint64_t> }, \
|
680
|
-
{fun<uint8_t, nm::Rational32, uint8_t>, fun<uint8_t, nm::Rational32, uint16_t>, fun<uint8_t, nm::Rational32, uint32_t>, fun<uint8_t, nm::Rational32, uint64_t> }, \
|
681
|
-
{fun<uint8_t, nm::Rational64, uint8_t>, fun<uint8_t, nm::Rational64, uint16_t>, fun<uint8_t, nm::Rational64, uint32_t>, fun<uint8_t, nm::Rational64, uint64_t> }, \
|
682
|
-
{fun<uint8_t, nm::Rational128, uint8_t>, fun<uint8_t, nm::Rational128, uint16_t>, fun<uint8_t, nm::Rational128, uint32_t>, fun<uint8_t, nm::Rational128, uint64_t> }, \
|
683
|
-
{fun<uint8_t, nm::RubyObject, uint8_t>, fun<uint8_t, nm::RubyObject, uint16_t>, fun<uint8_t, nm::RubyObject, uint32_t>, fun<uint8_t, nm::RubyObject, uint64_t> } \
|
684
|
-
}, \
|
685
|
-
{ \
|
686
|
-
{fun<int8_t, uint8_t, uint8_t>, fun<int8_t, uint8_t, uint16_t>, fun<int8_t, uint8_t, uint32_t>, fun<int8_t, uint8_t, uint64_t> }, \
|
687
|
-
{fun<int8_t, int8_t, uint8_t>, fun<int8_t, int8_t, uint16_t>, fun<int8_t, int8_t, uint32_t>, fun<int8_t, int8_t, uint64_t> }, \
|
688
|
-
{fun<int8_t, int16_t, uint8_t>, fun<int8_t, int16_t, uint16_t>, fun<int8_t, int16_t, uint32_t>, fun<int8_t, int16_t, uint64_t> }, \
|
689
|
-
{fun<int8_t, int32_t, uint8_t>, fun<int8_t, int32_t, uint16_t>, fun<int8_t, int32_t, uint32_t>, fun<int8_t, int32_t, uint64_t> }, \
|
690
|
-
{fun<int8_t, int64_t, uint8_t>, fun<int8_t, int64_t, uint16_t>, fun<int8_t, int64_t, uint32_t>, fun<int8_t, int64_t, uint64_t> }, \
|
691
|
-
{fun<int8_t, float32_t, uint8_t>, fun<int8_t, float32_t, uint16_t>, fun<int8_t, float32_t, uint32_t>, fun<int8_t, float32_t, uint64_t> }, \
|
692
|
-
{fun<int8_t, float64_t, uint8_t>, fun<int8_t, float64_t, uint16_t>, fun<int8_t, float64_t, uint32_t>, fun<int8_t, float64_t, uint64_t> }, \
|
693
|
-
{fun<int8_t, nm::Complex64, uint8_t>, fun<int8_t, nm::Complex64, uint16_t>, fun<int8_t, nm::Complex64, uint32_t>, fun<int8_t, nm::Complex64, uint64_t> }, \
|
694
|
-
{fun<int8_t, nm::Complex128, uint8_t>, fun<int8_t, nm::Complex128, uint16_t>, fun<int8_t, nm::Complex128, uint32_t>, fun<int8_t, nm::Complex128, uint64_t> }, \
|
695
|
-
{fun<int8_t, nm::Rational32, uint8_t>, fun<int8_t, nm::Rational32, uint16_t>, fun<int8_t, nm::Rational32, uint32_t>, fun<int8_t, nm::Rational32, uint64_t> }, \
|
696
|
-
{fun<int8_t, nm::Rational64, uint8_t>, fun<int8_t, nm::Rational64, uint16_t>, fun<int8_t, nm::Rational64, uint32_t>, fun<int8_t, nm::Rational64, uint64_t> }, \
|
697
|
-
{fun<int8_t, nm::Rational128, uint8_t>, fun<int8_t, nm::Rational128, uint16_t>, fun<int8_t, nm::Rational128, uint32_t>, fun<int8_t, nm::Rational128, uint64_t> }, \
|
698
|
-
{fun<int8_t, nm::RubyObject, uint8_t>, fun<int8_t, nm::RubyObject, uint16_t>, fun<int8_t, nm::RubyObject, uint32_t>, fun<int8_t, nm::RubyObject, uint64_t> } \
|
699
|
-
}, \
|
700
|
-
{{fun<int16_t, uint8_t, uint8_t>, fun<int16_t, uint8_t, uint16_t>, fun<int16_t, uint8_t, uint32_t>, fun<int16_t, uint8_t, uint64_t> }, {fun<int16_t, int8_t, uint8_t>, fun<int16_t, int8_t, uint16_t>, fun<int16_t, int8_t, uint32_t>, fun<int16_t, int8_t, uint64_t> }, {fun<int16_t, int16_t, uint8_t>, fun<int16_t, int16_t, uint16_t>, fun<int16_t, int16_t, uint32_t>, fun<int16_t, int16_t, uint64_t> }, {fun<int16_t, int32_t, uint8_t>, fun<int16_t, int32_t, uint16_t>, fun<int16_t, int32_t, uint32_t>, fun<int16_t, int32_t, uint64_t> }, {fun<int16_t, int64_t, uint8_t>, fun<int16_t, int64_t, uint16_t>, fun<int16_t, int64_t, uint32_t>, fun<int16_t, int64_t, uint64_t> }, {fun<int16_t, float32_t, uint8_t>, fun<int16_t, float32_t, uint16_t>, fun<int16_t, float32_t, uint32_t>, fun<int16_t, float32_t, uint64_t> }, {fun<int16_t, float64_t, uint8_t>, fun<int16_t, float64_t, uint16_t>, fun<int16_t, float64_t, uint32_t>, fun<int16_t, float64_t, uint64_t> }, {fun<int16_t, nm::Complex64, uint8_t>, fun<int16_t, nm::Complex64, uint16_t>, fun<int16_t, nm::Complex64, uint32_t>, fun<int16_t, nm::Complex64, uint64_t> }, {fun<int16_t, nm::Complex128, uint8_t>, fun<int16_t, nm::Complex128, uint16_t>, fun<int16_t, nm::Complex128, uint32_t>, fun<int16_t, nm::Complex128, uint64_t> }, {fun<int16_t, nm::Rational32, uint8_t>, fun<int16_t, nm::Rational32, uint16_t>, fun<int16_t, nm::Rational32, uint32_t>, fun<int16_t, nm::Rational32, uint64_t> }, {fun<int16_t, nm::Rational64, uint8_t>, fun<int16_t, nm::Rational64, uint16_t>, fun<int16_t, nm::Rational64, uint32_t>, fun<int16_t, nm::Rational64, uint64_t> }, {fun<int16_t, nm::Rational128, uint8_t>, fun<int16_t, nm::Rational128, uint16_t>, fun<int16_t, nm::Rational128, uint32_t>, fun<int16_t, nm::Rational128, uint64_t> }, {fun<int16_t, nm::RubyObject, uint8_t>, fun<int16_t, nm::RubyObject, uint16_t>, fun<int16_t, nm::RubyObject, uint32_t>, fun<int16_t, nm::RubyObject, uint64_t> }}, \
|
701
|
-
{{fun<int32_t, uint8_t, uint8_t>, fun<int32_t, uint8_t, uint16_t>, fun<int32_t, uint8_t, uint32_t>, fun<int32_t, uint8_t, uint64_t> }, {fun<int32_t, int8_t, uint8_t>, fun<int32_t, int8_t, uint16_t>, fun<int32_t, int8_t, uint32_t>, fun<int32_t, int8_t, uint64_t> }, {fun<int32_t, int16_t, uint8_t>, fun<int32_t, int16_t, uint16_t>, fun<int32_t, int16_t, uint32_t>, fun<int32_t, int16_t, uint64_t> }, {fun<int32_t, int32_t, uint8_t>, fun<int32_t, int32_t, uint16_t>, fun<int32_t, int32_t, uint32_t>, fun<int32_t, int32_t, uint64_t> }, {fun<int32_t, int64_t, uint8_t>, fun<int32_t, int64_t, uint16_t>, fun<int32_t, int64_t, uint32_t>, fun<int32_t, int64_t, uint64_t> }, {fun<int32_t, float32_t, uint8_t>, fun<int32_t, float32_t, uint16_t>, fun<int32_t, float32_t, uint32_t>, fun<int32_t, float32_t, uint64_t> }, {fun<int32_t, float64_t, uint8_t>, fun<int32_t, float64_t, uint16_t>, fun<int32_t, float64_t, uint32_t>, fun<int32_t, float64_t, uint64_t> }, {fun<int32_t, nm::Complex64, uint8_t>, fun<int32_t, nm::Complex64, uint16_t>, fun<int32_t, nm::Complex64, uint32_t>, fun<int32_t, nm::Complex64, uint64_t> }, {fun<int32_t, nm::Complex128, uint8_t>, fun<int32_t, nm::Complex128, uint16_t>, fun<int32_t, nm::Complex128, uint32_t>, fun<int32_t, nm::Complex128, uint64_t> }, {fun<int32_t, nm::Rational32, uint8_t>, fun<int32_t, nm::Rational32, uint16_t>, fun<int32_t, nm::Rational32, uint32_t>, fun<int32_t, nm::Rational32, uint64_t> }, {fun<int32_t, nm::Rational64, uint8_t>, fun<int32_t, nm::Rational64, uint16_t>, fun<int32_t, nm::Rational64, uint32_t>, fun<int32_t, nm::Rational64, uint64_t> }, {fun<int32_t, nm::Rational128, uint8_t>, fun<int32_t, nm::Rational128, uint16_t>, fun<int32_t, nm::Rational128, uint32_t>, fun<int32_t, nm::Rational128, uint64_t> }, {fun<int32_t, nm::RubyObject, uint8_t>, fun<int32_t, nm::RubyObject, uint16_t>, fun<int32_t, nm::RubyObject, uint32_t>, fun<int32_t, nm::RubyObject, uint64_t> }}, \
|
702
|
-
{{fun<int64_t, uint8_t, uint8_t>, fun<int64_t, uint8_t, uint16_t>, fun<int64_t, uint8_t, uint32_t>, fun<int64_t, uint8_t, uint64_t> }, {fun<int64_t, int8_t, uint8_t>, fun<int64_t, int8_t, uint16_t>, fun<int64_t, int8_t, uint32_t>, fun<int64_t, int8_t, uint64_t> }, {fun<int64_t, int16_t, uint8_t>, fun<int64_t, int16_t, uint16_t>, fun<int64_t, int16_t, uint32_t>, fun<int64_t, int16_t, uint64_t> }, {fun<int64_t, int32_t, uint8_t>, fun<int64_t, int32_t, uint16_t>, fun<int64_t, int32_t, uint32_t>, fun<int64_t, int32_t, uint64_t> }, {fun<int64_t, int64_t, uint8_t>, fun<int64_t, int64_t, uint16_t>, fun<int64_t, int64_t, uint32_t>, fun<int64_t, int64_t, uint64_t> }, {fun<int64_t, float32_t, uint8_t>, fun<int64_t, float32_t, uint16_t>, fun<int64_t, float32_t, uint32_t>, fun<int64_t, float32_t, uint64_t> }, {fun<int64_t, float64_t, uint8_t>, fun<int64_t, float64_t, uint16_t>, fun<int64_t, float64_t, uint32_t>, fun<int64_t, float64_t, uint64_t> }, {fun<int64_t, nm::Complex64, uint8_t>, fun<int64_t, nm::Complex64, uint16_t>, fun<int64_t, nm::Complex64, uint32_t>, fun<int64_t, nm::Complex64, uint64_t> }, {fun<int64_t, nm::Complex128, uint8_t>, fun<int64_t, nm::Complex128, uint16_t>, fun<int64_t, nm::Complex128, uint32_t>, fun<int64_t, nm::Complex128, uint64_t> }, {fun<int64_t, nm::Rational32, uint8_t>, fun<int64_t, nm::Rational32, uint16_t>, fun<int64_t, nm::Rational32, uint32_t>, fun<int64_t, nm::Rational32, uint64_t> }, {fun<int64_t, nm::Rational64, uint8_t>, fun<int64_t, nm::Rational64, uint16_t>, fun<int64_t, nm::Rational64, uint32_t>, fun<int64_t, nm::Rational64, uint64_t> }, {fun<int64_t, nm::Rational128, uint8_t>, fun<int64_t, nm::Rational128, uint16_t>, fun<int64_t, nm::Rational128, uint32_t>, fun<int64_t, nm::Rational128, uint64_t> }, {fun<int64_t, nm::RubyObject, uint8_t>, fun<int64_t, nm::RubyObject, uint16_t>, fun<int64_t, nm::RubyObject, uint32_t>, fun<int64_t, nm::RubyObject, uint64_t> }}, \
|
703
|
-
{{fun<float32_t, uint8_t, uint8_t>, fun<float32_t, uint8_t, uint16_t>, fun<float32_t, uint8_t, uint32_t>, fun<float32_t, uint8_t, uint64_t> }, {fun<float32_t, int8_t, uint8_t>, fun<float32_t, int8_t, uint16_t>, fun<float32_t, int8_t, uint32_t>, fun<float32_t, int8_t, uint64_t> }, {fun<float32_t, int16_t, uint8_t>, fun<float32_t, int16_t, uint16_t>, fun<float32_t, int16_t, uint32_t>, fun<float32_t, int16_t, uint64_t> }, {fun<float32_t, int32_t, uint8_t>, fun<float32_t, int32_t, uint16_t>, fun<float32_t, int32_t, uint32_t>, fun<float32_t, int32_t, uint64_t> }, {fun<float32_t, int64_t, uint8_t>, fun<float32_t, int64_t, uint16_t>, fun<float32_t, int64_t, uint32_t>, fun<float32_t, int64_t, uint64_t> }, {fun<float32_t, float32_t, uint8_t>, fun<float32_t, float32_t, uint16_t>, fun<float32_t, float32_t, uint32_t>, fun<float32_t, float32_t, uint64_t> }, {fun<float32_t, float64_t, uint8_t>, fun<float32_t, float64_t, uint16_t>, fun<float32_t, float64_t, uint32_t>, fun<float32_t, float64_t, uint64_t> }, {fun<float32_t, nm::Complex64, uint8_t>, fun<float32_t, nm::Complex64, uint16_t>, fun<float32_t, nm::Complex64, uint32_t>, fun<float32_t, nm::Complex64, uint64_t> }, {fun<float32_t, nm::Complex128, uint8_t>, fun<float32_t, nm::Complex128, uint16_t>, fun<float32_t, nm::Complex128, uint32_t>, fun<float32_t, nm::Complex128, uint64_t> }, {fun<float32_t, nm::Rational32, uint8_t>, fun<float32_t, nm::Rational32, uint16_t>, fun<float32_t, nm::Rational32, uint32_t>, fun<float32_t, nm::Rational32, uint64_t> }, {fun<float32_t, nm::Rational64, uint8_t>, fun<float32_t, nm::Rational64, uint16_t>, fun<float32_t, nm::Rational64, uint32_t>, fun<float32_t, nm::Rational64, uint64_t> }, {fun<float32_t, nm::Rational128, uint8_t>, fun<float32_t, nm::Rational128, uint16_t>, fun<float32_t, nm::Rational128, uint32_t>, fun<float32_t, nm::Rational128, uint64_t> }, {fun<float32_t, nm::RubyObject, uint8_t>, fun<float32_t, nm::RubyObject, uint16_t>, fun<float32_t, nm::RubyObject, uint32_t>, fun<float32_t, nm::RubyObject, uint64_t> }}, \
|
704
|
-
{{fun<float64_t, uint8_t, uint8_t>, fun<float64_t, uint8_t, uint16_t>, fun<float64_t, uint8_t, uint32_t>, fun<float64_t, uint8_t, uint64_t> }, {fun<float64_t, int8_t, uint8_t>, fun<float64_t, int8_t, uint16_t>, fun<float64_t, int8_t, uint32_t>, fun<float64_t, int8_t, uint64_t> }, {fun<float64_t, int16_t, uint8_t>, fun<float64_t, int16_t, uint16_t>, fun<float64_t, int16_t, uint32_t>, fun<float64_t, int16_t, uint64_t> }, {fun<float64_t, int32_t, uint8_t>, fun<float64_t, int32_t, uint16_t>, fun<float64_t, int32_t, uint32_t>, fun<float64_t, int32_t, uint64_t> }, {fun<float64_t, int64_t, uint8_t>, fun<float64_t, int64_t, uint16_t>, fun<float64_t, int64_t, uint32_t>, fun<float64_t, int64_t, uint64_t> }, {fun<float64_t, float32_t, uint8_t>, fun<float64_t, float32_t, uint16_t>, fun<float64_t, float32_t, uint32_t>, fun<float64_t, float32_t, uint64_t> }, {fun<float64_t, float64_t, uint8_t>, fun<float64_t, float64_t, uint16_t>, fun<float64_t, float64_t, uint32_t>, fun<float64_t, float64_t, uint64_t> }, {fun<float64_t, nm::Complex64, uint8_t>, fun<float64_t, nm::Complex64, uint16_t>, fun<float64_t, nm::Complex64, uint32_t>, fun<float64_t, nm::Complex64, uint64_t> }, {fun<float64_t, nm::Complex128, uint8_t>, fun<float64_t, nm::Complex128, uint16_t>, fun<float64_t, nm::Complex128, uint32_t>, fun<float64_t, nm::Complex128, uint64_t> }, {fun<float64_t, nm::Rational32, uint8_t>, fun<float64_t, nm::Rational32, uint16_t>, fun<float64_t, nm::Rational32, uint32_t>, fun<float64_t, nm::Rational32, uint64_t> }, {fun<float64_t, nm::Rational64, uint8_t>, fun<float64_t, nm::Rational64, uint16_t>, fun<float64_t, nm::Rational64, uint32_t>, fun<float64_t, nm::Rational64, uint64_t> }, {fun<float64_t, nm::Rational128, uint8_t>, fun<float64_t, nm::Rational128, uint16_t>, fun<float64_t, nm::Rational128, uint32_t>, fun<float64_t, nm::Rational128, uint64_t> }, {fun<float64_t, nm::RubyObject, uint8_t>, fun<float64_t, nm::RubyObject, uint16_t>, fun<float64_t, nm::RubyObject, uint32_t>, fun<float64_t, nm::RubyObject, uint64_t> }}, \
|
705
|
-
{{fun<nm::Complex64, uint8_t, uint8_t>, fun<nm::Complex64, uint8_t, uint16_t>, fun<nm::Complex64, uint8_t, uint32_t>, fun<nm::Complex64, uint8_t, uint64_t> }, {fun<nm::Complex64, int8_t, uint8_t>, fun<nm::Complex64, int8_t, uint16_t>, fun<nm::Complex64, int8_t, uint32_t>, fun<nm::Complex64, int8_t, uint64_t> }, {fun<nm::Complex64, int16_t, uint8_t>, fun<nm::Complex64, int16_t, uint16_t>, fun<nm::Complex64, int16_t, uint32_t>, fun<nm::Complex64, int16_t, uint64_t> }, {fun<nm::Complex64, int32_t, uint8_t>, fun<nm::Complex64, int32_t, uint16_t>, fun<nm::Complex64, int32_t, uint32_t>, fun<nm::Complex64, int32_t, uint64_t> }, {fun<nm::Complex64, int64_t, uint8_t>, fun<nm::Complex64, int64_t, uint16_t>, fun<nm::Complex64, int64_t, uint32_t>, fun<nm::Complex64, int64_t, uint64_t> }, {fun<nm::Complex64, float32_t, uint8_t>, fun<nm::Complex64, float32_t, uint16_t>, fun<nm::Complex64, float32_t, uint32_t>, fun<nm::Complex64, float32_t, uint64_t> }, {fun<nm::Complex64, float64_t, uint8_t>, fun<nm::Complex64, float64_t, uint16_t>, fun<nm::Complex64, float64_t, uint32_t>, fun<nm::Complex64, float64_t, uint64_t> }, {fun<nm::Complex64, nm::Complex64, uint8_t>, fun<nm::Complex64, nm::Complex64, uint16_t>, fun<nm::Complex64, nm::Complex64, uint32_t>, fun<nm::Complex64, nm::Complex64, uint64_t> }, {fun<nm::Complex64, nm::Complex128, uint8_t>, fun<nm::Complex64, nm::Complex128, uint16_t>, fun<nm::Complex64, nm::Complex128, uint32_t>, fun<nm::Complex64, nm::Complex128, uint64_t> }, {fun<nm::Complex64, nm::Rational32, uint8_t>, fun<nm::Complex64, nm::Rational32, uint16_t>, fun<nm::Complex64, nm::Rational32, uint32_t>, fun<nm::Complex64, nm::Rational32, uint64_t> }, {fun<nm::Complex64, nm::Rational64, uint8_t>, fun<nm::Complex64, nm::Rational64, uint16_t>, fun<nm::Complex64, nm::Rational64, uint32_t>, fun<nm::Complex64, nm::Rational64, uint64_t> }, {fun<nm::Complex64, nm::Rational128, uint8_t>, fun<nm::Complex64, nm::Rational128, uint16_t>, fun<nm::Complex64, nm::Rational128, uint32_t>, fun<nm::Complex64, nm::Rational128, uint64_t> }, {fun<nm::Complex64, nm::RubyObject, uint8_t>, fun<nm::Complex64, nm::RubyObject, uint16_t>, fun<nm::Complex64, nm::RubyObject, uint32_t>, fun<nm::Complex64, nm::RubyObject, uint64_t> }}, \
|
706
|
-
{{fun<nm::Complex128, uint8_t, uint8_t>, fun<nm::Complex128, uint8_t, uint16_t>, fun<nm::Complex128, uint8_t, uint32_t>, fun<nm::Complex128, uint8_t, uint64_t> }, {fun<nm::Complex128, int8_t, uint8_t>, fun<nm::Complex128, int8_t, uint16_t>, fun<nm::Complex128, int8_t, uint32_t>, fun<nm::Complex128, int8_t, uint64_t> }, {fun<nm::Complex128, int16_t, uint8_t>, fun<nm::Complex128, int16_t, uint16_t>, fun<nm::Complex128, int16_t, uint32_t>, fun<nm::Complex128, int16_t, uint64_t> }, {fun<nm::Complex128, int32_t, uint8_t>, fun<nm::Complex128, int32_t, uint16_t>, fun<nm::Complex128, int32_t, uint32_t>, fun<nm::Complex128, int32_t, uint64_t> }, {fun<nm::Complex128, int64_t, uint8_t>, fun<nm::Complex128, int64_t, uint16_t>, fun<nm::Complex128, int64_t, uint32_t>, fun<nm::Complex128, int64_t, uint64_t> }, {fun<nm::Complex128, float32_t, uint8_t>, fun<nm::Complex128, float32_t, uint16_t>, fun<nm::Complex128, float32_t, uint32_t>, fun<nm::Complex128, float32_t, uint64_t> }, {fun<nm::Complex128, float64_t, uint8_t>, fun<nm::Complex128, float64_t, uint16_t>, fun<nm::Complex128, float64_t, uint32_t>, fun<nm::Complex128, float64_t, uint64_t> }, {fun<nm::Complex128, nm::Complex64, uint8_t>, fun<nm::Complex128, nm::Complex64, uint16_t>, fun<nm::Complex128, nm::Complex64, uint32_t>, fun<nm::Complex128, nm::Complex64, uint64_t> }, {fun<nm::Complex128, nm::Complex128, uint8_t>, fun<nm::Complex128, nm::Complex128, uint16_t>, fun<nm::Complex128, nm::Complex128, uint32_t>, fun<nm::Complex128, nm::Complex128, uint64_t> }, {fun<nm::Complex128, nm::Rational32, uint8_t>, fun<nm::Complex128, nm::Rational32, uint16_t>, fun<nm::Complex128, nm::Rational32, uint32_t>, fun<nm::Complex128, nm::Rational32, uint64_t> }, {fun<nm::Complex128, nm::Rational64, uint8_t>, fun<nm::Complex128, nm::Rational64, uint16_t>, fun<nm::Complex128, nm::Rational64, uint32_t>, fun<nm::Complex128, nm::Rational64, uint64_t> }, {fun<nm::Complex128, nm::Rational128, uint8_t>, fun<nm::Complex128, nm::Rational128, uint16_t>, fun<nm::Complex128, nm::Rational128, uint32_t>, fun<nm::Complex128, nm::Rational128, uint64_t> }, {fun<nm::Complex128, nm::RubyObject, uint8_t>, fun<nm::Complex128, nm::RubyObject, uint16_t>, fun<nm::Complex128, nm::RubyObject, uint32_t>, fun<nm::Complex128, nm::RubyObject, uint64_t> }}, \
|
707
|
-
{{fun<nm::Rational32, uint8_t, uint8_t>, fun<nm::Rational32, uint8_t, uint16_t>, fun<nm::Rational32, uint8_t, uint32_t>, fun<nm::Rational32, uint8_t, uint64_t> }, {fun<nm::Rational32, int8_t, uint8_t>, fun<nm::Rational32, int8_t, uint16_t>, fun<nm::Rational32, int8_t, uint32_t>, fun<nm::Rational32, int8_t, uint64_t> }, {fun<nm::Rational32, int16_t, uint8_t>, fun<nm::Rational32, int16_t, uint16_t>, fun<nm::Rational32, int16_t, uint32_t>, fun<nm::Rational32, int16_t, uint64_t> }, {fun<nm::Rational32, int32_t, uint8_t>, fun<nm::Rational32, int32_t, uint16_t>, fun<nm::Rational32, int32_t, uint32_t>, fun<nm::Rational32, int32_t, uint64_t> }, {fun<nm::Rational32, int64_t, uint8_t>, fun<nm::Rational32, int64_t, uint16_t>, fun<nm::Rational32, int64_t, uint32_t>, fun<nm::Rational32, int64_t, uint64_t> }, {NULL, NULL, NULL, NULL }, {NULL, NULL, NULL, NULL }, {NULL, NULL, NULL, NULL }, {NULL, NULL, NULL, NULL }, {fun<nm::Rational32, nm::Rational32, uint8_t>, fun<nm::Rational32, nm::Rational32, uint16_t>, fun<nm::Rational32, nm::Rational32, uint32_t>, fun<nm::Rational32, nm::Rational32, uint64_t> }, {fun<nm::Rational32, nm::Rational64, uint8_t>, fun<nm::Rational32, nm::Rational64, uint16_t>, fun<nm::Rational32, nm::Rational64, uint32_t>, fun<nm::Rational32, nm::Rational64, uint64_t> }, {fun<nm::Rational32, nm::Rational128, uint8_t>, fun<nm::Rational32, nm::Rational128, uint16_t>, fun<nm::Rational32, nm::Rational128, uint32_t>, fun<nm::Rational32, nm::Rational128, uint64_t> }, {fun<nm::Rational32, nm::RubyObject, uint8_t>, fun<nm::Rational32, nm::RubyObject, uint16_t>, fun<nm::Rational32, nm::RubyObject, uint32_t>, fun<nm::Rational32, nm::RubyObject, uint64_t>}}, \
|
708
|
-
{{fun<nm::Rational64, uint8_t, uint8_t>, fun<nm::Rational64, uint8_t, uint16_t>, fun<nm::Rational64, uint8_t, uint32_t>, fun<nm::Rational64, uint8_t, uint64_t> }, {fun<nm::Rational64, int8_t, uint8_t>, fun<nm::Rational64, int8_t, uint16_t>, fun<nm::Rational64, int8_t, uint32_t>, fun<nm::Rational64, int8_t, uint64_t> }, {fun<nm::Rational64, int16_t, uint8_t>, fun<nm::Rational64, int16_t, uint16_t>, fun<nm::Rational64, int16_t, uint32_t>, fun<nm::Rational64, int16_t, uint64_t> }, {fun<nm::Rational64, int32_t, uint8_t>, fun<nm::Rational64, int32_t, uint16_t>, fun<nm::Rational64, int32_t, uint32_t>, fun<nm::Rational64, int32_t, uint64_t> }, {fun<nm::Rational64, int64_t, uint8_t>, fun<nm::Rational64, int64_t, uint16_t>, fun<nm::Rational64, int64_t, uint32_t>, fun<nm::Rational64, int64_t, uint64_t> }, {NULL, NULL, NULL, NULL }, {NULL, NULL, NULL, NULL }, {NULL, NULL, NULL, NULL }, {NULL, NULL, NULL, NULL }, {fun<nm::Rational64, nm::Rational32, uint8_t>, fun<nm::Rational64, nm::Rational32, uint16_t>, fun<nm::Rational64, nm::Rational32, uint32_t>, fun<nm::Rational64, nm::Rational32, uint64_t> }, {fun<nm::Rational64, nm::Rational64, uint8_t>, fun<nm::Rational64, nm::Rational64, uint16_t>, fun<nm::Rational64, nm::Rational64, uint32_t>, fun<nm::Rational64, nm::Rational64, uint64_t> }, {fun<nm::Rational64, nm::Rational128, uint8_t>, fun<nm::Rational64, nm::Rational128, uint16_t>, fun<nm::Rational64, nm::Rational128, uint32_t>, fun<nm::Rational64, nm::Rational128, uint64_t> }, {fun<nm::Rational64, nm::RubyObject, uint8_t>, fun<nm::Rational64, nm::RubyObject, uint16_t>, fun<nm::Rational64, nm::RubyObject, uint32_t>, fun<nm::Rational64, nm::RubyObject, uint64_t>}}, \
|
709
|
-
{{fun<nm::Rational128, uint8_t, uint8_t>, fun<nm::Rational128, uint8_t, uint16_t>, fun<nm::Rational128, uint8_t, uint32_t>, fun<nm::Rational128, uint8_t, uint64_t> }, {fun<nm::Rational128, int8_t, uint8_t>, fun<nm::Rational128, int8_t, uint16_t>, fun<nm::Rational128, int8_t, uint32_t>, fun<nm::Rational128, int8_t, uint64_t> }, {fun<nm::Rational128, int16_t, uint8_t>, fun<nm::Rational128, int16_t, uint16_t>, fun<nm::Rational128, int16_t, uint32_t>, fun<nm::Rational128, int16_t, uint64_t> }, {fun<nm::Rational128, int32_t, uint8_t>, fun<nm::Rational128, int32_t, uint16_t>, fun<nm::Rational128, int32_t, uint32_t>, fun<nm::Rational128, int32_t, uint64_t> }, {fun<nm::Rational128, int64_t, uint8_t>, fun<nm::Rational128, int64_t, uint16_t>, fun<nm::Rational128, int64_t, uint32_t>, fun<nm::Rational128, int64_t, uint64_t> }, {fun<nm::Rational128, float32_t, uint8_t>, fun<nm::Rational128, float32_t, uint16_t>, fun<nm::Rational128, float32_t, uint32_t>, fun<nm::Rational128, float32_t, uint64_t> }, {NULL, NULL, NULL, NULL }, {NULL, NULL, NULL, NULL }, {NULL, NULL, NULL, NULL }, {fun<nm::Rational128, nm::Rational32, uint8_t>, fun<nm::Rational128, nm::Rational32, uint16_t>, fun<nm::Rational128, nm::Rational32, uint32_t>, fun<nm::Rational128, nm::Rational32, uint64_t> }, {fun<nm::Rational128, nm::Rational64, uint8_t>, fun<nm::Rational128, nm::Rational64, uint16_t>, fun<nm::Rational128, nm::Rational64, uint32_t>, fun<nm::Rational128, nm::Rational64, uint64_t> }, {fun<nm::Rational128, nm::Rational128, uint8_t>, fun<nm::Rational128, nm::Rational128, uint16_t>, fun<nm::Rational128, nm::Rational128, uint32_t>, fun<nm::Rational128, nm::Rational128, uint64_t> }, {fun<nm::Rational128, nm::RubyObject, uint8_t>, fun<nm::Rational128, nm::RubyObject, uint16_t>, fun<nm::Rational128, nm::RubyObject, uint32_t>, fun<nm::Rational128, nm::RubyObject, uint64_t>}}, \
|
710
|
-
{{fun<nm::RubyObject, uint8_t, uint8_t>, fun<nm::RubyObject, uint8_t, uint16_t>, fun<nm::RubyObject, uint8_t, uint32_t>, fun<nm::RubyObject, uint8_t, uint64_t> }, {fun<nm::RubyObject, int8_t, uint8_t>, fun<nm::RubyObject, int8_t, uint16_t>, fun<nm::RubyObject, int8_t, uint32_t>, fun<nm::RubyObject, int8_t, uint64_t> }, {fun<nm::RubyObject, int16_t, uint8_t>, fun<nm::RubyObject, int16_t, uint16_t>, fun<nm::RubyObject, int16_t, uint32_t>, fun<nm::RubyObject, int16_t, uint64_t> }, {fun<nm::RubyObject, int32_t, uint8_t>, fun<nm::RubyObject, int32_t, uint16_t>, fun<nm::RubyObject, int32_t, uint32_t>, fun<nm::RubyObject, int32_t, uint64_t> }, {fun<nm::RubyObject, int64_t, uint8_t>, fun<nm::RubyObject, int64_t, uint16_t>, fun<nm::RubyObject, int64_t, uint32_t>, fun<nm::RubyObject, int64_t, uint64_t> }, {fun<nm::RubyObject, float32_t, uint8_t>, fun<nm::RubyObject, float32_t, uint16_t>, fun<nm::RubyObject, float32_t, uint32_t>, fun<nm::RubyObject, float32_t, uint64_t> }, {fun<nm::RubyObject, float64_t, uint8_t>, fun<nm::RubyObject, float64_t, uint16_t>, fun<nm::RubyObject, float64_t, uint32_t>, fun<nm::RubyObject, float64_t, uint64_t> }, {fun<nm::RubyObject, nm::Complex64, uint8_t>, fun<nm::RubyObject, nm::Complex64, uint16_t>, fun<nm::RubyObject, nm::Complex64, uint32_t>, fun<nm::RubyObject, nm::Complex64, uint64_t> }, {fun<nm::RubyObject, nm::Complex128, uint8_t>, fun<nm::RubyObject, nm::Complex128, uint16_t>, fun<nm::RubyObject, nm::Complex128, uint32_t>, fun<nm::RubyObject, nm::Complex128, uint64_t> }, {fun<nm::RubyObject, nm::Rational32, uint8_t>, fun<nm::RubyObject, nm::Rational32, uint16_t>, fun<nm::RubyObject, nm::Rational32, uint32_t>, fun<nm::RubyObject, nm::Rational32, uint64_t> }, {fun<nm::RubyObject, nm::Rational64, uint8_t>, fun<nm::RubyObject, nm::Rational64, uint16_t>, fun<nm::RubyObject, nm::Rational64, uint32_t>, fun<nm::RubyObject, nm::Rational64, uint64_t> }, {fun<nm::RubyObject, nm::Rational128, uint8_t>, fun<nm::RubyObject, nm::Rational128, uint16_t>, fun<nm::RubyObject, nm::Rational128, uint32_t>, fun<nm::RubyObject, nm::Rational128, uint64_t> }, {fun<nm::RubyObject, nm::RubyObject, uint8_t>, fun<nm::RubyObject, nm::RubyObject, uint16_t>, fun<nm::RubyObject, nm::RubyObject, uint32_t>, fun<nm::RubyObject, nm::RubyObject, uint64_t>}} \
|
711
|
-
};
|
712
|
-
|
713
|
-
/*
|
714
|
-
* Defines a static array that holds function pointers to left dtype and itype
|
715
|
-
* templated versions of the specified function.
|
716
|
-
*/
|
717
|
-
#define LI_DTYPE_TEMPLATE_TABLE(fun, ret, ...) NAMED_LI_DTYPE_TEMPLATE_TABLE(ttable, fun, ret, __VA_ARGS__)
|
718
|
-
|
719
|
-
#define NAMED_LI_DTYPE_TEMPLATE_TABLE(name, fun, ret, ...) \
|
720
|
-
static ret (*(name)[nm::NUM_DTYPES][nm::NUM_ITYPES])(__VA_ARGS__) = { \
|
721
|
-
{ fun<uint8_t,uint8_t>,fun<uint8_t,uint16_t>,fun<uint8_t,uint32_t>,fun<uint8_t,uint64_t> }, \
|
722
|
-
{ fun<int8_t,uint8_t>,fun<int8_t,uint16_t>,fun<int8_t,uint32_t>,fun<int8_t,uint64_t> }, \
|
723
|
-
{ fun<int16_t,uint8_t>,fun<int16_t,uint16_t>,fun<int16_t,uint32_t>,fun<int16_t,uint64_t> }, \
|
724
|
-
{ fun<int32_t,uint8_t>,fun<int32_t,uint16_t>,fun<int32_t,uint32_t>,fun<int32_t,uint64_t> }, \
|
725
|
-
{ fun<int64_t,uint8_t>,fun<int64_t,uint16_t>,fun<int64_t,uint32_t>,fun<int64_t,uint64_t> }, \
|
726
|
-
{ fun<float32_t,uint8_t>,fun<float32_t,uint16_t>,fun<float32_t,uint32_t>,fun<float32_t,uint64_t> }, \
|
727
|
-
{ fun<float64_t,uint8_t>,fun<float64_t,uint16_t>,fun<float64_t,uint32_t>,fun<float64_t,uint64_t> }, \
|
728
|
-
{ fun<nm::Complex64,uint8_t>,fun<nm::Complex64,uint16_t>,fun<nm::Complex64,uint32_t>,fun<nm::Complex64,uint64_t> }, \
|
729
|
-
{ fun<nm::Complex128,uint8_t>,fun<nm::Complex128,uint16_t>,fun<nm::Complex128,uint32_t>,fun<nm::Complex128,uint64_t> }, \
|
730
|
-
{ fun<nm::Rational32,uint8_t>,fun<nm::Rational32,uint16_t>,fun<nm::Rational32,uint32_t>,fun<nm::Rational32,uint64_t> }, \
|
731
|
-
{ fun<nm::Rational64,uint8_t>,fun<nm::Rational64,uint16_t>,fun<nm::Rational64,uint32_t>,fun<nm::Rational64,uint64_t> }, \
|
732
|
-
{ fun<nm::Rational128,uint8_t>,fun<nm::Rational128,uint16_t>,fun<nm::Rational128,uint32_t>,fun<nm::Rational128,uint64_t> }, \
|
733
|
-
{ fun<nm::RubyObject,uint8_t>,fun<nm::RubyObject,uint16_t>,fun<nm::RubyObject,uint32_t>,fun<nm::RubyObject,uint64_t>} \
|
734
|
-
};
|
735
|
-
|
736
|
-
#define NAMED_LI_DTYPE_TEMPLATE_TABLE_NO_ROBJ(name, fun, ret, ...) \
|
737
|
-
static ret (*(name)[nm::NUM_DTYPES][nm::NUM_ITYPES])(__VA_ARGS__) = { \
|
738
|
-
{ fun<uint8_t,uint8_t>,fun<uint8_t,uint16_t>,fun<uint8_t,uint32_t>,fun<uint8_t,uint64_t> }, \
|
739
|
-
{ fun<int8_t,uint8_t>,fun<int8_t,uint16_t>,fun<int8_t,uint32_t>,fun<int8_t,uint64_t> }, \
|
740
|
-
{ fun<int16_t,uint8_t>,fun<int16_t,uint16_t>,fun<int16_t,uint32_t>,fun<int16_t,uint64_t> }, \
|
741
|
-
{ fun<int32_t,uint8_t>,fun<int32_t,uint16_t>,fun<int32_t,uint32_t>,fun<int32_t,uint64_t> }, \
|
742
|
-
{ fun<int64_t,uint8_t>,fun<int64_t,uint16_t>,fun<int64_t,uint32_t>,fun<int64_t,uint64_t> }, \
|
743
|
-
{ fun<float32_t,uint8_t>,fun<float32_t,uint16_t>,fun<float32_t,uint32_t>,fun<float32_t,uint64_t> }, \
|
744
|
-
{ fun<float64_t,uint8_t>,fun<float64_t,uint16_t>,fun<float64_t,uint32_t>,fun<float64_t,uint64_t> }, \
|
745
|
-
{ fun<nm::Complex64,uint8_t>,fun<nm::Complex64,uint16_t>,fun<nm::Complex64,uint32_t>,fun<nm::Complex64,uint64_t> }, \
|
746
|
-
{ fun<nm::Complex128,uint8_t>,fun<nm::Complex128,uint16_t>,fun<nm::Complex128,uint32_t>,fun<nm::Complex128,uint64_t> }, \
|
747
|
-
{ fun<nm::Rational32,uint8_t>,fun<nm::Rational32,uint16_t>,fun<nm::Rational32,uint32_t>,fun<nm::Rational32,uint64_t> }, \
|
748
|
-
{ fun<nm::Rational64,uint8_t>,fun<nm::Rational64,uint16_t>,fun<nm::Rational64,uint32_t>,fun<nm::Rational64,uint64_t> }, \
|
749
|
-
{ fun<nm::Rational128,uint8_t>,fun<nm::Rational128,uint16_t>,fun<nm::Rational128,uint32_t>,fun<nm::Rational128,uint64_t> } \
|
750
|
-
};
|
751
|
-
|
752
|
-
|
753
656
|
extern "C" {
|
754
657
|
|
755
658
|
|
@@ -761,10 +664,6 @@ extern "C" {
|
|
761
664
|
extern const char* const DTYPE_NAMES[nm::NUM_DTYPES];
|
762
665
|
extern const size_t DTYPE_SIZES[nm::NUM_DTYPES];
|
763
666
|
|
764
|
-
// index data types
|
765
|
-
extern const char* const ITYPE_NAMES[nm::NUM_ITYPES];
|
766
|
-
extern const size_t ITYPE_SIZES[nm::NUM_ITYPES];
|
767
|
-
|
768
667
|
extern const nm::dtype_t Upcast[nm::NUM_DTYPES][nm::NUM_DTYPES];
|
769
668
|
|
770
669
|
|
@@ -776,7 +675,6 @@ extern const nm::dtype_t Upcast[nm::NUM_DTYPES][nm::NUM_DTYPES];
|
|
776
675
|
void* rubyobj_to_cval(VALUE val, nm::dtype_t dtype);
|
777
676
|
void rubyval_to_cval(VALUE val, nm::dtype_t dtype, void* loc);
|
778
677
|
nm::RubyObject rubyobj_from_cval(void* val, nm::dtype_t dtype);
|
779
|
-
nm::RubyObject rubyobj_from_cval_by_itype(void* val, nm::itype_t itype);
|
780
678
|
|
781
679
|
void nm_init_data();
|
782
680
|
|