CYCLUS
Functions
cyclus::compmath Namespace Reference

Functions

CompMap Add (const CompMap &v1, const CompMap &v2)
 
bool AllPositive (const CompMap &v)
 
bool AlmostEq (const CompMap &v1, const CompMap &v2, double threshold)
 
void ApplyThreshold (CompMap *v, double threshold)
 
void Normalize (CompMap *v, double val=1.0)
 
CompMap Sub (const CompMap &v1, const CompMap &v2)
 
double Sum (const CompMap &v1)
 
bool ValidNucs (const CompMap &v)
 

Detailed Description

Contains functions for performing fundamental operations on CompMap's.

Function Documentation

CompMap cyclus::compmath::Add ( const CompMap v1,
const CompMap v2 
)

Does component-wise subtraction of the nuclide quantities of v1 and v2 and returns the result.

No normalization is done. Example:

v1[922350000] = 2.3;
v1[922380000] = 1.3;
v2[922350000] = 1.1;
v2[922380000] = 1.2;
CompMap v3 = compmath::Add(v1, v2):
// v3[922350000] == 3.4, v3[922380000] == 2.5

Definition at line 18 of file comp_math.cc.

bool cyclus::compmath::AllPositive ( const CompMap v)

Returns true if all nuclides in v have quantities greater than or equal to zero.

Definition at line 83 of file comp_math.cc.

bool cyclus::compmath::AlmostEq ( const CompMap v1,
const CompMap v2,
double  threshold 
)

Returns true if all nuclides of v1 and v2 are the same within threshold.

No normalization is performed.

Definition at line 93 of file comp_math.cc.

void cyclus::compmath::ApplyThreshold ( CompMap v,
double  threshold 
)

All nuclides with quantities below threshold will have their quantity set to zero.

Definition at line 45 of file comp_math.cc.

void cyclus::compmath::Normalize ( CompMap v,
double  val 
)

The sum of quantities of all nuclides of v is normalized to val.

Definition at line 63 of file comp_math.cc.

CompMap cyclus::compmath::Sub ( const CompMap v1,
const CompMap v2 
)

Does component-wise subtraction of the nuclide quantities of v1 and v2 and returns the result.

No normalization is done.

Definition at line 27 of file comp_math.cc.

double cyclus::compmath::Sum ( const CompMap v)

Sums the quantities of all nuclides without normalization.

Definition at line 36 of file comp_math.cc.

bool cyclus::compmath::ValidNucs ( const CompMap v)

Returns true if all nuclide keys in v are valid.

Definition at line 73 of file comp_math.cc.