Search All of the Math Forum:
Views expressed in these public forums are not endorsed by
Drexel University or The Math Forum.
|
|
|
|
Re: [mg4362] Re: c code generation
Posted:
Jul 19, 1996 2:49 AM
|
|
Mark Evans wrote:
>The whole point of using a tool like Mathematica is to avoid writing C >code.
Absolutely wrong!
You always endeavour to use the best tool, or the most convenient set of tools, for the job at hand.
If you have a good fast C program, then that should be able to be used ``in conjunction with'' Mathematica. Indeed Mathematica provides ways to do this.
Thus Mathematica can provide a nice `Front End' to the C code, displaying the result `as if' Mathematica had done it itself.
This is especially convenient for creating complicated graphics which require much computing to decide what to plot, or what colour to set for a each pixel, say. Many examples can be found in various books, and elsewhere.
> .... If you must do that, I recommend a standard reference like >Numerical Recipies in C. In any event, Mathematica does not generate C >code for you.
Nobody asks it to. ( Though doubtless it is flexible enough to do so, if you really wanted to devise a program to do this. )
Mathematica lets you ignore much of the visual/interface aspects of the code that you will find in this reference, allowing your C code to concentrate on the numerics (almost) exclusively.
>What you can do -- and what is very helpful -- is to check your own C >code against Mathematica output to verify its correctness.
Sure. But why the competitive connotations to this comment?
If I already have good C code, why rewrite it in Mathematica, when all I need do is `link to it', from Mathematica.
Regards,
Ross Moore
|
|
|
|