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

Preconditioner #51

Open
nilgoyette opened this issue Apr 18, 2020 · 1 comment
Open

Preconditioner #51

nilgoyette opened this issue Apr 18, 2020 · 1 comment

Comments

@nilgoyette
Copy link
Contributor

One of the method I coded in Rust is the "Conjugate gradient solver for positive-definite matrices." I see that you already coded this method. I didn't compare them yet because there's a small difference: I'm using a diagonal conditioner

for idx_iter in 1..max_iterations {
    // We're using the diagonal conditioner.
    let z = &r / &diag;
    ... standard algo, I think ...

As you know, I'm not a mathematician at all, so I can't explain you what this is and why we need it in argmin. Maybe almost nobody uses that and we shouldn't code it. I don't know. This looks like a new trait and a new template parameter, something you may be tired of :)

Is there a minimum-effort way to compare our algo? Like, using what you already coded to update the array or some magic that you know?

@stefan-k
Copy link
Member

Preconditioning would be a nice feature! If I understand it correctly, it only requires another multiplication with a matrix (or the inverse of a matrix) with a vector. I'm however unsure how this is best done in practice. I've used preconditioning by applying the preconditioning to the system itself, but not as part of the solver. I guess that, depending on the type of preconditioning, there may be computationally efficient implementations, and we should not limit the implementation such that these become impossible. But I don't have a sufficient overview over the topic. Do you by any chance know how this is solved in other solvers?

Could you elaborate how you would solve this with a trait? From the top of my head I'd say that an optional field holding the preconditioner may be sufficient, at least for a basic implementation.

Is there a minimum-effort way to compare our algo? Like, using what you already coded to update the array or some magic that you know?

Do you want to compare performance (speed) or performance (convergence, ...)? For the latter I suppose choosing your preconditioner such that it has no effect would work. The former probably requires some code.

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