==============================================================================
| 66 | |
| 67 | //============================================================================== |
| 68 | void MultiObjectiveProblem::setSolutionDimension( |
| 69 | std::size_t dim, std::size_t integerDim) |
| 70 | { |
| 71 | if (dim > kMaxDimension) { |
| 72 | throw std::invalid_argument( |
| 73 | "[MultiObjectiveProblem::setSolutionDimension] Requested dimension (" |
| 74 | + std::to_string(dim) + ") exceeds the maximum allowed dimension (" |
| 75 | + std::to_string(kMaxDimension) + ")."); |
| 76 | } |
| 77 | |
| 78 | if (dim == mDimension && integerDim == mIntegerDimension) |
| 79 | return; |
| 80 | |
| 81 | mDimension = dim; |
| 82 | mIntegerDimension = integerDim; |
| 83 | |
| 84 | const double inf = std::numeric_limits<double>::infinity(); |
| 85 | const auto dimension = static_cast<Eigen::VectorXd::Index>(dim); |
| 86 | |
| 87 | setLowerBounds(Eigen::VectorXd::Constant(dimension, -inf)); |
| 88 | setUpperBounds(Eigen::VectorXd::Constant(dimension, inf)); |
| 89 | } |
| 90 | |
| 91 | //============================================================================== |
| 92 | std::size_t MultiObjectiveProblem::getSolutionDimension() const |