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

Vandermonde inverse #75

Open
nsajko opened this issue Jan 1, 2023 · 1 comment
Open

Vandermonde inverse #75

nsajko opened this issue Jan 1, 2023 · 1 comment

Comments

@nsajko
Copy link

nsajko commented Jan 1, 2023

Here I have a module with a short and simple implementation of a Vandermonde matrix inverse:

https://gitlab.com/nsajko/PolynomialPassingThroughIntervals.jl/-/blob/main/src/VandermondeInverse.jl

The module depends on the SkipVectors module, located in the same directory.

As far as I remember VandermondeInverse.vandermonde_inv offers a huge improvement in accuracy over using SpecialMatrices.jl, and sometimes it's significantly faster, too.

Do you want a PR? If so, do you have any suggestions regarding the code, or testing, or perhaps do you want some benchmarks?

@JeffFessler
Copy link
Member

Sure it would be good to have a fast inv here for Vandermonde.
I actually don't see any inv in the current code (I haven't worked the guts of the Vandermonde case so I don't know much about the internals), so yes it would be be helpful to see a benchmark to see exactly what you are comparing. Oh, perhaps what you are calling inv is actually A\b. Consider using the standard Julia names like ldiv!

Comments on code:

  • for subtracter you might look at Base.Fix1
  • do you really need all those local statements? you need those in a REPL, but i don't think they are needed in functions.
  • i don't understand vandermonde_inv(x::AbstractVector{T}) - a docstring might help
  • please include docstrings and tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants