24#ifndef HYBRIDSIMULATEDANNEALINGFUNCTORS_H
25#define HYBRIDSIMULATEDANNEALINGFUNCTORS_H
52 for (
Size i = 0; i < currentPoint.
size(); i++)
73 for (
Size i = 0; i < currentPoint.
size(); i++)
98 for (
Size i = 0; i < currentPoint.
size(); i++){
100 while(newPoint[i] <
lower_[i] || newPoint[i] >
upper_[i]){
101 if(newPoint[i] <
lower_[i]){
132 for (
Size i = 0; i < currentPoint.
size(); i++){
134 while(newPoint[i] <
lower_[i] || newPoint[i] >
upper_[i]){
135 if(newPoint[i] <
lower_[i]){
164 for (
Size i = 0; i < currentPoint.
size(); i++)
190 for (
Size i = 0; i < currentPoint.
size(); i++) {
191 newPoint[i] =
lower_[i] - 1.0;
192 while (newPoint[i] <
lower_[i] || newPoint[i] >
upper_[i]) {
194 Real sign =
static_cast<int>(0.5 < draw) -
static_cast<int>(draw < 0.5);
195 Real y = sign*temp[i] * (std::pow(1.0 + 1.0 / temp[i],
196 std::abs(2 * draw - 1.0)) - 1.0);
214 return currentValue > newValue;
228 Real temperature = *std::max_element(temp.
begin(), temp.
end());
245 if (newValue < currentValue)
247 Real mTemperature = *std::max_element(temp.
begin(), temp.
end());
347 Real aCurrentValue,
const Array & currTemp) {};
363 Real stepSize = 1e-7,
364 Real minSize = 1e-10,
365 Real functionTol = 1e-10)
373 for (
Size i = 0; i <
N_; i++) {
380 Real currentValue,
const Array & currTemp) {
385 Real finiteDiffMax = 0.0;
386 Array ofssetPoint(currentPoint);
387 for (
Size i = 0; i <
N_; i++) {
393 if (finiteDiffs[i] > finiteDiffMax)
394 finiteDiffMax = finiteDiffs[i];
396 for (
Size i = 0; i <
N_; i++) {
398 Real sRatio = finiteDiffMax / finiteDiffs[i];
403 steps[i] = std::pow(std::fabs(std::log(sRatio*tRatio)),
1-D array used in linear algebra.
1-D array used in linear algebra.
bool empty() const
whether the array is empty
const_iterator end() const
Size size() const
dimension of the array
const_iterator begin() const
Boltzmann Downhill Probability.
std::uniform_real_distribution< Real > distribution_
bool operator()(Real currentValue, Real newValue, const Array &temp)
ProbabilityBoltzmannDownhill(unsigned long seed=SeedGenerator::instance().get())
std::uniform_real_distribution< Real > distribution_
bool operator()(Real currentValue, Real newValue, const Array &temp)
ProbabilityBoltzmann(unsigned long seed=SeedGenerator::instance().get())
Constrained optimization problem.
Real value(const Array &x)
call cost function computation and increment evaluation counter
Reannealing Finite Difference.
ReannealingFiniteDifferences(Real initialTemp, Size dimension, const Array &lower=Array(), const Array &upper=Array(), Real stepSize=1e-7, Real minSize=1e-10, Real functionTol=1e-10)
void operator()(Array &steps, const Array ¤tPoint, Real currentValue, const Array &currTemp)
void setProblem(Problem &P)
SamplerCauchy(unsigned long seed=SeedGenerator::instance().get())
void operator()(Array &newPoint, const Array ¤tPoint, const Array &temp)
std::cauchy_distribution< Real > distribution_
std::normal_distribution< Real > distribution_
void operator()(Array &newPoint, const Array ¤tPoint, const Array &temp)
SamplerGaussian(unsigned long seed=SeedGenerator::instance().get())
SamplerLogNormal(unsigned long seed=SeedGenerator::instance().get())
std::normal_distribution< Real > distribution_
void operator()(Array &newPoint, const Array ¤tPoint, const Array &temp)
SamplerMirrorGaussian(Array lower, Array upper, unsigned long seed=SeedGenerator::instance().get())
std::normal_distribution< Real > distribution_
void operator()(Array &newPoint, const Array ¤tPoint, const Array &temp)
std::normal_distribution< Real > distribution_
SamplerRingGaussian(Array lower, Array upper, unsigned long seed=SeedGenerator::instance().get())
void operator()(Array &newPoint, const Array ¤tPoint, const Array &temp)
Very Fast Annealing Sampler.
std::uniform_real_distribution< Real > distribution_
SamplerVeryFastAnnealing(Array lower, Array upper, unsigned long seed=SeedGenerator::instance().get())
void operator()(Array &newPoint, const Array ¤tPoint, const Array &temp)
static SeedGenerator & instance()
access to the unique instance
void operator()(Array &newTemp, const Array &currTemp, const Array &steps)
TemperatureBoltzmann(Real initialTemp, Size dimension)
void operator()(Array &newTemp, const Array &currTemp, const Array &steps)
TemperatureCauchy1D(Real initialTemp, Size dimension)
void operator()(Array &newTemp, const Array &currTemp, const Array &steps)
TemperatureCauchy(Real initialTemp, Size dimension)
void operator()(Array &newTemp, const Array &currTemp, const Array &steps)
TemperatureExponential(Real initialTemp, Size dimension, Real power=0.95)
Temperature Very Fast Annealing.
void operator()(Array &newTemp, const Array &currTemp, const Array &steps)
TemperatureVeryFastAnnealing(Real initialTemp, Real finalTemp, Real maxSteps, Size dimension)
#define QL_REQUIRE(condition, message)
throw an error if the given pre-condition is not verified
QL_INTEGER Integer
integer number
std::size_t Size
size of a container
Abstract optimization problem class.
Always Downhill Probability.
bool operator()(Real currentValue, Real newValue, const Array &temp)
void operator()(Array &steps, const Array ¤tPoint, Real aCurrentValue, const Array &currTemp)
ReannealingTrivial()=default
void setProblem(Problem &P)