Matrix

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

Example.Quanty
M = {{1,2},{3,4}}
setmetatable(M, MatrixMeta)

Matrices can be created as a user data with the function Matrix.New

Example.Quanty
M = Matrix.New( {{1,2},{3,4}} )

Below you can find a list of possible functions and operations one can perform on matrices

Table of contents

Print/export