Skip to content

Commit

Permalink
Fix function
Browse files Browse the repository at this point in the history
  • Loading branch information
payetvin committed Feb 20, 2025
1 parent 1100570 commit cc9feca
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
14 changes: 7 additions & 7 deletions src/libs/antares/utils/utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,23 +175,23 @@ double floorDiv(double numerator, double denominator)
bool checkAllElementsIdenticalOrOne(std::vector<unsigned> w)
{
auto first_one = std::remove(w.begin(), w.end(), 1); // Reject all 1 to the end
return std::adjacent_find(w.begin(), first_one, std::not_equal_to<uint>()) == first_one;
return std::adjacent_find(w.begin(), first_one, std::not_equal_to<unsigned>()) == first_one;
}

std::pair<bool, std::string> checkAllElementsIdenticalOrOne(
std::vector<std::pair<unsigned, std::string>>& p)
{
// Reject all 1 to the end
auto first_one = std::ranges::remove_if(p, [](const auto& pair) { return pair.first == 1; });
auto width = first_one.begin()->first;
for (const auto& pair: first_one)
auto width = p.begin()->first;
for (auto pair = p.begin(); pair < first_one.begin(); ++pair)
{
if (pair.first != width)
if (pair->first != width)
{
logs.error() << "Inconsitent time series width, found: " << pair.first
<< " Previous was " << width << " for " << pair.second;
logs.error() << "Inconsitent time series width, found: " << pair->first
<< " Previous was " << width << " for " << pair->second;

return {false, pair.second};
return {false, pair->second};
}
}
return {true, ""};
Expand Down
2 changes: 1 addition & 1 deletion src/solver/simulation/timeseries-numbers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ bool checkInterModalConsistencyForArea(const Area& area,
if (isTSintermodal[indexTS])
{
listNumberTsOverArea.emplace_back(area.hydro.series->TScount(),
"Area: " + area.name + " wind");
"Area: " + area.name + " hydro");
}

// Thermal : Add thermal's number of TS of each cluster in area ...
Expand Down

0 comments on commit cc9feca

Please sign in to comment.