def max(dimen=0)
inject_rank(dimen) do |max, sub_mat|
if max.is_a? NMatrix then
max * (max >= sub_mat).cast(self.stype, self.dtype) + ((max)*0.0 + (max < sub_mat).cast(self.stype, self.dtype)) * sub_mat
else
max >= sub_mat ? max : sub_mat
end
end
end.to_a.to_nm
Do let me know if this is a bug. I want to work on the fix.
It's not a bug, just a difference. In my experience, it's easier to have a universe that consists entirely of 2D matrices than one that has 2D matrices and 1D vectors (of ambiguous orientation).
Problem
While comparing #max betweek NMatrix and Numpy, I found following differences in shape/dimension:
Numpy:
NMatrix:
Workaround/ solution
Do let me know if this is a bug. I want to work on the fix.
Thanks!