Dump parts of the full matrix.

Former-commit-id: 53b84dc031fab778b089226be8b26d89e6f6a4a0
This commit is contained in:
Marek Nečada 2019-03-13 11:36:52 +02:00
parent aee4d2db2a
commit cc61a64313
1 changed files with 23 additions and 0 deletions

View File

@ -167,6 +167,29 @@ int main()
fputc('\n', stderr); fputc('\n', stderr);
} }
} }
{
complex double *S_partrecfull = qpms_scatsys_irrep_unpack_matrix(NULL,
S_packed[0], ss, 0, false);
for (qpms_iri_t iri = 0; iri < ss->sym->nirreps; ++iri) {
qpms_scatsys_irrep_unpack_matrix(S_partrecfull, S_packed[iri],
ss, iri, false);
fprintf(stderr, "\nPartial reconstruction %d (%s):\n", (int)iri, ss->sym->irreps[iri].name);
const size_t full_len = ss->fecv_size;
for (size_t row = 0 ; row < full_len; ++row) {
for (size_t col = 0 ; col < full_len; ++col)
fprintf(stderr, "%+2.3f%+2.3fj ", creal(S_partrecfull[full_len * row + col]), cimag(S_partrecfull[full_len * row + col]));
fputc('\n', stderr);
}
}
double maxerr = 0;
for (size_t i = 0; i < ss->fecv_size; ++i) {
double err = cabs(S_full[i] - S_partrecfull[i]);
maxerr = (err > maxerr) ? err : maxerr;
}
free(S_partrecfull);
}
complex double *S_recfull = qpms_scatsys_irrep_unpack_matrix(NULL, complex double *S_recfull = qpms_scatsys_irrep_unpack_matrix(NULL,
S_packed[0], ss, 0, false); S_packed[0], ss, 0, false);