narray 0.5.9.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (81) hide show
  1. data/src/ChangeLog +614 -0
  2. data/src/MANIFEST +82 -0
  3. data/src/README.en +54 -0
  4. data/src/README.ja +63 -0
  5. data/src/SPEC.en +300 -0
  6. data/src/SPEC.ja +284 -0
  7. data/src/depend +14 -0
  8. data/src/extconf.rb +111 -0
  9. data/src/lib/narray_ext.rb +211 -0
  10. data/src/lib/nmatrix.rb +244 -0
  11. data/src/mkmath.rb +780 -0
  12. data/src/mknafunc.rb +190 -0
  13. data/src/mkop.rb +638 -0
  14. data/src/na_array.c +644 -0
  15. data/src/na_func.c +1624 -0
  16. data/src/na_index.c +988 -0
  17. data/src/na_linalg.c +616 -0
  18. data/src/na_random.c +409 -0
  19. data/src/narray.c +1308 -0
  20. data/src/narray.def +29 -0
  21. data/src/narray.h +170 -0
  22. data/src/narray_local.h +210 -0
  23. data/src/nimage/README.en +38 -0
  24. data/src/nimage/demo/fits.rb +97 -0
  25. data/src/nimage/demo/fits_convol.rb +28 -0
  26. data/src/nimage/demo/fits_fftdemo.rb +27 -0
  27. data/src/nimage/demo/fitsdemo1.rb +13 -0
  28. data/src/nimage/demo/fitsdemo2.rb +30 -0
  29. data/src/nimage/demo/fitsdemo3.rb +26 -0
  30. data/src/nimage/demo/fitsmorph.rb +39 -0
  31. data/src/nimage/demo/life_na.rb +57 -0
  32. data/src/nimage/demo/mandel.rb +41 -0
  33. data/src/nimage/extconf.rb +12 -0
  34. data/src/nimage/lib/nimage.rb +51 -0
  35. data/src/nimage/nimage.c +328 -0
  36. data/src/speed/add.py +12 -0
  37. data/src/speed/add.rb +8 -0
  38. data/src/speed/add_int.py +12 -0
  39. data/src/speed/add_int.rb +9 -0
  40. data/src/speed/lu.m +14 -0
  41. data/src/speed/lu.rb +22 -0
  42. data/src/speed/mat.m +23 -0
  43. data/src/speed/mat.rb +28 -0
  44. data/src/speed/mul.py +12 -0
  45. data/src/speed/mul.rb +9 -0
  46. data/src/speed/mul2.py +15 -0
  47. data/src/speed/mul2.rb +13 -0
  48. data/src/speed/mul_comp.py +12 -0
  49. data/src/speed/mul_comp.rb +9 -0
  50. data/src/speed/mul_int.py +12 -0
  51. data/src/speed/mul_int.rb +9 -0
  52. data/src/speed/mybench.py +15 -0
  53. data/src/speed/mybench.rb +31 -0
  54. data/src/speed/solve.m +18 -0
  55. data/src/speed/solve.py +16 -0
  56. data/src/speed/solve.rb +21 -0
  57. data/src/test/statistics.rb +22 -0
  58. data/src/test/testarray.rb +20 -0
  59. data/src/test/testbit.rb +27 -0
  60. data/src/test/testcast.rb +14 -0
  61. data/src/test/testcomplex.rb +35 -0
  62. data/src/test/testfftw.rb +16 -0
  63. data/src/test/testindex.rb +11 -0
  64. data/src/test/testindexary.rb +26 -0
  65. data/src/test/testindexset.rb +55 -0
  66. data/src/test/testmask.rb +40 -0
  67. data/src/test/testmath.rb +48 -0
  68. data/src/test/testmath2.rb +46 -0
  69. data/src/test/testmatrix.rb +13 -0
  70. data/src/test/testmatrix2.rb +33 -0
  71. data/src/test/testmatrix3.rb +19 -0
  72. data/src/test/testminmax.rb +46 -0
  73. data/src/test/testobject.rb +29 -0
  74. data/src/test/testpow.rb +19 -0
  75. data/src/test/testrandom.rb +23 -0
  76. data/src/test/testround.rb +11 -0
  77. data/src/test/testsort.rb +37 -0
  78. data/src/test/teststr.rb +13 -0
  79. data/src/test/testtrans.rb +18 -0
  80. data/src/test/testwhere.rb +27 -0
  81. metadata +127 -0
@@ -0,0 +1,11 @@
1
+ require 'narray'
2
+
3
+ def testround a
4
+ print "a = "; p a
5
+ print "a.floor = "; p a.floor
6
+ print "a.ceil = "; p a.ceil
7
+ print "a.round = "; p a.round
8
+ print "\n"
9
+ end
10
+
11
+ testround NArray.float(4,2).indgen!/4-2
@@ -0,0 +1,37 @@
1
+ require 'narray'
2
+
3
+ def test a,b
4
+ print a," #=> "
5
+ p b
6
+ end
7
+
8
+ a = NArray.int(16).random!(100)
9
+
10
+ test "a",a
11
+ test "a.sort",a.sort
12
+
13
+ print "\n# as string...\n"
14
+ a = a.to_string
15
+ test "a",a
16
+ test "a.sort",a.sort
17
+
18
+ print "\n# up to 0-rank...\n"
19
+ a = NArray.int(4,4).random!(100)
20
+ test "a",a
21
+ test "a.sort(0)",a.sort(0)
22
+
23
+ print "\n# big array test...\n"
24
+ a = NArray.int(10,10,10,10,10).random!(100)
25
+ test "a",a
26
+ test "a.sort(1)",a.sort(1)
27
+
28
+ print "\n# test sort_index...\n"
29
+ a = NArray.int(7,4).random!(100)
30
+ test "a",a
31
+ test "a.sort_index(0)",idx=a.sort_index(0)
32
+ test "a[a.sort_index]",a[idx]
33
+
34
+ print "\n# following will fail...\n"
35
+ a = NArray.complex(3,3).random!(100)
36
+ test "a",a
37
+ test "a.sort",a.sort
@@ -0,0 +1,13 @@
1
+ require 'narray'
2
+
3
+ a = NArray.float(3,3)
4
+ p a.indgen!
5
+ p a.to_string
6
+ p NArray.complex(3,3).indgen!.div!(3).to_string
7
+ p NArray.scomplex(3,3).indgen!.div!(3).to_string
8
+ p NArray.byte(3,3).indgen!.add!(32).to_string
9
+
10
+ a = NArray.int(3,3)
11
+ p a.indgen!
12
+ p a.to_string
13
+ p NArray.sfloat(3,3).indgen!.to_string.to_string
@@ -0,0 +1,18 @@
1
+ require 'narray'
2
+
3
+ def test a,b
4
+ print a," #=> "
5
+ p b
6
+ end
7
+
8
+ a = NArray.int(4,3,2).indgen!
9
+ test "a",a
10
+
11
+ print "\n# transpose first and second...\n"
12
+ test "a.transpose(1,0)",a.transpose(1,0)
13
+
14
+ print "\n# transpose first and last...\n"
15
+ test "a.transpose(-1,1..-2,0)",a.transpose(-1,1..-2,0)
16
+
17
+ print "\n# transpose shift forward ...\n"
18
+ test "a.transpose(1..-1,0)",a.transpose(1..-1,0)
@@ -0,0 +1,27 @@
1
+ require 'narray'
2
+
3
+ a = NArray.float(8).indgen!
4
+
5
+ print "a = "
6
+ p a
7
+
8
+ t,f = ( (a>=5).or(a<2) ).where2
9
+ print "t,f = ( (a>=5).or (a<2) ).where2\n"
10
+ print "t = "; p t
11
+ print "f = "; p f
12
+
13
+ t,f = ( (a>=5).and(a<2) ).where2
14
+ print "t,f = ( (a>=5).and (a<2) ).where2\n"
15
+ print "t = "; p t
16
+ print "f = "; p f
17
+
18
+ print "\n vvv no-meaning !! vvv\n"
19
+ t,f = ( (a>=5) && (a<2) ).where2
20
+ print "t,f = ( (a>=5) && (a<2) ).where2\n"
21
+ print "t = "; p t
22
+ print "f = "; p f
23
+
24
+ t,f = ( (a>=5) || (a<2) ).where2
25
+ print "t,f = ( (a>=5) || (a<2) ).where2\n"
26
+ print "t = "; p t
27
+ print "f = "; p f
metadata ADDED
@@ -0,0 +1,127 @@
1
+ --- !ruby/object:Gem::Specification
2
+ rubygems_version: 0.9.4
3
+ specification_version: 1
4
+ name: narray
5
+ version: !ruby/object:Gem::Version
6
+ version: 0.5.9.4
7
+ date: 2008-01-28 00:00:00 +09:00
8
+ summary: N-dimensional Numerical Array class for Ruby
9
+ require_paths:
10
+ - .
11
+ email: masa16.tanaka@gmail.com
12
+ homepage: http://narray.rubyforge.org/
13
+ rubyforge_project:
14
+ description:
15
+ autorequire:
16
+ default_executable:
17
+ bindir: bin
18
+ has_rdoc: false
19
+ required_ruby_version: !ruby/object:Gem::Version::Requirement
20
+ requirements:
21
+ - - ">"
22
+ - !ruby/object:Gem::Version
23
+ version: 0.0.0
24
+ version:
25
+ platform: ruby
26
+ signing_key:
27
+ cert_chain:
28
+ post_install_message:
29
+ authors:
30
+ - Masahiro Tanaka
31
+ files:
32
+ - src/ChangeLog
33
+ - src/MANIFEST
34
+ - src/README.en
35
+ - src/README.ja
36
+ - src/SPEC.en
37
+ - src/SPEC.ja
38
+ - src/depend
39
+ - src/extconf.rb
40
+ - src/mkmath.rb
41
+ - src/mknafunc.rb
42
+ - src/mkop.rb
43
+ - src/na_array.c
44
+ - src/na_func.c
45
+ - src/na_index.c
46
+ - src/na_linalg.c
47
+ - src/na_random.c
48
+ - src/narray.c
49
+ - src/narray.def
50
+ - src/narray.h
51
+ - src/narray_local.h
52
+ - src/lib/narray_ext.rb
53
+ - src/lib/nmatrix.rb
54
+ - src/nimage/README.en
55
+ - src/nimage/extconf.rb
56
+ - src/nimage/nimage.c
57
+ - src/nimage/demo
58
+ - src/nimage/demo/fits.rb
59
+ - src/nimage/demo/fits_convol.rb
60
+ - src/nimage/demo/fits_fftdemo.rb
61
+ - src/nimage/demo/fitsdemo1.rb
62
+ - src/nimage/demo/fitsdemo2.rb
63
+ - src/nimage/demo/fitsdemo3.rb
64
+ - src/nimage/demo/fitsmorph.rb
65
+ - src/nimage/demo/life_na.rb
66
+ - src/nimage/demo/mandel.rb
67
+ - src/nimage/lib
68
+ - src/nimage/lib/nimage.rb
69
+ - src/speed/add.py
70
+ - src/speed/add.rb
71
+ - src/speed/add_int.py
72
+ - src/speed/add_int.rb
73
+ - src/speed/lu.m
74
+ - src/speed/lu.rb
75
+ - src/speed/mat.m
76
+ - src/speed/mat.rb
77
+ - src/speed/mul.py
78
+ - src/speed/mul.rb
79
+ - src/speed/mul2.py
80
+ - src/speed/mul2.rb
81
+ - src/speed/mul_comp.py
82
+ - src/speed/mul_comp.rb
83
+ - src/speed/mul_int.py
84
+ - src/speed/mul_int.rb
85
+ - src/speed/mybench.py
86
+ - src/speed/mybench.rb
87
+ - src/speed/solve.m
88
+ - src/speed/solve.py
89
+ - src/speed/solve.rb
90
+ - src/test/statistics.rb
91
+ - src/test/testarray.rb
92
+ - src/test/testbit.rb
93
+ - src/test/testcast.rb
94
+ - src/test/testcomplex.rb
95
+ - src/test/testfftw.rb
96
+ - src/test/testindex.rb
97
+ - src/test/testindexary.rb
98
+ - src/test/testindexset.rb
99
+ - src/test/testmask.rb
100
+ - src/test/testmath.rb
101
+ - src/test/testmath2.rb
102
+ - src/test/testmatrix.rb
103
+ - src/test/testmatrix2.rb
104
+ - src/test/testmatrix3.rb
105
+ - src/test/testminmax.rb
106
+ - src/test/testobject.rb
107
+ - src/test/testpow.rb
108
+ - src/test/testrandom.rb
109
+ - src/test/testround.rb
110
+ - src/test/testsort.rb
111
+ - src/test/teststr.rb
112
+ - src/test/testtrans.rb
113
+ - src/test/testwhere.rb
114
+ test_files: []
115
+
116
+ rdoc_options: []
117
+
118
+ extra_rdoc_files: []
119
+
120
+ executables: []
121
+
122
+ extensions:
123
+ - src/extconf.rb
124
+ requirements: []
125
+
126
+ dependencies: []
127
+