|
eisgenerator 2.1.x
|
Various math functions performed on eisgenerator types. More...
Functions | |
| void | eis::mulitplyAdd (std::vector< eis::DataPoint > &data, fvalue mult, fvalue add) |
| std::complex< fvalue > | eis::absGrad (const std::vector< eis::DataPoint > &data, size_t index) |
| Calculates the element wise absolute gradient at the given point of the data given. | |
| fvalue | eis::grad (const std::vector< fvalue > &data, const std::vector< fvalue > &omega, size_t index) |
| Calculates derivative at the given point of the data given. | |
| std::complex< fvalue > | eis::grad (const std::vector< eis::DataPoint > &data, size_t index) |
| Calculates the gradient at the given point of the data given. | |
| fvalue | eis::mean (const std::vector< fvalue > &data) |
| Calculates the mean of the given data. | |
| std::complex< fvalue > | eis::mean (const std::vector< eis::DataPoint > &data) |
| Calculates the mean of the given data. | |
| fvalue | eis::median (std::vector< fvalue > data) |
| Calculates the median of the given data. | |
| std::complex< fvalue > | eis::median (const std::vector< eis::DataPoint > &data) |
| Calculates the median of the given data. | |
| void | eis::difference (std::vector< eis::DataPoint > &a, const std::vector< eis::DataPoint > &b) |
| Calculates the difference between two spectra. | |
| std::vector< eis::DataPoint > | eis::rescale (const std::vector< eis::DataPoint > &data, size_t outputSize) |
| Resamples the data to the given amount of points. | |
| fvalue | eis::pearsonCorrelation (const std::vector< eis::DataPoint > &data) |
| Calculates the Pearson correlation between the imaginary and the real part of the data. | |
| fvalue | eis::nonConstantScore (const std::vector< eis::DataPoint > &data) |
| fvalue | eis::nyquistAreaVariance (const std::vector< eis::DataPoint > &data, eis::DataPoint *centroid=nullptr) |
| Calculates the variance of the distance of the data from a centroid in the nyquist plane. | |
| fvalue | eis::maximumNyquistJump (const std::vector< eis::DataPoint > &data) |
| Finds the maximum distance between subsequent points in the data in the nyquist plane. | |
| void | eis::noise (std::vector< eis::DataPoint > &data, double amplitude, bool relative) |
| Adds white noise to the data. | |
| void | eis::removeDuplicates (std::vector< eis::DataPoint > &data) |
| Removes duplicate data points from the data. | |
| bool | eis::fvalueEq (fvalue a, fvalue b, unsigned int ulp=4) |
| Checks two fvalues for equality. | |
| std::vector< eis::DataPoint > | eis::fitToFrequencies (std::vector< fvalue > omegas, const std::vector< eis::DataPoint > &data, bool linearExtrapolation=false) |
| This function resamples, extrapolates and interpolates to fit the data given to the frequencies also given. | |
| fvalue | eis::eisDistance (const std::vector< eis::DataPoint > &a, const std::vector< eis::DataPoint > &b) |
| Returns the mean l2 element wise distance of the given spectra. | |
| fvalue | eis::eisNyquistDistance (const std::vector< eis::DataPoint > &a, const std::vector< eis::DataPoint > &b) |
| Returns the mean distance of the points in a to the linearly interpolated nyquist curve of b. | |
Various math functions performed on eisgenerator types.
| std::complex< fvalue > eis::absGrad | ( | const std::vector< eis::DataPoint > & | data, |
| size_t | index ) |
Calculates the element wise absolute gradient at the given point of the data given.
| data | The data to calculate the gradient on. |
| index | The position in the data to calculate the gradient at. |
References absGrad().
Referenced by absGrad().
| void eis::difference | ( | std::vector< eis::DataPoint > & | a, |
| const std::vector< eis::DataPoint > & | b ) |
Calculates the difference between two spectra.
this function calculates an element wise a = a-b and ingores omega
| a | The first operand, where b is subtracted |
| b | The second operand that is subtracted from the first, must be the same size as a |
References difference().
Referenced by difference().
| fvalue eis::eisDistance | ( | const std::vector< eis::DataPoint > & | a, |
| const std::vector< eis::DataPoint > & | b ) |
Returns the mean l2 element wise distance of the given spectra.
This function will be moved to the math API in the future.
| a | The first set of points. |
| b | The second set of points, must contain the same number of elements as a |
References eisDistance().
Referenced by eisDistance().
| fvalue eis::eisNyquistDistance | ( | const std::vector< eis::DataPoint > & | a, |
| const std::vector< eis::DataPoint > & | b ) |
Returns the mean distance of the points in a to the linearly interpolated nyquist curve of b.
This function will be moved to the math API in the future.
This implementation is quite slow.
| a | The first set of points. |
| b | The second set of points. |
References eisNyquistDistance().
Referenced by eisNyquistDistance().
| std::vector< eis::DataPoint > eis::fitToFrequencies | ( | std::vector< fvalue > | omegas, |
| const std::vector< eis::DataPoint > & | data, | ||
| bool | linearExtrapolation = false ) |
This function resamples, extrapolates and interpolates to fit the data given to the frequencies also given.
Data is resampled to the target size, interpolation for data points is performed using linear interpolation, extrapolation is performed using linear or base 10 logarithmic extrapolation.
| omegas | The frequencies to resample the data to. |
| data | The data to resample. |
| linearExtrapolation | true if linear extrapolation is to be performed, otherwise base 10 logarithmic extrapolation is used. |
References fitToFrequencies().
Referenced by fitToFrequencies().
| bool eis::fvalueEq | ( | fvalue | a, |
| fvalue | b, | ||
| unsigned int | ulp = 4 ) |
Checks two fvalues for equality.
Equality is considered given when the values are within ulp epsilons at the magnitude of the sum of operands.
| a | the first value to compare |
| b | the second value to compare |
References fvalueEq().
Referenced by fvalueEq().
| std::complex< fvalue > eis::grad | ( | const std::vector< eis::DataPoint > & | data, |
| size_t | index ) |
Calculates the gradient at the given point of the data given.
| data | The data to calculate the gradient on. |
| index | The position in the data to calculate the gradient at. |
References grad().
| fvalue eis::grad | ( | const std::vector< fvalue > & | data, |
| const std::vector< fvalue > & | omega, | ||
| size_t | index ) |
| fvalue eis::maximumNyquistJump | ( | const std::vector< eis::DataPoint > & | data | ) |
Finds the maximum distance between subsequent points in the data in the nyquist plane.
| data | The data to use. |
References maximumNyquistJump().
Referenced by maximumNyquistJump().
| std::complex< fvalue > eis::mean | ( | const std::vector< eis::DataPoint > & | data | ) |
Calculates the mean of the given data.
| data | The data to calculate the mean of. |
References mean().
| fvalue eis::mean | ( | const std::vector< fvalue > & | data | ) |
| std::complex< fvalue > eis::median | ( | const std::vector< eis::DataPoint > & | data | ) |
Calculates the median of the given data.
| data | The data to calculate the median of. |
References median().
| fvalue eis::median | ( | std::vector< fvalue > | data | ) |
| void eis::noise | ( | std::vector< eis::DataPoint > & | data, |
| double | amplitude, | ||
| bool | relative ) |
| fvalue eis::nyquistAreaVariance | ( | const std::vector< eis::DataPoint > & | data, |
| eis::DataPoint * | centroid = nullptr ) |
Calculates the variance of the distance of the data from a centroid in the nyquist plane.
| data | The data to calculate on. |
| centroid | The centroid to use, if nullptr is passed here, the mean of the data will be used as the centroid. |
References nyquistAreaVariance().
Referenced by nyquistAreaVariance().
| fvalue eis::pearsonCorrelation | ( | const std::vector< eis::DataPoint > & | data | ) |
Calculates the Pearson correlation between the imaginary and the real part of the data.
| data | Data to calculate the Pearson correlation on. |
References pearsonCorrelation().
Referenced by pearsonCorrelation().
| void eis::removeDuplicates | ( | std::vector< eis::DataPoint > & | data | ) |
Removes duplicate data points from the data.
Duplicates are detected by checking the value of omega for sameness using fvalueEq with the default ulp.
| data | the data to remove duplicates from |
References removeDuplicates().
Referenced by removeDuplicates().