Closed ladc closed 8 years ago
Looking at the file matrix.lua it seems that the code is already there:
> lgsl = require "lgsl"
> m = lgsl.matrix.new(5,5, function(i,j) return 1/(i+j) end)
> =m
cdata<struct 180>: 0x003b69a8
> =m:show()
[ 0.5 0.33333333 0.25 0.2 0.16666667 ]
[ 0.33333333 0.25 0.2 0.16666667 0.14285714 ]
[ 0.25 0.2 0.16666667 0.14285714 0.125 ]
[ 0.2 0.16666667 0.14285714 0.125 0.11111111 ]
[ 0.16666667 0.14285714 0.125 0.11111111 0.1 ]
That could be ok or you would like something else ?
Indeed, you have already implemented this, but I still need to do add a this as the __tostring method, so print(m) would actually print the above.
Fixed in 4f16cfd4
Implement a form (however minimalistic) for pretty printing of matrices, as in GSL Shell.