mdarray 0.5.5.2-java → 0.5.6-java

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (209) hide show
  1. checksums.yaml +4 -4
  2. data/config.rb +29 -95
  3. data/doc/BinaryOperator.html +20 -21
  4. data/doc/BitwiseOperators.html +18 -8
  5. data/doc/BitwiseOperators/BinaryAnd.html +189 -0
  6. data/doc/BitwiseOperators/BinaryLeftShift.html +189 -0
  7. data/doc/BitwiseOperators/BinaryOnesComplement.html +189 -0
  8. data/doc/BitwiseOperators/BinaryOr.html +189 -0
  9. data/doc/BitwiseOperators/BinaryRightShift.html +189 -0
  10. data/doc/BitwiseOperators/BinaryXor.html +189 -0
  11. data/doc/BooleanFunctions.html +18 -8
  12. data/doc/BooleanFunctions/And.html +189 -0
  13. data/doc/BooleanFunctions/Not.html +189 -0
  14. data/doc/BooleanFunctions/Or.html +189 -0
  15. data/doc/BooleanMDArray.html +10 -10
  16. data/doc/ByteMDArray.html +73 -14
  17. data/doc/CernDoubleFunctions.html +208 -0
  18. data/doc/CernFloatFunctions.html +208 -0
  19. data/doc/CernFunctions.html +828 -0
  20. data/doc/CernIntFunctions.html +208 -0
  21. data/doc/CernLongFunctions.html +208 -0
  22. data/doc/CharMDArray.html +181 -0
  23. data/doc/Colt.html +18 -20
  24. data/doc/ComparisonOperators.html +18 -8
  25. data/doc/ComparisonOperators/Eq.html +189 -0
  26. data/doc/ComparisonOperators/Ge.html +189 -0
  27. data/doc/ComparisonOperators/Gt.html +189 -0
  28. data/doc/ComparisonOperators/Le.html +189 -0
  29. data/doc/ComparisonOperators/Lt.html +189 -0
  30. data/doc/Const.html +107 -47
  31. data/doc/Csv.html +325 -113
  32. data/doc/Csv/Dimension.html +771 -0
  33. data/doc/Csv/Dimensions.html +654 -0
  34. data/doc/DDescriptive.html +573 -625
  35. data/doc/DoubleMDArray.html +40 -172
  36. data/doc/DoubleStatList.html +19 -20
  37. data/doc/FastBinaryOperator.html +166 -148
  38. data/doc/FastUnaryOperator.html +104 -109
  39. data/doc/FloatMDArray.html +55 -16
  40. data/doc/FunctionCreation.html +53 -273
  41. data/doc/FunctionMap.html +381 -93
  42. data/doc/GenericFunctions.html +18 -8
  43. data/doc/GenericFunctions/Null.html +187 -0
  44. data/doc/IntMDArray.html +77 -16
  45. data/doc/Java/CernJetMathTdouble/DoubleFunctions.html +120 -0
  46. data/doc/Java/CernJetMathTfloat/FloatFunctions.html +120 -0
  47. data/doc/Java/CernJetMathTint/IntFunctions.html +120 -0
  48. data/doc/Java/CernJetMathTlong/LongFunctions.html +120 -0
  49. data/doc/LazyBinaryOperator.html +714 -0
  50. data/doc/LazyMDArray.html +990 -0
  51. data/doc/LazyMDArray/BinaryComp.html +282 -0
  52. data/doc/LazyMDArray/UnaryComp.html +280 -0
  53. data/doc/LazyUnaryOperator.html +537 -0
  54. data/doc/LongMDArray.html +59 -15
  55. data/doc/MDArray.html +3223 -2181
  56. data/doc/MDArray/Counter.html +321 -1233
  57. data/doc/MDArray/IteratorFast.html +177 -116
  58. data/doc/MDArray/IteratorFastBoolean.html +37 -41
  59. data/doc/MDArray/IteratorFastByte.html +46 -39
  60. data/doc/MDArray/IteratorFastChar.html +37 -41
  61. data/doc/MDArray/IteratorFastDouble.html +37 -41
  62. data/doc/MDArray/IteratorFastFloat.html +37 -41
  63. data/doc/MDArray/IteratorFastInt.html +37 -41
  64. data/doc/MDArray/IteratorFastLong.html +37 -41
  65. data/doc/MDArray/IteratorFastShort.html +37 -41
  66. data/doc/MDArray/Section.html +561 -0
  67. data/doc/Nashorn.html +1407 -0
  68. data/doc/NetCDF.html +749 -0
  69. data/doc/NetCDF/Attribute.html +875 -0
  70. data/doc/NetCDF/AttributeWriter.html +286 -0
  71. data/doc/NetCDF/CDMNode.html +460 -0
  72. data/doc/NetCDF/Dimension.html +559 -0
  73. data/doc/NetCDF/DimensionWriter.html +642 -0
  74. data/doc/NetCDF/File.html +1593 -0
  75. data/doc/NetCDF/FileParent.html +674 -0
  76. data/doc/NetCDF/FileWriter.html +2875 -0
  77. data/doc/NetCDF/Group.html +685 -0
  78. data/doc/NetCDF/GroupWriter.html +851 -0
  79. data/doc/NetCDF/TimeVariable.html +646 -0
  80. data/doc/NetCDF/Variable.html +2994 -0
  81. data/doc/NetCDF/VariableWriter.html +420 -0
  82. data/doc/NonNumericalMDArray.html +11 -11
  83. data/doc/NumericFunctions.html +38 -30
  84. data/doc/NumericFunctions/Abs.html +189 -0
  85. data/doc/NumericFunctions/Add.html +189 -0
  86. data/doc/NumericFunctions/Ceil.html +189 -0
  87. data/doc/NumericFunctions/Cube.html +189 -0
  88. data/doc/NumericFunctions/Div.html +189 -0
  89. data/doc/NumericFunctions/Floor.html +189 -0
  90. data/doc/NumericFunctions/Fourth.html +189 -0
  91. data/doc/NumericFunctions/IsZero.html +189 -0
  92. data/doc/NumericFunctions/Max.html +189 -0
  93. data/doc/NumericFunctions/Min.html +189 -0
  94. data/doc/NumericFunctions/Mul.html +189 -0
  95. data/doc/NumericFunctions/Power.html +189 -0
  96. data/doc/NumericFunctions/Square.html +189 -0
  97. data/doc/NumericFunctions/Sub.html +189 -0
  98. data/doc/NumericFunctions/Truncate.html +189 -0
  99. data/doc/NumericalMDArray.html +14 -15
  100. data/doc/Operator.html +318 -109
  101. data/doc/Proc.html +120 -129
  102. data/doc/RubyBinaryOperator.html +66 -70
  103. data/doc/RubyFunctions.html +572 -27
  104. data/doc/RubyMath.html +18 -8
  105. data/doc/RubyMath/Acos.html +189 -0
  106. data/doc/RubyMath/Acosh.html +189 -0
  107. data/doc/RubyMath/Asin.html +189 -0
  108. data/doc/RubyMath/Asinh.html +189 -0
  109. data/doc/RubyMath/Atan.html +189 -0
  110. data/doc/RubyMath/Atan2.html +189 -0
  111. data/doc/RubyMath/Atanh.html +189 -0
  112. data/doc/RubyMath/Cbrt.html +189 -0
  113. data/doc/RubyMath/Cos.html +189 -0
  114. data/doc/RubyMath/Cosh.html +189 -0
  115. data/doc/RubyMath/Erf.html +189 -0
  116. data/doc/RubyMath/Erfc.html +189 -0
  117. data/doc/RubyMath/Exp.html +189 -0
  118. data/doc/RubyMath/Gamma.html +189 -0
  119. data/doc/RubyMath/Hypot.html +189 -0
  120. data/doc/RubyMath/Ldexp.html +189 -0
  121. data/doc/RubyMath/Log.html +189 -0
  122. data/doc/RubyMath/Log10.html +189 -0
  123. data/doc/RubyMath/Log2.html +189 -0
  124. data/doc/RubyMath/Neg.html +189 -0
  125. data/doc/RubyMath/Sin.html +189 -0
  126. data/doc/RubyMath/Sinh.html +189 -0
  127. data/doc/RubyMath/Sqrt.html +189 -0
  128. data/doc/RubyMath/Tan.html +189 -0
  129. data/doc/RubyMath/Tanh.html +189 -0
  130. data/doc/RubyStats.html +8 -8
  131. data/doc/RubyUnaryOperator.html +61 -65
  132. data/doc/ShortMDArray.html +69 -14
  133. data/doc/Sol.html +700 -0
  134. data/doc/Sol/BarChart.html +181 -0
  135. data/doc/Sol/BaseChart.html +800 -0
  136. data/doc/Sol/Bootstrap.html +1137 -0
  137. data/doc/Sol/Bridge.html +586 -0
  138. data/doc/Sol/Chart.html +1162 -0
  139. data/doc/Sol/CoordinateChart.html +679 -0
  140. data/doc/Sol/Dashboard.html +2094 -0
  141. data/doc/Sol/Dashboard/DCFX.html +786 -0
  142. data/doc/Sol/Dashboard/MyHandle.html +338 -0
  143. data/doc/Sol/Dashboard/MyService.html +202 -0
  144. data/doc/Sol/Dashboard/MyTask.html +291 -0
  145. data/doc/Sol/Interval.html +1213 -0
  146. data/doc/Sol/LineChart.html +346 -0
  147. data/doc/Sol/LinearScale.html +334 -0
  148. data/doc/Sol/Margins.html +219 -0
  149. data/doc/Sol/OrdinalScale.html +263 -0
  150. data/doc/Sol/Scale.html +462 -0
  151. data/doc/Sol/Stack.html +199 -0
  152. data/doc/Sol/TimeScale.html +397 -0
  153. data/doc/StatList.html +110 -125
  154. data/doc/StringMDArray.html +10 -10
  155. data/doc/StructureMDArray.html +10 -10
  156. data/doc/UnaryOperator.html +20 -21
  157. data/doc/UserFunction.html +51 -49
  158. data/doc/_index.html +881 -106
  159. data/doc/class_list.html +8 -3
  160. data/doc/css/style.css +2 -1
  161. data/doc/file.README.html +455 -104
  162. data/doc/file_list.html +7 -2
  163. data/doc/frames.html +5 -7
  164. data/doc/index.html +455 -104
  165. data/doc/js/app.js +7 -2
  166. data/doc/js/full_list.js +11 -3
  167. data/doc/method_list.html +3170 -1233
  168. data/doc/top-level-namespace.html +31 -8
  169. data/lib/colt/matrix/algebra.rb +5 -5
  170. data/lib/mdarray.rb +6 -3
  171. data/lib/mdarray/csv.rb +25 -5
  172. data/lib/mdarray/fast_operators.rb +1 -1
  173. data/lib/mdarray/function_creation.rb +3 -1
  174. data/lib/mdarray/hierarchy.rb +2 -0
  175. data/lib/mdarray/operators.rb +1 -1
  176. data/lib/mdarray/ruby_functions.rb +8 -4
  177. data/lib/mdarray/ruby_math.rb +0 -28
  178. data/test/colt/matrix/test_matrix2d_floatingalgebra.rb +31 -7
  179. data/test/complete.rb +4 -4
  180. data/test/mdarray/PETR4_2014.csv +249 -0
  181. data/test/mdarray/VALE_2014.csv +253 -0
  182. data/test/mdarray/VALE_PETR4.csv +501 -0
  183. data/test/mdarray/arithmetic_casting.rb +1 -0
  184. data/test/mdarray/test_access.rb +1 -0
  185. data/test/mdarray/test_boolean.rb +1 -0
  186. data/test/mdarray/test_comparison.rb +1 -0
  187. data/test/mdarray/test_complete.rb +2 -5
  188. data/test/mdarray/test_counter.rb +1 -0
  189. data/test/mdarray/test_creation.rb +1 -0
  190. data/test/mdarray/test_csv.rb +51 -0
  191. data/test/mdarray/test_error.rb +1 -0
  192. data/test/mdarray/test_non_numeric.rb +1 -1
  193. data/test/mdarray/test_operator.rb +31 -14
  194. data/test/mdarray/test_performance.rb +2 -1
  195. data/test/mdarray/test_printing.rb +1 -0
  196. data/test/mdarray/test_sections.rb +1 -0
  197. data/test/mdarray/test_shape.rb +1 -0
  198. data/test/mdarray/test_trigonometry.rb +1 -0
  199. data/test/mdarray/test_views.rb +1 -0
  200. data/vendor/mdarray.jar +0 -0
  201. data/vendor/{netcdfAll-4.5_0.jar → netcdfAll-4.6.jar} +0 -0
  202. data/vendor/slf4j-jdk14-1.7.12.jar +0 -0
  203. data/version.rb +1 -1
  204. metadata +247 -139
  205. data/lib/env.rb +0 -12
  206. data/lib/mdarray/lazy_mdarray.rb +0 -315
  207. data/lib/mdarray/lazy_operators.rb +0 -174
  208. data/test/env.rb +0 -8
  209. data/test/mdarray/test_lazy.rb +0 -306
@@ -1,8 +0,0 @@
1
- require_relative '../config.rb'
2
-
3
- # Tmp directory for data storage
4
- $TMP_TEST_DIR = MDArray.home_dir + "/test/tmp"
5
- #Colt test directory
6
- $COLT_TEST_DIR = MDArray.home_dir + "/test/colt"
7
- # NetCDF test directory
8
- $NETCDF_TEST_DIR = MDArray.home_dir + "/test/netcdf"
@@ -1,306 +0,0 @@
1
- # -*- coding: utf-8 -*-
2
-
3
- ##########################################################################################
4
- # Copyright © 2013 Rodrigo Botafogo. All Rights Reserved. Permission to use, copy, modify,
5
- # and distribute this software and its documentation, without fee and without a signed
6
- # licensing agreement, is hereby granted, provided that the above copyright notice, this
7
- # paragraph and the following two paragraphs appear in all copies, modifications, and
8
- # distributions.
9
- #
10
- # IN NO EVENT SHALL RODRIGO BOTAFOGO BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL,
11
- # INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF
12
- # THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF RODRIGO BOTAFOGO HAS BEEN ADVISED OF THE
13
- # POSSIBILITY OF SUCH DAMAGE.
14
- #
15
- # RODRIGO BOTAFOGO SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
16
- # THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE
17
- # SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED HEREUNDER IS PROVIDED "AS IS".
18
- # RODRIGO BOTAFOGO HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS,
19
- # OR MODIFICATIONS.
20
- ##########################################################################################
21
-
22
- require 'rubygems'
23
- require "test/unit"
24
- require 'shoulda'
25
-
26
- require 'mdarray'
27
-
28
-
29
- class MDArrayTest < Test::Unit::TestCase
30
-
31
- context "Lazy operations" do
32
-
33
- setup do
34
-
35
- @a = MDArray.int([2, 3], [1, 2, 3, 4, 5, 6])
36
- @b = MDArray.int([2, 3], [10, 20, 30, 40, 50, 60])
37
- @c = MDArray.double([2, 3], [100, 200, 300, 400, 500, 600])
38
- @d = MDArray.init_with("int", [2, 3], 4)
39
- @e = MDArray.init_with("int", [2, 3], 5)
40
- @f = MDArray.init_with("int", [2, 3], 6)
41
- @g = MDArray.init_with("int", [2, 3], 7)
42
-
43
- @h = MDArray.init_with("int", [3, 3], 7)
44
- @i = MDArray.init_with("int", [3, 3], 7)
45
-
46
- @float = MDArray.init_with("float", [2, 3], 10.5)
47
- @long = MDArray.init_with("long", [2, 3], 10)
48
- @byte = MDArray.init_with("byte", [2, 3], 10)
49
-
50
- MDArray.lazy = true
51
-
52
- end
53
-
54
-
55
- #-------------------------------------------------------------------------------------
56
- #
57
- #-------------------------------------------------------------------------------------
58
-
59
- should "execute lazy operations" do
60
-
61
- p "2 a"
62
- a_2 = (@a + @a)[]
63
- a_2.print
64
-
65
- c = 2 * @a
66
-
67
- lazy_c = @a + @b
68
- # calculate the value of the lazy array with []
69
- c = lazy_c[]
70
- c.print
71
-
72
- c = (@c + @a)[]
73
- c = (@a + @c)[]
74
-
75
- c = (@c + @byte)[]
76
- c = (@byte + @c)[]
77
-
78
- lazy_c = (@a * @d - @e) - (@b + @c)
79
- lazy_c[].print
80
-
81
- # evaluate the lazy expression with [] on the same line
82
- d = ((@a * @d - @e) - (@b + @c))[]
83
- d.print
84
-
85
- # evaluate lazy expression with [] anywhere in the expression. (@a * @d - @e) is
86
- # done lazyly then evaluated then operated with a lazy (@b + @c). The final
87
- # result is lazy
88
- d = ((@a * @d - @e)[] - (@b + @c))
89
- d.print
90
-
91
- MDArray.lazy = false
92
-
93
- end
94
-
95
- #-------------------------------------------------------------------------------------
96
- #
97
- #-------------------------------------------------------------------------------------
98
-
99
- should "check that lazy is contagious" do
100
-
101
- # this is done lazyly as we have "MDArray.lazy = true" defined in the setup
102
- l_c = @a + @b
103
-
104
- # now operations are done eagerly
105
- MDArray.lazy = false
106
- e_e = @c + @b
107
- # note that we do not require [] before printing e_e
108
- e_e.print
109
-
110
- # now operating a lazy array with an eager array... should be lazy even when
111
- # MDArray.lazy is false
112
- l_f = l_c + e_e
113
- l_f.print
114
- # request the calculation and print
115
- l_f[].print
116
-
117
- MDArray.lazy = false
118
-
119
- end
120
-
121
- #-------------------------------------------------------------------------------------
122
- #
123
- #-------------------------------------------------------------------------------------
124
-
125
- should "execute operations eagerly" do
126
-
127
- MDArray.lazy = false
128
-
129
- c = @a + @b
130
- c.print
131
-
132
- c = (@a * @d - @e) - (@b + @c)
133
- c.print
134
-
135
- MDArray.lazy = false
136
-
137
- end
138
-
139
- #-------------------------------------------------------------------------------------
140
- #
141
- #-------------------------------------------------------------------------------------
142
-
143
- should "show that lazy is really lazy" do
144
-
145
- # MDArray lazy operations are really lazy, i.e., there is not checking of any sort
146
- # when parsing the expression. Validation is only done when values are required.
147
-
148
- a = MDArray.int([2, 3], [1, 2, 3, 4, 5, 6])
149
- b = MDArray.double([3, 1], [1, 2, 3])
150
-
151
-
152
- # arrays a and b are of different shape and cannot work together. Yet, there will
153
- # be no error while parsing
154
- l_c = a + b
155
-
156
- # now we get an error
157
- assert_raise ( RuntimeError ) { l_c[].print }
158
-
159
- # now lets add correctly
160
- p "calculating lazy c"
161
- l_c = @a + @b
162
- l_c[].print
163
-
164
- # now lets change @b
165
- @b[0, 0] = 1000
166
- # and calculate again lazy c
167
- p "calculating lazy c again"
168
- l_c[].print
169
-
170
- p "calculating expression"
171
- @b[1, 0] = 2000
172
- p1 = (@a * @d - @e)[]
173
- p2 = (@b + @c)[]
174
- (p1 - p2)[].print
175
- p "@b is"
176
- @b.print
177
-
178
- # evaluate lazy expression with [] anywhere in the expression. (@a * @d - @e) is
179
- # done lazyly then evaluated then operated with a lazy (@b + @c). The final
180
- # result is lazy
181
- p "calculating lazy d"
182
- d = ((@a * @d - @e)[] - (@b + @c))
183
- d[].print
184
- # lets now change the value of @a
185
- @a[0, 0] = 1000
186
- # no change in d... @a has being eagerly calculated
187
- p "lazy d again after changing @a"
188
- d[].print
189
- # lets now change @b
190
- @b[0, 0] = 1
191
- @b[0, 1] = 150
192
- @b[1, 1] = 1000
193
- p "b is now:"
194
- @b.print
195
- # @b is still lazy on d calculation, so changing @b will change the value
196
- # of d[].
197
- p "lazy d again after changing @b"
198
- d[].print
199
-
200
- p "calculating new expression"
201
- p3 = (@b + @c)
202
- (p1 - p3)[].print
203
-
204
- MDArray.lazy = false
205
-
206
- end
207
-
208
- #-------------------------------------------------------------------------------------
209
- #
210
- #-------------------------------------------------------------------------------------
211
-
212
- should "work with Numeric" do
213
-
214
- l_c = @a + 2
215
- l_c[].print
216
-
217
- l_c = 2 + @a
218
- l_c[].print
219
-
220
- l_c = 2 - @a
221
- l_c[].print
222
-
223
- MDArray.lazy = false
224
-
225
- end
226
-
227
- #-------------------------------------------------------------------------------------
228
- #
229
- #-------------------------------------------------------------------------------------
230
- should "work with unary operators" do
231
-
232
- # MDArray.lazy = false
233
-
234
- arr = MDArray.linspace("double", 0, 1, 100)
235
- l_a = arr.sin
236
- l_a.print
237
-
238
- b = l_a[]
239
- b.print
240
-
241
- ((@a * @d - @e).sin - (@b + @c))[].print
242
-
243
- sinh = (arr.sinh)[]
244
-
245
- MDArray.lazy = false
246
-
247
- end
248
-
249
- #-------------------------------------------------------------------------------------
250
- #
251
- #-------------------------------------------------------------------------------------
252
-
253
- =begin
254
- should "convert expressions involving only arrays to RPN" do
255
-
256
- lazy_c = @a + @b
257
- assert_equal("int int add ", lazy_c.rpn)
258
-
259
- lazy_d = @a * @b
260
- assert_equal("int int mul ", lazy_d.rpn)
261
-
262
- lazy_e = lazy_c / lazy_d
263
- assert_equal("int int add int int mul div ", lazy_e.rpn)
264
-
265
- lazy_c = @a - @b + (@c * @d / (@f + @g))
266
- assert_equal("int int sub int int mul int int add div add ", lazy_c.rpn)
267
-
268
- lazy_f = @a - @b + (@c * @d - @f / (@f + @g))
269
- assert_equal("int int sub int int mul int int int add div sub add ", lazy_f.rpn)
270
-
271
- end
272
-
273
- #-------------------------------------------------------------------------------------
274
- #
275
- #-------------------------------------------------------------------------------------
276
-
277
- should "validate operations" do
278
-
279
- lazy_c = @a + @b
280
- lazy_c.validate
281
-
282
- # does not validate as shapes are different
283
- lazy_e = @h + @a
284
- assert_raise ( RuntimeError ) { lazy_e.validate }
285
-
286
- lazy_f = @h + @i - @a + @b
287
- assert_raise ( RuntimeError ) { lazy_f.validate }
288
-
289
- lazy_g = @h + @i
290
-
291
- lazy_k = lazy_g + lazy_c
292
- assert_raise ( RuntimeError ) { lazy_k.validate }
293
-
294
- end
295
-
296
- #-------------------------------------------------------------------------------------
297
- #
298
- #-------------------------------------------------------------------------------------
299
-
300
- should "convert expressions involving numeric to RPN" do
301
-
302
- end
303
- =end
304
- end
305
-
306
- end