Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
documentation:language_reference:objects:matrix:start [2018/08/06 11:23] – created Simon Heinze | documentation:language_reference:objects:matrix:start [2024/12/12 14:07] (current) – Maurits W. Haverkort | ||
---|---|---|---|
Line 3: | Line 3: | ||
### | ### | ||
- | The object Matrix defines matrices, | + | The object Matrix defines matrices. Matrices in Lua can be defined as tables of tables, however Lua does not allow mathematical operations on tables. The Matrix object implements a set of functions and operations on tables of tables. We have two ways of storing matrices, either as a Lua table of tables, or as a user data object. The user data object stores the data as a consecutive array and is faster, especially if several matrix operations need to be preformed. In most cases one can use tables and user data matrices without the need to realise how the matrix is internally stored. |
### | ### | ||
+ | ### | ||
+ | Matrices can be created from tables of tables by setting the meta table of the table to MatrixMeta | ||
+ | <code Quanty Example.Quanty> | ||
+ | M = {{1, | ||
+ | setmetatable(M, | ||
+ | </ | ||
+ | Matrices can be created as a user data with the function Matrix.New | ||
+ | <code Quanty Example.Quanty> | ||
+ | M = Matrix.New( {{1, | ||
+ | </ | ||
+ | ### | ||
+ | |||
+ | ### | ||
+ | Below you can find a list of possible functions and operations one can perform on matrices | ||
+ | ### | ||
===== Table of contents ===== | ===== Table of contents ===== | ||
- | {{indexmenu> | + | {{indexmenu> |