feature: Add opt-in Kahan compensated summation#134
Conversation
3ec109a to
407cec2
Compare
Note: Adds a public summation field on IterativeConfig (default Pairwise). Call sites that build the struct with a full literal need the new field; Default, from_parameters, and with_summation are unchanged in behavior for existing users.
a478499 to
ca11954
Compare
|
I do not like changing function APIs to add a new "summation" arg that 99% of the users will never care about. That is why currently pairwise summation is default. Unfortunately Rust does not do default function args so that adds another complication. I would instead add the summation arg in struct member definitions, with pairwise as default. Users must call builder pattern function to enable kahan sum if needed. So for example |
Closes #13
Note: Adds a public summation field on IterativeConfig (default Pairwise). Call sites that build the struct with a full literal need the new field; Default, from_parameters, and with_summation are unchanged in behavior for existing users.
Checklist
## [Unreleased](required for behavior-facing changes)cargo test+cargo clippy --all-targetsclean locallyunwrap/expect/panicon library paths (typed errors instead)