Linear system solver in D?

Christopher Wright dhasenan at gmail.com
Mon Feb 18 20:45:20 PST 2008


BCS wrote:
> I am going to have a system of equations like this
> 
> a_11*x_1 + a_12*x2 + ... a_1n*x_n = y_1
> a_21*x_1 + a_22*x2 + ... a_2n*x_n = y_2
> ..
> ..
> ..
> a_m1*x_1 + a_m2*x2 + ... a_mn*x_n = y_m
> 
> y_* and a_* known, I need to find x_*
> 
> What is the best available solver for such a system that works under D?
> 
> C bindings would work, D code would be better and I'd rather stay away 
> from non portable (uses __ asm and has no port to other system).
> 
> If no one knows of a good lib that is ready to use, what is a good C lib 
> to do bindings for?
> 
> 
> p.s. I'm going to be putting this in a non-linear root finder, has 
> someone already written on of those for D.

You definitely want bindings rather than native D. D just hasn't been 
around long enough for people to make decent math libraries for it; most 
of the people with the required skills are still transitioning from Fortran.

You could use GLPK -- it's a linear solver that accepts a superset of 
AMPL. If you're doing serious work on large data sets, go with CPLEX. If 
you manage to write something that does any better than GLPK, start a 
company. CPLEX is significantly better, but you might be able to make 
some money if you marketed it toward smaller research projects for $500 
or so.


More information about the Digitalmars-d-learn mailing list