Skip to content

Can't find inv() after updating #278

Closed
@xd009642

Description

@xd009642

So I've updated to ndarray 0.15.1 and ndarray-linalg 0.13.1 and some code that was using inv() now doesn't work, it's probably something silly my end so I was hoping someone could point me in the right direction. I'm using the mkl backend and here's a reduced code example with just the involved code:

use ndarray::{array, prelude::*, s, Data};
use ndarray_linalg::*;

    fn transform(
        transform: ArrayView2<f64>,
    ) -> Result<Self::Output, Error> {
        let shape = transform.shape();
        if !(shape[0] == 3 || shape[0] == 2) {
            Err(Error::InvalidTransformation)
        } else {
            let new_transform = transform.into_owned();
            let transform = new_transform
                .inv()
                .map_err(|_| Error::NonInvertibleTransformation)?;
        }
    }

And the error is:

error[E0599]: no method named `inv` found for struct `ndarray::ArrayBase<OwnedRepr<f64>, Dim<[usize; 2]>>` in the current scope
   --> src/transform/mod.rs:118:18
    |
118 |                 .inv()
    |                  ^^^ method not found in `ndarray::ArrayBase<OwnedRepr<f64>, Dim<[usize; 2]>>`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions