Merge pull request #39 from PurplePachyderm/dev

Update vfc_ci test variables and minor bugfix in HTML report
This commit is contained in:
Pablo de Oliveira Castro 2021-05-25 10:30:24 +02:00 committed by GitHub
commit 65bb0fd0b5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 19 additions and 7 deletions

View File

@ -235,8 +235,8 @@ class CompareRuns:
def update_n_runs(self, attrname, old, new): def update_n_runs(self, attrname, old, new):
# Simply update runs selection (value and string display) # Simply update runs selection (value and string display)
self.select_n_runs.value = new self.widgets["select_n_runs"].value = new
self.current_n_runs = self.n_runs_dict[self.select_n_runs.value] self.current_n_runs = self.n_runs_dict[self.widgets["select_n_runs"].value]
self.update_plots() self.update_plots()

View File

@ -232,3 +232,15 @@ template <typename T> T residual_frobenius2(T *A, unsigned int Dim) {
} }
return res; return res;
} }
template <typename T> T residual2(T * A, unsigned int Dim) {
double res = 0.0;
for (unsigned int i = 0; i < Dim; i++) {
for (unsigned int j = 0; j < Dim; j++) {
T delta = (A[i * Dim + j] - (i == j));
res += delta*delta;
}
}
return res;
}

View File

@ -133,15 +133,15 @@ int test_cycle(H5File file, int cycle, std::string version,
matMul(slater_matrix, slater_inverse, res, dim); matMul(slater_matrix, slater_inverse, res, dim);
bool ok = is_identity(res, dim, 1e-3); bool ok = is_identity(res, dim, 1e-3);
double res_max = residual_max(res, dim); double res2 = residual2(res, dim);
double res2 = residual_frobenius2(res, dim); double frob2 = norm_frobenius2(res, dim);
#ifdef DEBUG #ifdef DEBUG
showMatrix(res, dim, "Result"); showMatrix(res, dim, "Result");
#endif #endif
vfc_put_probe(probes, &(zero_padded_group)[0], &("res_max_" + version)[0], vfc_put_probe(probes, &(zero_padded_group)[0], &("frob2_" + version)[0],
res_max); frob2);
vfc_put_probe(probes, &(zero_padded_group)[0], &("res2_" + version)[0], res2); vfc_put_probe(probes, &(zero_padded_group)[0], &("res2_" + version)[0], res2);
delete[] res, updates, u, col_update_index, slater_matrix, slater_inverse; delete[] res, updates, u, col_update_index, slater_matrix, slater_inverse;