libcmaes 0.10.2
A C++11 library for stochastic optimization with CMA-ES
Loading...
Searching...
No Matches
libcmaes::Candidate Class Reference

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

#include <libcmaes/candidate.h>

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

Public Member Functions

 Candidate ()
 empty constructor.
 
 Candidate (const double &fvalue, const dVec &x)
 constructor.
 
void set_fvalue (const double &fval)
 set candidate's function value.
 
double get_fvalue () const
 get function value of this candidate.
 
void set_x (const dVec &x)
 sets parameter vector of this candidate.
 
dVec get_x_dvec () const
 get parameter vector of this candidate in Eigen vector format.
 
dVec & get_x_dvec_ref ()
 get reference parameter vector of this candidate in Eigen vector format.
 
const doubleget_x_ptr () const
 get parameter vector pointer of this candidate as array. DO NOT USE from temporary candidate object.
 
std::vector< doubleget_x () const
 get parameter vector copy for this candidate.
 
unsigned int get_x_size () const
 get x vector size
 
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.
 
void set_id (const int &id)
 set candidate id
 
int get_id () const
 get candidate id
 
void set_rank (const int &r)
 set candidate rank
 
int get_rank () const
 get candidate rank
 

Protected Attributes

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

Detailed Description

candidate solution point, in function parameter space.

Constructor & Destructor Documentation

◆ Candidate()

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

constructor.

Parameters
fvaluefunction value
xfunction parameter vector

Member Function Documentation

◆ get_fvalue()

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

get function value of this candidate.

Returns
function value

◆ get_id()

int libcmaes::Candidate::get_id ( ) const
inline

get candidate id

Returns
candidate id

◆ get_rank()

int libcmaes::Candidate::get_rank ( ) const
inline

get candidate rank

Returns
candidate rank

◆ get_x()

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

get parameter vector copy for this candidate.

Returns
parameter vector copy

◆ get_x_dvec()

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

◆ get_x_dvec_ref()

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

◆ get_x_pheno_dvec()

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

◆ get_x_ptr()

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

◆ get_x_size()

unsigned int libcmaes::Candidate::get_x_size ( ) const
inline

get x vector size

Returns
x vector size

◆ set_fvalue()

void libcmaes::Candidate::set_fvalue ( const double fval)
inline

set candidate's function value.

Parameters
fvalfunction value

◆ set_id()

void libcmaes::Candidate::set_id ( const int id)
inline

set candidate id

Parameters
idcandidate id

◆ set_rank()

void libcmaes::Candidate::set_rank ( const int r)
inline

set candidate rank

Parameters
rcandidate rank

◆ set_x()

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

sets parameter vector of this candidate.

Parameters
xparameter vector

Member Data Documentation

◆ _fvalue

double libcmaes::Candidate::_fvalue
protected

function value.

◆ _id

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

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

◆ _r

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

candidate rank.

◆ _x

dVec libcmaes::Candidate::_x
protected

function parameter vector.


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