.. index:: pair: namespace; vesin::cpu .. _doxid-namespacevesin_1_1cpu: namespace vesin::cpu ==================== .. toctree:: :hidden: Overview ~~~~~~~~ .. ref-code-block:: cpp :class: doxyrest-overview-code-block namespace cpu { // global functions double :ref:`visit_round`(double t); template void :ref:`brute_force_visit`(const double* points, std::size_t n, const double w[3], const double inv[3], double list_cutoff2, double visit_cutoff2, std::vector& pairs, Visitor&& visit); template void :ref:`brute_force_visit_only`(const double* points, std::size_t n, const double w[3], const double inv[3], double visit_cutoff2, Visitor&& visit); } // namespace cpu .. _details-namespacevesin_1_1cpu: Detailed Documentation ~~~~~~~~~~~~~~~~~~~~~~ Global Functions ---------------- .. index:: pair: function; visit_round .. _doxid-vesin__visit_8hpp_1a8023db2860bd5f16e17a286d0636c88d: .. ref-code-block:: cpp :class: doxyrest-title-code-block double visit_round(double t) Round to nearest via truncate-cast: no libm floor call on -march targets without roundsd. Half-integer inputs round away from zero. .. index:: pair: function; brute_force_visit .. _doxid-vesin__visit_8hpp_1aa54c382d063fd7778805e747c3864fa5: .. ref-code-block:: cpp :class: doxyrest-title-code-block template void brute_force_visit(const double* points, std::size_t n, const double w[3], const double inv[3], double list_cutoff2, double visit_cutoff2, std::vector& pairs, Visitor&& visit) Scan all i < j pairs of ``points`` (interleaved x,y,z, ``n`` atoms), folding each dimension by width ``w[k]`` when ``inv[k] = 1/w[k]`` is nonzero (``inv[k] == 0`` disables the fold for that dimension). Pairs with ``r2 < list_cutoff2`` append (i, j) to ``pairs`` (flat int32, cleared first); pairs with ``r2 <= visit_cutoff2`` additionally invoke ``visit(i, j, dx, dy, dz, r2)`` with the folded ``r_j - r_i`` vector. Pass a negative ``visit_cutoff2`` for a collect-only scan. .. index:: pair: function; brute_force_visit_only .. _doxid-vesin__visit_8hpp_1a14136d6c144a04597ab39d085b6f4206: .. ref-code-block:: cpp :class: doxyrest-title-code-block template void brute_force_visit_only(const double* points, std::size_t n, const double w[3], const double inv[3], double visit_cutoff2, Visitor&& visit) Evaluation-only variant: same scan and fold, no pair collection. Serves first-sighting evaluations where list capture would be paid for nothing.