Owns Cartesian coordinates parsed from a CHARMM CRD or COR file. More...
#include <CharmmCrd.h>
Public Member Functions | |
| CharmmCrd (const std::filesystem::path &filePath) | |
| Constructs coordinates by parsing one CHARMM CRD or COR file. | |
Public Member Functions inherited from Coordinates | |
| Coordinates (void) | |
| Constructs an unset coordinate object. | |
| Coordinates (const std::vector< double3 > &coords) | |
| Constructs both representations from double-precision coordinates. | |
| Coordinates (const std::vector< float3 > &coords) | |
| Constructs both representations from single-precision coordinates. | |
| Coordinates (const std::vector< std::vector< double > > &coords) | |
| Constructs both representations from nested double rows. | |
| Coordinates (const std::vector< std::vector< float > > &coords) | |
| Constructs both representations from nested float rows. | |
| void | setNumAtoms (const int numAtoms) |
| Sets the atom count and resizes both coordinate vectors. | |
| int | getNumAtoms (void) const |
| Returns the stored atom count. | |
| const std::vector< double3 > & | getCoordinatesDP (void) const |
| Returns the double-precision coordinate vector. | |
| std::vector< double3 > & | getCoordinatesDP (void) |
| Returns mutable double-precision coordinate storage. | |
| const std::vector< float3 > & | getCoordinatesSP (void) const |
| Returns the single-precision coordinate vector. | |
| std::vector< float3 > & | getCoordinatesSP (void) |
| Returns mutable single-precision coordinate storage. | |
Additional Inherited Members | |
Protected Attributes inherited from Coordinates | |
| int | m_NumAtoms |
| std::vector< double3 > | m_CoordinatesDP |
| std::vector< float3 > | m_CoordinatesSP |
Owns Cartesian coordinates parsed from a CHARMM CRD or COR file.
Construction reads and parses the file synchronously into the inherited host-resident double- and single-precision coordinate vectors. Only Cartesian coordinates are retained. Atom identifiers, residue metadata, segment data, weights, and any other trailing fields are ignored. No file path is retained after construction, and no CUDA allocation, transfer, or synchronization is performed.
Compiler-generated copy and move operations have the same owned-vector semantics as Coordinates. The inherited mutable accessors remain unchecked escape hatches.
Coordinates pointer. | CharmmCrd::CharmmCrd | ( | const std::filesystem::path & | filePath | ) |
Constructs coordinates by parsing one CHARMM CRD or COR file.
Consecutive nonempty lines beginning with * in column one are treated as title records. The first following line supplies the atom count in its first space-delimited token. An exact uppercase EXT second token selects extended records; otherwise standard records are assumed.
Standard records read X, Y, and Z from one-based columns 21-30, 31-40, and 41-50. Extended records read them from columns 41-60, 61-80, and 81-100. The parsed values must be finite doubles and use angstroms. The file-name extension is not validated.
| [in] | filePath | Borrowed file-system path. It must be nonempty. The path and file contents are copied as needed during construction and are not retained after return. |
| ApoCharmmError | With code ApoCharmmErrorCode::InvalidArgument if filePath is empty. |
| ApoCharmmError | With code ApoCharmmErrorCode::Runtime if the file cannot be opened, sized, sought, or read; the atom count is missing, malformed, negative, or greater than INT_MAX; a required coordinate record or field is missing; or a coordinate is malformed, out of range, or non-finite. |
| std::bad_alloc | If file, vector, or diagnostic storage cannot be allocated. |
| std::length_error | If file, vector, or diagnostic storage exceeds an implementation limit. |
getNumAtoms() is the parsed non-negative count and both inherited coordinate vectors contain that many atom records. double, but does not verify representability as float before constructing the single-precision representation.