std::vector<double> LunacekBiRastriginFunction<T>::serialise() const noexcept { std::vector<double> serialisedOptimisationProblem = BlackBoxOptimisationBenchmark<T, T>::serialise(); for(std::size_t n = 0; n < rotationQ_.n_elem; ++n) { serialisedOptimisationProblem.push_back(static_cast<double>(rotationQ_(n))); } return serialisedOptimisationProblem; }
std::vector<double> AttractiveSectorFunction::serialise() const { std::vector<double> serialisedOptimisationProblem = BlackBoxOptimisationBenchmark::serialise(); for (arma::uword n = 0; n < rotationQ_.n_elem; ++n) { serialisedOptimisationProblem.push_back(rotationQ_(n)); } return serialisedOptimisationProblem; }
void LunacekBiRastriginFunction<T>::deserialise( const std::vector<double>& serialisedOptimisationProblem) { rotationQ_.set_size(this->numberOfDimensions_, this->numberOfDimensions_); for(std::size_t n = 0; n < rotationQ_.n_elem; ++n) { rotationQ_(n) = static_cast<T>(serialisedOptimisationProblem.pop_back()); } BlackBoxOptimisationBenchmark<T, T>::deserialise(serialisedOptimisationProblem); }
void AttractiveSectorFunction::deserialise( std::vector<double> serialisedOptimisationProblem) { rotationQ_.set_size(numberOfDimensions_, numberOfDimensions_); for (arma::uword n = 0; n < rotationQ_.n_elem; ++n) { rotationQ_(n) = serialisedOptimisationProblem.back(); serialisedOptimisationProblem.pop_back(); } BlackBoxOptimisationBenchmark::deserialise(serialisedOptimisationProblem); }
std::vector<double> GallaghersGaussian101mePeaksFunction::serialise() const { std::vector<double> serialisedOptimisationProblem = BlackBoxOptimisationBenchmark::serialise(); for (arma::uword n = 0; n < rotationQ_.n_elem; ++n) { serialisedOptimisationProblem.push_back(rotationQ_(n)); } for (arma::uword n = 0; n < localParameterConditionings_.n_elem; ++n) { serialisedOptimisationProblem.push_back(localParameterConditionings_(n)); } for (arma::uword n = 0; n < localParameterTranslations_.n_elem; ++n) { serialisedOptimisationProblem.push_back(localParameterTranslations_(n)); } return serialisedOptimisationProblem; }
std::vector<double> GallaghersGaussian21hiPeaksFunction<T>::serialise() const noexcept { std::vector<double> serialisedOptimisationProblem = BlackBoxOptimisationBenchmark<T, T>::serialise(); for(std::size_t n = 0; n < rotationQ_.n_elem; ++n) { serialisedOptimisationProblem.push_back(static_cast<double>(rotationQ_(n))); } for(std::size_t n = 0; n < localParameterConditionings_.n_elem; ++n) { serialisedOptimisationProblem.push_back(static_cast<double>(localParameterConditionings_(n))); } for(std::size_t n = 0; n < localParameterTranslations_.n_elem; ++n) { serialisedOptimisationProblem.push_back(static_cast<double>(localParameterTranslations_(n))); } return serialisedOptimisationProblem; }
void GallaghersGaussian21hiPeaksFunction<T>::deserialise( const std::vector<double>& serialisedOptimisationProblem) { rotationQ_.set_size(this->numberOfDimensions_, this->numberOfDimensions_); for(std::size_t n = 0; n < rotationQ_.n_elem; ++n) { rotationQ_(n) = static_cast<T>(serialisedOptimisationProblem.pop_back()); } localParameterConditionings_.set_size(this->numberOfDimensions_, 21); for(std::size_t n = 0; n < localParameterConditionings_.n_elem; ++n) { localParameterConditionings_(n) = static_cast<T>(serialisedOptimisationProblem.pop_back()); } localParameterTranslations_.set_size(this->numberOfDimensions_, 21); for(std::size_t n = 0; n < localParameterTranslations_.n_elem; ++n) { localParameterTranslations_(n) = static_cast<T>(serialisedOptimisationProblem.pop_back()); } BlackBoxOptimisationBenchmark<T, T>::deserialise(serialisedOptimisationProblem); }
void GallaghersGaussian101mePeaksFunction::deserialise( std::vector<double> serialisedOptimisationProblem) { localParameterTranslations_.set_size(numberOfDimensions_, 21); for (arma::uword n = 0; n < localParameterTranslations_.n_elem; ++n) { localParameterTranslations_(n) = serialisedOptimisationProblem.back(); serialisedOptimisationProblem.pop_back(); } localParameterConditionings_.set_size(numberOfDimensions_, 21); for (arma::uword n = 0; n < localParameterConditionings_.n_elem; ++n) { localParameterConditionings_(n) = serialisedOptimisationProblem.back(); serialisedOptimisationProblem.pop_back(); } rotationQ_.set_size(numberOfDimensions_, numberOfDimensions_); for (arma::uword n = 0; n < rotationQ_.n_elem; ++n) { rotationQ_(n) = serialisedOptimisationProblem.back(); serialisedOptimisationProblem.pop_back(); } BlackBoxOptimisationBenchmark::deserialise(serialisedOptimisationProblem); }