31 freqs = std::vector<std::pair<int, decimal>>();
36 for (
unsigned int i = 0; i < other.
freqs.size(); i++)
53 for (
unsigned int i = 0; i <
freqs.size(); i++)
55 r.push_back(
freqs.at(i).first);
61 for (
unsigned int i = 0; i <
freqs.size(); i++)
63 r[i] =
freqs.at(i).first;
69 if (i < 0 || i >=
freqs.size())
73 return freqs.at(i).first;
78 for (
unsigned int i = 0; i <
freqs.size(); i++)
80 r.push_back(
freqs.at(i).second);
86 for (
unsigned int i = 0; i <
freqs.size(); i++)
88 r[i] =
freqs.at(i).second;
94 if (i < 0 || i >=
freqs.size())
98 return freqs.at(i).second;
103 freqs.push_back(std::pair<int, decimal>(freq, power));
107 std::vector<std::pair<int, decimal>>
freqs;
void getPowers(decimal *r)
Return into an array (sized before) all the power values of the spectrum.
Spectre()
Default constructor.
std::vector< std::pair< int, decimal > > freqs
Vector of pairs (Frequency,Power)
virtual ~Spectre()
Destructor.
void addFrequencie(int freq, decimal power)
Add a new pair (frequency,power)
int getFrequencie(unsigned int i)
Get a the ith frequency of the spectrum.
void getPowers(std::vector< decimal > &r)
Return into a vector all the power values of the spectrum.
void getFrequencies(int *r)
Return into an array (sized before) all the frequency values of the spectrum.
Spectre(const Spectre &other)
Copy constructor.
size_t getSizeSpectre()
Get the size of the vector storing the spectrum.
void getFrequencies(std::vector< int > &r)
Return into a vector all the frequency values of the spectrum.
decimal getPower(unsigned int i)
Get the power for a frequency given by its index.