Skip to content
Snippets Groups Projects
Commit d1d8668b authored by Carl Philipp Klemm's avatar Carl Philipp Klemm
Browse files

add trival difference function

parent 5b425797
Branches
No related tags found
No related merge requests found
......@@ -411,3 +411,10 @@ std::vector<eis::DataPoint> eis::fitToFrequencies(std::vector<fvalue> omegas, co
return out;
}
void difference(std::vector<eis::DataPoint>& a, const std::vector<eis::DataPoint>& b)
{
assert(a.size() == b.size());
for(size_t i = 0; i < a.size(); ++i)
a[i] = a[i] - b[i];
}
......@@ -89,6 +89,17 @@ namespace eis
*/
std::complex<fvalue> median(const std::vector<eis::DataPoint>& data);
/**
* @brief Calculates the difference between two spectra.
*
* this function calculates an element wise a = a-b and ingores omega
*
* @param a The first operand, where b is subtracted
* @param b The second operand that is subtracted from the first, must be the same size as a
*/
void difference(std::vector<eis::DataPoint>& a, const std::vector<eis::DataPoint>& b);
/**
* @brief Resamples the data to the given amount of points.
*
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment