Question: CodeGeneration: procedure breaks rtable

Hi all,

I'm having a problem with CodeGeneration[C].

In my simple example that reproduces the problem, there's a procedure containing just a single rtable statement. The contents of the rtable are 6 formulae depending on a single variable, p.

When I stuff the procedure xpr_3 into CodeGeneration[C], strange things will happen. It appears to me that CodeGeneration[C] is omitting anything with the variable p in it. However xpr_3 can be evaluated the usual way.

I'm quite sure that the reason for this nuisance is the proc block around the rtable, since it's no problem to translate the rtable itself into C code.

I attached the simple test case.

 

Where's my mistake?

TIA

- Christoph

 

> xpr_3 := proc (p)
>     rtable(1 .. 6, {5 = 2*p, 2 = -3*p, 6 = 1666.666667, 3 = 6, 1 = 1e-3+4*p^2, 4 = 8*p^2}, datatype = anything, subtype = Vector[column], storage = rectangular, order = Fortran_order)
> end proc;
xpr_3 := proc(p)
  rtable(1 .. 6,
  {3 = 6, 6 = 1666.666667, 5 = 2*p, 2 = -3*p, 1 = 0.001 + 4*p^2, 4 = 8*p^2},
  datatype = anything, subtype = Vector[column], storage = rectangular,
  order = Fortran_order)
end proc;
> xpr_3(2);
                         [     16.001]
                         [           ]
                         [         -6]
                         [           ]
                         [          6]
                         [           ]
                         [         32]
                         [           ]
                         [          4]
                         [           ]
                         [1666.666667]
> CodeGeneration[C](xpr_3);
Error, (in IssueError) cannot recognize rtable initializer {3 = 6, 6 = 1666.666667, 5 = 2*, 2 = -3*, 4 = 8*^2, 1 = 0.1e-2+4*^2}
> CodeGeneration[C](rtable(1 .. 6, {5 = 2*p, 2 = -3*p, 6 = 1666.666667, 3 = 6, 1 = 1e-3+4*p^2, 4 = 8*p^2}, datatype = anything, subtype = Vector[column], storage = rectangular, order = Fortran_order));
cg0[0] = 0.1e-2 + (double) (4 * p * p);
cg0[1] = -3 * p;
cg0[2] = 6;
cg0[3] = 8 * p * p;
cg0[4] = 2 * p;
cg0[5] = 0.1666666667e4;

Please Wait...