mirror of
https://github.com/aportelli/LatAnalyze.git
synced 2025-06-22 08:52:01 +01:00
Compare commits
3 Commits
andrew-pr
...
c73b609ac5
Author | SHA1 | Date | |
---|---|---|---|
c73b609ac5 | |||
05138baa08 | |||
a0bdbfd9dd |
2
.github/workflows/build-macos.yml
vendored
2
.github/workflows/build-macos.yml
vendored
@ -1,6 +1,6 @@
|
|||||||
name: Build macOS
|
name: Build macOS
|
||||||
|
|
||||||
on: [push]
|
on: [push, workflow_dispatch]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
using namespace std;
|
using namespace std;
|
||||||
using namespace Latan;
|
using namespace Latan;
|
||||||
|
|
||||||
constexpr Index size = 8;
|
constexpr Index n = 8;
|
||||||
constexpr Index nDraw = 20000;
|
constexpr Index nDraw = 20000;
|
||||||
constexpr Index nSample = 2000;
|
constexpr Index nSample = 2000;
|
||||||
const string stateFileName = "exRand.seed";
|
const string stateFileName = "exRand.seed";
|
||||||
@ -40,14 +40,14 @@ int main(void)
|
|||||||
p << PlotFunction(compile("return exp(-x_0^2/2)/sqrt(2*pi);", 1), -5., 5.);
|
p << PlotFunction(compile("return exp(-x_0^2/2)/sqrt(2*pi);", 1), -5., 5.);
|
||||||
p.display();
|
p.display();
|
||||||
|
|
||||||
DMat var(size, size);
|
DMat var(n, n);
|
||||||
DVec mean(size);
|
DVec mean(n);
|
||||||
DMatSample sample(nSample, size, 1);
|
DMatSample sample(nSample, n, 1);
|
||||||
|
|
||||||
cout << "-- generating " << nSample << " Gaussian random vectors..." << endl;
|
cout << "-- generating " << nSample << " Gaussian random vectors..." << endl;
|
||||||
var = DMat::Random(size, size);
|
var = DMat::Random(n, n);
|
||||||
var *= var.adjoint();
|
var *= var.adjoint();
|
||||||
mean = DVec::Random(size);
|
mean = DVec::Random(n);
|
||||||
RandomNormal mgauss(mean, var, rd());
|
RandomNormal mgauss(mean, var, rd());
|
||||||
sample[central] = mgauss();
|
sample[central] = mgauss();
|
||||||
FOR_STAT_ARRAY(sample, s)
|
FOR_STAT_ARRAY(sample, s)
|
||||||
|
@ -108,23 +108,6 @@ inline std::string strFrom(const T x)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// specialization for vectors
|
// specialization for vectors
|
||||||
template<>
|
|
||||||
inline std::vector<Index> strTo<std::vector<Index>>(const std::string &str)
|
|
||||||
{
|
|
||||||
std::vector<Index> res;
|
|
||||||
std::vector<double> vbuf;
|
|
||||||
double buf;
|
|
||||||
std::istringstream stream(str);
|
|
||||||
|
|
||||||
while (!stream.eof())
|
|
||||||
{
|
|
||||||
stream >> buf;
|
|
||||||
res.push_back(buf);
|
|
||||||
}
|
|
||||||
|
|
||||||
return res;
|
|
||||||
}
|
|
||||||
|
|
||||||
template<>
|
template<>
|
||||||
inline DVec strTo<DVec>(const std::string &str)
|
inline DVec strTo<DVec>(const std::string &str)
|
||||||
{
|
{
|
||||||
|
@ -253,39 +253,16 @@ DMatSample CorrelatorUtils::shift(const DMatSample &c, const Index ts)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
DMatSample CorrelatorUtils::fold(const DMatSample &c, const CorrelatorModels::ModelPar &par)
|
DMatSample CorrelatorUtils::fold(const DMatSample &c)
|
||||||
{
|
{
|
||||||
const Index nt = c[central].rows();
|
const Index nt = c[central].rows();
|
||||||
DMatSample buf = c;
|
DMatSample buf = c;
|
||||||
int sign;
|
|
||||||
bool fold = false;
|
|
||||||
|
|
||||||
switch (par.type)
|
FOR_STAT_ARRAY(buf, s)
|
||||||
{
|
{
|
||||||
case CorrelatorType::cosh:
|
for (Index t = 0; t < nt; ++t)
|
||||||
case CorrelatorType::cst:
|
|
||||||
sign = 1;
|
|
||||||
fold = true;
|
|
||||||
break;
|
|
||||||
case CorrelatorType::sinh:
|
|
||||||
sign = -1;
|
|
||||||
fold = true;
|
|
||||||
break;
|
|
||||||
case CorrelatorType::linear:
|
|
||||||
cout << "Linear model is asymmetric: will not fold." << endl;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (fold)
|
|
||||||
{
|
|
||||||
FOR_STAT_ARRAY(buf, s)
|
|
||||||
{
|
{
|
||||||
for (Index t = 0; t < nt; ++t)
|
buf[s](t) = 0.5*(c[s](t) + c[s]((nt - t) % nt));
|
||||||
{
|
|
||||||
buf[s](t) = 0.5*(c[s](t) + sign*c[s]((nt - t) % nt));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -56,7 +56,7 @@ namespace CorrelatorModels
|
|||||||
namespace CorrelatorUtils
|
namespace CorrelatorUtils
|
||||||
{
|
{
|
||||||
DMatSample shift(const DMatSample &c, const Index ts);
|
DMatSample shift(const DMatSample &c, const Index ts);
|
||||||
DMatSample fold(const DMatSample &c, const CorrelatorModels::ModelPar &par);
|
DMatSample fold(const DMatSample &c);
|
||||||
DMatSample fourierTransform(const DMatSample &c, FFT &fft,
|
DMatSample fourierTransform(const DMatSample &c, FFT &fft,
|
||||||
const unsigned int dir = FFT::Forward);
|
const unsigned int dir = FFT::Forward);
|
||||||
};
|
};
|
||||||
|
@ -146,16 +146,6 @@ double Histogram::getX(const Index i) const
|
|||||||
return x_(i);
|
return x_(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
double Histogram::getXMin(void) const
|
|
||||||
{
|
|
||||||
return xMin_;
|
|
||||||
}
|
|
||||||
|
|
||||||
double Histogram::getXMax(void) const
|
|
||||||
{
|
|
||||||
return xMax_;
|
|
||||||
}
|
|
||||||
|
|
||||||
double Histogram::operator[](const Index i) const
|
double Histogram::operator[](const Index i) const
|
||||||
{
|
{
|
||||||
return bin_(i)*(isNormalized() ? norm_ : 1.);
|
return bin_(i)*(isNormalized() ? norm_ : 1.);
|
||||||
|
@ -52,8 +52,6 @@ public:
|
|||||||
const StatArray<double> & getData(void) const;
|
const StatArray<double> & getData(void) const;
|
||||||
const StatArray<double> & getWeight(void) const;
|
const StatArray<double> & getWeight(void) const;
|
||||||
double getX(const Index i) const;
|
double getX(const Index i) const;
|
||||||
double getXMin(void) const;
|
|
||||||
double getXMax(void) const;
|
|
||||||
double operator[](const Index i) const;
|
double operator[](const Index i) const;
|
||||||
double operator()(const double x) const;
|
double operator()(const double x) const;
|
||||||
// percentiles & confidence interval
|
// percentiles & confidence interval
|
||||||
|
@ -300,67 +300,6 @@ const XYStatData & XYSampleData::getData(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// fit /////////////////////////////////////////////////////////////////////////
|
// fit /////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
void XYSampleData::fitSample(std::vector<Minimizer *> &minimizer,
|
|
||||||
const std::vector<const DoubleModel *> &v,
|
|
||||||
SampleFitResult &result,
|
|
||||||
DVec &init,
|
|
||||||
Index s)
|
|
||||||
{
|
|
||||||
result.resize(nSample_);
|
|
||||||
result.chi2_.resize(nSample_);
|
|
||||||
result.model_.resize(v.size());
|
|
||||||
FitResult sampleResult;
|
|
||||||
setDataToSample(s);
|
|
||||||
if (s == central)
|
|
||||||
{
|
|
||||||
sampleResult = data_.fit(minimizer, init, v);
|
|
||||||
init = sampleResult.segment(0, init.size());
|
|
||||||
result.nPar_ = sampleResult.getNPar();
|
|
||||||
result.nDof_ = sampleResult.nDof_;
|
|
||||||
result.parName_ = sampleResult.parName_;
|
|
||||||
result.corrRangeDb_ = Math::svdDynamicRangeDb(getFitCorrMat());
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
sampleResult = data_.fit(*(minimizer.back()), init, v);
|
|
||||||
}
|
|
||||||
result[s] = sampleResult;
|
|
||||||
result.chi2_[s] = sampleResult.getChi2();
|
|
||||||
for (unsigned int j = 0; j < v.size(); ++j)
|
|
||||||
{
|
|
||||||
result.model_[j].resize(nSample_);
|
|
||||||
result.model_[j][s] = sampleResult.getModel(j);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
SampleFitResult XYSampleData::fit(std::vector<Minimizer *> &minimizer,
|
|
||||||
const DVec &init,
|
|
||||||
const std::vector<const DoubleModel *> &v,
|
|
||||||
Index s)
|
|
||||||
{
|
|
||||||
computeVarMat();
|
|
||||||
|
|
||||||
SampleFitResult result;
|
|
||||||
DVec initCopy = init;
|
|
||||||
|
|
||||||
fitSample(minimizer, v, result, initCopy, s);
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
SampleFitResult XYSampleData::fit(Minimizer &minimizer,
|
|
||||||
const DVec &init,
|
|
||||||
const std::vector<const DoubleModel *> &v,
|
|
||||||
Index s)
|
|
||||||
{
|
|
||||||
vector<Minimizer *> mv{&minimizer};
|
|
||||||
|
|
||||||
return fit(mv, init, v, s);
|
|
||||||
}
|
|
||||||
|
|
||||||
SampleFitResult XYSampleData::fit(std::vector<Minimizer *> &minimizer,
|
SampleFitResult XYSampleData::fit(std::vector<Minimizer *> &minimizer,
|
||||||
const DVec &init,
|
const DVec &init,
|
||||||
const std::vector<const DoubleModel *> &v)
|
const std::vector<const DoubleModel *> &v)
|
||||||
@ -368,14 +307,43 @@ SampleFitResult XYSampleData::fit(std::vector<Minimizer *> &minimizer,
|
|||||||
computeVarMat();
|
computeVarMat();
|
||||||
|
|
||||||
SampleFitResult result;
|
SampleFitResult result;
|
||||||
|
FitResult sampleResult;
|
||||||
DVec initCopy = init;
|
DVec initCopy = init;
|
||||||
Minimizer::Verbosity verbCopy = minimizer.back()->getVerbosity();
|
Minimizer::Verbosity verbCopy = minimizer.back()->getVerbosity();
|
||||||
|
|
||||||
|
result.resize(nSample_);
|
||||||
|
result.chi2_.resize(nSample_);
|
||||||
|
result.model_.resize(v.size());
|
||||||
FOR_STAT_ARRAY(result, s)
|
FOR_STAT_ARRAY(result, s)
|
||||||
{
|
{
|
||||||
fitSample(minimizer, v, result, initCopy, s);
|
setDataToSample(s);
|
||||||
|
if (s == central)
|
||||||
|
{
|
||||||
|
sampleResult = data_.fit(minimizer, initCopy, v);
|
||||||
|
initCopy = sampleResult.segment(0, initCopy.size());
|
||||||
|
if (verbCopy != Minimizer::Verbosity::Debug)
|
||||||
|
{
|
||||||
|
minimizer.back()->setVerbosity(Minimizer::Verbosity::Silent);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
|
||||||
|
sampleResult = data_.fit(*(minimizer.back()), initCopy, v);
|
||||||
|
}
|
||||||
|
result[s] = sampleResult;
|
||||||
|
result.chi2_[s] = sampleResult.getChi2();
|
||||||
|
for (unsigned int j = 0; j < v.size(); ++j)
|
||||||
|
{
|
||||||
|
result.model_[j].resize(nSample_);
|
||||||
|
result.model_[j][s] = sampleResult.getModel(j);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
minimizer.back()->setVerbosity(verbCopy);
|
minimizer.back()->setVerbosity(verbCopy);
|
||||||
|
result.nPar_ = sampleResult.getNPar();
|
||||||
|
result.nDof_ = sampleResult.nDof_;
|
||||||
|
result.parName_ = sampleResult.parName_;
|
||||||
|
result.corrRangeDb_ = Math::svdDynamicRangeDb(getFitCorrMat());
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
@ -103,13 +103,6 @@ public:
|
|||||||
// get internal XYStatData
|
// get internal XYStatData
|
||||||
const XYStatData & getData(void);
|
const XYStatData & getData(void);
|
||||||
// fit
|
// fit
|
||||||
void fitSample(std::vector<Minimizer *> &minimizer,
|
|
||||||
const std::vector<const DoubleModel *> &v,
|
|
||||||
SampleFitResult &sampleResult, DVec &init, Index s);
|
|
||||||
SampleFitResult fit(std::vector<Minimizer *> &minimizer, const DVec &init,
|
|
||||||
const std::vector<const DoubleModel *> &v, Index s);
|
|
||||||
SampleFitResult fit(Minimizer &minimizer, const DVec &init,
|
|
||||||
const std::vector<const DoubleModel *> &v, Index s);
|
|
||||||
SampleFitResult fit(std::vector<Minimizer *> &minimizer, const DVec &init,
|
SampleFitResult fit(std::vector<Minimizer *> &minimizer, const DVec &init,
|
||||||
const std::vector<const DoubleModel *> &v);
|
const std::vector<const DoubleModel *> &v);
|
||||||
SampleFitResult fit(Minimizer &minimizer, const DVec &init,
|
SampleFitResult fit(Minimizer &minimizer, const DVec &init,
|
||||||
|
@ -24,7 +24,7 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
// parse arguments /////////////////////////////////////////////////////////
|
// parse arguments /////////////////////////////////////////////////////////
|
||||||
OptParser opt;
|
OptParser opt;
|
||||||
bool parsed, doLaplace, doPlot, doHeatmap, doCorr, fold, doScan;
|
bool parsed, doLaplace, doPlot, doHeatmap, doCorr, fold, doScan, noGuess;
|
||||||
string corrFileName, model, outFileName, outFmt, savePlot;
|
string corrFileName, model, outFileName, outFmt, savePlot;
|
||||||
Index ti, tf, shift, nPar, thinning;
|
Index ti, tf, shift, nPar, thinning;
|
||||||
double svdTol;
|
double svdTol;
|
||||||
@ -59,6 +59,8 @@ int main(int argc, char *argv[])
|
|||||||
"show the fit plot");
|
"show the fit plot");
|
||||||
opt.addOption("h", "heatmap" , OptParser::OptType::trigger, true,
|
opt.addOption("h", "heatmap" , OptParser::OptType::trigger, true,
|
||||||
"show the fit correlation heatmap");
|
"show the fit correlation heatmap");
|
||||||
|
opt.addOption("", "no-guess" , OptParser::OptType::trigger, true,
|
||||||
|
"do not try to guess fit parameters");
|
||||||
opt.addOption("", "save-plot", OptParser::OptType::value, true,
|
opt.addOption("", "save-plot", OptParser::OptType::value, true,
|
||||||
"saves the source and .pdf", "");
|
"saves the source and .pdf", "");
|
||||||
opt.addOption("", "scan", OptParser::OptType::trigger, true,
|
opt.addOption("", "scan", OptParser::OptType::trigger, true,
|
||||||
@ -87,6 +89,7 @@ int main(int argc, char *argv[])
|
|||||||
fold = opt.gotOption("fold");
|
fold = opt.gotOption("fold");
|
||||||
doPlot = opt.gotOption("p");
|
doPlot = opt.gotOption("p");
|
||||||
doHeatmap = opt.gotOption("h");
|
doHeatmap = opt.gotOption("h");
|
||||||
|
noGuess = opt.gotOption("no-guess");
|
||||||
savePlot = opt.optionValue("save-plot");
|
savePlot = opt.optionValue("save-plot");
|
||||||
doScan = opt.gotOption("scan");
|
doScan = opt.gotOption("scan");
|
||||||
switch (opt.optionValue<unsigned int>("v"))
|
switch (opt.optionValue<unsigned int>("v"))
|
||||||
@ -114,7 +117,6 @@ int main(int argc, char *argv[])
|
|||||||
nt = corr[central].rows();
|
nt = corr[central].rows();
|
||||||
corr = corr.block(0, 0, nt, 1);
|
corr = corr.block(0, 0, nt, 1);
|
||||||
corr = CorrelatorUtils::shift(corr, shift);
|
corr = CorrelatorUtils::shift(corr, shift);
|
||||||
|
|
||||||
if (doLaplace)
|
if (doLaplace)
|
||||||
{
|
{
|
||||||
vector<double> filter = {1., -2., 1.};
|
vector<double> filter = {1., -2., 1.};
|
||||||
@ -156,11 +158,6 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fold)
|
|
||||||
{
|
|
||||||
corr = CorrelatorUtils::fold(corr,modelPar);
|
|
||||||
}
|
|
||||||
|
|
||||||
// fit /////////////////////////////////////////////////////////////////////
|
// fit /////////////////////////////////////////////////////////////////////
|
||||||
DVec init(nPar);
|
DVec init(nPar);
|
||||||
NloptMinimizer globMin(NloptMinimizer::Algorithm::GN_CRS2_LM);
|
NloptMinimizer globMin(NloptMinimizer::Algorithm::GN_CRS2_LM);
|
||||||
@ -173,13 +170,14 @@ int main(int argc, char *argv[])
|
|||||||
fitter.setThinning(thinning);
|
fitter.setThinning(thinning);
|
||||||
|
|
||||||
// set initial values ******************************************************
|
// set initial values ******************************************************
|
||||||
if (modelPar.type != CorrelatorType::undefined)
|
if ((modelPar.type != CorrelatorType::undefined) and !noGuess)
|
||||||
{
|
{
|
||||||
init = CorrelatorModels::parameterGuess(corr, modelPar);
|
init = CorrelatorModels::parameterGuess(corr, modelPar);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
init.fill(0.1);
|
init.fill(1.);
|
||||||
|
init(0) = 0.2;
|
||||||
}
|
}
|
||||||
|
|
||||||
// set limits for minimisers ***********************************************
|
// set limits for minimisers ***********************************************
|
||||||
|
@ -18,42 +18,30 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <LatAnalyze/Io/Io.hpp>
|
#include <LatAnalyze/Io/Io.hpp>
|
||||||
#include <LatAnalyze/Core/OptParser.hpp>
|
|
||||||
|
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
using namespace Latan;
|
using namespace Latan;
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
OptParser opt;
|
|
||||||
Index nSample;
|
Index nSample;
|
||||||
double val, err;
|
double val, err;
|
||||||
string outFileName;
|
string outFileName;
|
||||||
|
|
||||||
opt.addOption("r", "seed" , OptParser::OptType::value, true,
|
if (argc != 5)
|
||||||
"random generator seed (default: random)");
|
|
||||||
opt.addOption("", "help" , OptParser::OptType::trigger, true,
|
|
||||||
"show this help message and exit");
|
|
||||||
|
|
||||||
bool parsed = opt.parse(argc, argv);
|
|
||||||
if (!parsed or (opt.getArgs().size() != 4) or opt.gotOption("help"))
|
|
||||||
{
|
{
|
||||||
cerr << "usage: " << argv[0];
|
cerr << "usage: " << argv[0];
|
||||||
cerr << " <central value> <error> <nSample> <output file>" << endl;
|
cerr << " <central value> <error> <nSample> <output file>" << endl;
|
||||||
cerr << endl << "Possible options:" << endl << opt << endl;
|
|
||||||
|
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
val = strTo<double>(argv[1]);
|
val = strTo<double>(argv[1]);
|
||||||
err = strTo<double>(argv[2]);
|
err = strTo<double>(argv[2]);
|
||||||
nSample = strTo<Index>(argv[3]);
|
nSample = strTo<Index>(argv[3]);
|
||||||
outFileName = argv[4];
|
outFileName = argv[4];
|
||||||
|
|
||||||
random_device rd;
|
random_device rd;
|
||||||
SeedType seed = (opt.gotOption("r")) ? opt.optionValue<SeedType>("r") : rd();
|
mt19937 gen(rd());
|
||||||
mt19937 gen(seed);
|
|
||||||
normal_distribution<> dis(val, err);
|
normal_distribution<> dis(val, err);
|
||||||
DSample res(nSample);
|
DSample res(nSample);
|
||||||
|
|
||||||
|
@ -38,23 +38,9 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
DMatSample s = Io::load<DMatSample>(fileName);
|
DMatSample s = Io::load<DMatSample>(fileName);
|
||||||
string name = Io::getFirstName(fileName);
|
string name = Io::getFirstName(fileName);
|
||||||
Index nRows = s[central].rows();
|
|
||||||
Index nCols = s[central].cols();
|
|
||||||
cout << scientific;
|
cout << scientific;
|
||||||
cout << "central value +/- standard deviation\n" << endl;
|
cout << "central value:\n" << s[central] << endl;
|
||||||
cout << "Re:" << endl;
|
cout << "standard deviation:\n" << s.variance().cwiseSqrt() << endl;
|
||||||
for(Index i = 0; i < nRows; i++)
|
|
||||||
{
|
|
||||||
cout << s[central](i,0) << " +/- " << s.variance().cwiseSqrt()(i,0) << endl;
|
|
||||||
}
|
|
||||||
if(nCols == 2)
|
|
||||||
{
|
|
||||||
cout << "\nIm:" << endl;
|
|
||||||
for(Index i = 0; i < nRows; i++)
|
|
||||||
{
|
|
||||||
cout << s[central](i,1) << " +/- " << s.variance().cwiseSqrt()(i,1) << endl;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!copy.empty())
|
if (!copy.empty())
|
||||||
{
|
{
|
||||||
Io::save(s, copy, File::Mode::write, name);
|
Io::save(s, copy, File::Mode::write, name);
|
||||||
@ -65,8 +51,8 @@ int main(int argc, char *argv[])
|
|||||||
DSample s = Io::load<DSample>(fileName);
|
DSample s = Io::load<DSample>(fileName);
|
||||||
string name = Io::getFirstName(fileName);
|
string name = Io::getFirstName(fileName);
|
||||||
cout << scientific;
|
cout << scientific;
|
||||||
cout << "central value +/- standard deviation\n" << endl;
|
cout << "central value:\n" << s[central] << endl;
|
||||||
cout << s[central] << " +/- " << sqrt(s.variance()) << endl;
|
cout << "standard deviation:\n" << sqrt(s.variance()) << endl;
|
||||||
if (!copy.empty())
|
if (!copy.empty())
|
||||||
{
|
{
|
||||||
Io::save(s, copy, File::Mode::write, name);
|
Io::save(s, copy, File::Mode::write, name);
|
||||||
|
Reference in New Issue
Block a user