davidm / lua-matrix

Matrices and vectors of are real, complex, and symbolic elements, implemented as Lua tables.
http://lua-users.org/wiki/LuaMatrix
Other
138 stars 54 forks source link

Changed Pivot to Use Max #5

Open waylonflinn opened 10 years ago

waylonflinn commented 10 years ago

I changed the pivot method used by the gauss-jordan method to look for a maximum value in a column instead of a minimum. This is the pivot choice described in: NUMERICAL RECIPES IN C: THE ART OF SCIENTIFIC COMPUTING (ISBN 0-521-43108-5)

This method produces much better results on my test data (previous method was accurate to one decimal place, this method is accurate to eight). Comparisons were made to the algorithm implemented in numpy.linalg.solve from numpy version 1.7.1 Test data included values ranging from 100 to 0.0001 in a single matrix

thegrb93 commented 5 years ago

I wish I saw this earlier