Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| documentation:language_reference:objects:matrix:functions:touserdata [2019/04/12 10:22] – Corrected my grammar Simon Heinze | documentation:language_reference:objects:matrix:functions:touserdata [2025/11/20 04:20] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| {{indexmenu_n> | {{indexmenu_n> | ||
| - | ====== ToUserdata ====== | + | ====== |
| ### | ### | ||
| Line 15: | Line 15: | ||
| <code Quanty Example.Quanty> | <code Quanty Example.Quanty> | ||
| --This creates a table of tables | --This creates a table of tables | ||
| - | A = Matrix.Random({-2, | + | A = Matrix.Random({-2, |
| - | setmetatable(A, MatrixMeta) | + | |
| TimeStart(" | TimeStart(" | ||
| B = Matrix.Transpose(A) | B = Matrix.Transpose(A) | ||
| Line 25: | Line 24: | ||
| print(B[1][1]) | print(B[1][1]) | ||
| TimeEnd(" | TimeEnd(" | ||
| + | |||
| AUData = Matrix.ToUserdata(A) | AUData = Matrix.ToUserdata(A) | ||
| - | --A is, after this point, no longer needed. | + | |
| - | A = nil | + | |
| - | B = nil | + | |
| - | collectgarbage() | + | |
| TimeStart(" | TimeStart(" | ||
| B = Matrix.Transpose(AUData) | B = Matrix.Transpose(AUData) | ||
| Line 37: | Line 32: | ||
| B = Matrix.ConjugateTranspose(B) | B = Matrix.ConjugateTranspose(B) | ||
| B = B - AUData | B = B - AUData | ||
| - | --In case we want to access the first element. | ||
| - | B = Matrix.ToTable(B) | ||
| print(B[1][1]) | print(B[1][1]) | ||
| TimeEnd(" | TimeEnd(" | ||
| + | |||
| TimePrint() | TimePrint() | ||
| </ | </ | ||
| Line 56: | Line 49: | ||
| ===== Table of contents ===== | ===== Table of contents ===== | ||
| - | {{indexmenu> | + | {{indexmenu> |