Go to the documentation of this file.00001 #ifndef rgrl_converge_status_h_
00002 #define rgrl_converge_status_h_
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #include "rgrl_object.h"
00016
00017
00018
00019 class rgrl_converge_status
00020 : public rgrl_object
00021 {
00022 public:
00023
00024 enum converge_type { conv_on_going, converged, stagnated };
00025
00026 enum status_type { status_on_going, good_enough, failed, good_and_terminate };
00027
00028
00029 rgrl_converge_status( );
00030
00031
00032 rgrl_converge_status( converge_type conv,
00033 status_type stat,
00034 double error,
00035 unsigned osc_count,
00036 double error_diff );
00037
00038
00039
00040 rgrl_converge_status( bool has_converged,
00041 bool has_stagnated,
00042 bool is_good_enough,
00043 bool in_is_failed,
00044 double error,
00045 unsigned oscillation_count,
00046 double error_diff );
00047
00048 virtual ~rgrl_converge_status();
00049
00050
00051
00052
00053 bool has_converged() const;
00054
00055
00056
00057
00058 bool has_stagnated() const;
00059
00060
00061
00062 bool is_good_enough() const;
00063
00064
00065
00066 bool is_failed() const;
00067
00068
00069
00070 bool is_good_and_should_terminate() const;
00071
00072
00073 converge_type current_converge() const;
00074
00075
00076 status_type current_status() const;
00077
00078
00079 void set_current_converge( converge_type c );
00080
00081
00082 void set_current_status( status_type s );
00083
00084
00085 void set_objective_value( double obj );
00086
00087
00088
00089
00090
00091 double objective_value() const;
00092
00093
00094
00095 double error() const;
00096
00097
00098
00099 double error_diff() const;
00100
00101
00102
00103 unsigned int oscillation_count() const;
00104
00105
00106 rgrl_type_macro( rgrl_converge_status, rgrl_object );
00107
00108 protected:
00109 converge_type conv_;
00110 status_type status_;
00111 double error_;
00112 unsigned oscillation_count_;
00113 double error_diff_;
00114 };
00115
00116 #endif // rgrl_converge_status_h_