use super::helpers::{multiply_reuse_lhs, multiply_reuse_rhs};
use crate::{integer::Integer, rational::Rational};
use core::ops::Mul;
impl Mul<Rational> for Rational {
type Output = Rational;
fn mul(self, rhs: Rational) -> Self::Output {
multiply_reuse_lhs(self, &rhs)
}
}
impl Mul<&Rational> for Rational {
type Output = Rational;
fn mul(self, rhs: &Rational) -> Self::Output {
multiply_reuse_lhs(self, rhs)
}
}
impl Mul<Rational> for &Rational {
type Output = Rational;
fn mul(self, rhs: Rational) -> Self::Output {
multiply_reuse_rhs(self, rhs)
}
}
impl Mul<&Rational> for &Rational {
type Output = Rational;
fn mul(self, rhs: &Rational) -> Self::Output {
Rational::multiply(self, rhs)
}
}
impl Mul<Integer> for Rational {
type Output = Rational;
fn mul(self, rhs: Integer) -> Self::Output {
multiply_reuse_lhs(self, &Rational::from(rhs))
}
}
impl Mul<&Integer> for Rational {
type Output = Rational;
fn mul(self, rhs: &Integer) -> Self::Output {
multiply_reuse_lhs(self, &Rational::from(rhs))
}
}
impl Mul<Integer> for &Rational {
type Output = Rational;
fn mul(self, rhs: Integer) -> Self::Output {
multiply_reuse_rhs(self, rhs)
}
}
impl Mul<&Integer> for &Rational {
type Output = Rational;
fn mul(self, rhs: &Integer) -> Self::Output {
multiply_reuse_rhs(self, rhs)
}
}
impl Mul<Rational> for Integer {
type Output = Rational;
fn mul(self, rhs: Rational) -> Self::Output {
multiply_reuse_rhs(&Rational::from(self), rhs)
}
}
impl Mul<&Rational> for Integer {
type Output = Rational;
fn mul(self, rhs: &Rational) -> Self::Output {
multiply_reuse_lhs(self, rhs)
}
}
impl Mul<Rational> for &Integer {
type Output = Rational;
fn mul(self, rhs: Rational) -> Self::Output {
multiply_reuse_rhs(&Rational::from(self), rhs)
}
}
impl Mul<&Rational> for &Integer {
type Output = Rational;
fn mul(self, rhs: &Rational) -> Self::Output {
multiply_reuse_lhs(self, rhs)
}
}
impl Mul<i8> for Rational {
type Output = Rational;
fn mul(self, rhs: i8) -> Self::Output {
multiply_reuse_lhs(self, &Rational::from(rhs))
}
}
impl Mul<&i8> for Rational {
type Output = Rational;
fn mul(self, rhs: &i8) -> Self::Output {
multiply_reuse_lhs(self, &Rational::from(rhs))
}
}
impl Mul<i8> for &Rational {
type Output = Rational;
fn mul(self, rhs: i8) -> Self::Output {
multiply_reuse_rhs(self, rhs)
}
}
impl Mul<&i8> for &Rational {
type Output = Rational;
fn mul(self, rhs: &i8) -> Self::Output {
multiply_reuse_rhs(self, rhs)
}
}
impl Mul<Rational> for i8 {
type Output = Rational;
fn mul(self, rhs: Rational) -> Self::Output {
multiply_reuse_rhs(&Rational::from(self), rhs)
}
}
impl Mul<&Rational> for i8 {
type Output = Rational;
fn mul(self, rhs: &Rational) -> Self::Output {
multiply_reuse_lhs(self, rhs)
}
}
impl Mul<Rational> for &i8 {
type Output = Rational;
fn mul(self, rhs: Rational) -> Self::Output {
multiply_reuse_rhs(&Rational::from(self), rhs)
}
}
impl Mul<&Rational> for &i8 {
type Output = Rational;
fn mul(self, rhs: &Rational) -> Self::Output {
multiply_reuse_lhs(self, rhs)
}
}
impl Mul<u8> for Rational {
type Output = Rational;
fn mul(self, rhs: u8) -> Self::Output {
multiply_reuse_lhs(self, &Rational::from(rhs))
}
}
impl Mul<&u8> for Rational {
type Output = Rational;
fn mul(self, rhs: &u8) -> Self::Output {
multiply_reuse_lhs(self, &Rational::from(rhs))
}
}
impl Mul<u8> for &Rational {
type Output = Rational;
fn mul(self, rhs: u8) -> Self::Output {
multiply_reuse_rhs(self, rhs)
}
}
impl Mul<&u8> for &Rational {
type Output = Rational;
fn mul(self, rhs: &u8) -> Self::Output {
multiply_reuse_rhs(self, rhs)
}
}
impl Mul<Rational> for u8 {
type Output = Rational;
fn mul(self, rhs: Rational) -> Self::Output {
multiply_reuse_rhs(&Rational::from(self), rhs)
}
}
impl Mul<&Rational> for u8 {
type Output = Rational;
fn mul(self, rhs: &Rational) -> Self::Output {
multiply_reuse_lhs(self, rhs)
}
}
impl Mul<Rational> for &u8 {
type Output = Rational;
fn mul(self, rhs: Rational) -> Self::Output {
multiply_reuse_rhs(&Rational::from(self), rhs)
}
}
impl Mul<&Rational> for &u8 {
type Output = Rational;
fn mul(self, rhs: &Rational) -> Self::Output {
multiply_reuse_lhs(self, rhs)
}
}
impl Mul<i16> for Rational {
type Output = Rational;
fn mul(self, rhs: i16) -> Self::Output {
multiply_reuse_lhs(self, &Rational::from(rhs))
}
}
impl Mul<&i16> for Rational {
type Output = Rational;
fn mul(self, rhs: &i16) -> Self::Output {
multiply_reuse_lhs(self, &Rational::from(rhs))
}
}
impl Mul<i16> for &Rational {
type Output = Rational;
fn mul(self, rhs: i16) -> Self::Output {
multiply_reuse_rhs(self, rhs)
}
}
impl Mul<&i16> for &Rational {
type Output = Rational;
fn mul(self, rhs: &i16) -> Self::Output {
multiply_reuse_rhs(self, rhs)
}
}
impl Mul<Rational> for i16 {
type Output = Rational;
fn mul(self, rhs: Rational) -> Self::Output {
multiply_reuse_rhs(&Rational::from(self), rhs)
}
}
impl Mul<&Rational> for i16 {
type Output = Rational;
fn mul(self, rhs: &Rational) -> Self::Output {
multiply_reuse_lhs(self, rhs)
}
}
impl Mul<Rational> for &i16 {
type Output = Rational;
fn mul(self, rhs: Rational) -> Self::Output {
multiply_reuse_rhs(&Rational::from(self), rhs)
}
}
impl Mul<&Rational> for &i16 {
type Output = Rational;
fn mul(self, rhs: &Rational) -> Self::Output {
multiply_reuse_lhs(self, rhs)
}
}
impl Mul<u16> for Rational {
type Output = Rational;
fn mul(self, rhs: u16) -> Self::Output {
multiply_reuse_lhs(self, &Rational::from(rhs))
}
}
impl Mul<&u16> for Rational {
type Output = Rational;
fn mul(self, rhs: &u16) -> Self::Output {
multiply_reuse_lhs(self, &Rational::from(rhs))
}
}
impl Mul<u16> for &Rational {
type Output = Rational;
fn mul(self, rhs: u16) -> Self::Output {
multiply_reuse_rhs(self, rhs)
}
}
impl Mul<&u16> for &Rational {
type Output = Rational;
fn mul(self, rhs: &u16) -> Self::Output {
multiply_reuse_rhs(self, rhs)
}
}
impl Mul<Rational> for u16 {
type Output = Rational;
fn mul(self, rhs: Rational) -> Self::Output {
multiply_reuse_rhs(&Rational::from(self), rhs)
}
}
impl Mul<&Rational> for u16 {
type Output = Rational;
fn mul(self, rhs: &Rational) -> Self::Output {
multiply_reuse_lhs(self, rhs)
}
}
impl Mul<Rational> for &u16 {
type Output = Rational;
fn mul(self, rhs: Rational) -> Self::Output {
multiply_reuse_rhs(&Rational::from(self), rhs)
}
}
impl Mul<&Rational> for &u16 {
type Output = Rational;
fn mul(self, rhs: &Rational) -> Self::Output {
multiply_reuse_lhs(self, rhs)
}
}
impl Mul<i32> for Rational {
type Output = Rational;
fn mul(self, rhs: i32) -> Self::Output {
multiply_reuse_lhs(self, &Rational::from(rhs))
}
}
impl Mul<&i32> for Rational {
type Output = Rational;
fn mul(self, rhs: &i32) -> Self::Output {
multiply_reuse_lhs(self, &Rational::from(rhs))
}
}
impl Mul<i32> for &Rational {
type Output = Rational;
fn mul(self, rhs: i32) -> Self::Output {
multiply_reuse_rhs(self, rhs)
}
}
impl Mul<&i32> for &Rational {
type Output = Rational;
fn mul(self, rhs: &i32) -> Self::Output {
multiply_reuse_rhs(self, rhs)
}
}
impl Mul<Rational> for i32 {
type Output = Rational;
fn mul(self, rhs: Rational) -> Self::Output {
multiply_reuse_rhs(&Rational::from(self), rhs)
}
}
impl Mul<&Rational> for i32 {
type Output = Rational;
fn mul(self, rhs: &Rational) -> Self::Output {
multiply_reuse_lhs(self, rhs)
}
}
impl Mul<Rational> for &i32 {
type Output = Rational;
fn mul(self, rhs: Rational) -> Self::Output {
multiply_reuse_rhs(&Rational::from(self), rhs)
}
}
impl Mul<&Rational> for &i32 {
type Output = Rational;
fn mul(self, rhs: &Rational) -> Self::Output {
multiply_reuse_lhs(self, rhs)
}
}
impl Mul<u32> for Rational {
type Output = Rational;
fn mul(self, rhs: u32) -> Self::Output {
multiply_reuse_lhs(self, &Rational::from(rhs))
}
}
impl Mul<&u32> for Rational {
type Output = Rational;
fn mul(self, rhs: &u32) -> Self::Output {
multiply_reuse_lhs(self, &Rational::from(rhs))
}
}
impl Mul<u32> for &Rational {
type Output = Rational;
fn mul(self, rhs: u32) -> Self::Output {
multiply_reuse_rhs(self, rhs)
}
}
impl Mul<&u32> for &Rational {
type Output = Rational;
fn mul(self, rhs: &u32) -> Self::Output {
multiply_reuse_rhs(self, rhs)
}
}
impl Mul<Rational> for u32 {
type Output = Rational;
fn mul(self, rhs: Rational) -> Self::Output {
multiply_reuse_rhs(&Rational::from(self), rhs)
}
}
impl Mul<&Rational> for u32 {
type Output = Rational;
fn mul(self, rhs: &Rational) -> Self::Output {
multiply_reuse_lhs(self, rhs)
}
}
impl Mul<Rational> for &u32 {
type Output = Rational;
fn mul(self, rhs: Rational) -> Self::Output {
multiply_reuse_rhs(&Rational::from(self), rhs)
}
}
impl Mul<&Rational> for &u32 {
type Output = Rational;
fn mul(self, rhs: &Rational) -> Self::Output {
multiply_reuse_lhs(self, rhs)
}
}
impl Mul<i64> for Rational {
type Output = Rational;
fn mul(self, rhs: i64) -> Self::Output {
multiply_reuse_lhs(self, &Rational::from(rhs))
}
}
impl Mul<&i64> for Rational {
type Output = Rational;
fn mul(self, rhs: &i64) -> Self::Output {
multiply_reuse_lhs(self, &Rational::from(rhs))
}
}
impl Mul<i64> for &Rational {
type Output = Rational;
fn mul(self, rhs: i64) -> Self::Output {
multiply_reuse_rhs(self, rhs)
}
}
impl Mul<&i64> for &Rational {
type Output = Rational;
fn mul(self, rhs: &i64) -> Self::Output {
multiply_reuse_rhs(self, rhs)
}
}
impl Mul<Rational> for i64 {
type Output = Rational;
fn mul(self, rhs: Rational) -> Self::Output {
multiply_reuse_rhs(&Rational::from(self), rhs)
}
}
impl Mul<&Rational> for i64 {
type Output = Rational;
fn mul(self, rhs: &Rational) -> Self::Output {
multiply_reuse_lhs(self, rhs)
}
}
impl Mul<Rational> for &i64 {
type Output = Rational;
fn mul(self, rhs: Rational) -> Self::Output {
multiply_reuse_rhs(&Rational::from(self), rhs)
}
}
impl Mul<&Rational> for &i64 {
type Output = Rational;
fn mul(self, rhs: &Rational) -> Self::Output {
multiply_reuse_lhs(self, rhs)
}
}
impl Mul<u64> for Rational {
type Output = Rational;
fn mul(self, rhs: u64) -> Self::Output {
multiply_reuse_lhs(self, &Rational::from(rhs))
}
}
impl Mul<&u64> for Rational {
type Output = Rational;
fn mul(self, rhs: &u64) -> Self::Output {
multiply_reuse_lhs(self, &Rational::from(rhs))
}
}
impl Mul<u64> for &Rational {
type Output = Rational;
fn mul(self, rhs: u64) -> Self::Output {
multiply_reuse_rhs(self, rhs)
}
}
impl Mul<&u64> for &Rational {
type Output = Rational;
fn mul(self, rhs: &u64) -> Self::Output {
multiply_reuse_rhs(self, rhs)
}
}
impl Mul<Rational> for u64 {
type Output = Rational;
fn mul(self, rhs: Rational) -> Self::Output {
multiply_reuse_rhs(&Rational::from(self), rhs)
}
}
impl Mul<&Rational> for u64 {
type Output = Rational;
fn mul(self, rhs: &Rational) -> Self::Output {
multiply_reuse_lhs(self, rhs)
}
}
impl Mul<Rational> for &u64 {
type Output = Rational;
fn mul(self, rhs: Rational) -> Self::Output {
multiply_reuse_rhs(&Rational::from(self), rhs)
}
}
impl Mul<&Rational> for &u64 {
type Output = Rational;
fn mul(self, rhs: &Rational) -> Self::Output {
multiply_reuse_lhs(self, rhs)
}
}
impl Mul<i128> for Rational {
type Output = Rational;
fn mul(self, rhs: i128) -> Self::Output {
multiply_reuse_lhs(self, &Rational::from(rhs))
}
}
impl Mul<&i128> for Rational {
type Output = Rational;
fn mul(self, rhs: &i128) -> Self::Output {
multiply_reuse_lhs(self, &Rational::from(rhs))
}
}
impl Mul<i128> for &Rational {
type Output = Rational;
fn mul(self, rhs: i128) -> Self::Output {
multiply_reuse_rhs(self, rhs)
}
}
impl Mul<&i128> for &Rational {
type Output = Rational;
fn mul(self, rhs: &i128) -> Self::Output {
multiply_reuse_rhs(self, rhs)
}
}
impl Mul<Rational> for i128 {
type Output = Rational;
fn mul(self, rhs: Rational) -> Self::Output {
multiply_reuse_rhs(&Rational::from(self), rhs)
}
}
impl Mul<&Rational> for i128 {
type Output = Rational;
fn mul(self, rhs: &Rational) -> Self::Output {
multiply_reuse_lhs(self, rhs)
}
}
impl Mul<Rational> for &i128 {
type Output = Rational;
fn mul(self, rhs: Rational) -> Self::Output {
multiply_reuse_rhs(&Rational::from(self), rhs)
}
}
impl Mul<&Rational> for &i128 {
type Output = Rational;
fn mul(self, rhs: &Rational) -> Self::Output {
multiply_reuse_lhs(self, rhs)
}
}
impl Mul<u128> for Rational {
type Output = Rational;
fn mul(self, rhs: u128) -> Self::Output {
multiply_reuse_lhs(self, &Rational::from(rhs))
}
}
impl Mul<&u128> for Rational {
type Output = Rational;
fn mul(self, rhs: &u128) -> Self::Output {
multiply_reuse_lhs(self, &Rational::from(rhs))
}
}
impl Mul<u128> for &Rational {
type Output = Rational;
fn mul(self, rhs: u128) -> Self::Output {
multiply_reuse_rhs(self, rhs)
}
}
impl Mul<&u128> for &Rational {
type Output = Rational;
fn mul(self, rhs: &u128) -> Self::Output {
multiply_reuse_rhs(self, rhs)
}
}
impl Mul<Rational> for u128 {
type Output = Rational;
fn mul(self, rhs: Rational) -> Self::Output {
multiply_reuse_rhs(&Rational::from(self), rhs)
}
}
impl Mul<&Rational> for u128 {
type Output = Rational;
fn mul(self, rhs: &Rational) -> Self::Output {
multiply_reuse_lhs(self, rhs)
}
}
impl Mul<Rational> for &u128 {
type Output = Rational;
fn mul(self, rhs: Rational) -> Self::Output {
multiply_reuse_rhs(&Rational::from(self), rhs)
}
}
impl Mul<&Rational> for &u128 {
type Output = Rational;
fn mul(self, rhs: &Rational) -> Self::Output {
multiply_reuse_lhs(self, rhs)
}
}