JErnestoMtz / rapl

Rank Polymorphic array library for Rust.
103 stars 3 forks source link

Improve Arithmetic Assign Traits #41

Open JErnestoMtz opened 1 year ago

JErnestoMtz commented 1 year ago

Arithmetic Assign Traits, are not ass general as they can be. For now they can only take references.

        //This works
        let mut arr2 = Ndarr::from([[1, 2], [3, 4]]);
        arr2 += &1;
        assert_eq!(arr2, Ndarr::from([[2, 3], [4, 5]]));
        arr2 -= &Ndarr::ones([2,2]);
        assert_eq!(arr2, Ndarr::from([[1, 2], [3, 4]]));

        //This does't work
        arr2 *= Ndarr::ones([2,2]);