Conversation
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The additions are small, correct, delegate to existing well-established routines with proper unit conversion, and the only findings are optional robustness nits around unchecked allocations.
Review effort: Balanced
Findings: 1
Open (1)
What changed in this PR
This PR extends the stopping-power API in the libamtrack C library by adding convenience functions that accept total kinetic energy in MeV (rather than the library's native MeV/u). Each new MeV-based array function converts the input energies to MeV/u via AT_E_MeV_u_from_E_MeV (per-particle, using the atomic weight) and delegates to the existing _with_no routines. The PR also adds single-particle wrappers for both MeV and MeV/u inputs, improving ergonomics for callers that work with one particle at a time.
Changes:
- Added array functions
AT_Mass_Stopping_Power_E_MeV_with_noandAT_Stopping_Power_E_MeV_with_nothat convert MeV→MeV/u before computing stopping power. - Added single-particle wrappers:
AT_Stopping_Power_E_MeV_single,AT_Mass_Stopping_Power_E_MeV_single,AT_Stopping_Power_E_MeV_u_single, andAT_Mass_Stopping_Power_E_MeV_u_single. - Added matching Doxygen-documented declarations in the public header.
| File | Description |
|---|---|
| src/AT_StoppingPower.c | Implements the new MeV-based array functions (with per-particle unit conversion) and the four single-particle wrappers; delegates to existing _with_no routines. |
| include/AT_StoppingPower.h | Declares the new functions with consistent Doxygen documentation describing units and conversion behavior. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Co-authored-by: Leszek Grzanka <grzanka@agh.edu.pl>
…s (copilot comment)

No description provided.