|
Correlation 4.10.0
An Analysis Tool for Liquids and for Amorphous Solids
|
Defines universal mathematical and physical constants. More...
Namespaces | |
| namespace | detail |
Classes | |
| class | Vector3 |
| A lightweight, constexpr, stack-based 3D vector. More... | |
| class | Vector3< double > |
| SIMD-optimized specialization of Vector3 for double. More... | |
| class | Vector3< float > |
| SIMD-optimized specialization of Vector3 for float. More... | |
| class | Matrix3 |
| A lightweight, constexpr, stack-based 3x3 matrix. More... | |
| struct | PositionBlockT |
| Represents a Structure of Arrays (SoA) block of atom positions for SIMD processing. More... | |
| struct | Point3T |
| Lightweight POD for passing 3D coordinates to scalar SIMD helpers. More... | |
| struct | SincIntegralParams |
| Parameter container for sincIntegral kernel invocations. More... | |
| struct | RDFNormalizationParams |
| Parameter container for normalizeRdfBins kernel invocations. More... | |
| struct | ScaleBinsParams |
| Parameter container for scaleBins kernel invocations. More... | |
| struct | MillerPhaseSumParams |
| Parameter container for millerPhaseSum kernel invocations. More... | |
| struct | MillerExpSumParams |
| Parameter container for millerExpSum / complexExpSum kernel invocations. More... | |
| struct | ComplexExpSumResult |
| Output result container holding cosine and sine phase sums. More... | |
| struct | FillPositionBlockParams |
| Parameter container for fillPositionBlock kernel invocations. More... | |
| struct | KernelGenerationParams |
| Parameters for kernel generation. More... | |
| struct | KernelSmoothingParams |
| Options bundling for data series kernel smoothing. More... | |
| struct | LegendreParams |
| Parameters for Legendre polynomial evaluation (degree and order). More... | |
Typedefs | |
| using | Vector3R = Vector3<real_t> |
| Precision-configurable aliases for 3D vectors and 3x3 matrices. | |
| using | Matrix3R = Matrix3<real_t> |
| using | PositionBlock = PositionBlockT<real_t> |
| Backward-compatible type alias for default real_t precision PositionBlock. | |
| using | Point3 = Point3T<real_t> |
| Backward-compatible type alias for default real_t precision Point3. | |
| template<typename T = real_t> | |
| using | ComplexExpSumParams = MillerExpSumParams<T> |
| Alias for MillerExpSumParams used with complexExpSum kernel invocations. | |
| template<typename T = real_t> | |
| using | PhaseSumResult = ComplexExpSumResult<T> |
| Alias for PhaseSumResult used with phase sum kernel invocations. | |
| template<typename T = real_t> | |
| using | MillerPhaseSumResult = ComplexExpSumResult<T> |
| Alias for MillerPhaseSumResult used with millerPhaseSum kernel invocations. | |
Enumerations | |
| enum class | KernelType : std::uint8_t { Gaussian , Bump , Triweight , Epanechnikov , Cosine , Biweight } |
| Selection of kernel types for smoothing. More... | |
Functions | |
| bool | isGoodFFTSize (size_t n) |
| Helper to check if a size is a product of small prime factors (2, 3, 5). Highly optimized for FFTW3 and MKL. | |
| size_t | findNextGoodFFTSize (size_t target) |
| Finds the next "good" FFT size >= target. | |
| template<typename T = double> | |
| void | computeFFT (std::vector< std::complex< T > > &data, bool invert) |
| Simple Radix-2 Cooley-Tukey FFT implementation with bit-reversal optimization. | |
| template<typename T = real_t> | |
| std::vector< T > | autocorrelate (const std::vector< T > &signal, std::vector< std::complex< T > > &workspace) |
| Computes the autocorrelation of a 1D real sequence using FFT. | |
| template<typename T = real_t> | |
| std::vector< T > | autocorrelate (const std::vector< T > &signal) |
| Convenience overload — allocates its own workspace. | |
| template<typename T> | |
| constexpr T | dot (const Vector3< T > &vec_a, const Vector3< T > &vec_b) noexcept |
| Computes the dot product of two vectors. | |
| template<typename T> | |
| constexpr Vector3< T > | cross (const Vector3< T > &vec_a, const Vector3< T > &vec_b) noexcept |
| Computes the cross product of two 3D vectors. | |
| Vector3< double > | cross (const Vector3< double > &vec_a, const Vector3< double > &vec_b) noexcept |
| Computes the cross product of two 3D vectors. | |
| template<typename T> | |
| constexpr T | normSq (const Vector3< T > &vec_a) noexcept |
| Computes the squared vector norm (length). | |
| template<typename T> | |
| constexpr T | norm (const Vector3< T > &vec_a) noexcept |
| Computes the vector norm (length). | |
| template<typename T> | |
| constexpr T | distance (const Vector3< T > &vec_a, const Vector3< T > &vec_b) noexcept |
| Computes the distance between two vectors. | |
| template<typename T> | |
| constexpr Vector3< T > | normalize (const Vector3< T > &vec_a) |
| Normalizes the given vector. | |
| template<typename T> | |
| constexpr T | determinant (const Matrix3< T > &matrix) noexcept |
| Computes the determinant of a 3x3 matrix. | |
| template<typename T> | |
| constexpr Matrix3< T > | invert (const Matrix3< T > &matrix) |
| Computes the inverse of a 3x3 matrix. | |
| template<typename T> | |
| constexpr Matrix3< T > | transpose (const Matrix3< T > &matrix) noexcept |
| Computes the transpose of a 3x3 matrix. | |
| template<typename T, typename U> | |
| constexpr auto | operator* (const Matrix3< T > &matrix, const Vector3< U > &vector) noexcept |
| Matrix-vector multiplication. | |
| template<typename T> | |
| constexpr Matrix3< T > | operator* (const Matrix3< T > &mat_a, const Matrix3< T > &mat_b) noexcept |
| Matrix-matrix multiplication. | |
| template<typename Scalar, typename T> requires std::is_arithmetic_v<Scalar> | |
| constexpr Vector3< T > | operator* (Scalar scalar, const Vector3< T > &vec) noexcept |
| Scalar-vector multiplication. | |
| template<typename T> | |
| void | computeDsqBlock (T ref_x, T ref_y, T ref_z, const PositionBlockT< T > &block, T *out_dsq) noexcept |
| Computes squared distances from a reference point to a SoA block of positions. | |
| template<typename AtomRange, typename T = real_t> | |
| std::size_t | fillPositionBlock (const FillPositionBlockParams< AtomRange, T > ¶ms) noexcept |
| Populates vectors with standard atom block positions for SIMD. | |
| template<typename T> | |
| T | sincIntegral (const SincIntegralParams< T > ¶ms) noexcept |
| Computes a sinc-weighted integral over a range. | |
| double | sincIntegral (double q_magnitude, const double *integrand, const double *radial_bins, double *sinqr_scratch, std::size_t count) noexcept |
| Computes a sinc-weighted integral for double precision (backward compatibility). | |
| float | sincIntegral (float q_magnitude, const float *integrand, const float *radial_bins, float *sinqr_scratch, std::size_t count) noexcept |
| Computes a sinc-weighted integral for single precision (backward compatibility). | |
| template<typename T> | |
| void | normalizeRdfBins (const RDFNormalizationParams< T > ¶ms) noexcept |
| Normalizes Radial Distribution Function (RDF) bins. | |
| template<typename T> | |
| void | scaleBins (const ScaleBinsParams< T > ¶ms) noexcept |
| Scales an array by a constant factor in-place using ScaleBinsParams container. | |
| template<typename T> | |
| void | scaleBins (T *arr, T scale_factor, std::size_t count) noexcept |
| Scales an array by a constant factor in-place. | |
| template<typename T> | |
| T | simdDot (const T *input_a, const T *input_b, std::size_t count) noexcept |
| Computes the dot product of two array buffers. | |
| template<typename T> | |
| void | dotBlock (T v1x, T v1y, T v1z, const T *v2x, const T *v2y, const T *v2z, T *out_dot, std::size_t count) noexcept |
| Computes dot products between a reference vector and a block of target vectors. | |
| template<typename T> | |
| T | debyeSum (T q_magnitude, const T *distances, T *scratch, std::size_t count) noexcept |
| Computes the Debye scattering equation sum across distances. | |
| template<typename T> | |
| void | complexExpSum (T q_x, T q_y, T q_z, const T *x_s, const T *y_s, const T *z_s, std::size_t count, ComplexExpSumResult< T > &result) noexcept |
| Computes the sum of complex exponentials for a query q-vector. | |
| template<typename T> | |
| void | complexExpSum (const ComplexExpSumParams< T > ¶ms, ComplexExpSumResult< T > &result) noexcept |
| template<typename T = real_t> | |
| ComplexExpSumResult< T > | complexExpSum (T q_x, T q_y, T q_z, const T *x_s, const T *y_s, const T *z_s, std::size_t count) noexcept |
| template<typename T = real_t> | |
| ComplexExpSumResult< T > | complexExpSum (const MillerExpSumParams< T > ¶ms) noexcept |
| template<typename T> | |
| void | millerPhaseSum (const MillerPhaseSumParams< T > ¶ms, MillerPhaseSumResult< T > &result) noexcept |
| Computes the Miller phase sum across angle blocks. | |
| template<typename T = real_t> | |
| MillerPhaseSumResult< T > | millerPhaseSum (const MillerPhaseSumParams< T > ¶ms) noexcept |
| template<typename T> | |
| void | millerPhaseSum (const T *cos1, const T *sin1, const T *cos2, const T *sin2, const T *cos3, const T *sin3, std::size_t count, MillerPhaseSumResult< T > &result) noexcept |
| template<typename T = real_t> | |
| MillerPhaseSumResult< T > | millerPhaseSum (const T *cos1, const T *sin1, const T *cos2, const T *sin2, const T *cos3, const T *sin3, std::size_t count) noexcept |
| template<typename T> | |
| T | distSqScalar (Point3T< T > point_a, Point3T< T > point_b) noexcept |
| Computes the squared distance between two 3D points. | |
| real_t | distSqScalar (Point3 point_a, Point3 point_b) noexcept |
| Non-templated overload of distSqScalar for backward compatibility. | |
| const char * | simdLevelString () noexcept |
| Returns a string describing the compiled SIMD instruction set level. | |
| std::vector< real_t > | generateKernel (const KernelGenerationParams ¶ms) |
| Generates a smoothing kernel. | |
| std::vector< real_t > | kernelSmoothing (const std::vector< real_t > &y_values, KernelSmoothingParams params) |
| Applies kernel smoothing to a data series. | |
| std::vector< real_t > | kernelSmoothing (const std::vector< real_t > &r_values, const std::vector< real_t > &y_values, KernelSmoothingParams params) |
| Grid overload: derives bin_width from the independent variable grid. | |
| real_t | factorial (int n) |
| Inline helper for factorials up to 20. Beyond 20, the values exceed the capacity of a 64-bit integer, so we return real_t for consistency. | |
| real_t | sphLegendre (LegendreParams params, real_t theta) |
| Computes the spherical associated Legendre polynomial corresponding to std::sph_legendre from C++17. | |
| void | sphLegendreBatch (LegendreParams params, const real_t *theta, real_t *results, size_t count) |
| Vectorized version of sphLegendre. Computes the polynomial for a range of angles. | |
Variables | |
| constexpr real_t | PI |
| High-precision mathematical pi constant. | |
| constexpr real_t | RAD_TO_DEG |
| Conversion factor: Radians to Degrees. | |
| constexpr real_t | DEG_TO_RAD |
| Conversion factor: Degrees to Radians. | |
| constexpr real_t | THZ_TO_CMINV = static_cast<real_t>(33.35641) |
| Conversion factor: THz to cm^-1. | |
| constexpr real_t | THZ_TO_MEV = static_cast<real_t>(4.135667) |
| Conversion factor: THz to meV. | |
| constexpr real_t | BOHR_TO_ANGSTROM |
| Conversion factor: Bohr to Angstroms. | |
| constexpr real_t | ANGSTROM_TO_BOHR |
| Conversion factor: Angstroms to Bohr. | |
| constexpr real_t | TWO_PI = static_cast<real_t>(2.0) * PI |
| 2 * PI | |
| constexpr real_t | FOUR_PI = static_cast<real_t>(4.0) * PI |
| 4 * PI | |
| constexpr real_t | KB_EV_PER_K = static_cast<real_t>(8.617333262e-5) |
| Boltzmann constant in eV/K. | |
| constexpr real_t | HBAR_EV_PS |
| Reduced Planck constant in eV*ps. | |
| constexpr real_t | MAX_CUTOFF_RADIUS |
| Maximum allowable cutoff radius in Angstroms. | |
Defines universal mathematical and physical constants.
| using correlation::math::ComplexExpSumParams = MillerExpSumParams<T> |
Alias for MillerExpSumParams used with complexExpSum kernel invocations.
| using correlation::math::Matrix3R = Matrix3<real_t> |
| using correlation::math::MillerPhaseSumResult = ComplexExpSumResult<T> |
Alias for MillerPhaseSumResult used with millerPhaseSum kernel invocations.
| using correlation::math::PhaseSumResult = ComplexExpSumResult<T> |
Alias for PhaseSumResult used with phase sum kernel invocations.
| using correlation::math::Point3 = Point3T<real_t> |
Backward-compatible type alias for default real_t precision PositionBlock.
| using correlation::math::Vector3R = Vector3<real_t> |
Precision-configurable aliases for 3D vectors and 3x3 matrices.
|
strong |
|
inlinenodiscard |
Convenience overload — allocates its own workspace.
Prefer the two-argument overload in tight loops to recycle the allocation.
| signal | Input signal vector. |

|
inlinenodiscard |
Computes the autocorrelation of a 1D real sequence using FFT.
| signal | Input signal. |
| workspace | Reusable scratch buffer. Resized automatically when needed. Pass the same buffer across repeated calls (e.g. per-atom loops) to avoid repeated heap allocation. |


|
inlinenoexcept |

|
inlinenoexcept |

|
inlinenoexcept |

|
inlinenoexcept |
Computes the sum of complex exponentials for a query q-vector.
| T | Coordinate scalar type (float or double). |

|
inlinenoexcept |
Computes squared distances from a reference point to a SoA block of positions.
| T | Floating-point coordinate type (float or double). |


|
inline |
Simple Radix-2 Cooley-Tukey FFT implementation with bit-reversal optimization.
| data | The input/output vector of complex numbers. Modifies in-place. |
| invert | If true, performs an inverse FFT and scales the result by 1/N. |


|
inlinenodiscardnoexcept |
Computes the cross product of two 3D vectors.
Optimized specialization for double using manual calculations to help the compiler generate aligned SIMD code.
| vec_a | The first vector. |
| vec_b | The second vector. |
|
nodiscardconstexprnoexcept |
Computes the cross product of two 3D vectors.
| vec_a | The first vector. |
| vec_b | The second vector. |

|
inlinenoexcept |
Computes the Debye scattering equation sum across distances.
| T | Floating-point precision (float or double). |

|
nodiscardconstexprnoexcept |
Computes the determinant of a 3x3 matrix.
| matrix | The matrix. |

|
nodiscardconstexprnoexcept |
Computes the distance between two vectors.
| vec_a | The first vector. |
| vec_b | The second vector. |


Non-templated overload of distSqScalar for backward compatibility.
| [in] | point_a | The first point. |
| [in] | point_b | The second point. |

|
inlinenodiscardnoexcept |
Computes the squared distance between two 3D points.
| T | Floating point coordinate type. |
| [in] | point_a | The first point. |
| [in] | point_b | The second point. |

|
nodiscardconstexprnoexcept |
Computes the dot product of two vectors.
| vec_a | The first vector. |
| vec_b | The second vector. |

|
inlinenoexcept |
Computes dot products between a reference vector and a block of target vectors.
| T | Floating-point precision (float or double). |

|
inline |
Inline helper for factorials up to 20. Beyond 20, the values exceed the capacity of a 64-bit integer, so we return real_t for consistency.
| n | the number to compute factorial for. |

|
inlinenoexcept |
Populates vectors with standard atom block positions for SIMD.
| AtomRange | A range of atom objects (e.g., std::vector<Atom>). |
| T | Coordinate scalar type (defaults to real_t). |
|
inlinenodiscard |
Finds the next "good" FFT size >= target.


|
inlinenodiscard |
Generates a smoothing kernel.
| params | The parameters for kernel generation. |


|
nodiscardconstexpr |
Computes the inverse of a 3x3 matrix.
| matrix | The matrix to invert. |
| std::runtime_error | if the matrix is singular (determinant near zero). |


|
inlinenodiscard |
Helper to check if a size is a product of small prime factors (2, 3, 5). Highly optimized for FFTW3 and MKL.

|
inline |
Grid overload: derives bin_width from the independent variable grid.
| r_values | The independent variable grid (e.g., radial distances). |
| y_values | The dependent variable values to be smoothed. |
| params | Kernel smoothing configuration parameters. |

|
inline |
Applies kernel smoothing to a data series.
This function convolves the chosen kernel with y_values to produce a smoothed version. The bin width in params characterises the sampling grid.
| y_values | The dependent variable values to be smoothed. |
| params | Kernel smoothing configuration parameters. |


|
inlinenoexcept |

|
inlinenoexcept |
Computes the Miller phase sum across angle blocks.
| T | Floating-point precision (float or double). |


|
inlinenoexcept |

|
inlinenoexcept |

|
nodiscardconstexprnoexcept |
Computes the vector norm (length).
| vec_a | The vector. |

|
nodiscardconstexpr |
Normalizes the given vector.
| vec_a | The vector to normalize. |
| std::domain_error | if the vector length is too close to zero. |


|
inlinenoexcept |
Normalizes Radial Distribution Function (RDF) bins.
| T | Floating-point precision (float or double). |

|
nodiscardconstexprnoexcept |
Computes the squared vector norm (length).
| vec_a | The vector. |

|
nodiscardconstexprnoexcept |
Matrix-matrix multiplication.
| T | Scalar type. |
| mat_a | Left matrix. |
| mat_b | Right matrix. |
|
nodiscardconstexprnoexcept |
Matrix-vector multiplication.
| T | Coordinate type. |
| matrix | 3x3 matrix. |
| vector | 3D vector. |
|
nodiscardconstexprnoexcept |
Scalar-vector multiplication.
| Scalar | Arithmetic type. |
| T | Vector coordinate type. |
| scalar | Scaling factor. |
| vec | Input vector. |
|
inlinenoexcept |
Scales an array by a constant factor in-place using ScaleBinsParams container.
| T | Floating-point precision (float or double). |


|
inlinenoexcept |
Scales an array by a constant factor in-place.
| T | Floating-point precision (float or double). |

|
inlinenoexcept |
Computes the dot product of two array buffers.
| T | Floating-point precision (float or double). |


|
inlinenodiscardnoexcept |
Returns a string describing the compiled SIMD instruction set level.
|
inlinenoexcept |
Computes a sinc-weighted integral over a range.
| T | Floating-point precision (float or double). |


|
inlinenoexcept |
Computes a sinc-weighted integral for double precision (backward compatibility).

|
inlinenoexcept |
Computes a sinc-weighted integral for single precision (backward compatibility).

|
inline |
Computes the spherical associated Legendre polynomial corresponding to std::sph_legendre from C++17.
Specifically, computes Y_l^m(theta, 0) without the Condon-Shortley phase.
| params | Degree and order parameters. |
| theta | The colatitudinal angle in radians. |


|
inline |
Vectorized version of sphLegendre. Computes the polynomial for a range of angles.
| params | Degree and order parameters. |
| theta | Array of colatitudinal angles. |
| results | Output array where computed polynomials will be stored. |
| count | Number of angles to process. |

|
nodiscardconstexprnoexcept |
Computes the transpose of a 3x3 matrix.
| matrix | The matrix to transpose. |
|
constexpr |
Conversion factor: Angstroms to Bohr.
|
constexpr |
Conversion factor: Bohr to Angstroms.
|
constexpr |
Conversion factor: Degrees to Radians.
|
constexpr |
Reduced Planck constant in eV*ps.
Boltzmann constant in eV/K.
|
constexpr |
Maximum allowable cutoff radius in Angstroms.
|
constexpr |
High-precision mathematical pi constant.
|
constexpr |
Conversion factor: THz to cm^-1.
Conversion factor: THz to meV.