www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Sparse matrix solver libraries

reply "Vic Kelson" <vic.kelson gmail.com> writes:
Hi All.

OK. I'm sold on using D to develop an experimental hydrologic 
modeling code, but I need a sparse linear algebra package. Has 
anyone either developed such a package in D or linked to an 
existing C or C++ library? There are a number of existing free 
libraries out there, and I hate to reinvent the wheel. If no such 
D library interface exists, I'm happy to work on one as a 
community project, but I suspect I'll need quite a bit of help. 
Is anybody game for such a project?

THANKS!
--vic
May 23 2012
next sibling parent reply Trass3r <un known.com> writes:
You might want to check out https://github.com/cristicbz/scid
May 23 2012
parent reply "Vic Kelson" <vic.kelson gmail.com> writes:
On Wednesday, 23 May 2012 at 15:27:54 UTC, Trass3r wrote:
 You might want to check out https://github.com/cristicbz/scid

I had found scid. For some of my work, BLAS and LAPACK are fine (full matrices), and I can use it for small problems on this project. But for large problems, I need a sparse solver, like PetSC or other solvers. THANKS!
May 23 2012
parent Jens Mueller <jens.k.mueller gmx.de> writes:
Vic Kelson wrote:
 On Wednesday, 23 May 2012 at 15:27:54 UTC, Trass3r wrote:
You might want to check out https://github.com/cristicbz/scid

I had found scid. For some of my work, BLAS and LAPACK are fine (full matrices), and I can use it for small problems on this project. But for large problems, I need a sparse solver, like PetSC or other solvers. THANKS!

Is it feasible to integrate a sparse solver as backend in SciD? This way sparse and dense operations are unified in one library. Jens
May 24 2012
prev sibling parent reply Justin Whear <justin economicmodeling.com> writes:
On Wed, 23 May 2012 16:16:19 +0200, Vic Kelson wrote:

 Hi All.
 
 OK. I'm sold on using D to develop an experimental hydrologic modeling
 code, but I need a sparse linear algebra package. Has anyone either
 developed such a package in D or linked to an existing C or C++ library?
 There are a number of existing free libraries out there, and I hate to
 reinvent the wheel. If no such D library interface exists, I'm happy to
 work on one as a community project, but I suspect I'll need quite a bit
 of help. Is anybody game for such a project?
 
 THANKS!
 --vic

I work for an economic modeling firm and we use a lot of D. We generally just link against BLASPack or Intel MKL for our linear algebra needs (linking C libs in D is really easy). D's compile-time code generation abilities make the thought of a native D solution rather interesting, but it would probably take years for such a project to reach the maturity level of existing libraries. Justin
May 23 2012
parent reply "Vic Kelson" <vic.kelson gmail.com> writes:
On Wednesday, 23 May 2012 at 16:12:40 UTC, Justin Whear wrote:
 On Wed, 23 May 2012 16:16:19 +0200, Vic Kelson wrote:

 Hi All.
 
 OK. I'm sold on using D to develop an experimental hydrologic 
 modeling
 code, but I need a sparse linear algebra package. Has anyone 
 either
 developed such a package in D or linked to an existing C or 
 C++ library?
 There are a number of existing free libraries out there, and I 
 hate to
 reinvent the wheel. If no such D library interface exists, I'm 
 happy to
 work on one as a community project, but I suspect I'll need 
 quite a bit
 of help. Is anybody game for such a project?
 
 THANKS!
 --vic

I work for an economic modeling firm and we use a lot of D. We generally just link against BLASPack or Intel MKL for our linear algebra needs (linking C libs in D is really easy). D's compile-time code generation abilities make the thought of a native D solution rather interesting, but it would probably take years for such a project to reach the maturity level of existing libraries. Justin

Alas, I'm working on an experimental code, and if it's a success, I'll give it away. I can't afford Intel MKL for a free project. I agree that a D implementation would be cool, but perhaps I'll just bite the bullet and try to convert headers for an existing library. Never done that before... Thanks!
May 23 2012
parent Trass3r <un known.com> writes:
 I agree that a D implementation would be cool, but perhaps I'll just  
 bite the bullet and try to convert headers for an existing library.  
 Never done that before...

It's not that hard to convert C headers. Just put an extern(C): at the top of the module, run some regex's to convert common patterns and do the rest manually. Guess the most work is converting preprocessor stuff.
May 23 2012