# File nmatrix.rb, line 35 def *(other) case other when NMatrix NMatrix.mul_add( NArray.refer(self).newdim!(0),other.newdim(2), 1 ) #NMatrix.mul_add( NArray.refer(self).newdim!(0), # other.transpose(1,0).newdim!(2), 0 ) when NVector NVector.mul_add( NArray.refer(self), other.newdim(1), 0 ) when NArray if other.instance_of?(NArray) NMatrix.mul( NArray.refer(self), other.newdim(0,0) ) else other.coerce_rev( self, :* ) end when Numeric super #NMatrix.mul( NArray.refer(self), other ) when Array NMatrix.mul( self, NArray[*other].newdim!(0,0) ) else raise TypeError,"Illegal operation: NMatrix * %s" % other.class end end