00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef _math_optimize_steep_h
00029 #define _math_optimize_steep_h
00030
00031 #ifdef __GNUC__
00032 #pragma interface
00033 #endif
00034
00035 #include <util/state/state.h>
00036 #include <util/class/class.h>
00037 #include <math/scmat/matrix.h>
00038 #include <math/optimize/function.h>
00039 #include <math/optimize/opt.h>
00040
00041 namespace sc {
00042
00043 class SteepestDescentOpt: public Optimize {
00044 protected:
00045 double maxabs_gradient;
00046 double accuracy_;
00047
00048 Ref<LineOpt> lineopt_;
00049
00050 int take_newton_step_;
00051
00052 int print_x_;
00053 int print_gradient_;
00054
00055 public:
00056 SteepestDescentOpt(const Ref<KeyVal>&);
00057 SteepestDescentOpt(StateIn&);
00058 ~SteepestDescentOpt();
00059 void save_data_state(StateOut&);
00060
00061 void init();
00062 int update();
00063
00064 void print(std::ostream& = ExEnv::out0()) const;
00065 };
00066
00067 }
00068
00069 #endif
00070
00071
00072
00073
00074