Template Function deepmd::hpp::validate_charge_spin#
Defined in File deepmd.hpp
Function Documentation#
- template<typename FPTYPE>
inline const FPTYPE *deepmd::hpp::validate_charge_spin(const std::vector<FPTYPE> &charge_spin, const int dchgspin, const unsigned int nframes, std::vector<FPTYPE> &charge_spin_tiled)# Validate a runtime charge_spin vector and return a raw pointer to it (or nullptr when empty, which falls back to the model’s default_chg_spin).
- Parameters:
charge_spin – [in] The per-frame charge/spin values.
dchgspin – [in] The model’s charge/spin dimension (0 if unsupported).
nframes – [in] The number of frames.
charge_spin_tiled – [out] Scratch storage used when one frame’s charge_spin should be broadcast to all frames.
- Returns:
charge_spin.data() or charge_spin_tiled.data() if non-empty and valid, otherwise nullptr.