141 [[nodiscard]] std::span<const Neighbor>
getNeighbors(
size_t atom_index)
const;
165 [[nodiscard]]
size_t nodeCount() const noexcept;
168 [[nodiscard]]
size_t edgeCount() const noexcept;
171 [[nodiscard]] std::span<const
size_t>
offsets() const noexcept;
174 [[nodiscard]] std::span<const
AtomID>
targets() const noexcept;
Atom data structure and AtomID type definitions.
Lightweight 3D vector and matrix classes for geometric calculations.
Compressed Sparse Row (CSR) based graph representing atomic connectivity.
Definition NeighborGraph.hpp:55
void addDirectedEdge(AtomID source, AtomID target, real_t distance, const math::Vector3< real_t > &r_ij)
Adds a directed edge between two atoms using individual parameters.
Definition NeighborGraph.hpp:108
std::span< const size_t > offsets() const noexcept
Definition NeighborGraph.cpp:264
std::vector< bool > getDenseAdjacencyMatrix() const
Generates a flattened dense adjacency matrix.
Definition NeighborGraph.cpp:233
void assignCSR(size_t node_count, std::vector< size_t > offsets, std::vector< Neighbor > neighbors, std::vector< AtomID > targets)
Directly assigns Compressed Sparse Row (CSR) storage.
Definition NeighborGraph.cpp:189
std::atomic< bool > is_finalized_
Definition NeighborGraph.hpp:186
size_t nodeCount() const noexcept
Definition NeighborGraph.cpp:257
std::vector< size_t > offsets_
Definition NeighborGraph.hpp:189
std::vector< Edge > unfinalized_edges_
Definition NeighborGraph.hpp:188
void ensureFinalized() const
Definition NeighborGraph.cpp:183
std::span< const Neighbor > getNeighbors(size_t atom_index) const
Retrieves the neighbor list for a specific atom.
Definition NeighborGraph.cpp:201
NeighborGraph()=default
Default constructor.
std::vector< AtomID > targets_
Definition NeighborGraph.hpp:191
~NeighborGraph()=default
Destructor.
size_t edgeCount() const noexcept
Definition NeighborGraph.cpp:259
void addDirectedEdge(const Edge &edge)
Adds a directed edge between two atoms.
Definition NeighborGraph.cpp:101
size_t node_count_
Definition NeighborGraph.hpp:185
NeighborGraph & operator=(const NeighborGraph &other)
Copy assignment operator.
Definition NeighborGraph.cpp:69
std::vector< Neighbor > neighbors_
Definition NeighborGraph.hpp:190
std::span< const AtomID > getNeighborIndices(size_t atom_index) const
Retrieves a lightweight index-only view of neighbors for a specific atom.
Definition NeighborGraph.cpp:211
std::span< const Neighbor > neighbors() const noexcept
Definition NeighborGraph.cpp:274
std::span< const AtomID > targets() const noexcept
Definition NeighborGraph.cpp:269
void finalize() const
Finalizes the graph into Compressed Sparse Row (CSR) storage.
Definition NeighborGraph.cpp:130
bool areConnected(AtomIndex first_atom, AtomIndex second_atom) const
Checks if two atoms are connected by an edge using binary search.
Definition NeighborGraph.cpp:221
std::mutex finalize_mutex_
Definition NeighborGraph.hpp:187
A lightweight, constexpr, stack-based 3D vector.
Definition LinearAlgebra.hpp:32
Definition ITrajectoryCalculator.hpp:13
real_t distance(const Atom &atom_a, const Atom &atom_b) noexcept
Calculates the Euclidean distance between two atoms.
Definition Atom.hpp:280
std::uint32_t AtomID
Unsigned integer type used for unique atom identification.
Definition Atom.hpp:31
double real_t
Definition Precision.hpp:18
Strong type wrapper representing an atom index.
Definition NeighborGraph.hpp:24
size_t id
Internal 0-based atom index.
Definition NeighborGraph.hpp:25
Represents a directed edge connecting two atoms in the graph.
Definition NeighborGraph.hpp:40
real_t distance
Separation distance (Angstrom).
Definition NeighborGraph.hpp:43
AtomID source
Index of the source atom.
Definition NeighborGraph.hpp:41
math::Vector3< real_t > r_ij
Relative position vector from source to target.
Definition NeighborGraph.hpp:44
AtomID target
Index of the target atom.
Definition NeighborGraph.hpp:42
Represents a neighbor atom in a neighbor list.
Definition NeighborGraph.hpp:31
math::Vector3< real_t > r_ij
Vector from central atom to neighbor.
Definition NeighborGraph.hpp:34
real_t distance
Distance to the neighbor.
Definition NeighborGraph.hpp:33
AtomID index
Index of the neighbor in the atom list.
Definition NeighborGraph.hpp:32