Skip to content

Commit

Permalink
Update sampler.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
atrayees authored Jul 29, 2024
1 parent a2cd74e commit 8872612
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions examples/correlation_matrices/sampler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#include "cartesian_geom/cartesian_kernel.h"
#include "convex_bodies/spectrahedra/spectrahedron.h"
#include "random_walks/random_walks.hpp"
#include "random_walks/uniform_billiard_walk.hpp"
#include "random_walks/uniform_accelerated_billiard_walk.hpp"
#include "sampling/sample_correlation_matrices.hpp"
#include "matrix_operations/EigenvaluesProblems.h"
#include "diagnostics/effective_sample_size.hpp"
Expand Down Expand Up @@ -157,12 +157,6 @@ void tune_parameter_L(const int walkL, const int choice, const std::vector<unsig
std::list<MT> randCorMatrices;

int d = n*(n-1)/2;
MT samples(d, num_points);
unsigned int jj = 0;
for(auto& mat : randCorMatrices){
samples.col(jj) = getCoefficientsFromMatrix<NT, MT>(mat);
jj++;
}
double _L;
switch(choice){
case 1: _L = sqrt(d);
Expand All @@ -187,6 +181,13 @@ void tune_parameter_L(const int walkL, const int choice, const std::vector<unsig
end = std::chrono::steady_clock::now();
time = std::chrono::duration_cast<std::chrono::milliseconds>(end - start).count();
std::cout << "Elapsed time : " << time << " (ms) for dimension: "<< n << std::endl;

MT samples(d, num_points);
unsigned int jj = 0;
for(auto& mat : randCorMatrices){
samples.col(jj) = getCoefficientsFromMatrix<NT, MT>(mat);
jj++;
}

//calculate psrf
VT psrf = univariate_psrf<NT, VT, MT>(samples);
Expand Down

0 comments on commit 8872612

Please sign in to comment.