Skip to content

Commit

Permalink
add sum and max_val util functions
Browse files Browse the repository at this point in the history
  • Loading branch information
MinaciousGrace committed May 10, 2020
1 parent 0c05596 commit 6a800b5
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions src/Etterna/Globals/MinaCalc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,30 @@ highest_difficulty(const DifficultyRating& difficulty)
return *std::max_element(v.begin(), v.end());
}

inline int
max_val(vector<int>& v)
{
return *std::max_element(v.begin(), v.end());
}

inline float
max_val(vector<float>& v)
{
return *std::max_element(v.begin(), v.end());
}

inline int
sum(vector<int>& v)
{
return std::accumulate(begin(v), end(v), 0);
}

inline float
sum(vector<float>& v)
{
return std::accumulate(begin(v), end(v), 0);
}

void
Calc::TotalMaxPoints()
{
Expand Down

0 comments on commit 6a800b5

Please sign in to comment.