MCPcopy Create free account
hub / github.com/dartsim/dart / setSolutionDimension

Method setSolutionDimension

dart/optimizer/MultiObjectiveProblem.cpp:68–89  ·  view source on GitHub ↗

==============================================================================

Source from the content-addressed store, hash-verified

66
67//==============================================================================
68void 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//==============================================================================
92std::size_t MultiObjectiveProblem::getSolutionDimension() const

Callers 1

TESTFunction · 0.80

Calls

no outgoing calls

Tested by 1

TESTFunction · 0.64