Loading...
Searching...
No Matches
fourdst::composition::Composition::CompositionCache Struct Reference

Caches computed properties of the composition to avoid redundant calculations. More...

## Public Member Functions

void | clear ()
| Clears all cached values.
bool | is_clear () const
| Checks if the cache is clear (i.e., all cached values are empty).

## Public Attributes

std::optional< CanonicalComposition > | canonicalComp
| Cached canonical composition data.
std::optional< std::vector< double > > | massFractions
| Cached vector of mass fractions.
std::optional< std::vector< double > > | numberFractions
| Cached vector of number fractions.
std::optional< std::vector< double > > | molarAbundances
| Cached vector of molar abundances.
std::optional< std::vector< atomic::Species > > | sortedSpecies
| Cached vector of sorted species (by mass).
std::optional< std::vector< std::string > > | sortedSymbols
| Cached vector of sorted species (by mass).
std::optional< double > | Ye
| Cached electron abundance.
std::optional< std::size_t > | hash

## Detailed Description

Caches computed properties of the composition to avoid redundant calculations.

This struct holds optional cached values for various computed properties of the composition, such as canonical composition, mass fractions, number fractions, molar abundances, sorted species, sorted symbols, and electron abundance. The cache can be cleared when the composition is modified.

Definition at line 111 of file composition.h.

## Member Function Documentation

## clear()

void fourdst::composition::Composition::CompositionCache::clear | ( |  | ) |

inline

Clears all cached values.

Definition at line 124 of file composition.h.

## is_clear()

bool fourdst::composition::Composition::CompositionCache::is_clear | ( |  | ) | const

inlinenodiscard

Checks if the cache is clear (i.e., all cached values are empty).

Returns
  True if the cache is clear, false otherwise.

Definition at line 139 of file composition.h.

## Member Data Documentation

## canonicalComp

std::optional<CanonicalComposition> fourdst::composition::Composition::CompositionCache::canonicalComp

Cached canonical composition data.

Definition at line 112 of file composition.h.

## hash

std::optional<std::size_t> fourdst::composition::Composition::CompositionCache::hash

Definition at line 119 of file composition.h.

## massFractions

std::optional<std::vector<double> > fourdst::composition::Composition::CompositionCache::massFractions

Cached vector of mass fractions.

Definition at line 113 of file composition.h.

## molarAbundances

std::optional<std::vector<double> > fourdst::composition::Composition::CompositionCache::molarAbundances

Cached vector of molar abundances.

Definition at line 115 of file composition.h.

## numberFractions

std::optional<std::vector<double> > fourdst::composition::Composition::CompositionCache::numberFractions

Cached vector of number fractions.

Definition at line 114 of file composition.h.

## sortedSpecies

std::optional<std::vector<atomic::Species> > fourdst::composition::Composition::CompositionCache::sortedSpecies

Cached vector of sorted species (by mass).

Definition at line 116 of file composition.h.

## sortedSymbols

std::optional<std::vector<std::string> > fourdst::composition::Composition::CompositionCache::sortedSymbols

Cached vector of sorted species (by mass).

Definition at line 117 of file composition.h.

## Ye

std::optional<double> fourdst::composition::Composition::CompositionCache::Ye

Cached electron abundance.

Definition at line 118 of file composition.h.

The documentation for this struct was generated from the following file:

- src/composition/include/fourdst/composition/composition.h