[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[dennou-ruby:003736] Re: [dennou-ruby:003735] Re: GPhys.join での associate coordinate
- To: Dennou-ruby <dennou-ruby@xxxxxxxxxxx>
- Subject: [dennou-ruby:003736] Re: [dennou-ruby:003735] Re: GPhys.join での associate coordinate
- From: Seiya Nishizawa <seiya@xxxxxxxxxxxxxx>
- Date: Tue, 10 Jun 2014 10:37:23 +0900
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:content-type:content-transfer-encoding; bh=VuS/fLcwxlMMlzEUJutSTNKWdoydFR0vkytBtuW9kcs=; b=ASBkJu8W+l3S3NmgCYb08o98M5sS9r/tgUY/c1Yl2wrSuJPJReztQLzFoX0tdqyliX FVK31NukVhVIE7sNnmlFeC2tfZPfevm5fkkBZwfMf7Yh7gpn/9Oc4eVHGBx2IOHPPSHY +Ml7ijgNv3YuYCO4R6UdvM961i2nniz/MwFP+hzMI3DnBiAy/Arc2A5rUbn602bNaklg P9XW+2hD9qqbFzUObNc0a1Q2kHh+CbV8Got24t3kjE4rIQafxguhBwHw1hpXKDH+dvfx KGBLYyU1vXFXidseYG6a58y8HR570518WrkP3WsHkDuhz0Py9LebUbePoBPksy/DWQcV 5JWw==
- Sender: seiyani@xxxxxxxxx
�Ƿ��
�ƥ��Ȥ������ߥåȤ��ޤ�����
���������ꤤ�������ޤ���
�߷��
2014ǯ6��� 0:41 Takeshi Horinouchi <horinout@xxxxxxxxxxxxxxxxx>:
> �߷���ޡ�
>
> ����ˤ褵������ѹ��Ǥ���������ɤ�������������
> �褯�狼������Զ���Ƹ��Ǥ��Ƥޤ���> �⤦���������뤫��������б��Ǥ��ꤤ�Ǥ���
> ���꤬�����Ǥ��ʲ������٥��ȡˡ�
>
> ��ۤɤΥ����������������Ƕ��ʤ��� unit test
> ����褦�ˤ��Ƥޤ�����ۤɤο������ߥåȤ�> test/test_assoccoords.rb �Ȥ����Τ��������Τǡ�
> �����˲�����ѹ��ʤ���������ơ����Ŭ�����> ���ޤ��Ԥ��ƥ��Ȥ���Ƥ����Τ��Ǥ����Ǥ���
> �ʥƥ��Ȥ�ѹ����åȤ��Ƥ�������>
>> �Ƿ��
>>
>> �Ф��������ޤ���>>
>> #cut ��[] ���ʾ�����ˡ�associate coordinate �����������Ƥ��ʤ��ä��Τǽ�����ޤ�����
>>
>> diff --git a/lib/numru/gphys/assoccoords.rb b/lib/numru/gphys/assoccoords.rb
>> index 7cfd707..cf85ecd 100644
>> --- a/lib/numru/gphys/assoccoords.rb
>> +++ b/lib/numru/gphys/assoccoords.rb
>>
>> @@ -230,7 +230,12 @@ module NumRu
>> end
>> end
>>
>> - ret = self.class.new( new_assoc_crds, @axnames )
>> + axnames = Array.new
>> + args.each_with_index do |a, i|
>> + axnames.push @axnames[i] unless Numeric === a
>> + end
>> +
>> + ret = self.class.new( new_assoc_crds, axnames )
>> ret
>> end
>>
>>
>>
>> �ޤ���#mean �ʤɤ����ˤ�����ư��Ƥ��ʤ��ä��Τǽ�����ޤ�����
>>
>> --- a/lib/numru/gphys/grid.rb
>> +++ b/lib/numru/gphys/grid.rb
>> @@ -410,7 +410,18 @@ module NumRu
>> newgrid = self.class.new( *newaxes )
>> newgrid.set_lost_axes( @lost_axes.dup )
>> if @assoc_coords
>> - newgrid.assoc_coords=@assoc_coords.subset_having_axnames(newgrid.axnames)
>> + if deleted_by
>> + assoc_coords = Array.new
>> + assoccoordnames.each do |aname|
>> + g = assoc_coord_gphys(aname)
>> + args = at.find_all{|i| g.axnames.include?(@axnames[i])}
>> + g = g.mean(*args) unless args.empty?
>> + assoc_coords.push g if GPhys === g
>> + end
>> + newgrid.set_assoc_coords assoc_coords
>> + else
>> + newgrid.assoc_coords =
>> @assoc_coords.subset_having_axnames(newgrid..axnames)
>> + end
>> end
>>
>> if !deleted_by
>>
>>
>> ���������ꤤ�������ޤ���
>>
>>
>> �߷��
>>
>> 2014ǯ6���0 Seiya Nishizawa <seiya@xxxxxxxxxxxxxx>:
>> > �Ƿ��
>> >
>> > GPhys.join �������ˡ� associate coordinate �������Ǥ�����
>> > ��Ƥߤޤ�����
>> > GPhys.join ��äƤ����Ǹ��ǤϤʤ��������ޤ�����
>> > �Ȥꤢ����ư��Ƥ������Ǥ���
>> >
>> > ��̵�������Ǥ����������������ޤ��Ǥ��礦����
>> > ���������ꤤ�������ޤ���
>> >
>> > # gphys �Υ��ߥåȥݥꥷ�����������Ƥ��ޤ���
>> > # ���Τ褦�˥���ѥå���������褤�Ǥ��礦��?
>> > # ������eature branch ��äơ����ߥåȡ�������������������Ǥ��礦����
>> >
>> >
>> > �߷��
>> >
>> >
>> >
>> > --- a/lib/numru/gphys/gphys.rb
>> > +++ b/lib/numru/gphys/gphys.rb
>> > @@ -1145,6 +1145,12 @@ module NumRu
>> > grid = Grid.new(*axes)
>> > # ** Develpment Note (2013-03-02, horinout)** joining assoc_coords
>> > # is yet to be supported; not difficult but cumbersome
>> > + if gp0.assoc_coords
>> > + assoc_coord = gp0.assoccoordnames.collect do |aname|
>> > + GPhys.join( gpnary.collect{|gp| gp.assoc_coord_gphys(aname)} )
>> > + end
>> > + grid.set_assoc_coords(assoc_coord)
>> > + end
>> >
>> > #< data >
>> > data = VArrayComposite.new( gpnary.collect{|gp| gp.data} )
>> >
>> > --
>> > Seiya Nishizawa
>> > RIKEN Advanced Institute for Computational Science
>> > Tel: +81-78-940-5754, Fax: +81-78-304-4972
>> > 7-1-26, Minatojima-minami-machi, Chuo-ku, Kobe, Hyogo 650-0047, Japan
>>
>>
>>
>> --
>> Seiya Nishizawa
>> RIKEN Advanced Institute for Computational Science
>> Tel: +81-78-940-5754, Fax: +81-78-304-4972
>> 7-1-26, Minatojima-minami-machi, Chuo-ku, Kobe, Hyogo 650-0047, Japan
>>
>
> �Ƿ� �
> ���ƻ���������ʳظ��污 ����ʳ��> ��060-0810 �����̶�10����
>
>
--
Seiya Nishizawa
RIKEN Advanced Institute for Computational Science
Tel: +81-78-940-5754, Fax: +81-78-304-4972
7-1-26, Minatojima-minami-machi, Chuo-ku, Kobe, Hyogo 650-0047, Japan