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

xt::linalg::lstsq is not working when M < N #89

Closed
potpath opened this issue Nov 14, 2018 · 3 comments
Closed

xt::linalg::lstsq is not working when M < N #89

potpath opened this issue Nov 14, 2018 · 3 comments

Comments

@potpath
Copy link
Contributor

potpath commented Nov 14, 2018

The following minimal test fails

TEST(xlinalg, lstsq_m_lessthan_n_minimal)
{
    xarray<double> arg_0 = {{ 0., 1.}};
    xarray<double> arg_1 = {1.};

    auto res = xt::linalg::lstsq(arg_0, arg_1);
}

The error is "Could not find workspace size for gelsd."

According to http://www.netlib.org/lapack/explore-html/d7/d3b/group__double_g_esolve_ga94bd4a63a6dacf523e25ff617719f752.html#ga94bd4a63a6dacf523e25ff617719f752:
ldb should be >= max(1,max(M,N)).

From
https://github.com/QuantStack/xtensor-blas/blob/9725a505db5c24f4037f9df4691171037e9f7026/include/xtensor-blas/xlapack.hpp#L693-L702
this looks like b and ldb is not handled differently when M < N .

@wolfv
Copy link
Member

wolfv commented Nov 15, 2018

I'm looking into this.

@wolfv
Copy link
Member

wolfv commented Nov 17, 2018

This is fixed with the latest PR.

@wolfv wolfv closed this as completed Nov 20, 2018
@potpath
Copy link
Contributor Author

potpath commented Nov 23, 2018 via email

@potpath potpath changed the title xt::linalg::lstsq is not working when M > N xt::linalg::lstsq is not working when M < N Jun 25, 2019
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