- 
          
 - 
                Notifications
    
You must be signed in to change notification settings  - Fork 518
 
Open
Description
I'm trying to run the following:
use std::ops::MulAssign;
use nalgebra::Const;
use nalgebra::DMatrix;
use nalgebra::Matrix;
fn main() {
    let identity = nalgebra::Matrix4::<f32>::identity();
    let mut matrix = Matrix::<f32, Const<8>, Const<4>, _>::zeros();
    let mut view = matrix.view_mut((0, 0), (5, 4));
    view.mul_assign(identity); // <-- doesn't work
    let mut points = DMatrix::zeros(8, 5);
    let mut view = points.view_mut((0, 0), (5, 4));
    view.mul_assign(identity); // <-- works
}But the first example doesn't work and gives the following error:
error[E0308]: mismatched types
   --> src/main.rs:12:21
    |
12  |     view.mul_assign(identity); // <-- doesn't work
    |          ---------- ^^^^^^^^ expected `f32`, found `Matrix<f32, Const<4>, Const<4>, ArrayStorage<f32, 4, 4>>`
    |          |
    |          arguments to this method are incorrect
    |
    = note: expected type `f32`
             found struct `Matrix<f32, Const<4>, Const<4>, ArrayStorage<f32, 4, 4>>`
note: method defined here
   --> /home/hgaiser/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ops/arith.rs:877:8
    |
877 |     fn mul_assign(&mut self, rhs: Rhs);
    |        ^^^^^^^^^^Metadata
Metadata
Assignees
Labels
No labels