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

Method setDimension

dart/optimizer/Problem.cpp:67–90  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

65
66//==============================================================================
67void Problem::setDimension(std::size_t _dim)
68{
69 if (_dim > kMaxDimension) {
70 throw std::invalid_argument(
71 "[Problem::setDimension] Requested dimension (" + std::to_string(_dim)
72 + ") exceeds the maximum allowed dimension ("
73 + std::to_string(kMaxDimension) + ").");
74 }
75
76 if (_dim != mDimension) {
77 mDimension = _dim;
78
79 mInitialGuess = Eigen::VectorXd::Zero(mDimension);
80
81 mLowerBounds = Eigen::VectorXd::Constant(
82 mDimension, -std::numeric_limits<double>::infinity());
83
84 mUpperBounds = Eigen::VectorXd::Constant(
85 mDimension, std::numeric_limits<double>::infinity());
86
87 mOptimalSolution = Eigen::VectorXd::Zero(mDimension);
88 clearAllSeeds();
89 }
90}
91
92//==============================================================================
93std::size_t Problem::getDimension() const

Callers 7

findSolutionMethod · 0.80
setDofsMethod · 0.80
resetProblemMethod · 0.80
findSolutionMethod · 0.80
resetProblemMethod · 0.80
ProblemFunction · 0.80
TESTFunction · 0.80

Calls

no outgoing calls

Tested by 1

TESTFunction · 0.64