Skip to content

Latest commit

 

History

History
7 lines (7 loc) · 304 Bytes

hint2-3.md

File metadata and controls

7 lines (7 loc) · 304 Bytes

To print the interatomic distance matrix, we could just run through its unique values:

  for(int i=0; i < mol.natom; i++)
    for(int j=0; j < i; j++)
      printf("%d %d %8.5f\n", i, j, R[i][j]);

Note the conditional on the index j which keeps the code form printing redundant information.