Commit fa45bd3b authored by Philipp Schäfer's avatar Philipp Schäfer
Browse files

ITASpectrum

- defined +=, *= and -= operators
parent 0ac8532c
......@@ -95,6 +95,14 @@ public:
//! Set entire values of the spectrum by extrapolating range
void SetValuesExtrapolated( const std::vector< float >& vfProvidedFrequencies, const std::vector< float >& vfProvidedValues, const int iStrategy = ITABase::InterpolationFunctions::NONE );
CITASpectrum& operator*=(const float rhs);
CITASpectrum& operator*=(const CITASpectrum& rhs);
CITASpectrum& operator+=(const float rhs);
CITASpectrum& operator+=(const CITASpectrum& rhs);
CITASpectrum& operator-=(const float rhs);
CITASpectrum& operator-=(const CITASpectrum& rhs);
protected:
std::vector< float > m_vfValues; //!< Scalar spectrum values of any kind
......
......@@ -194,6 +194,39 @@ void CITASpectrum::SetValuesExtrapolated( const std::vector< float >& vfProvided
}
}
CITASpectrum& CITASpectrum::operator*=(const float rhs)
{
this->Multiply(rhs);
return *this;
}
CITASpectrum& CITASpectrum::operator*=(const CITASpectrum& rhs)
{
this->Multiply(rhs);
return *this;
}
CITASpectrum& CITASpectrum::operator+=(const float rhs)
{
this->Add(rhs);
return *this;
}
CITASpectrum& CITASpectrum::operator+=(const CITASpectrum& rhs)
{
this->Add(rhs);
return *this;
}
CITASpectrum& CITASpectrum::operator-=(const float rhs)
{
(*this) += (-rhs);
return *this;
}
CITASpectrum& CITASpectrum::operator-=(const CITASpectrum& rhs)
{
this->Sub(rhs);
return *this;
}
std::ostream& operator<<( std::ostream& os, const CITASpectrum& oSpectrum )
{
std::string sName = "Unnamed spectrum";
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment