@@ -150,44 +150,42 @@ void correlation_matrix_uniform_sampling_MT(const unsigned int n, const unsigned
150
150
}
151
151
152
152
template <typename WalkTypePolicy, typename PointType, typename RNGType, typename MT>
153
- void tune_walkL (const std::vector< unsigned int >& walkL_values , const std::vector<unsigned int >& dimensions, const unsigned int num_points,
153
+ void tune_walkL (const unsigned int walkL , const std::vector<unsigned int >& dimensions, const unsigned int num_points,
154
154
const unsigned int nburns, const unsigned int num_matrices){
155
155
for (unsigned int n : dimensions) {
156
156
std::list<MT> randCorMatrices;
157
157
158
- for (unsigned int walkL : walkL_values) {
159
- std::chrono::steady_clock::time_point start, end;
160
- double time ;
161
- start = std::chrono::steady_clock::now ();
162
-
163
- uniform_correlation_sampling_MT<WalkTypePolicy, PointType, RNGType>(n, randCorMatrices, walkL, num_points, 0 );
164
-
165
- end = std::chrono::steady_clock::now ();
166
- time = std::chrono::duration_cast<std::chrono::milliseconds>(end - start).count ();
167
- std::cout << " Elapsed time : " << time << " (ms) for dimension: " << n << std::endl;
168
-
169
- int d = n*(n-1 )/2 ;
170
- MT samples (d, num_points);
171
- unsigned int jj = 0 ;
172
- for (auto & mat : randCorMatrices){
173
- samples.col (jj) = getCoefficientsFromMatrix<NT, MT>(mat);
174
- jj++;
175
- }
158
+ std::chrono::steady_clock::time_point start, end;
159
+ double time ;
160
+ start = std::chrono::steady_clock::now ();
161
+
162
+ uniform_correlation_sampling_MT<WalkTypePolicy, PointType, RNGType>(n, randCorMatrices, walkL, num_points, 0 );
163
+
164
+ end = std::chrono::steady_clock::now ();
165
+ time = std::chrono::duration_cast<std::chrono::milliseconds>(end - start).count ();
166
+ std::cout << " Elapsed time : " << time << " (ms) for dimension: " << n << std::endl;
167
+
168
+ int d = n*(n-1 )/2 ;
169
+ MT samples (d, num_points);
170
+ unsigned int jj = 0 ;
171
+ for (auto & mat : randCorMatrices){
172
+ samples.col (jj) = getCoefficientsFromMatrix<NT, MT>(mat);
173
+ jj++;
174
+ }
176
175
177
- // calculate psrf
178
- VT psrf = univariate_psrf<NT, VT, MT>(samples);
179
- double max_psrf = psrf.maxCoeff ();
180
- std::cout << " PSRF = " << max_psrf << std::endl;
176
+ // calculate psrf
177
+ VT psrf = univariate_psrf<NT, VT, MT>(samples);
178
+ double max_psrf = psrf.maxCoeff ();
179
+ std::cout << " PSRF = " << max_psrf << std::endl;
181
180
182
- // calculate ess
183
- unsigned int min_ess = 0 ;
184
- VT ess_vector = effective_sample_size<NT, VT, MT>(samples, min_ess);
185
- std::cout << " Effective Sample Size = " << min_ess << std::endl;
186
- std::cout << " Average Effective Sample Size = " << min_ess/num_matrices << std::endl;
187
-
188
- // Clear the matrices for the next iteration
189
- randCorMatrices.clear ();
190
- }
181
+ // calculate ess
182
+ unsigned int min_ess = 0 ;
183
+ VT ess_vector = effective_sample_size<NT, VT, MT>(samples, min_ess);
184
+ std::cout << " Effective Sample Size = " << min_ess << std::endl;
185
+ std::cout << " Average Effective Sample Size = " << min_ess/num_matrices << std::endl;
186
+
187
+ // Clear the matrices for the next iteration
188
+ randCorMatrices.clear ();
191
189
}
192
190
}
193
191
0 commit comments