Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Matrices = require 'stuart-ml.linalg.Matrices'
- -- Create a dense matrix ((1.0, 2.0), (3.0, 4.0), (5.0, 6.0))
- local dm = Matrices.dense(3, 2, {1.0, 3.0, 5.0, 2.0, 4.0, 6.0})
- -- Create a sparse matrix ((9.0, 0.0), (0.0, 8.0), (0.0, 6.0))
- local sm = Matrices.sparse(3, 2, {0, 1, 3}, {0, 2, 1}, {9, 6, 8})
Add Comment
Please, Sign In to add comment