Skip to content

Commit

Permalink
Only printing header once
Browse files Browse the repository at this point in the history
  • Loading branch information
paulsbond authored and wojdyr committed Feb 6, 2025
1 parent 2ef2b96 commit ff00d3b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion prog/fprime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ int GEMMI_MAIN(int argc, char **argv) {
return result;
};

bool header_printed = false;
for (int i = 0; i < p.nonOptionsCount(); ++i) {
const char* name = p.nonOption(i);
gemmi::Element elem = gemmi::find_element(name);
Expand Down Expand Up @@ -107,7 +108,10 @@ int GEMMI_MAIN(int argc, char **argv) {
}
std::vector<double> fp(energies.size(), 0);
std::vector<double> fpp(energies.size(), 0);
printf("Element\t E[eV]\tWavelength[A]\t f' \t f\"\n");
if (! header_printed) {
printf("Element\t E[eV]\tWavelength[A]\t f' \t f\"\n");
header_printed = true;
}
gemmi::cromer_liberman_for_array(elem.atomic_number(),
(int) energies.size(), energies.data(),
&fp[0], &fpp[0]);
Expand Down

0 comments on commit ff00d3b

Please sign in to comment.