[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[dennou-ruby:000109] Re: NMDArray revised
In message "[dennou-ruby:000107] Re: NMDArray revised"
on 99/10/05, Takeshi Horinouchi <horinout@xxxxxx> writes:
>������������ǥå������оݤ�Ʊ�ͤΥ�åɤ���Ф�����Ǥ��͡�
�̰Ƥ�ͤ��ޤ�������ǽ�� compose �Ȥ����Τ��Ѱդ����㤨��
�����褦��:
Array#compose
[a,b,c,...].compose{|i,j,k,...| ....}
¿���������Array�˵�ǽ���롣����������Ǥ�֥��å��ѿ��Ȥ���
�黻��ܤ�����̤�¿����������֤���
[a,b].compose{|i,j| i*j if i > 0}
�ϰʲ��Ȥۤ������Ǥ��롣
c = []
a.each_indeces{|i| c[i] = a[i] * b[i] if a[i] > 0}
a = c