mirror of
https://github.com/aportelli/LatAnalyze.git
synced 2025-04-11 03:20:46 +01:00
fix of potential conflict with std::size
This commit is contained in:
parent
a0bdbfd9dd
commit
05138baa08
@ -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)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user