Array problems in Mathematica
- To: mathgroup at yoda.physics.unc.edu (Mathematica user group)
- Subject: Array problems in Mathematica
- From: Mark Sofroniou <M.Sofroniou at loughborough.ac.uk>
- Date: Tue, 11 Feb 92 14:33:49 GMT
Has anyone come accros the following? Firstly, applying N[] to an array also carries through to the arguments. i.e. N[2 a[1]] = 2. a[1.] and not 2. a[1] Is there a way to protect the arguments of an array from N[]? Secondly, using CForm on arrays gives the output in unappropriate form. i.e. CForm[a[1]] = a(1) and not a[1] Now try to write a C program splicing in output from Mathematica containing arrays and the compiler recognises a() as a function, not an array. Is there a way round this? I really can't understand the logic here, since both Mathematica and C use [] for array arguments, so why should CForm[] convert to ()? I would be most grateful if anyone has any suggestions. Thanks in advance Mark Sofroniou.