Skip to content

qr for tall rectangular matrix #22

@newbisi

Description

@newbisi

For a tall rectangular matrix the qr decomposition returns an error.
Example:

import numpy as np
import xprec
import xprec.linalg
A = np.random.rand(3,2)
A = A.astype(xprec.ddouble)
Q, R = xprec.linalg.qr(A)

This seems to be due to wrong dimensions in https://github.com/tuwien-cms/xprec/blob/40189e4c2e07e434726278d16108bac3d6ccb9b9/pysrc/xprec/linalg.py#L32C1-L32C34
It most likely should be Q = np.zeros((m, k), A.dtype) instead of Q = np.zeros((k, m), A.dtype). Also compare with the truncated qr decomposition rrqr for which this error doesn't occur.

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