Skip to content

Can't find inv() after updating #278

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
xd009642 opened this issue Apr 13, 2021 · 3 comments
Closed

Can't find inv() after updating #278

xd009642 opened this issue Apr 13, 2021 · 3 comments

Comments

@xd009642
Copy link

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]>>`
@relf
Copy link

relf commented Apr 13, 2021

I think it is a bit like #259, ndarray-linalg 0.14, which supports ndarray 0.15, has not been published yet (#276)

@relf
Copy link

relf commented Apr 13, 2021

With ndarray-linalg 0.13.1, you have to stick to ndarray 0.14.

@xd009642
Copy link
Author

Ah I just looked in the repo cargo.toml and thought it would have been published. Cool thanks, I'll move back a version 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants