narray 0.5.9.8 → 0.5.9.9

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 (4) hide show
  1. data/src/ChangeLog +32 -25
  2. data/src/lib/nmatrix.rb +7 -3
  3. data/src/narray.h +3 -3
  4. metadata +15 -5
@@ -1,3 +1,10 @@
1
+ 2010-12-14 Masahiro TANAKA <masa16.tanaka@gmail.com>
2
+
3
+ * lib/nmatrix.rb (NMatrix#diagonal!):
4
+ - failed due to spec change of NArray.to_na.
5
+ Thanks to M. Kikkawa.
6
+ * ver 0.5.9p9
7
+
1
8
  2010-09-13 David MacMahon <davidm at astro.berkeley...>
2
9
 
3
10
  * narray.c (na_where2):
@@ -11,17 +18,17 @@
11
18
 
12
19
  2010-04-30 Masahiro TANAKA <masa16.tanaka at gmail.com>
13
20
 
14
- * narray.c (na_s_to_na):
21
+ * narray.c (na_s_to_na):
15
22
  - the number of arguments was not checked.
16
23
  Thanks to S D for report.
17
24
 
18
25
  2010-01-16 Masahiro TANAKA <masa16.tanaka at gmail.com>
19
26
 
20
- * na_index.c (na_index_analysis):
27
+ * na_index.c (na_index_analysis):
21
28
  - access out-of-bounds "struct slice" array.
22
29
  * SPEC.en, SPEC.ja:
23
30
  - fix wrong explanation in count_false/true.
24
- * na_random.c (na_random):
31
+ * na_random.c (na_random):
25
32
  - modify random method not to change itself.
26
33
  * lib/narray_ext.rb:
27
34
  - modify randomn! method to replace itself.
@@ -36,13 +43,13 @@
36
43
 
37
44
  2009-05-20 Masahiro TANAKA <masa16.tanaka at gmail.com>
38
45
 
39
- * lib/narray_ext.rb (mean, stddev,rms,rsmdev,covariance):
46
+ * lib/narray_ext.rb (mean, stddev,rms,rsmdev,covariance):
40
47
  - swith to DFLOAT type if integer array.
41
48
  - thanks to Philip Silva for report.
42
49
 
43
50
  2009-03-11 Masahiro TANAKA <masa16.tanaka at gmail.com>
44
51
 
45
- * na_index.c (na_aset_single_dim):
52
+ * na_index.c (na_aset_single_dim):
46
53
  - add check of storing empty array.
47
54
  - thanks to NISHI Takao for report.
48
55
 
@@ -90,8 +97,8 @@
90
97
 
91
98
  2008-01-28 Masahiro TANAKA <masa16.tanaka at gmail.com>
92
99
 
93
- * na_array.c (na_range_to_sequence, na_do_mdai):
94
- * na_index.c (na_index_range):
100
+ * na_array.c (na_range_to_sequence, na_do_mdai):
101
+ * na_index.c (na_index_range):
95
102
  change in internal structure of Ruby 1.9 Range object.
96
103
  Thanks to Hargobind Khalsa.
97
104
 
@@ -99,7 +106,7 @@
99
106
 
100
107
  2007-12-27 Masahiro TANAKA <masa16.tanaka at gmail.com>
101
108
 
102
- * narray_local.h, narray.c, na_array.c:
109
+ * narray_local.h, narray.c, na_array.c:
103
110
  use RSTRING_PTR, RSTRING_LEN for Ruby 1.9.0.
104
111
 
105
112
  * ver 0.5.9p3
@@ -114,26 +121,26 @@
114
121
 
115
122
  2007-10-09 David MacMahon <davidm at astro.berkeley...>
116
123
 
117
- * narray.h, mkop.rb:
124
+ * narray.h, mkop.rb:
118
125
  bug in NArray::NARRAY_VERSION and InspX.
119
126
 
120
127
  2006-08-09 Masahiro TANAKA <masahiro.tanaka at nao.ac.jp>
121
128
 
122
- * na_fftw.c, extconf.rb, narray.c (Init_narray):
129
+ * na_fftw.c, extconf.rb, narray.c (Init_narray):
123
130
  Remove FFTW2 support; it is a separete module.
124
131
 
125
132
  * ver 0.5.9
126
133
 
127
134
  2006-08-08 Masahiro TANAKA <masahiro.tanaka at nao.ac.jp>
128
135
 
129
- * na_index.c (na_index_test, na_aset_single_dim):
136
+ * na_index.c (na_index_test, na_aset_single_dim):
130
137
  `nv[1] = nu' should work if nv and nu are NVector.
131
138
  `NA_IsNArray(nu)' is used for checking NArray.
132
139
  Thanks to sun@titech.
133
140
 
134
141
  2006-08-08 Masahiro TANAKA <masahiro.tanaka at nao.ac.jp>
135
142
 
136
- * narray_local.h, mknafunc.rb (mksortfuncs):
143
+ * narray_local.h, mknafunc.rb (mksortfuncs):
137
144
  Argument type of comparison function passed to
138
145
  qsort should be `const void *'.
139
146
  Thank Daniel Berger for report.
@@ -172,7 +179,7 @@
172
179
 
173
180
  2005-01-25 Masahiro TANAKA <masahiro.tanaka at nao.ac.jp>
174
181
 
175
- * na_array.c (na_ary_to_nary_w_type):
182
+ * na_array.c (na_ary_to_nary_w_type):
176
183
  Bug: "type" is not initialized when an array is empty.
177
184
 
178
185
  2005-01-07 Masahiro TANAKA <masahiro.tanaka at nao.ac.jp>
@@ -226,7 +233,7 @@
226
233
 
227
234
  2003-03-04 Masahiro TANAKA <masa@ir.isas.ac.jp>
228
235
 
229
- * narray.c (na_alloc_struct):
236
+ * narray.c (na_alloc_struct):
230
237
  NArray-specific GC is enabled for ruby-1.8.0.
231
238
 
232
239
  * ver 0.5.7
@@ -235,7 +242,7 @@
235
242
 
236
243
  * na_random.c: created.
237
244
 
238
- * lib/narray_ext.rb (rank_total):
245
+ * lib/narray_ext.rb (rank_total):
239
246
  Array#indices is obsolete. use Array#select.
240
247
  Default `to_a' will be obsolete.
241
248
 
@@ -244,7 +251,7 @@
244
251
  2003-03-01 Masahiro TANAKA <masa@ir.isas.ac.jp>
245
252
 
246
253
  * narray_ext.rb (swap_byte,hton,htov): removed.
247
- * mkop.rb, mknafunc.rb, na_func.c, narray_local.h:
254
+ * mkop.rb, mknafunc.rb, na_func.c, narray_local.h:
248
255
  add C-version of swap_byte, hton, htov.
249
256
 
250
257
  2003-02-28 Masahiro TANAKA <masa@ir.isas.ac.jp>
@@ -267,7 +274,7 @@
267
274
 
268
275
  * extconf.rb: to build in another directory than source tree.
269
276
  * depend: ditto.
270
-
277
+
271
278
  2002-05-18 Masahiro TANAKA <masa@ir.isas.ac.jp>
272
279
 
273
280
  * lib/narray_ext.rb (NArray#==): return false unless other is NArray.
@@ -296,7 +303,7 @@
296
303
 
297
304
  2002-03-24 Masahiro TANAKA <masa@ir.isas.ac.jp>
298
305
 
299
- * na_array.c:
306
+ * na_array.c:
300
307
  New multi-dimentional array investigation is introduced.
301
308
  Scan array only once and check recursive array.
302
309
 
@@ -304,7 +311,7 @@
304
311
  Local definisions in narray.h are moved into narray_local.h.
305
312
 
306
313
  * ver 0.5.6
307
-
314
+
308
315
  2002-03-17 Masahiro TANAKA <masa@ir.isas.ac.jp>
309
316
 
310
317
  * nmatrix.rb (NMatrix#*): accept Array as an argument.
@@ -345,7 +352,7 @@
345
352
  2001-07-01 Masahiro Tanaka <masa@ir.isas.ac.jp>
346
353
 
347
354
  * narray.h: introduce na_index_t.
348
- * na_func.c (na_init_slice,na_loop_index_ref,na_loop_general):
355
+ * na_func.c (na_init_slice,na_loop_index_ref,na_loop_general):
349
356
  change to na_index_t.
350
357
  * na_index.c: modify EXCL(range) to use excule_end?.
351
358
  * na_index.c (na_aref_single_dim): remain array if sl->step!=0.
@@ -361,7 +368,7 @@
361
368
  * narray.h: conditional typedef. define NARRAY_H.
362
369
  * na_func.c (Init_na_funcs): change == to eq. add gt,ge,lt,le.
363
370
  * lib/narray_ext.rb: new entry: ==, all?, any?, none?.
364
-
371
+
365
372
  * mkop.rb: new entry: conditional XOR.
366
373
  * na_func.c (na_cond_xor): ditto.
367
374
  * narray.h: ditto.
@@ -376,7 +383,7 @@
376
383
 
377
384
  2001-06-04 Masahiro Tanaka <masa@ir.isas.ac.jp>
378
385
 
379
- * na_index.c (na_aref_multi_dim_single_elm):
386
+ * na_index.c (na_aref_multi_dim_single_elm):
380
387
  do not change class even if a[0..0,0..0] for NMatrix.
381
388
  Thanks to Daishi Harada.
382
389
  * narray.c (na_inspect): rb_str_cat(str,": \n",4);
@@ -493,7 +500,7 @@
493
500
  2000-10-05 Masahiro Tanaka <masa>
494
501
 
495
502
  * nmatrix.rb: created.
496
-
503
+
497
504
  * too many changes are applied to source codes. ^^;
498
505
 
499
506
  2000-10-03 Masahiro Tanaka <masa>
@@ -518,7 +525,7 @@
518
525
  (na_reshape_ref,na_newrank_ref): created.
519
526
  (na_inspect): print class name.
520
527
 
521
- * narray.h: add "VALUE obj" elmt to "struct NARRAY".
528
+ * narray.h: add "VALUE obj" elmt to "struct NARRAY".
522
529
 
523
530
  2000-09-29 Masahiro Tanaka <masa>
524
531
 
@@ -551,7 +558,7 @@
551
558
  remove unused variables and functions. (-Wall check)
552
559
  (Thanks to Robert Feldt)
553
560
 
554
- * lib/narray_ext.rb (convol): put in module FFTW.
561
+ * lib/narray_ext.rb (convol): put in module FFTW.
555
562
  (Thanks to Robert Feldt)
556
563
 
557
564
  2000-09-01 Masahiro Tanaka <masa>
@@ -132,9 +132,13 @@ class NMatrix < NArray
132
132
  shp = self.shape
133
133
  idx = NArray.int(shp[0..1].min).indgen! * (shp[0]+1)
134
134
  ref = reshape(shp[0]*shp[1],true)
135
- val = NArray.to_na(val)
136
- raise ArgumentError, "must be 1-d array" if val.dim!=1
137
- ref[idx,true] = val.newdim!(-1)
135
+ if val.kind_of?(Numeric)
136
+ ref[idx,true] = val
137
+ else
138
+ val = NArray.to_na(val)
139
+ raise ArgumentError, "must be 1-d array" if val.dim!=1
140
+ ref[idx,true] = val.newdim!(-1)
141
+ end
138
142
  self
139
143
  end
140
144
 
@@ -23,8 +23,8 @@
23
23
  # include <sys/types.h>
24
24
  #endif
25
25
 
26
- #define NARRAY_VERSION "0.5.9p8"
27
- #define NARRAY_VERSION_CODE 598
26
+ #define NARRAY_VERSION "0.5.9p9"
27
+ #define NARRAY_VERSION_CODE 599
28
28
 
29
29
  /*
30
30
  Data types used in NArray :
@@ -67,7 +67,7 @@ typedef int int32_t; /* NA_LINT */
67
67
  typedef uint32_t u_int32_t;
68
68
  # else
69
69
  # if SIZEOF_LONG == 4
70
- typedef unsigned long u_int32_t;
70
+ typedef unsigned long u_int32_t;
71
71
  # else
72
72
  # if SIZEOF_INT == 4
73
73
  typedef unsigned int u_int32_t;
metadata CHANGED
@@ -1,7 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: narray
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.9.8
4
+ prerelease: false
5
+ segments:
6
+ - 0
7
+ - 5
8
+ - 9
9
+ - 9
10
+ version: 0.5.9.9
5
11
  platform: ruby
6
12
  authors:
7
13
  - Masahiro Tanaka
@@ -9,7 +15,7 @@ autorequire:
9
15
  bindir: bin
10
16
  cert_chain: []
11
17
 
12
- date: 2010-12-06 00:00:00 +09:00
18
+ date: 2010-12-14 00:00:00 +09:00
13
19
  default_executable:
14
20
  dependencies: []
15
21
 
@@ -85,21 +91,25 @@ rdoc_options: []
85
91
  require_paths:
86
92
  - .
87
93
  required_ruby_version: !ruby/object:Gem::Requirement
94
+ none: false
88
95
  requirements:
89
96
  - - ">="
90
97
  - !ruby/object:Gem::Version
98
+ segments:
99
+ - 0
91
100
  version: "0"
92
- version:
93
101
  required_rubygems_version: !ruby/object:Gem::Requirement
102
+ none: false
94
103
  requirements:
95
104
  - - ">="
96
105
  - !ruby/object:Gem::Version
106
+ segments:
107
+ - 0
97
108
  version: "0"
98
- version:
99
109
  requirements: []
100
110
 
101
111
  rubyforge_project: narray
102
- rubygems_version: 1.3.5
112
+ rubygems_version: 1.3.7
103
113
  signing_key:
104
114
  specification_version: 3
105
115
  summary: N-dimensional Numerical Array class for Ruby