proj home

Files   Classes   Functions   Hierarchy  

probsysequ01 Class Reference

Test problem. More...

#include <probsysequ01.h>

Collaboration diagram for probsysequ01:

List of all members.

Public Member Functions

 probsysequ01 ()
 ~probsysequ01 ()
void operator() (double &fval)
 Evaluate the function to be minimized.
void partialderivative (double &val, uintc i, double const h)
 Numerically evaluate the partial derivative.

Public Attributes

uint counter
 Counts the number of times the function is evaluated.
double * xi


Detailed Description

Test problem.

Solve a 2D non linear simultaneous equation.

Definition at line 13 of file probsysequ01.h.


Constructor & Destructor Documentation

probsysequ01::probsysequ01 (  )  [inline]

Definition at line 22 of file probsysequ01.h.

00023     : counter(0), xi(new double[2]) {}

probsysequ01::~probsysequ01 (  )  [inline]

Definition at line 24 of file probsysequ01.h.

References xi.

00025     { delete[] xi; }


Member Function Documentation

void probsysequ01::operator() ( double &  fval  )  [inline]

Evaluate the function to be minimized.

Definition at line 29 of file probsysequ01.h.

References counter, and xi.

Referenced by partialderivative().

00032   {
00033     double t0 = xi[0]-0.1136*(xi[0]+3.0*xi[1])*(1.0-xi[0]);
00034     double t1 = xi[1]+7.5*(2.0*xi[0]-xi[1])*(1.0-xi[1]);
00035     fval = t0*t0 + t1*t1;
00036 //cout << SHOW(fval) << endl;
00037     ++counter;
00038   }

void probsysequ01::partialderivative ( double &  val,
uintc  i,
double const   h 
) [inline]

Numerically evaluate the partial derivative.

Definition at line 42 of file probsysequ01.h.

References operator()(), and xi.

Referenced by exploretest03().

00047   {
00048     assert(i<2);
00049     static double x2[2];
00050 
00051     //Save initial value.
00052     x2[i] = xi[i];
00053 
00054     xi[i] -= h*0.5;
00055     double f0;
00056     operator()(f0);
00057 
00058     double f1;
00059     xi[i] += h;
00060     operator()(f1);
00061 
00062     val = (f1-f0)/h;
00063 
00064     // Restore initial value.
00065     xi[i] = x2[i];
00066   };


Member Data Documentation

Counts the number of times the function is evaluated.

Definition at line 18 of file probsysequ01.h.

Referenced by explorepdtest02(), exploretest03(), minimizecomparetest01(), minimizecomparetest02(), operator()(), partialderivativetest01(), and test11().

Definition at line 20 of file probsysequ01.h.

Referenced by operator()(), partialderivative(), and ~probsysequ01().


The documentation for this class was generated from the following file:

Generated on Fri Mar 4 00:50:11 2011 for Chelton Evans Source by  doxygen 1.5.8