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

separate LU economy mode #272

Closed
JeffBezanson opened this issue Dec 1, 2011 · 2 comments
Closed

separate LU economy mode #272

JeffBezanson opened this issue Dec 1, 2011 · 2 comments
Labels
performance Must go faster

Comments

@JeffBezanson
Copy link
Sponsor Member

Currently we can't infer a simple type for the result of lu since it might return either (LU, P) or (L, U, P).
I'm willing to give in on this in some cases, but this one doesn't seem necessary. Especially since lu(A, true) is not very easy to read. Yes, a keyword argument would be best but that still probably won't fix the type issue.
We need something like lu_compact or lu_econ.

Similar concerns might apply to other linear algebra functions. But it's much better if the various possible returns are prefixes of each other, i.e. (A,B), (A,B,C), (A,B,C,D) etc. so we always know the types of values that are requested.

@ViralBShah
Copy link
Member

There are various forms of LU with various input combinations:

  1. One output argument only, which does an in-place decomposition.
  2. Two output arguments - L and U
  3. Three output arguments - L, U, and P
  4. A way to return P either as a vector or a matrix
  5. In the case of sparse LU, there are 4 output args possible - L, U, P, and Q

It would be inelegant to have differently named functions for each case.

We certainly can ensure that the names are prefixes of each other, and that can be done in the case of existing lu also.

@JeffBezanson
Copy link
Sponsor Member Author

It's not as bad as you make it look. 4 is not necessary since the P vector can be turned into a matrix in an extra step. 2 and 3 can be the same function. 5 would be a separate method anyway since it is for sparse. So that really still leaves you with two functions for the dense case.

vtjnash pushed a commit to vtjnash/julia that referenced this issue Dec 31, 2011
* 'master' of github.com:JuliaLang/julia:
  Working sparse \
  small fix to suitesparse build.
  Build SuiteSparse. Still need to resolve LAPACK symbols.
  Use lu! for economy mode. No economy argument to lu any more. lu is implemented using lu! Close JuliaLang#272.
  Specialize the conversion for integer arrays as the real case led to stack overflow in the earlier commit.
  Promote all non-float arrays to float for lapack function calls (both real and complex cases) Fix bug in calling complex qr close JuliaLang#134
  ode23 is quite decent. ode45 seems ok, but may need some code cleanup and performance testing. Both need a few more function signatures - but good enough to get started.
  Implement select(k) using quickselect Separate stats stuff into statistics.j Implement median using select
  Almost working quickselect that will pave the way for median and order statistics.
KristofferC added a commit that referenced this issue May 9, 2018
* fix some printing inconsistencies
KristofferC added a commit that referenced this issue May 9, 2018
* fix some printing inconsistencies
LilithHafner pushed a commit to LilithHafner/julia that referenced this issue Oct 11, 2021
* Array shouldn't be parameterised on T and change from sample! to sample

* Add simple tests for weighted sampling with a dimension
cmcaine pushed a commit to cmcaine/julia that referenced this issue Nov 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance Must go faster
Projects
None yet
Development

No branches or pull requests

2 participants