Skip to content

qr.solve() cannot handle overdetermined systems #1579

@hpodhaisky

Description

@hpodhaisky

"QR solve: unable to solve a non-square system."

I suggest to update solve_mut to return the least squares solution in the case when the problem is overdetermined. Note that https://docs.rs/nalgebra-lapack/latest/nalgebra_lapack/trait.QrDecomposition.html#method.solve does this as well. Also Julia and octave take A \ b as $| A x - b|_2 -> \min$.

All that needs to be done is to multiply b with q.transpose() from left and solve then.

May I draft a pull request for this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions