Closed hleb-albau closed 6 years ago
Hi, we don't have this kind of solver yet and YES: your contribution is very welcome. Thanks. Dorival
@cpmech Could you, please, give me a short start point? what module should I extend (or create)? Also as far, as I understand, scipy generate Python code from FORTRAN bicgstab implementation using f2py.
If it is so complicated, instead of writing code myself, I can attach bounty using gitcoin.
Sure and thanks!
The sparse solver follows the interface given here: https://github.com/cpmech/gosl/blob/master/la/sparse_solver.go
It's actually pretty straightforward:
type SparseSolver interface {
Init(t *Triplet, symmetric, verbose bool, ordering, scaling string, comm *mpi.Communicator)
Free()
Fact()
Solve(x, b Vector, bIsDistr bool)
}
Usage is something like this:
// initialise solver
mysolver.Init(mytriplet, false, false, "", "", nil)
// factorise
mysolver.Fact()
// solve
x := NewVector(len(b))
mysolve.Solve(x, b, false) // x := inv(A) * b
I would suggesting copying https://github.com/cpmech/gosl/blob/master/la/sparse_solver_umfpack.go and renaming to sparse_solver_bicgstab.go
Then, it's just a matter of filling the gaps.
Also, I'd suggest using https://github.com/cpmech/gosl/blob/master/la/t_sp_solver_umfpack_test.go as an example to implement unit tests.
Please feel free to contact me again (direct message by email is fine) with your files then I can have a look and provide help.
By the way, as you've mentioned, support for an initial guess would have to be considered as well. To do so, we would have to change the SparseSolver interface and this would require changes to UMFPACK and MUMPS solvers. I'm happy to do that as soon as we known what kind of interface is required. Thanks. D
All right! SparseSolver.Init
now takes SpArgs
as input which includes a Guess field that can be used with iterative solvers. Also, in this way, it's easier to expand the capabilities of SparseSolver. See changes here: https://github.com/cpmech/gosl/commit/a1ea1401470848da6ab86058348147e72711c337
Hi @cpmech, thanks for fast responses. I will pick up it next week.
no worries! and thanks!
Hi @cpmech, is there any iterative solver for sparce linear systems with supporting of linitial guess?
For example, something like scipy scipy.sparse.linalg.bicgstab method.
P.S. If no, I am interested in contributing.