CYCLUS
Static Public Member Functions | List of all members
cyclus::CycArithmetic Class Reference

Detailed Description

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::vector< double > to_sort)
 
static std::vector< double > sort_ascending (std::map< int, double > to_sort)
 
static void sort_inplace_ascending (std::vector< double > &to_sort)
 

Member Function Documentation

double cyclus::CycArithmetic::KahanSum ( std::vector< double >  input)
static

sums the materials in the vector in an intelligent way, to avoid floating point issues.

Parameters
inputis the list of values to add to each other
Returns
is the sum of all the values in the input vector

Definition at line 13 of file cyc_arithmetic.cc.

std::vector< double > cyclus::CycArithmetic::sort_ascending ( std::vector< double >  to_sort)
static

orders the vector from smallest value to largest value.

This helps for addition algorithms.

Parameters
to_sortis the vector of values to sort
Returns
a set sorted from smallest to largest

Definition at line 40 of file cyc_arithmetic.cc.

std::vector< double > cyclus::CycArithmetic::sort_ascending ( std::map< int, double >  to_sort)
static

orders the values in a map from smallest value to largest value.

This helps for addition algorithms.

Parameters
to_sortis a map of values to sort (according to the value of the double)
Returns
a set sorted from smallest to largest

Definition at line 46 of file cyc_arithmetic.cc.

void cyclus::CycArithmetic::sort_inplace_ascending ( std::vector< double > &  to_sort)
static

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.


The documentation for this class was generated from the following files: