mirror of
https://github.com/aportelli/LatAnalyze.git
synced 2025-06-21 16:32:02 +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
|
||||
|
||||
on: [push]
|
||||
on: [push, workflow_dispatch]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
@ -7,7 +7,7 @@
|
||||
using namespace std;
|
||||
using namespace Latan;
|
||||
|
||||
constexpr Index size = 8;
|
||||
constexpr Index n = 8;
|
||||
constexpr Index nDraw = 20000;
|
||||
constexpr Index nSample = 2000;
|
||||
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.display();
|
||||
|
||||
DMat var(size, size);
|
||||
DVec mean(size);
|
||||
DMatSample sample(nSample, size, 1);
|
||||
DMat var(n, n);
|
||||
DVec mean(n);
|
||||
DMatSample sample(nSample, n, 1);
|
||||
|
||||
cout << "-- generating " << nSample << " Gaussian random vectors..." << endl;
|
||||
var = DMat::Random(size, size);
|
||||
var = DMat::Random(n, n);
|
||||
var *= var.adjoint();
|
||||
mean = DVec::Random(size);
|
||||
mean = DVec::Random(n);
|
||||
RandomNormal mgauss(mean, var, rd());
|
||||
sample[central] = mgauss();
|
||||
FOR_STAT_ARRAY(sample, s)
|
||||
|
@ -24,7 +24,7 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
// parse arguments /////////////////////////////////////////////////////////
|
||||
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;
|
||||
Index ti, tf, shift, nPar, thinning;
|
||||
double svdTol;
|
||||
@ -59,6 +59,8 @@ int main(int argc, char *argv[])
|
||||
"show the fit plot");
|
||||
opt.addOption("h", "heatmap" , OptParser::OptType::trigger, true,
|
||||
"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,
|
||||
"saves the source and .pdf", "");
|
||||
opt.addOption("", "scan", OptParser::OptType::trigger, true,
|
||||
@ -87,6 +89,7 @@ int main(int argc, char *argv[])
|
||||
fold = opt.gotOption("fold");
|
||||
doPlot = opt.gotOption("p");
|
||||
doHeatmap = opt.gotOption("h");
|
||||
noGuess = opt.gotOption("no-guess");
|
||||
savePlot = opt.optionValue("save-plot");
|
||||
doScan = opt.gotOption("scan");
|
||||
switch (opt.optionValue<unsigned int>("v"))
|
||||
@ -167,13 +170,14 @@ int main(int argc, char *argv[])
|
||||
fitter.setThinning(thinning);
|
||||
|
||||
// set initial values ******************************************************
|
||||
if (modelPar.type != CorrelatorType::undefined)
|
||||
if ((modelPar.type != CorrelatorType::undefined) and !noGuess)
|
||||
{
|
||||
init = CorrelatorModels::parameterGuess(corr, modelPar);
|
||||
}
|
||||
else
|
||||
{
|
||||
init.fill(0.1);
|
||||
init.fill(1.);
|
||||
init(0) = 0.2;
|
||||
}
|
||||
|
||||
// set limits for minimisers ***********************************************
|
||||
|
Reference in New Issue
Block a user