100 void configure(
const std::vector<double>& min,
const std::vector<double>& max,
const std::vector<size_t>& sections)
102 size_t params = min.size();
108 for (
size_t dimension = 0; dimension < params; dimension++)
110 size_t numSections = sections[dimension];
112 node.resize(numSections);
114 if ( numSections == 1 )
116 node[0] = (( min[dimension] + max[dimension] ) / 2.0);
118 else for (
size_t section = 0; section < numSections; section++)
120 node[section] = (min[dimension] + section * (max[dimension] - min[dimension]) / (numSections - 1.0));
134 void configure(
double min1,
double max1,
size_t sections1,
double min2,
double max2,
size_t sections2)
143 if ( sections1 == 1 ) {
146 for (
size_t section = 0; section < sections1; section++)
147 m_nodeValues[0].push_back(min1 + section * (max1 - min1) / (sections1 - 1.0));
150 if ( sections2 == 1 ) {
153 for (
size_t section = 0; section < sections2; section++)
154 m_nodeValues[1].push_back(min2 + section * (max2 - min2) / (sections2 - 1.0));
279 std::vector<size_t> index(dimensions, 0);
281 RealVector point(dimensions);
287 for (
size_t dimension = 0; dimension < dimensions; dimension++)
288 point(dimension) =
m_nodeValues[dimension][index[dimension]];
291 if (objectiveFunction.isFeasible(point))
293 double error = objectiveFunction.eval(point);
295#ifdef SHARK_CV_VERBOSE_1
296 std::cout <<
"." << std::flush;
298#ifdef SHARK_CV_VERBOSE
299 std::cout << point <<
"\t" << error << std::endl;
309 size_t dimension = 0;
310 for (; dimension < dimensions; dimension++)
313 if (index[dimension] <
m_nodeValues[dimension].size())
break;
314 index[dimension] = 0;
316 if (dimension == dimensions)
break;
318#ifdef SHARK_CV_VERBOSE_1
319 std::cout << std::endl;