EvolvingObjects
CMAState.h
00001 /*
00002  * C++ification of Nikolaus Hansen's original C-source code for the
00003  * CMA-ES.
00004  *
00005  * Copyright (C) 1996, 2003, Nikolaus Hansen
00006  *           (C) 2005, Maarten Keijzer
00007  *
00008  * License: LGPL (see source file)
00009  *
00010  */
00011 
00012 #ifndef CMASTATE_H_
00013 #define CMASTATE_H_
00014 
00015 #include <vector>
00016 #include <valarray>
00017 
00018 namespace eo {
00019 
00020 
00021 class CMAStateImpl;
00022 class CMAParams;
00023 class CMAState {
00024 
00025     CMAStateImpl* pimpl; /* pointer to implementation, hidden in source file */
00026 
00027     public:
00028 
00029     CMAState(const CMAParams&, const std::vector<double>& initial_point, const double initial_sigma = 1.0);
00030     ~CMAState();
00031     CMAState(const CMAState&);
00032     CMAState& operator=(const CMAState&);
00033 
00050     void sample(std::vector<double>& v) const;
00051 
00062     void reestimate(const std::vector<const std::vector<double>* >& sorted_population, double muBest, double muWorst);
00063 
00073     bool updateEigenSystem(unsigned max_tries = 1, unsigned max_iters = 0);
00074 };
00075 
00076 } // namespace eo
00077 
00078 #endif
 All Classes Namespaces Files Functions Variables Typedefs Friends