I have a system of 6 equations that I need to solve over and over again in a program (with many different inputs of course). I am currently using the Cramer's rule method of solving the system and it works quite well (it seems that my processor really likes add and multiply operations, it gets solutions in 1 microsecond despite the explicit equations being over 2 pages in length). However the number of times i need to solve is huge and I'm looking for an even faster method.
The question is, is there an even faster or more efficient method for solving these equations or would something like CUDA be beneficial here?
perhaps you could give http://arma.sourceforge.net/docs.html a try.
It provides premade solve function, http://arma.sourceforge.net/docs.html#solve. however it uses atlas/lapack backand, which is geared more towards larger functions.
You can also try multiplication by inverse, http://arma.sourceforge.net/docs.html#inv, which is compile time template and maybe faster for your purposes.
try this: x = inv(A)*b . Since A does not change, inversion is done only once. Then you are home free with simple matrix vector multiplications, which will be really fast
Cramer's rule doesn't scale well. For little system of equations with two or three unknowns it's fine but if the system gets larger, other methods are more efficient, for example: LU decomposition + forward substitution + backward substitution.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With