30 #include "eo_matrix.h"
40 template <
class U,
class V>
friend class GenoPheno;
46 const double *ubounds,
56 void scale_to_internal(dVec &x,
62 void scale_to_f(
const dVec &x,
68 void remove_dimensions(
const std::vector<int> &k)
79 double _intmin = -std::numeric_limits<double>::max();
80 double _intmax = std::numeric_limits<double>::max();
87 template <
class U,
class V>
friend class GenoPheno;
91 :_scaling(dVec::Constant(1,1.0)),_shift(dVec::Zero(1)),_id(
true)
96 const double *ubounds,
100 compute_scaling(lbounds,ubounds,dim);
105 :_scaling(scaling),_shift(shift),_id(
false)
110 void compute_scaling(
const double *lbounds,
111 const double *ubounds,
114 dVec vlbounds = Eigen::Map<dVec>(
const_cast<double*
>(lbounds),dim);
115 dVec vubounds = Eigen::Map<dVec>(
const_cast<double*
>(ubounds),dim);
116 dVec denom = vubounds-vlbounds;
117 denom = denom.cwiseMin(std::numeric_limits<double>::max());
118 _scaling = (dVec::Constant(dim,
_intmax)-dVec::Constant(dim,
_intmin)).cwiseQuotient(denom);
119 _shift = dVec::Constant(dim,
_intmax) - _scaling.cwiseProduct(vubounds);
122 void scale_to_internal(dVec &x,
125 x = y.cwiseProduct(_scaling) + _shift;
128 void scale_to_f(
const dVec &x,
132 y = y.cwiseQuotient(_scaling);
135 bool is_id()
const {
return _id; }
137 void remove_dimensions(
const std::vector<int> &k)
141 removeElement(_scaling,i);
142 removeElement(_shift,i);
Holder of the set of evolving solutions from running an instance of CMA-ES.
Definition: cmasolutions.h:41
double _intmax
Definition: scaling.h:148
linear scaling of the parameter space to achieve similar sensitivity across all components.
Definition: acovarianceupdate.cc:25
Definition: genopheno.h:35
double _intmin
Definition: scaling.h:147