functionalObjects.h allows the C++ programmer performing common calculations to use a more symbolic syntax rather than an algorithmic syntax. This is not as ambitious as a symbolic manipulation program such as Mathematica; it is more like having the ability to drop a very simple Mathematica statement into a C++ program. For example, a program to compute the integral of x*y, where the x integral runs from 0 to y and the
y integral runs from 0 to 1, is written:
#include <stl. #include "functionalObjects.h"
functionalObjectGlobals theGlobals;
main()
{char* x = "x";
char* y = "y";
theGlobals.registerArgument(x);
theGlobals.registerArgument(y);
cout << "Integral: " Evaluate(Integrate(y, 0.0, 1.0,
Multiply(y, Integrate(x, 0.0, y, x)))) << endl; }


Back to Program

Back to ACAT Web page