Skip to content

Commit

Permalink
added *= operator
Browse files Browse the repository at this point in the history
  • Loading branch information
Danbr4d committed Oct 31, 2024
1 parent 88e0bbb commit 8e345d2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/classes/potentialSet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,14 @@ void PotentialSet::operator+=(const double delta)

void PotentialSet::operator+=(const PotentialSet &source) {}

void PotentialSet::operator*=(const double factor)
{
for (auto &[key, potential] : potentials_)
{
potential.ep *= factor;
}
}

/*
* Serialisation
*/
Expand Down
1 change: 1 addition & 0 deletions src/classes/potentialSet.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ class PotentialSet
public:
void operator+=(const double delta);
void operator+=(const PotentialSet &source);
void operator*=(const double factor);

/*
* Serialisation
Expand Down

0 comments on commit 8e345d2

Please sign in to comment.