You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I will provide some default implementation for monoid, such as calculating sums, products, maximum or minimum values. I want to implement them for all types available, but currently there are no traits that ensure the existence of additive unit etc.. I suggest creating a new trait that returns such values. The names listed in the title are just examples.
The text was updated successfully, but these errors were encountered:
i think implementing traits like multiplicative/additive identity can be useful in many generic functions like binary_exp, (so the end user can implement a wrapper class for 2D vector and implement MulIdentity trait and Mul operator and use the same binary_exp for matrix exp), gcd, ext_gcd, etc.
and we can implement traits for primitive types using macros as implement_mul_iden!(i8, i16, i32, i64, i128, isize, u8, u16, u32, u64, u128, usize);
I will provide some default implementation for monoid, such as calculating sums, products, maximum or minimum values. I want to implement them for all types available, but currently there are no traits that ensure the existence of additive unit etc.. I suggest creating a new trait that returns such values. The names listed in the title are just examples.
The text was updated successfully, but these errors were encountered: