Question: local vectors and matrices within a procedure for use with codegeneration

Hi,

I am trying to ease my c coding work with the "CodeGeneration" tool in maple. The Idea to generate ready to use functions is quite thrilling.
In my attempts to generate code I entontert two problems.
First it seems to be impossible to assign local vectors to vectors passed in the argument list:

> MapX := proc (X\_out::Vector(2), X\_in::Vector(2), PRO2RO::Vector(2))
> local X\_t :: Vector(2,0), i;
> X\_t[1] := PRO2RO[1];
> X\_t[2] := PRO2RO[2]*10;
> X\_out := X\_in + X\_t;
> return;
> end proc;

here the assignment X\_out := X\_in + X\_t; is not recognized.
A for loop does the job for vectors but I am not too happy with that for matrices.

Second If I use the for loop it works fine within maple. The problem here is with the code generation tool. it seems to be unable to generate local arrays in C. The maple code
> local X\_t :: Vector(2,0), i;
causes the codegeneration error
"Error, (in IssueError) cannot analyze array/rtable arguments [0]"

any help appreciated
Mark


Please Wait...