[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[dennou-ruby:004055] Re: [dennou-ruby:004054] Re: [dennou-ruby:004052] Re: rb-gslでNArray
- To: dennou-ruby@xxxxxxxxxxx, "OTOBE, Naohito" <otobe@xxxxxxxxxxxxxx>
- Subject: [dennou-ruby:004055] Re: [dennou-ruby:004054] Re: [dennou-ruby:004052] Re: rb-gslでNArray
- From: 西本絵梨子 <eriko@xxxxxxxxxxxxxx>
- Date: Thu, 20 Sep 2018 15:17:18 +0900
�������
���Ǥ������η���٤��ʤäƤ��ߤޤ����錄���ϡ�ruby-gsl��ɬ��ʾ��ϤȤꤢ����Array����Ѵ�����Ϥ��ˡ��äƤ��ޤ���
�ۤ��ˤ���ɤ��ˡ���������ʤ��Ȼפ��Ĥġ���
�켡�����Ǥ�����Ƥ��ʤ��Τǡ�������ʾ����ΤȤ��ˤ��ޤ������ˡ���狼������
���Ȥ��С�ganalysis/histogram.rb �ˤϼ��Τ褦��atch�ƤƤ��ޤ���
--- histogram.rb.org 2018-05-21 13:53:35.669370953 +0900
+++ histogram.rb 2018-09-20 15:13:31.579176844 +0900
@@ -43,9 +43,9 @@
val = gphys0.val
val = val.get_array![val.get_mask!] if NArrayMiss === val
val = NMath.log10(val) if log_bins
- hist.increment(val)
+ hist.increment(val.to_a)
- bounds = hist.range.to_na
+ bounds = NArray.to_na(hist.range.to_a)
bounds = 10 ** bounds if log_bins
center = (bounds[0..-2]+bounds[1..-1])/2
cell_width = (bounds[1..-1] - bounds[0..-2]) / 2
@@ -57,7 +57,7 @@
axis.set_cell(center, bounds, name)
axis.set_pos_to_center
- bin = hist.bin.to_na
+ bin = NArray.to_na(hist.bin.to_a)
bin /= cell_width if opts["log_bins"]
bin = VArray.new(bin,
{"long_name" => (log_bins ? "number per unit
bin width" : "number in bins"), "units"=>"1"},
�����Ǥ⻲�ͤˤʤ���
On Fri, 14 Sep 2018 at 14:18, Otobe, Naohito <otobe@xxxxxxxxxxxxxx> wrote:
>
> ����Ǥ���
>
> ����uby-GSL��äϷ��ɤ��פä��餤���ΤǤ��礦����
> gem���ʤˤ���numo-narray ��ruby-gsl �ȡ��뤹�롩
> ���ξ��Numo::Narray �Υ��֥������Ȥ�Ф��Ƥ�SL�δؿ�Ƥ٤� ��ˤʤ���Ȼפ��ΤǤ���
> ����umo::NArray��rray����Ȥ���> ����Τϲ������������Ǥ��������������Ҥä����äƤ�������
> ��������ΤȤ���դ��������Ǥ��礦����
>
> ���ߤޤ���GSL�ؿ�Ȥ������Ȼפä��Ȥ���> �ɤ������������Τ������Ƥ��������������
>
>
>
>
>
>
> 2018ǯ5���(�) 17:21 Takeshi Horinouchi <horinout@xxxxxxxxxxxxxxxxx>:
>>
>> ���������Ф���������Ǥ����͡�rb-gsl �ȥ����ե�������>> ����֤���ä��ꤷ�ޤ����͡������Ȥ⤫�� rb-gsl �� narray
>> �ζ�����ϡ������Τ褦�ˤ������褤�ΤǤϤʤ����Ȼפ��ޤ���
>>
>> �Ƿ�
>>
>> > ������Ǥ���
>> >
>> > Numo::GSL �ϴ�������
>> > https://github.com/ruby-numo/numo-narray/blob/master/README.md
>> >
>> > ���ͤޤǤˡ�
>> >
>> > On May 17, 2018 4:34:42 PM Takeshi Horinouchi <horinout@xxxxxxxxxxxxxxxxx> wrote:
>> >
>> > > �Ƿ��Ǥ���
>> > >
>> > >> Debian9.4 �ǥѥå��������ȡ��뤷�� ruby-gsl ��NArray ���Ȥ��ʤ��褦�Ǥ���
>> > >
>> > > �����ʤ�����������Ф餯��˻Ȥ��ʤ��ʤäƤ뤳�Ȥ�>> > > ��������ޤ��������ߤ�rb-gsl ��narray �ȤΥ����ե������� > > ��ѥå�������������Ȼפ��ޤ������ߤΥ��ƥʤ�>> > > ������Ϥʤ��ʤäƤޤ�����
>> > >
>> > > narray Ū�ʤ����������Ƥ��ǡ��������ӥѥå�������
>> > > ���ơ�rb-gsl-narray �Ȥ� rb-gsl-numo-narray �ʤɤȤ���> > > �Τ������ΤǤϤʤ����Ȼפ��ޤ�(rb-gsl-narray �ʤ�> > > rb-gsl ��narray �˰����������ߤΥ��ƥʤ�>> > > �����äƤ������ʤ�������ꤽ����Ϥ��ʤ��ΤǤ�����
>> > > narray �����ե����������ä������С������Τ� > > �����Ʋ桹�������������� ������Ƥ�Ǥ��ޤ�����
>> > >
>> > >
>> > >> �ǾRuby�Τߤʤ���>> > >>
>> > >> ���Ǥ���
>> > >> Debian9.4 �ǥѥå��������ȡ��뤷�� ruby-gsl ��NArray ���Ȥ��ʤ��褦�Ǥ���
>> > >>
>> > >> % ruby -v
>> > >> ruby 2.3.3p222 (2016-11-21) [x86_64-linux-gnu]
>> > >>
>> > >> % irb
>> > >> rirb(main):001:0> require "gsl"
>> > >> => true
>> > >> irb(main):002:0> require "narray"
>> > >> => false
>> > >> irb(main):003:0> val=NArray.float(5).indgen
>> > >> => NArray.float(5):
>> > >> [ 0.0, 1.0, 2.0, 3.0, 4.0 ]
>> > >> irb(main):004:0> val.to_gslv
>> > >> NoMethodError: undefined method `to_gslv' for "NArray.float(5): \n[
>> > >> 0.0, 1.0, 2.0, 3.0, 4.0 ]":NArray
>> > >> Did you mean? to_s
>> > >> from (irb):4
>> > >> from /usr/bin/irb:11:in `<main>'
>> > >>
>> > >>
>> > >> �ޤ���gem��array�ξ���ꤷ��b-gsl�ȡ��뤷�褦�Ȥ��Ƥ⤳���ޤ���
>> > >> % export NARRAY=1
>> > >> % gem install rb-gsl -- --with-narray-include={narray.h�ξ�}
>> > >>
>> > >> Makefile:241: �������å�'dht.o' �Υ쥷�ԤǼ�����ޤ���
>> > >> make: *** [dht.o] ���顼 1
>> > >>
>> > >> make failed, exit code 2
>> > >>
>> > >>
>> > >> --
>> > >> Eriko Nishimoto (�������,
>> > >> Project Scientist, Project Team for Advanced Climate Modeling, JAMSTEC
>> > >> http://gfd-dennou.org/member/eriko/
>> > >>
>> > >>
>> > >
>> > > �Ƿ� �
>> > > ���ƻ���������ʳظ��污 ����ʳ��>> > > ��060-0810 �����̶�10����
>> >
>> >
>> >
>> >
>>
>> �Ƿ� �
>> ���ƻ���������ʳظ��污 ����ʳ��>> ��060-0810 �����̶�10����
>>
>>
>>
>
>
> --
> ==================================================
> ʡ������������ʳض���
> Otobe,Naohito (E-Mail:otobe@xxxxxxxxxxxxxx)
> ==================================================
--
Eriko Nishimoto (�������,
Project Scientist, Project Team for Advanced Climate Modeling, JAMSTEC
http://gfd-dennou.org/member/eriko/