Guest User

Untitled

a guest
Jan 16th, 2019
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. Matrices = require 'stuart-ml.linalg.Matrices'
  2.  
  3. -- Create a dense matrix ((1.0, 2.0), (3.0, 4.0), (5.0, 6.0))
  4. local dm = Matrices.dense(3, 2, {1.0, 3.0, 5.0, 2.0, 4.0, 6.0})
  5.  
  6. -- Create a sparse matrix ((9.0, 0.0), (0.0, 8.0), (0.0, 6.0))
  7. local sm = Matrices.sparse(3, 2, {0, 1, 3}, {0, 2, 1}, {9, 6, 8})
Add Comment
Please, Sign In to add comment