9 #ifndef _utl_TabulatedFunctionComplexLgAmpPhase_h_
10 #define _utl_TabulatedFunctionComplexLgAmpPhase_h_
15 #include <utl/ComplexLgAmpPhase.h>
16 #include <utl/TabulatedFunctionComplexLgAmpPhaseIterators.h>
36 typedef std::vector<double>
Array;
45 const std::vector<utl::ComplexLgAmpPhase>& yValues,
46 const double boundaryTolerance = 1e-3) :
76 Array::iterator
XBegin() {
return fX.begin(); }
79 Array::const_iterator
XBegin()
const {
return fX.begin(); }
82 ArrayComplex::iterator
YBegin() {
return fY.begin(); }
85 ArrayComplex::const_iterator
YBegin()
const {
return fY.begin(); }
88 Array::iterator
XEnd() {
return fX.end(); }
91 Array::const_iterator
XEnd()
const {
return fX.end(); }
94 ArrayComplex::iterator
YEnd() {
return fY.end(); }
97 ArrayComplex::const_iterator
YEnd()
const {
return fY.end(); }
100 Array::const_reference
XFront()
const {
return fX.front(); }
103 ArrayComplex::const_reference
YFront()
const {
return fY.front(); }
106 Array::const_reference
XBack()
const {
return fX.back(); }
109 ArrayComplex::const_reference
YBack()
const {
return fY.back(); }
129 const double&
GetX(
const unsigned int idx)
const {
return fX[idx]; }
131 double&
GetX(
const unsigned int idx) {
return fX[idx]; }
135 double SumX()
const {
return std::accumulate(
fX.begin(),
fX.end(), 0.); }
140 {
return fX == t.
fX &&
fY == t.
fY; }
158 void FillTable(
const std::vector<double>& xValues,
159 const std::vector<utl::ComplexLgAmpPhase >& yValues);
TabulatedFunctionComplexLgAmpPhaseIterator Iterator
Array::const_iterator XEnd() const
end of array of X
ConstIterator End() const
ArrayComplex::const_reference YBack() const
read-only reference to back of array of Y
ArrayComplex::const_iterator YBegin() const
begin of array of Y
bool operator==(const TabulatedFunctionComplexLgAmpPhase &t) const
ConstIterator FindY(const utl::ComplexLgAmpPhase &y) const
Iterator Insert(const double x, const utl::ComplexLgAmpPhase &y)
double SumX() const
return the sum of X values
TabulatedFunctionComplexLgAmpPhase(const double boundaryTolerance=1e-3)
ArrayComplex::iterator YBegin()
begin of array of Y
Array::iterator XEnd()
end of array of X
double & GetX(const unsigned int idx)
void Pow(const double power)
calculate the power of a TabulatedFunctionComplexLgAmpPhase (correctly treating amplitude and phase) ...
const utl::ComplexLgAmpPhase & GetY(const unsigned int idx) const
Interpolate the Y value with a polyDegree polynomial.
TabulatedFunctionComplexLgAmpPhase(const std::vector< double > &xValues, const std::vector< utl::ComplexLgAmpPhase > &yValues, const double boundaryTolerance=1e-3)
ArrayComplex::const_reference YFront() const
read-only reference to front of array of Y
const phoenix::function< PowerToImpl > power
void FillTable(const std::vector< double > &xValues, const std::vector< utl::ComplexLgAmpPhase > &yValues)
virtual ~TabulatedFunctionComplexLgAmpPhase()
Array::const_reference XBack() const
read-only reference to back of array of X
std::vector< double > Array
Class to hold collection (x,y) points and provide interpolation between them, where y are complex num...
bool IsInValidRange(const double x) const
void SetBoundaryTolerance(const double tolerance)
A class to store complex numbers which are internally represented by log10(amplitude) and phase (and ...
utl::ComplexLgAmpPhase Y(const double x) const
Get or interpolate the Y value that corresponds to parameter x.
Array::const_iterator XBegin() const
begin of array of X
ArrayComplex::const_iterator YEnd() const
end of array of Y
Array::iterator XBegin()
begin of array of X
double fBoundaryTolerance
unsigned int GetNPoints() const
void PushBack(const double x, const utl::ComplexLgAmpPhase &y)
TabulatedFunctionComplexLgAmpPhase & operator*=(const TabulatedFunctionComplexLgAmpPhase &rhs)
multiply the current TabulatedFunctionComplexLgAmpPhase with another one
const double & GetX(const unsigned int idx) const
std::vector< utl::ComplexLgAmpPhase > ArrayComplex
bool operator!=(const TabulatedFunctionComplexLgAmpPhase &t) const
ArrayComplex::iterator YEnd()
end of array of Y
ConstIterator Begin() const
double GetBoundaryTolerance() const
ConstTabulatedFunctionComplexLgAmpPhaseIterator ConstIterator
Array::const_reference XFront() const
read-only reference to front of array of X
utl::ComplexLgAmpPhase & GetY(const unsigned int idx)
ConstIterator FindX(const double x) const
PairComplexLgAmpPhase operator[](const int idx) const
Note: cannot be used in assignment.