libcmaes
A C++11 library for stochastic optimization with CMA-ES
 All Classes Namespaces Functions Variables Typedefs
Public Member Functions | Protected Attributes | List of all members
libcmaes::Candidate Class Reference

candidate solution point, in function parameter space. More...

#include <candidate.h>

Inheritance diagram for libcmaes::Candidate:
libcmaes::RankedCandidate

Public Member Functions

 Candidate ()
 empty constructor.
 
 Candidate (const double &fvalue, const dVec &x)
 constructor. More...
 
void set_fvalue (const double &fval)
 set candidate's function value. More...
 
double get_fvalue () const
 get function value of this candidate. More...
 
void set_x (const dVec &x)
 sets parameter vector of this candidate. More...
 
dVec get_x_dvec () const
 get parameter vector of this candidate in Eigen vector format. More...
 
dVec & get_x_dvec_ref ()
 get reference parameter vector of this candidate in Eigen vector format. More...
 
const double * get_x_ptr () const
 get parameter vector pointer of this candidate as array. DO NOT USE from temporary candidate object. More...
 
std::vector< double > get_x () const
 get parameter vector copy for this candidate. More...
 
unsigned int get_x_size () const
 get x vector size More...
 
template<class TGenoPheno >
dVec get_x_pheno_dvec (const CMAParameters< TGenoPheno > &p) const
 get pheno transform of parameter vector of this candidate in Eigen vector format. More...
 
void set_id (const int &id)
 set candidate id More...
 
int get_id () const
 get candidate id More...
 
void set_rank (const int &r)
 set candidate rank More...
 
int get_rank () const
 get candidate rank More...
 

Protected Attributes

double _fvalue
 
dVec _x
 
int _id = -1
 
int _r = -1
 

Detailed Description

candidate solution point, in function parameter space.

Constructor & Destructor Documentation

libcmaes::Candidate::Candidate ( const double &  fvalue,
const dVec &  x 
)
inline

constructor.

Parameters
fvaluefunction value
xfunction parameter vector

Member Function Documentation

double libcmaes::Candidate::get_fvalue ( ) const
inline

get function value of this candidate.

Returns
function value
int libcmaes::Candidate::get_id ( ) const
inline

get candidate id

Returns
candidate id
int libcmaes::Candidate::get_rank ( ) const
inline

get candidate rank

Returns
candidate rank
std::vector<double> libcmaes::Candidate::get_x ( ) const
inline

get parameter vector copy for this candidate.

Returns
parameter vector copy
dVec libcmaes::Candidate::get_x_dvec ( ) const
inline

get parameter vector of this candidate in Eigen vector format.

Returns
parameter vector in Eigen vector format
dVec& libcmaes::Candidate::get_x_dvec_ref ( )
inline

get reference parameter vector of this candidate in Eigen vector format.

Returns
reference to parameter vector in Eigen vector format
template<class TGenoPheno >
dVec libcmaes::Candidate::get_x_pheno_dvec ( const CMAParameters< TGenoPheno > &  p) const
inline

get pheno transform of parameter vector of this candidate in Eigen vector format.

Returns
pheno transform of parameter vector in Eigen vector format
const double* libcmaes::Candidate::get_x_ptr ( ) const
inline

get parameter vector pointer of this candidate as array. DO NOT USE from temporary candidate object.

Returns
parameter vector pointer
unsigned int libcmaes::Candidate::get_x_size ( ) const
inline

get x vector size

Returns
x vector size
void libcmaes::Candidate::set_fvalue ( const double &  fval)
inline

set candidate's function value.

Parameters
fvalfunction value
void libcmaes::Candidate::set_id ( const int &  id)
inline

set candidate id

Parameters
idcandidate id
void libcmaes::Candidate::set_rank ( const int &  r)
inline

set candidate rank

Parameters
rcandidate rank
void libcmaes::Candidate::set_x ( const dVec &  x)
inline

sets parameter vector of this candidate.

Parameters
xparameter vector

Member Data Documentation

double libcmaes::Candidate::_fvalue
protected

function value.

int libcmaes::Candidate::_id = -1
protected

candidate id, used for identification after ranking, when needed.

int libcmaes::Candidate::_r = -1
protected

candidate rank.

dVec libcmaes::Candidate::_x
protected

function parameter vector.


The documentation for this class was generated from the following file: