array-like frame indexing

This commit is contained in:
daniel
2020-11-17 09:00:11 +01:00
parent a29faf9d63
commit ee9158555e
3 changed files with 66 additions and 8 deletions

View File

@@ -29,7 +29,7 @@ fn main() -> Result<()> {
assert_eq!(frame.step, 1);
assert_eq!(frame.len(), num_atoms);
let first_atom_coords = frame.coords[0];
let first_atom_coords = frame[0]; // shorthand for frame.coords[0]
assert_eq!(first_atom_coords, [-0.8901, 0.4127, -0.055499997]);
Ok(())