Question: Tables as datatype for efficient maple code

Hi all,

I wonder if it makes sense to use tables as datatype for efficient maple code. I need this datatype to pass parameters to a procedure which is called many times.

In particular, I have the following criteria:

* efficient (fast) to access for read and write.

* potentially thread save ( I can also imagine having individual copies for each thread)

* present in future Maple versions

* easy to transform into C-code later

I am thinking of something similar to structures in C which I can imagine to realize with tables:

mytable['field1']:=1;

mytable['field2']:=2;

myprocedure:=proc(tab::table)

  result:=Pi*tab['field1']+tab['field2'];

end proc:

which is similar to 

mytable->field1=1;

mytable->field2=2;

double myprocedure(struct table *tab)

{

 double result;

  result=Pi*tab->field1+tab->field2;

}

As structures the datatype should allow for fields of various type. But are tables efficient enough for this task or can I run into problems?

Thanks in advance!

Please Wait...