Skip to content
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

LUFactorized Implemented? #314

Open
JP-Ellis opened this issue Jun 16, 2022 · 0 comments
Open

LUFactorized Implemented? #314

JP-Ellis opened this issue Jun 16, 2022 · 0 comments

Comments

@JP-Ellis
Copy link

I was having a look at the code behind LUFactorized and it appears that there is no LU factorization done at all. For example, the factorize_into source is

fn factorize_into(mut self) -> Result<LUFactorized<S>> {
    let ipiv = A::lu(self.layout()?, self.as_allocated_mut()?)?;
    Ok(LUFactorized { a: self, ipiv })
}

where self here is the original matrix. While it is fine to be storing the original matrix A (perhaps the LU decomposition is lazily evaluated), the solve_inplace code indicates that this is actually not the case at all. Instead it just uses the standard solve function without actually doing any LU decomposition at any point.

fn solve_inplace<'a, Sb>(
    &self,
    rhs: &'a mut ArrayBase<Sb, Ix1>,
) -> Result<&'a mut ArrayBase<Sb, Ix1>>
where
    Sb: DataMut<Elem = A>,
{
    assert_eq!(
        rhs.len(),
        self.a.len_of(Axis(1)),
        "The length of `rhs` must be compatible with the shape of the factored matrix.",
    );
    A::solve(
        self.a.square_layout()?,
        Transpose::No,
        self.a.as_allocated()?,
        &self.ipiv,
        rhs.as_slice_mut().unwrap(),
    )?;
    Ok(rhs)
}

Am I missing something? Or is this a temporary implementation until an LU factorization can be properly implemented?

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

1 participant