/*------------------------------------------------------------------------- | The software accompanies the paper | | | | Classes and Objects of Chemical Thermodynamics in Object-Oriented | | Programming. 2. A Class of Chemical Species | | | | E.B. Rudnyi | | E-mail: rudnyi@comp.chem.msu.su | | Homepages: http://www.chem.msu.su/~rudnyi/welcome.html | | | | presented at Second Electronic Computational Chemistry Conference, | | November 1995, http://hackberry.chem.niu.edu/ECCC2/ | --------------------------------------------------------------------------*/ #include #include #include "function.h" #include "memtst.h" void print_function(function& t) { if (t) cout << "function is " << endl << t << endl << "current errno " << t.errno << ", number of characters " << t.len() << endl << "number of simple functions is " << t.nfunc() << endl << endl; else cout << "function is not determined" << endl << endl; } int main() { memory test; ifstream in("functn2.dat"); function a, b, c; in >> a >> b >> c; print_function(a); print_function(b); print_function(c); cout << "press RETURN to continue" << endl; cin.get(); cout << endl; function d = a + b*c; print_function(d); for (global::p = 1.; global::p < 10.; global::p += 4.) { cout << "press RETURN to continue" << endl; cin.get(); cout << endl; for (global::T = 1.; global::T < 8.; global::T += 1.) cout << setw(10) << global::T << setw(10) << global::p << setw(13) << a() << setw(13) << b() << setw(13) << c() << setw(13) << d() << endl; } return 0; }