davidm / lua-matrix

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

Inverse of complex matrix is not working #16

Open mathsbeauty opened 2 years ago

mathsbeauty commented 2 years ago

The complex numbers module is loaded with the following code. local complex = require "luacomplex" DEPENDENCIES: None (other than Lua 5.1 or 5.2). May be used with complex.lua. <<--- This line in project suggests for it. Everything works fine for matrices having complex numbers except for inverse. For example the matrix {{1,2,3},{4,5,6},{7,8,complex('9+3i')}} can't be inverted. It throws the following error

bad argument #1 to 'abs' (number expected, got table) stack traceback: [C]: in function 'math.abs' [\directlua]:in function 'pivotOk' [\directlua]: in field 'dogauss' [\directlua]:: in field 'invert'