CYCLUS
|
CycArithmetic is a toolkit for arithmetic.
Definition at line 15 of file cyc_arithmetic.h.
#include <cyc_arithmetic.h>
Static Public Member Functions | |
static double | KahanSum (std::vector< double > input) |
static std::vector< double > | sort_ascending (std::map< int, double > to_sort) |
static std::vector< double > | sort_ascending (std::vector< double > to_sort) |
static void | sort_inplace_ascending (std::vector< double > &to_sort) |
sums the materials in the vector in an intelligent way, to avoid floating point issues.
input | is the list of values to add to each other |
Definition at line 13 of file cyc_arithmetic.cc.
|
static |
orders the values in a map from smallest value to largest value.
This helps for addition algorithms.
to_sort | is a map of values to sort (according to the value of the double) |
Definition at line 46 of file cyc_arithmetic.cc.
orders the vector from smallest value to largest value.
This helps for addition algorithms.
to_sort | is the vector of values to sort |
Definition at line 40 of file cyc_arithmetic.cc.
Identical to sort_ascending(std::vector<double>) except it modifies the sorts the vector in-place modifying the passed in argument directly.
Definition at line 35 of file cyc_arithmetic.cc.