lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Well, I had a similar problem in my application and what I did was to create a Matrix c++ object that I exported to Lua. So you could do something like:

matrix = getMatrix("name");
objs = matrix:getObjectsByType("type");

for example. I don't have here the code I've made but tell if it is something like this that you want that I'll send it to you tomorrow.

José Tavares

On 2/4/07, Darius Blaszijk <dhkblaszyk@zeelandnet.nl> wrote:
In my application I have a matrix of data for which I want to use Lua to
manipulate it. I'm planning to implement filtering functions, statistical
functions and the like.
What I'm still struggeling with though is how to represent the data in Lua.
Currently I'm planning to keep the data in my app and provide getters and
setters for the data. I'm finding difficulties though to find a proper
description of it in the PIL or refman. But afair there should be a
possibility to do it.

So what I want to be able to do is:

data[1,2] = 1.234
print(data[1,2])  -- returns 1.234

Can someone point me to the right resources so I can start reading and
testing myself? Or perhaps someone can give me a hint.

TIA Darius




--
Believe nothing, no matter where you read it, or who said it,
no matter if I have said it, unless it agrees with your own reason
and your common sense.
- Buda

Para quê ter olhos azuis, se a Natureza deixa os meus  vermelhos?
- Bob Marley

"Don't try to use what you learn from Buddhism to be a Buddhist;
use it to be a better whatever-you-already-are."
- His Holiness the 14th Dalai Lama

Idealism is what precedes experience; cynicism is what follows.
  - David T. Wolf

"Please don't download, because I want to get a pool in my second home."
  - Kanye West