Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
documentation:language_reference:objects:matrix:start [2018/08/06 11:23] – created Simon Heinzedocumentation:language_reference:objects:matrix:start [2024/12/12 14:07] (current) Maurits W. Haverkort
Line 3: Line 3:
  
 ### ###
-The object Matrix defines matrices, i.eTables of Tables.+The object Matrix defines matrices. Matrices in Lua can be defined as tables of tableshowever Lua does not allow mathematical operations on tablesThe Matrix object implements a set of functions and operations on tables of tablesWe 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,2},{3,4}}
 +setmetatable(M, MatrixMeta)
 +</code>
 +Matrices can be created as a user data with the function Matrix.New
 +<code Quanty Example.Quanty>
 +M = Matrix.New( {{1,2},{3,4}} )
 +</code>
 +###
 +
 +###
 +Below you can find a list of possible functions and operations one can perform on matrices
 +###
  
 ===== Table of contents ===== ===== Table of contents =====
-{{indexmenu>.#1|msort}}+{{indexmenu>.#2|tsort}}
  
Print/export