mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-07-11 22:03:01 -06:00
*ScatterDraw: Fixed Eigen namespace
git-svn-id: svn://ultimatepp.org/upp/trunk@13757 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
cc61e89ff7
commit
ba09b3f25d
3 changed files with 11 additions and 6 deletions
|
|
@ -5,7 +5,7 @@
|
|||
#include <ScatterDraw/Pedantic.h>
|
||||
|
||||
namespace Upp {
|
||||
|
||||
using namespace Eigen;
|
||||
|
||||
#define Membercall(fun) (this->*fun)
|
||||
|
||||
|
|
@ -500,7 +500,7 @@ Vector<Pointf> FFTSimple(VectorXd &data, double tSample, bool frequency, int typ
|
|||
Vector<Pointf> res;
|
||||
VectorXcd freqbuf;
|
||||
try {
|
||||
Eigen::FFT<double> fft;
|
||||
FFT<double> fft;
|
||||
fft.SetFlag(fft.HalfSpectrum);
|
||||
fft.fwd(freqbuf, data);
|
||||
} catch(...) {
|
||||
|
|
@ -755,7 +755,8 @@ Vector<double> DataSource::Percentile(Getdatafun getdata, double rate) {
|
|||
Vector<double> ret;
|
||||
for (int i = 0; i < num; ++i) {
|
||||
double val = data[i];
|
||||
ret << data[i];
|
||||
if (!IsNull(val))
|
||||
ret << data[i];
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
|
@ -763,8 +764,11 @@ Vector<double> DataSource::Percentile(Getdatafun getdata, double rate) {
|
|||
double DataSource::PercentileAvg(Getdatafun getdata, double rate) {
|
||||
Vector<double> data = Percentile(getdata, rate);
|
||||
double ret = 0;
|
||||
for (int i = 0; i < data.GetCount(); ++i)
|
||||
ret += data[i];
|
||||
for (int i = 0; i < data.GetCount(); ++i) {
|
||||
double val = data[i];
|
||||
if (!IsNull(val))
|
||||
ret += val;
|
||||
}
|
||||
return ret/data.GetCount();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -83,7 +83,7 @@ public:
|
|||
{GetSpectralMoments(&DataSource::y, &DataSource::x, frequency, m_1, m0, m1, m2);}
|
||||
|
||||
Vector<double> SortDataY() {return SortData(&DataSource::y);}
|
||||
Vector<double> PercentileY(double rate) {return Percentile(&DataSource::y, rate);}
|
||||
Vector<double> PercentileY(double rate) {return Percentile(&DataSource::y, rate);}
|
||||
double PercentileAvgY(double rate) {return PercentileAvg(&DataSource::y, rate);}
|
||||
|
||||
double Min(Getdatafun getdata, int64& id);
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
#include <ScatterDraw/Pedantic.h>
|
||||
|
||||
namespace Upp {
|
||||
using namespace Eigen;
|
||||
|
||||
struct Equation_functor : NonLinearOptimizationFunctor<double> {
|
||||
DataSource *series;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue