Experiment

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Experiment

Luigi Ballabio-4

Hi all,
        lately I've been looking at CWEB (from Don Knuth himself, freely available
at http://www-cs-faculty.stanford.edu/~knuth/cweb.html) which could be of
some use for example programs since it allows one to lay out more clearly
the structure of the tasks performed by the code.
As an experiment, I've converted to CWEB format the SwapValuation example.
The resulting CWEB file generates:
a) a C++ file equivalent to the example now in the distribution;
b) a TeX documentation file for the program.

I'm attaching the current version of swapvaluation.cpp and the PDF file
resulting from compiling the TeX file.
In your opinion, which one (the code or the PDF) outlines more clearly what
to do in order to price a swap? Which one do you find easier to read? In
short, which one do you like better as a tutorial/example?

Thanks,
        Luigi

swapvaluation.pdf (344K) Download Attachment
swapvaluation.cpp (27K) Download Attachment