I am suffering from a CCodeGenerate error when a variable is defined using subscripts.
A simplified reproduction code is shown below.
<< CCodeGenerator`
(* good *)
f = x^2+y^2
CCodeStringGenerate[Compile[{x, y}, Evaluate @ f], "test"]
(* bad *)
x0 = Subscript[x,0]
x1 = Subscript[x,1]
f = x0^2+x1^2
CCodeStringGenerate[Compile[{x0, x1}, Evaluate @ f], "test"]
The errors that occur are as follows.
CCodeGenerate::wmreq: The expression Function[{x0, x1}, x ] requires Mathematica to be evaluated. The function will be generated but can be expected to fail with a nonzero error code when executed.
0
Is there a mistake in my use of subscript?