Files Classes Functions Hierarchy
Go to the source code of this file.
Functions | |
| void | powelltest01 (int argc, char **argv) |
| void | powelltest02 (int argc, char **argv) |
| void powelltest01 | ( | int | argc, | |
| char ** | argv | |||
| ) |
Definition at line 26 of file powelltest.cpp.
00027 { 00028 /* 00029 00030 cout << "explore and golden ratio line search" << endl; 00031 cout << " k=3 lineiter=10 are defaults." << endl; 00032 00033 typedef exploreh<probsysequ01,double*,double> exp2; 00034 typedef linepathd1< probsysequ01,double*,double*,double > lnpath; 00035 typedef lineoptimizergold2< lnpath, double > lnmin; 00036 00037 00038 commandline cmd(argc,argv); 00039 uint lineiter(10); 00040 cmd.mapvar(lineiter,"lineiter"); 00041 uint k(3); 00042 cmd.mapvar(k,"k"); 00043 00044 powell02< exp2, lnmin > w(2,lineiter,h0step); 00045 00046 cmd.mapvar(w.linet0,"t0"); 00047 cmd.mapvar(w.linet1,"t1"); 00048 00049 cout << SHOW( w.exp.fn.counter) << endl; 00050 00051 double x0[2] = { 0.5, 0.5 }; 00052 w.reset(x0); 00053 00054 00055 cout << SHOW( w.exp.fn.counter) << endl; 00056 00057 for (uint i=0; i<k; ++i) 00058 { 00059 //cout << printvecfunc(w.xi,2) << endl; 00060 //cout << SHOW(w.exp.fmin) << endl; 00061 ++w; 00062 // cout << SHOW(w.fn.counter) << endl; 00063 } 00064 00065 double * xi = w.xi0[0]; 00066 00067 long double y0((long double)0.2); 00068 long double y1((long double)2.0/(long double)3.0); 00069 long double dist = (y0-xi[0])*(y0-xi[0]) + (y1-xi[1])*(y1-xi[1]); 00070 00071 cout << "Compare with true solution" << endl; 00072 cout << "fn count, k, lineiter, distance" << endl; 00073 cout << w.exp.fn.counter << " "; 00074 cout << k << " "; 00075 cout << lineiter << " "; 00076 cout << scientific << dist << endl; 00077 cout << SHOW(w.exp.fmin) << endl; 00078 */ 00079 00080 }
| void powelltest02 | ( | int | argc, | |
| char ** | argv | |||
| ) |
1.5.8