ndarray icon indicating copy to clipboard operation
ndarray copied to clipboard

impl ScalarOperand for Ratio<i32 and i64>

Open yan-zaretskiy opened this issue 3 years ago • 2 comments
trafficstars

Would you consider adding the above-mentioned impl to enable a more ergonomic handling of arrays of rational numbers?

yan-zaretskiy avatar Nov 12 '22 15:11 yan-zaretskiy

Hi @mindv0rtex. I don't understand what you're suggesting. Can you please provide more information and/or a code example?

nilgoyette avatar May 25 '23 16:05 nilgoyette

I apologize if my request is too opaque.

I had an application where I was performing scalar operations on a matrix of instances of num::rational::Ratio. It was not very ergonomic, because the ScalarOperand trait: https://docs.rs/ndarray/latest/ndarray/trait.ScalarOperand.html, is not implemented for it. I thought since you already have this trait implemented for num::complex::Complex, adding the Ratio support would be a reasonable request.

yan-zaretskiy avatar May 25 '23 17:05 yan-zaretskiy