subgradopt.h

Go to the documentation of this file.
00001 // Copyright (C) 2006 Ivo Nowak and Stefan Vigerske
00002 // All Rights Reserved.
00003 // This code is published under the Common Public License.
00004 //
00005 // Author: Hernan Alperin, Stefan Vigerske
00006 
00007 #ifndef SUBGRADOPT_H
00008 #define SUBGRADOPT_H
00009 
00010 #include "standard.h"
00011 #include "opt.h"
00012 #include "func.h"
00013 #include "param.h"
00014 
00017 class SubGradOpt : public DualSolver {
00018   private:
00021     int LineSearch;
00022 
00023     double start_beta;
00024     double elasticity;
00025 
00028     dvector d_old;
00031     bool ConjGrad;
00032 
00033   public:
00041     SubGradOpt(DualFunc& f, vector<double> lower_bound_, Param& param_, Pointer<ostream> out_solver_p_=out_out_p, Pointer<ostream> out_solver_log_p_=out_log_p)
00042     : DualSolver(f, lower_bound_, param_, out_solver_p_, out_solver_log_p_),
00043       d_old(f.dim()),
00044       ConjGrad(param.get_i("Conjugate Gradient", 0)),
00045       LineSearch(param.get_i("Line Search", 0)),
00046       start_beta(param.get_d("start beta", 1.)),
00047       elasticity(param.get_d("elasticity", 4.))
00048     { iter_max=param.get_i("SubGradOpt max iter",100);
00049         tol=param.get_d("SubGradOpt tol", 0.001);
00050     }
00051 
00052     int solve(dvector& z) {
00053       sol_point=z;
00054       return solve();
00055     }
00056 
00057     int solve();
00058 
00059 };
00060 
00061 
00062 class Random : public DualSolver {
00063   private:
00064     double dispersion;
00065 
00066   public:
00074     Random(DualFunc& f, vector<double> lower_bound_, Param& param_, Pointer<ostream> out_solver_p_=out_out_p, Pointer<ostream> out_solver_log_p_=out_log_p)
00075     : DualSolver(f, lower_bound_, param_, out_solver_p_, out_solver_log_p_),
00076       dispersion(param_.get_d("dispersion", 1.))
00077       { iter_max=param_.get_i("Random max iter",1);
00078       }
00079     
00080     int solve(dvector& z) {
00081       sol_point=z;
00082       return solve();
00083     }
00084 
00085     int solve();
00086 
00087 };
00088 
00089 #endif

Generated on Tue Oct 21 03:12:10 2008 for LaGO by  doxygen 1.4.7