proj home

Files   Classes   Functions   Hierarchy  

lineoptimizergoldtest.cpp

Go to the documentation of this file.
00001 #include <iostream>
00002 using namespace std;
00003 
00004 
00005 #include <probparab.h>
00006 #include <lineoptimizergold.h>
00007 // #includ <lineoptimizergold2.h>
00008 #include <lineoptimizerparabola.h>
00009 
00010 #include <lineoptimizergoldtest.h>
00011 #include <linepath_d1.h>
00012 
00013 void lineoptimizergoldtest01()
00014 {
00015   cout << "Testing the golden ratio line optimizer." << endl;
00016   //cout << "
00017 
00018   double d1[] = {0.0,1.0,1.0};
00019   double x0[] = {0.0,0.0,0.0};
00020   probparab2 fn;
00021   lineoptimizergold<probparab2&,double*,double*,double> 
00022     opt(3,fn,fn.xi,x0,d1);
00023 
00024   opt.reset(0.0,5.0);
00025   for (uint i=0; i<10; ++i)
00026   {
00027     ++opt;
00028     opt.printstate();
00029   }
00030 
00031   cout << SHOW(fn.counter) << endl;
00032 }
00033 
00034 /*
00035 void lineoptimizergoldtest02()
00036 {
00037   cout << "Testing the golden ratio line optimizer." << endl;
00038   //cout << "
00039 
00040   double d1[] = {0.0,1.0,1.0};
00041   double x0[] = {0.0,0.0,0.0};
00042   probparab2 fn;
00043   typedef linepath_d1< probparab2 & ,double*,double*,double> lpth;
00044   lineoptimizergold2< lpth ,double> 
00045     opt( lpth(3,fn,fn.xi,x0,d1) );
00046 
00047   opt.reset(0.0,5.0);
00048   for (uint i=0; i<10; ++i)
00049   {
00050     ++opt;
00051     opt.printstate();
00052   }
00053   cout << SHOW(fn.counter) << endl;
00054 }
00055 
00056 
00057 void lineoptimizergoldtest03()
00058 {
00059   cout << "Testing the golden ratio line optimizer." << endl;
00060   //cout << "
00061 
00062   double d1[] = {0.0,1.0,1.0};
00063   double x0[] = {0.0,0.0,0.0};
00064   probparab2 fn;
00065   typedef linepath_d1<probparab2&,double*,double*,double> lpth;
00066   lineoptimizerparabola<lpth,double> 
00067     opt( lpth(3,fn,fn.xi,x0,d1) );
00068 
00069   opt.reset(0.0,5.0);
00070   for (uint i=0; i<3; ++i)
00071   {
00072     ++opt;
00073     opt.printstate();
00074   }
00075   cout << SHOW(fn.counter) << endl;
00076 }
00077 
00078    
00079 void lineoptimizergoldtest04()
00080 {
00081 
00082 
00083 }
00084 
00085 */
00086 
00087 

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