Commit 783d8f3d authored by niklas.baumgarten's avatar niklas.baumgarten
Browse files

refactored

parent a7284265
......@@ -8,10 +8,8 @@
/*
* Todo:
* * idea: make second key template for degree
* Todo: make second key template for degree
* to realize MultidegreeMonteCarlo
* && ?
*/
template<typename T>
......@@ -23,49 +21,49 @@ public:
LevelMap() {};
LevelMap(std::initializer_list<std::pair<int, T>> levelMap) {
for (std::pair<int, T> pair : levelMap) {
for (auto const &pair : levelMap) {
_levelMap.emplace(pair.first, T(pair.second));
}
}
std::vector<int> GetLevelVector() const {
std::vector<int> levelVector;
for (auto &&[level, entry]: _levelMap)
for (auto const &[level, entry]: _levelMap)
levelVector.push_back(level);
return levelVector;
}
std::vector<double> GetQVector() const {
std::vector<double> qVector;
for (auto &&[level, entry]: _levelMap)
for (auto const &[level, entry]: _levelMap)
qVector.push_back(entry.Q);
return qVector;
}
std::vector<double> GetYVector() const {
std::vector<double> yVector;
for (auto &&[level, entry]: _levelMap)
for (auto const &[level, entry]: _levelMap)
yVector.push_back(entry.Y);
return yVector;
}
std::vector<double> GetCostVector() const {
std::vector<double> costVector;
for (auto &&[level, entry]: _levelMap)
for (auto const &[level, entry]: _levelMap)
costVector.push_back(entry.C);
return costVector;
}
std::vector<int> GetMVector() const {
std::vector<int> mVector;
for (auto &&[level, entry]: _levelMap)
for (auto const &[level, entry]: _levelMap)
mVector.push_back(entry.M);
return mVector;
}
std::vector<int> GetdMVector() const {
std::vector<int> dMVector;
for (auto &&[level, entry]: _levelMap)
for (auto const &[level, entry]: _levelMap)
dMVector.push_back(entry.dM);
return dMVector;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment