proj home

Files   Classes   Functions   Hierarchy  

partialderivativetest.cpp File Reference

#include <print.h>
#include <partialderivativetest.h>
#include <exploreh.h>
#include <probsysequ01.h>
#include <partialderivative.h>

Include dependency graph for partialderivativetest.cpp:

Go to the source code of this file.

Functions

void partialderivativetest01 ()


Function Documentation

void partialderivativetest01 (  ) 

Definition at line 12 of file partialderivativetest.cpp.

References partialderivative< EXP >::absvalue(), probsysequ01::counter, exploreh< FN, XI, T >::fn, exploreh< FN, XI, T >::print(), exploreh< FN, XI, T >::reset(), and SHOW.

Referenced by main().

00013 {
00014   cout << "This test is to solve a non-linear system of equations" << endl;
00015   cout << " numerically and terminate the approximation when the" << endl;
00016   cout << " parital derivatives become small." << endl;
00017   exploreh<probsysequ01,double*,double> g(2,0.2,50000);
00018 
00019   double x0[2] = { 0.5, 0.5 };
00020 
00021   g.reset(x0);
00022 
00023   g.print(cout);
00024 
00025   double zero = 1e-5;
00026   cout << "Iterate until the partial derivative are less than" << endl;
00027   cout << " " << zero << " in magnitude." << endl;
00028   bool valid=true;
00029 
00030   partialderivative< exploreh<probsysequ01,double*,double> > partiald(g);
00031 
00032   uintc kmax=30;
00033   for (uint i=0; valid; ++i)
00034   {
00035     for (uint k=0; k<kmax; ++k)
00036       ++g;
00037 
00038     partiald();
00039     if (zero > partiald.absvalue() )
00040       valid=false;
00041 
00042 cout << SHOW(i) << endl;
00043     //++g;
00044 
00045   }
00046 
00047   g.print(cout);
00048   cout << SHOW(g.fn.counter) << endl;
00049 
00050 }


Generated on Fri Mar 4 00:49:45 2011 for Chelton Evans Source by  doxygen 1.5.8