\doxysection{composition.\+cpp}
\hypertarget{composition_8cpp_source}{}\label{composition_8cpp_source}\index{src/composition/lib/composition.cpp@{src/composition/lib/composition.cpp}}
\mbox{\hyperlink{composition_8cpp}{Go to the documentation of this file.}}
\begin{DoxyCode}{0}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00001}00001\ \textcolor{comment}{/*\ ***********************************************************************}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00002}00002\ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00003}00003\ \textcolor{comment}{//\ \ \ Copyright\ (C)\ 2025\ -\/-\/\ The\ 4D-\/STAR\ Collaboration}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00004}00004\ \textcolor{comment}{//\ \ \ File\ Author:\ Emily\ Boudreaux}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00005}00005\ \textcolor{comment}{//\ \ \ Last\ Modified:\ October\ 6,\ 2025}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00006}00006\ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00007}00007\ \textcolor{comment}{//\ \ \ 4DSSE\ is\ free\ software;\ you\ can\ use\ it\ and/or\ modify}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00008}00008\ \textcolor{comment}{//\ \ \ it\ under\ the\ terms\ and\ restrictions\ the\ GNU\ General\ Library\ Public}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00009}00009\ \textcolor{comment}{//\ \ \ License\ version\ 3\ (GPLv3)\ as\ published\ by\ the\ Free\ Software\ Foundation.}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00010}00010\ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00011}00011\ \textcolor{comment}{//\ \ \ 4DSSE\ is\ distributed\ in\ the\ hope\ that\ it\ will\ be\ useful,}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00012}00012\ \textcolor{comment}{//\ \ \ but\ WITHOUT\ ANY\ WARRANTY;\ without\ even\ the\ implied\ warranty\ of}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00013}00013\ \textcolor{comment}{//\ \ \ MERCHANTABILITY\ or\ FITNESS\ FOR\ A\ PARTICULAR\ PURPOSE.}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00014}00014\ \textcolor{comment}{//\ \ \ See\ the\ GNU\ Library\ General\ Public\ License\ for\ more\ details.}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00015}00015\ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00016}00016\ \textcolor{comment}{//\ \ \ You\ should\ have\ received\ a\ copy\ of\ the\ GNU\ Library\ General\ Public\ License}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00017}00017\ \textcolor{comment}{//\ \ \ along\ with\ this\ software;\ if\ not,\ write\ to\ the\ Free\ Software}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00018}00018\ \textcolor{comment}{//\ \ \ Foundation,\ Inc.,\ 59\ Temple\ Place,\ Suite\ 330,\ Boston,\ MA\ 02111-\/1307\ USA}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00019}00019\ \textcolor{comment}{//}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00020}00020\ \textcolor{comment}{//\ ***********************************************************************\ */}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00021}00021\ \textcolor{preprocessor}{\#include\ "{}quill/LogMacros.h"{}}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00022}00022\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00023}00023\ \textcolor{preprocessor}{\#include\ <stdexcept>}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00024}00024\ \textcolor{preprocessor}{\#include\ <unordered\_map>}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00025}00025\ \textcolor{preprocessor}{\#include\ <vector>}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00026}00026\ \textcolor{preprocessor}{\#include\ <ranges>}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00027}00027\ \textcolor{preprocessor}{\#include\ <algorithm>}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00028}00028\ \textcolor{preprocessor}{\#include\ <set>}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00029}00029\ \textcolor{preprocessor}{\#include\ <string>}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00030}00030\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00031}00031\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00032}00032\ \textcolor{preprocessor}{\#include\ <utility>}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00033}00033\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00034}00034\ \textcolor{preprocessor}{\#include\ "{}\mbox{\hyperlink{atomic_species_8h}{fourdst/atomic/atomicSpecies.h}}"{}}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00035}00035\ \textcolor{preprocessor}{\#include\ "{}\mbox{\hyperlink{species_8h}{fourdst/atomic/species.h}}"{}}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00036}00036\ \textcolor{preprocessor}{\#include\ "{}\mbox{\hyperlink{composition_8h}{fourdst/composition/composition.h}}"{}}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00037}00037\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00038}00038\ \textcolor{preprocessor}{\#include\ <numeric>}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00039}00039\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00040}00040\ \textcolor{preprocessor}{\#include\ "{}\mbox{\hyperlink{composition__hash_8h}{fourdst/composition/utils/composition\_hash.h}}"{}}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00041}00041\ \textcolor{preprocessor}{\#include\ "{}\mbox{\hyperlink{utils_8h}{fourdst/composition/utils.h}}"{}}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00042}00042\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00043}00043\ \textcolor{preprocessor}{\#include\ "{}\mbox{\hyperlink{exceptions__composition_8h}{fourdst/composition/exceptions/exceptions\_composition.h}}"{}}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00044}00044\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00045}00045\ \textcolor{keyword}{namespace\ }\{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00046}00046\ \ \ \ \ \textcolor{keywordtype}{void}\ throw\_unknown\_symbol(quill::Logger*\ logger,\ \textcolor{keyword}{const}\ std::string\&\ symbol)\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00047}00047\ \ \ \ \ \ \ \ \ LOG\_ERROR(logger,\ \textcolor{stringliteral}{"{}Symbol\ \{\}\ is\ not\ a\ valid\ species\ symbol\ (not\ in\ the\ species\ database)"{}},\ symbol);}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00048}00048\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{throw}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1exceptions_1_1_unknown_symbol_error}{fourdst::composition::exceptions::UnknownSymbolError}}(\textcolor{stringliteral}{"{}Symbol\ "{}}\ +\ symbol\ +\ \textcolor{stringliteral}{"{}\ is\ not\ a\ valid\ species\ symbol\ (not\ in\ the\ species\ database)"{}});}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00049}00049\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00050}00050\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00051}00051\ \ \ \ \ \textcolor{keywordtype}{void}\ throw\_unregistered\_symbol(quill::Logger*\ logger,\ \textcolor{keyword}{const}\ std::string\&\ symbol)\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00052}00052\ \ \ \ \ \ \ \ \ LOG\_ERROR(logger,\ \textcolor{stringliteral}{"{}Symbol\ \{\}\ is\ not\ registered\ in\ the\ composition."{}},\ symbol);}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00053}00053\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{throw}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1exceptions_1_1_unregistered_symbol_error}{fourdst::composition::exceptions::UnregisteredSymbolError}}(\textcolor{stringliteral}{"{}Symbol\ "{}}\ +\ symbol\ +\ \textcolor{stringliteral}{"{}\ is\ not\ registered\ in\ the\ composition."{}});}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00054}00054\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00055}00055\ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00056}00056\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00057}00057\ \textcolor{keyword}{namespace\ }\mbox{\hyperlink{namespacefourdst_1_1composition}{fourdst::composition}}\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00058}00058\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00064}00064\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00065}\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a2d6fbe5c8142b358641bbe7ffde51053}{00065}}\ \ \ \ \ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a23b83b76ee025f6fc009184ee19bba88}{Composition::Composition}}(}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00066}00066\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ std::set<std::string>\&\ symbols}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00067}00067\ \ \ \ \ )\ :\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a23b83b76ee025f6fc009184ee19bba88}{Composition}}(symbols\ |\ std::ranges::to<std::vector>())\ \{\}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00068}00068\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00069}\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a7d19fb3326e51c8fc8db5e0738e97d95}{00069}}\ \ \ \ \ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a23b83b76ee025f6fc009184ee19bba88}{Composition::Composition}}(}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00070}00070\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ std::set<atomic::Species>\ \&species}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00071}00071\ \ \ \ \ )\ :\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a23b83b76ee025f6fc009184ee19bba88}{Composition}}(species\ |\ std::ranges::to<std::vector>())\ \{\}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00072}00072\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00073}\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aae910b7824058f70b96460425a637837}{00073}}\ \ \ \ \ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a23b83b76ee025f6fc009184ee19bba88}{Composition::Composition}}(}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00074}00074\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ std::unordered\_set<std::string>\ \&symbols}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00075}00075\ \ \ \ \ )\ :\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a23b83b76ee025f6fc009184ee19bba88}{Composition}}(symbols\ |\ std::ranges::to<std::vector>())\ \{\}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00076}00076\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00077}\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a8e7f19488c52c8aba1d7e488688ced7f}{00077}}\ \ \ \ \ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a23b83b76ee025f6fc009184ee19bba88}{Composition::Composition}}(}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00078}00078\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ std::unordered\_set<atomic::Species>\ \&species}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00079}00079\ \ \ \ \ )\ :\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a23b83b76ee025f6fc009184ee19bba88}{Composition}}(species\ |\ std::ranges::to<std::vector>())\ \{\}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00080}00080\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00081}\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_ae3cc2099efd7db8eec3d9af2294b75fa}{00081}}\ \ \ \ \ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a23b83b76ee025f6fc009184ee19bba88}{Composition::Composition}}(}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00082}00082\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ std::vector<std::string>\&\ symbols}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00083}00083\ \ \ \ \ )\ :\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a23b83b76ee025f6fc009184ee19bba88}{Composition}}(\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a3f013e33b8978baf81447e5bd177f38b}{symbolVectorToSpeciesVector}}(symbols))\ \{\}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00084}00084\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00085}\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_afa95dddfa88a101ad6ce261295a4460c}{00085}}\ \ \ \ \ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a23b83b76ee025f6fc009184ee19bba88}{Composition::Composition}}(}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00086}00086\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ std::vector<atomic::Species>\ \&species}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00087}00087\ \ \ \ \ )\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00088}00088\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa0edc4976ccd24f2d9f6ad730f058b27}{m\_species}}\ =\ species;}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00089}00089\ \ \ \ \ \ \ \ \ std::ranges::sort(\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa0edc4976ccd24f2d9f6ad730f058b27}{m\_species}},\ [\&](\textcolor{keyword}{const}\ \mbox{\hyperlink{structfourdst_1_1atomic_1_1_species}{atomic::Species}}\&\ a,\ \textcolor{keyword}{const}\ \mbox{\hyperlink{structfourdst_1_1atomic_1_1_species}{atomic::Species}}\&\ b)\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00090}00090\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ a\ <\ b;}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00091}00091\ \ \ \ \ \ \ \ \ \});}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00092}00092\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00093}00093\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ \textcolor{keyword}{auto}\ last\ =\ std::ranges::unique(\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa0edc4976ccd24f2d9f6ad730f058b27}{m\_species}}).begin();}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00094}00094\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa0edc4976ccd24f2d9f6ad730f058b27}{m\_species}}.erase(last,\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa0edc4976ccd24f2d9f6ad730f058b27}{m\_species}}.end());}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00095}00095\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00096}00096\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_ab2faabe2e64c587bda8106687f752479}{m\_molarAbundances}}.resize(\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa0edc4976ccd24f2d9f6ad730f058b27}{m\_species}}.size(),\ 0.0);}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00097}00097\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00098}00098\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00104}00104\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00105}\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a0b3c93ce7c9473ac4aa4c9ee04f78051}{00105}}\ \ \ \ \ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a23b83b76ee025f6fc009184ee19bba88}{Composition::Composition}}(}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00106}00106\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ std::vector<std::string>\&\ symbols,}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00107}00107\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ std::vector<double>\&\ molarAbundances}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00108}00108\ \ \ \ \ )\ :\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a23b83b76ee025f6fc009184ee19bba88}{Composition}}(\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a3f013e33b8978baf81447e5bd177f38b}{symbolVectorToSpeciesVector}}(symbols),\ molarAbundances)\ \{\}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00109}00109\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00110}\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_ad6cdb28598267743f236d053cd5a62ae}{00110}}\ \ \ \ \ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a23b83b76ee025f6fc009184ee19bba88}{Composition::Composition}}(}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00111}00111\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ std::set<std::string>\ \&symbols,}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00112}00112\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ std::vector<double>\ \&molarAbundances}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00113}00113\ \ \ \ \ )\ :\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a23b83b76ee025f6fc009184ee19bba88}{Composition}}(\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a3f013e33b8978baf81447e5bd177f38b}{symbolVectorToSpeciesVector}}(symbols\ |\ std::ranges::to<std::vector>()),\ molarAbundances)\ \{\}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00114}00114\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00115}00115\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00116}\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a1e5e0bd7cf77d5cf260c94418612bb36}{00116}}\ \ \ \ \ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a23b83b76ee025f6fc009184ee19bba88}{Composition::Composition}}(}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00117}00117\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ std::unordered\_map<std::string,\ double>\ \&symbolMolarAbundances}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00118}00118\ \ \ \ \ )\ :\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a23b83b76ee025f6fc009184ee19bba88}{Composition}}(}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00119}00119\ \ \ \ \ \ \ \ \ symbolMolarAbundances\ |\ std::views::keys\ |\ std::ranges::to<std::vector>(),}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00120}00120\ \ \ \ \ \ \ \ \ symbolMolarAbundances\ |\ std::views::values\ |\ std::ranges::to<std::vector>()}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00121}00121\ \ \ \ \ \ \ \ \ )\ \{\}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00122}00122\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00123}\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a5d3fe0a5d2c6aeae667d4e3894b0ee3b}{00123}}\ \ \ \ \ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a23b83b76ee025f6fc009184ee19bba88}{Composition::Composition}}(}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00124}00124\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ std::map<std::string,\ double>\ \&symbolMolarAbundances}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00125}00125\ \ \ \ \ )\ :\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a23b83b76ee025f6fc009184ee19bba88}{Composition}}(}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00126}00126\ \ \ \ \ \ \ \ \ symbolMolarAbundances\ |\ std::views::keys\ |\ std::ranges::to<std::vector>(),}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00127}00127\ \ \ \ \ \ \ \ \ symbolMolarAbundances\ |\ std::views::values\ |\ std::ranges::to<std::vector>()}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00128}00128\ \ \ \ \ \ \ \ \ )\ \{\}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00129}00129\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00130}\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a321598f3b8bb4c58992d09a90ea3079b}{00130}}\ \ \ \ \ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a23b83b76ee025f6fc009184ee19bba88}{Composition::Composition}}(}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00131}00131\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ std::unordered\_map<atomic::Species,\ double>\ \&speciesMolarAbundances}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00132}00132\ \ \ \ \ )\ :\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a23b83b76ee025f6fc009184ee19bba88}{Composition}}(}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00133}00133\ \ \ \ \ \ \ \ \ speciesMolarAbundances\ |\ std::views::keys\ |\ std::ranges::to<std::vector>(),}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00134}00134\ \ \ \ \ \ \ \ \ speciesMolarAbundances\ |\ std::views::values\ |\ std::ranges::to<std::vector>()}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00135}00135\ \ \ \ \ \ \ \ \ )\ \{\}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00136}00136\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00137}\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a8a371588eaa38c8d54b4baec2a594fc2}{00137}}\ \ \ \ \ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a23b83b76ee025f6fc009184ee19bba88}{Composition::Composition}}(}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00138}00138\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ std::map<atomic::Species,\ double>\ \&speciesMolarAbundances}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00139}00139\ \ \ \ \ )\ :\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a23b83b76ee025f6fc009184ee19bba88}{Composition}}(}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00140}00140\ \ \ \ \ \ \ \ \ speciesMolarAbundances\ |\ std::views::keys\ |\ std::ranges::to<std::vector>(),}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00141}00141\ \ \ \ \ \ \ \ \ speciesMolarAbundances\ |\ std::views::values\ |\ std::ranges::to<std::vector>()}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00142}00142\ \ \ \ \ \ \ \ \ )\ \{\}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00143}00143\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00144}\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a7f0798b3f1191561b38f336406acf62a}{00144}}\ \ \ \ \ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a23b83b76ee025f6fc009184ee19bba88}{Composition::Composition}}(}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00145}00145\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ std::vector<atomic::Species>\ \&species,}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00146}00146\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ std::vector<double>\ \&molarAbundances}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00147}00147\ \ \ \ \ )\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00148}00148\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (\_\_builtin\_expect(species.size()\ !=\ molarAbundances.size(),\ 0))\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00149}00149\ \ \ \ \ \ \ \ \ \ \ \ \ LOG\_CRITICAL(\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a46a706f9e4c06a45b45ae3dffdde5e9e}{getLogger}}(),\ \textcolor{stringliteral}{"{}The\ number\ of\ species\ and\ molarAbundances\ must\ be\ equal\ (got\ \{\}\ species\ and\ \{\}\ molarAbundances)."{}},\ species.size(),\ molarAbundances.size());}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00150}00150\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{throw}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1exceptions_1_1_invalid_composition_error}{exceptions::InvalidCompositionError}}(\textcolor{stringliteral}{"{}The\ number\ of\ species\ and\ fractions\ must\ be\ equal.\ Got\ "{}}\ +\ std::to\_string(species.size())\ +\ \textcolor{stringliteral}{"{}\ species\ and\ "{}}\ +\ std::to\_string(molarAbundances.size())\ +\ \textcolor{stringliteral}{"{}\ fractions."{}});}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00151}00151\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00152}00152\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00153}00153\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ \textcolor{keywordtype}{size\_t}\ numSpecies\ =\ species.size();}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00154}00154\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa0edc4976ccd24f2d9f6ad730f058b27}{m\_species}}.reserve(numSpecies);}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00155}00155\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_ab2faabe2e64c587bda8106687f752479}{m\_molarAbundances}}.reserve(numSpecies);}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00156}00156\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00157}00157\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{for}\ (\textcolor{keywordtype}{size\_t}\ i\ =\ 0;\ i\ <\ numSpecies;\ ++i)\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00158}00158\ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa0edc4976ccd24f2d9f6ad730f058b27}{m\_species}}.push\_back(species[i]);}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00159}00159\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (\_\_builtin\_expect(molarAbundances[i]\ <\ 0.0,\ 0))\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00160}00160\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ LOG\_CRITICAL(\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a46a706f9e4c06a45b45ae3dffdde5e9e}{getLogger}}(),\ \textcolor{stringliteral}{"{}Molar\ abundance\ for\ species\ \{\}\ is\ negative\ (y\ =\ \{\}).\ Molar\ abundances\ must\ be\ non-\/negative."{}},\ species[i].name(),\ molarAbundances[i]);}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00161}00161\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{throw}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1exceptions_1_1_invalid_composition_error}{exceptions::InvalidCompositionError}}(\textcolor{stringliteral}{"{}Molar\ abundance\ for\ species\ "{}}\ +\ std::string(species[i].name())\ +\ \textcolor{stringliteral}{"{}\ is\ negative\ (y\ =\ "{}}\ +\ std::to\_string(molarAbundances[i])\ +\ \textcolor{stringliteral}{"{}).\ Molar\ abundances\ must\ be\ non-\/negative."{}});}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00162}00162\ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00163}00163\ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_ab2faabe2e64c587bda8106687f752479}{m\_molarAbundances}}.push\_back(molarAbundances[i]);}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00164}00164\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00165}00165\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00166}00166\ \ \ \ \ \ \ \ \ \textcolor{keyword}{auto}\ combined\ =\ std::views::zip(\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa0edc4976ccd24f2d9f6ad730f058b27}{m\_species}},\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_ab2faabe2e64c587bda8106687f752479}{m\_molarAbundances}});}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00167}00167\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00168}00168\ \ \ \ \ \ \ \ \ std::ranges::sort(combined,\ [](\textcolor{keyword}{const}\ \textcolor{keyword}{auto}\&\ a,\ \textcolor{keyword}{const}\ \textcolor{keyword}{auto}\&\ b)\ -\/>\ \textcolor{keywordtype}{bool}\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00169}00169\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ \textcolor{keyword}{auto}\&\ spA\ =\ std::get<0>(a);}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00170}00170\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ \textcolor{keyword}{auto}\&\ spB\ =\ std::get<0>(b);}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00171}00171\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00172}00172\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (spA\ !=\ spB)\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00173}00173\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ spA\ <\ spB;}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00174}00174\ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00175}00175\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00176}00176\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ std::get<1>(a)\ >\ std::get<1>(b);}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00177}00177\ \ \ \ \ \ \ \ \ \});}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00178}00178\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00179}00179\ \ \ \ \ \ \ \ \ \textcolor{keyword}{auto}\ [first,\ last]\ =\ std::ranges::unique(combined,\ [](\textcolor{keyword}{const}\ \textcolor{keyword}{auto}\&\ a,\ \textcolor{keyword}{const}\ \textcolor{keyword}{auto}\&\ b)\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00180}00180\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ std::get<0>(a)\ ==\ std::get<0>(b);}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00181}00181\ \ \ \ \ \ \ \ \ \});}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00182}00182\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00183}00183\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ \textcolor{keyword}{auto}\ newEndIndex\ =\ std::distance(combined.begin(),\ first);}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00184}00184\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa0edc4976ccd24f2d9f6ad730f058b27}{m\_species}}.erase(\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa0edc4976ccd24f2d9f6ad730f058b27}{m\_species}}.begin()\ +\ newEndIndex,\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa0edc4976ccd24f2d9f6ad730f058b27}{m\_species}}.end());}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00185}00185\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_ab2faabe2e64c587bda8106687f752479}{m\_molarAbundances}}.erase(\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_ab2faabe2e64c587bda8106687f752479}{m\_molarAbundances}}.begin()\ +\ newEndIndex,\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_ab2faabe2e64c587bda8106687f752479}{m\_molarAbundances}}.end());}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00186}00186\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00187}00187\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00191}00191\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00192}\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a21369a80378d4c90438a34f0e4a275ca}{00192}}\ \ \ \ \ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a23b83b76ee025f6fc009184ee19bba88}{Composition::Composition}}(\textcolor{keyword}{const}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a23b83b76ee025f6fc009184ee19bba88}{Composition}}\ \&\mbox{\hyperlink{namespacefourdst_1_1composition}{composition}})\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00193}00193\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa0edc4976ccd24f2d9f6ad730f058b27}{m\_species}}\ =\ \mbox{\hyperlink{namespacefourdst_1_1composition}{composition}}.m\_species;}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00194}00194\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_ab2faabe2e64c587bda8106687f752479}{m\_molarAbundances}}\ =\ \mbox{\hyperlink{namespacefourdst_1_1composition}{composition}}.m\_molarAbundances;}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00195}00195\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00196}00196\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00197}\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a11e281872b4047e5c757923f2b0682cf}{00197}}\ \ \ \ \ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a23b83b76ee025f6fc009184ee19bba88}{Composition::Composition}}(\textcolor{keyword}{const}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_abstract}{CompositionAbstract}}\ \&\mbox{\hyperlink{namespacefourdst_1_1composition}{composition}})\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00198}00198\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{for}\ (\textcolor{keyword}{const}\ \textcolor{keyword}{auto}\&\ species\ :\ \mbox{\hyperlink{namespacefourdst_1_1composition}{composition}}.getRegisteredSpecies())\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00199}00199\ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a392a34c19f45d6c936cc7030e6cfaf3f}{registerSpecies}}(species);}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00200}00200\ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a262d7133035d4e6f45daa81827abf5e7}{setMolarAbundance}}(species,\ \mbox{\hyperlink{namespacefourdst_1_1composition}{composition}}.getMolarAbundance(species));}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00201}00201\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00202}00202\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00203}00203\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00204}\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a4ec1e23cfecef764cb831171fed62fc2}{00204}}\ \ \ \ \ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a23b83b76ee025f6fc009184ee19bba88}{Composition}}\&\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a4ec1e23cfecef764cb831171fed62fc2}{Composition::operator=}}(}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00205}00205\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a23b83b76ee025f6fc009184ee19bba88}{Composition}}\ \&other}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00206}00206\ \ \ \ \ )\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00207}00207\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (\textcolor{keyword}{this}\ !=\ \&other)\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00208}00208\ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa0edc4976ccd24f2d9f6ad730f058b27}{m\_species}}\ =\ other.\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa0edc4976ccd24f2d9f6ad730f058b27}{m\_species}};}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00209}00209\ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_ab2faabe2e64c587bda8106687f752479}{m\_molarAbundances}}\ \ \ =\ other.\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_ab2faabe2e64c587bda8106687f752479}{m\_molarAbundances}};}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00210}00210\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00211}00211\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a02cd9d9608da082a200fdfa86d14bf5d}{m\_cache}}.clear();}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00212}00212\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ *\textcolor{keyword}{this};}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00213}00213\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00214}00214\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00215}\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_afba49b5ceeb42e0372b6118f48b4ee54}{00215}}\ \ \ \ \ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a23b83b76ee025f6fc009184ee19bba88}{Composition}}\ \&\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a4ec1e23cfecef764cb831171fed62fc2}{Composition::operator=}}(\textcolor{keyword}{const}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_abstract}{CompositionAbstract}}\ \&other)\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00216}00216\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa0edc4976ccd24f2d9f6ad730f058b27}{m\_species}}.clear();}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00217}00217\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_ab2faabe2e64c587bda8106687f752479}{m\_molarAbundances}}.clear();}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00218}00218\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a02cd9d9608da082a200fdfa86d14bf5d}{m\_cache}}.clear();}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00219}00219\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{for}\ (\textcolor{keyword}{const}\ \textcolor{keyword}{auto}\&\ species\ :\ other.\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_abstract_ad17ae8649860ef4f7a949e7c9143c0ec}{getRegisteredSpecies}}())\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00220}00220\ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a392a34c19f45d6c936cc7030e6cfaf3f}{registerSpecies}}(species);}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00221}00221\ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a262d7133035d4e6f45daa81827abf5e7}{setMolarAbundance}}(species,\ other.\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_abstract_a29613d8197cee96f764aeeaa3b7286f8}{getMolarAbundance}}(species));}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00222}00222\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00223}00223\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ *\textcolor{keyword}{this};}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00224}00224\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00225}00225\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00226}\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a5a1f5661a329ec7bc8b7e118ff9d6c25}{00226}}\ \ \ \ \ std::unique\_ptr<CompositionAbstract>\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a5a1f5661a329ec7bc8b7e118ff9d6c25}{Composition::clone}}()\textcolor{keyword}{\ const\ }\{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00227}00227\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ std::make\_unique<Composition>(*\textcolor{keyword}{this});}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00228}00228\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00229}00229\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00230}00230\ \ \ \ \ \textcolor{comment}{//-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00231}00231\ \ \ \ \ \textcolor{comment}{//\ Registration\ methods}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00232}00232\ \ \ \ \ \textcolor{comment}{//-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00233}00233\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00234}\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a3ab4dcda0bfd1a35b169bcc57fe66725}{00234}}\ \ \ \ \ \textcolor{keywordtype}{void}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a3ab4dcda0bfd1a35b169bcc57fe66725}{Composition::registerSymbol}}(}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00235}00235\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ std::string\&\ symbol}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00236}00236\ \ \ \ \ )\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00237}00237\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ \textcolor{keyword}{auto}\ result\ =\ \mbox{\hyperlink{namespacefourdst_1_1composition_adcc2e4ca25ab7b93983730fc78f4deea}{getSpecies}}(symbol);}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00238}00238\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (!result)\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00239}00239\ \ \ \ \ \ \ \ \ \ \ \ \ throw\_unknown\_symbol(\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a46a706f9e4c06a45b45ae3dffdde5e9e}{getLogger}}(),\ symbol);}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00240}00240\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00241}00241\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00242}00242\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a392a34c19f45d6c936cc7030e6cfaf3f}{registerSpecies}}(result.value());}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00243}00243\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00244}00244\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00245}\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a156d1198ef47deed9689949f271969e2}{00245}}\ \ \ \ \ \textcolor{keywordtype}{void}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a3ab4dcda0bfd1a35b169bcc57fe66725}{Composition::registerSymbol}}(}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00246}00246\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ std::vector<std::string>\&\ symbols}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00247}00247\ \ \ \ \ )\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00248}00248\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a392a34c19f45d6c936cc7030e6cfaf3f}{registerSpecies}}(\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a3f013e33b8978baf81447e5bd177f38b}{symbolVectorToSpeciesVector}}(symbols));}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00249}00249\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00250}00250\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00251}\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a392a34c19f45d6c936cc7030e6cfaf3f}{00251}}\ \ \ \ \ \textcolor{keywordtype}{void}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a392a34c19f45d6c936cc7030e6cfaf3f}{Composition::registerSpecies}}(}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00252}00252\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ \mbox{\hyperlink{structfourdst_1_1atomic_1_1_species}{atomic::Species}}\ \&species}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00253}00253\ \ \ \ \ )\ \textcolor{keyword}{noexcept}\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00254}00254\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (\textcolor{keyword}{const}\ \textcolor{keyword}{auto}\ it\ =\ std::ranges::lower\_bound(\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa0edc4976ccd24f2d9f6ad730f058b27}{m\_species}},\ species);\ it\ ==\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa0edc4976ccd24f2d9f6ad730f058b27}{m\_species}}.end()\ ||\ *it\ !=\ species)\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00255}00255\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ \textcolor{keyword}{auto}\ index\ =\ std::distance(\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa0edc4976ccd24f2d9f6ad730f058b27}{m\_species}}.begin(),\ it);}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00256}00256\ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa0edc4976ccd24f2d9f6ad730f058b27}{m\_species}}.insert(it,\ species);}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00257}00257\ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_ab2faabe2e64c587bda8106687f752479}{m\_molarAbundances}}.insert(\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_ab2faabe2e64c587bda8106687f752479}{m\_molarAbundances}}.begin()\ +\ index,\ 0.0);}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00258}00258\ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a02cd9d9608da082a200fdfa86d14bf5d}{m\_cache}}.clear();}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00259}00259\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00260}00260\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00261}00261\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00262}\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a2846f4ea0d6075ecdaf4334741a54750}{00262}}\ \ \ \ \ \textcolor{keywordtype}{void}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a392a34c19f45d6c936cc7030e6cfaf3f}{Composition::registerSpecies}}(}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00263}00263\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ std::vector<atomic::Species>\ \&species}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00264}00264\ \ \ \ \ )\ \textcolor{keyword}{noexcept}\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00265}00265\ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ We\ do\ not\ simply\ call\ registerSpecies(species)\ here\ as\ that\ would\ have\ a\ complexity\ of\ O(n\string^2)\ due\ to\ constantly}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00266}00266\ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ reinserting\ into\ the\ vector.\ Rather\ we\ build\ the\ vector\ once\ and\ then\ sort\ it}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00267}00267\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00268}00268\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (species.empty())\ \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00269}00269\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00270}00270\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ \textcolor{keywordtype}{size\_t}\ total\_size\ =\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa0edc4976ccd24f2d9f6ad730f058b27}{m\_species}}.size()\ +\ species.size();}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00271}00271\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa0edc4976ccd24f2d9f6ad730f058b27}{m\_species}}.reserve(total\_size);}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00272}00272\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_ab2faabe2e64c587bda8106687f752479}{m\_molarAbundances}}.reserve(total\_size);}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00273}00273\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00274}00274\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{for}\ (\textcolor{keyword}{const}\ \textcolor{keyword}{auto}\&\ sp\ :\ species)\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00275}00275\ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa0edc4976ccd24f2d9f6ad730f058b27}{m\_species}}.push\_back(sp);}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00276}00276\ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_ab2faabe2e64c587bda8106687f752479}{m\_molarAbundances}}.push\_back(0.0);}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00277}00277\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00278}00278\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00279}00279\ \ \ \ \ \ \ \ \ \textcolor{keyword}{auto}\ combined\ =\ std::views::zip(\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa0edc4976ccd24f2d9f6ad730f058b27}{m\_species}},\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_ab2faabe2e64c587bda8106687f752479}{m\_molarAbundances}});}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00280}00280\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00281}00281\ \ \ \ \ \ \ \ \ std::ranges::sort(combined,\ [](\textcolor{keyword}{const}\ \textcolor{keyword}{auto}\&\ a,\ \textcolor{keyword}{const}\ \textcolor{keyword}{auto}\&\ b)\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00282}00282\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ \textcolor{keyword}{auto}\&\ speciesA\ =\ std::get<0>(a);}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00283}00283\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ \textcolor{keyword}{auto}\&\ speciesB\ =\ std::get<0>(b);}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00284}00284\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00285}00285\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (speciesA\ !=\ speciesB)\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00286}00286\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ speciesA\ <\ speciesB;}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00287}00287\ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00288}00288\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00289}00289\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ std::get<1>(a)\ >\ std::get<1>(b);}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00290}00290\ \ \ \ \ \ \ \ \ \});}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00291}00291\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00292}00292\ \ \ \ \ \ \ \ \ \textcolor{keyword}{auto}\ [first,\ last]\ =\ std::ranges::unique(combined,\ [](\textcolor{keyword}{const}\ \textcolor{keyword}{auto}\&\ a,\ \textcolor{keyword}{const}\ \textcolor{keyword}{auto}\&\ b)\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00293}00293\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ std::get<0>(a)\ ==\ std::get<0>(b);}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00294}00294\ \ \ \ \ \ \ \ \ \});}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00295}00295\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00296}00296\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ \textcolor{keyword}{auto}\ newEndIndex\ =\ std::distance(combined.begin(),\ first);}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00297}00297\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00298}00298\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa0edc4976ccd24f2d9f6ad730f058b27}{m\_species}}.erase(\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa0edc4976ccd24f2d9f6ad730f058b27}{m\_species}}.begin()\ +\ newEndIndex,\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa0edc4976ccd24f2d9f6ad730f058b27}{m\_species}}.end());}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00299}00299\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_ab2faabe2e64c587bda8106687f752479}{m\_molarAbundances}}.erase(\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_ab2faabe2e64c587bda8106687f752479}{m\_molarAbundances}}.begin()\ +\ newEndIndex,\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_ab2faabe2e64c587bda8106687f752479}{m\_molarAbundances}}.end());}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00300}00300\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00301}00301\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a02cd9d9608da082a200fdfa86d14bf5d}{m\_cache}}.clear();}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00302}00302\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00303}00303\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00304}\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a3ae885c28580ae15be8c16614bef3b0e}{00304}}\ \ \ \ \ std::set<std::string>\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a3ae885c28580ae15be8c16614bef3b0e}{Composition::getRegisteredSymbols}}()\ const\ noexcept\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00305}00305\ \ \ \ \ \ \ \ \ std::set<std::string>\ symbols;}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00306}00306\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{for}\ (\textcolor{keyword}{const}\ \textcolor{keyword}{auto}\&\ species\ :\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa0edc4976ccd24f2d9f6ad730f058b27}{m\_species}})\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00307}00307\ \ \ \ \ \ \ \ \ \ \ \ \ symbols.insert(std::string(species.name()));}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00308}00308\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00309}00309\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ symbols;}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00310}00310\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00311}00311\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00312}\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_af4b01ec4140e278d92c18f139f69ab1f}{00312}}\ \ \ \ \ \textcolor{keyword}{const}\ std::vector<atomic::Species>\ \&\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_af4b01ec4140e278d92c18f139f69ab1f}{Composition::getRegisteredSpecies}}()\ const\ noexcept\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00313}00313\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa0edc4976ccd24f2d9f6ad730f058b27}{m\_species}};}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00314}00314\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00315}00315\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00316}00316\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00317}00317\ \ \ \ \ \textcolor{comment}{//-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00318}00318\ \ \ \ \ \textcolor{comment}{//\ Molar\ abundance\ setters}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00319}00319\ \ \ \ \ \textcolor{comment}{//-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00320}00320\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00321}\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a262d7133035d4e6f45daa81827abf5e7}{00321}}\ \ \ \ \ \textcolor{keywordtype}{void}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a262d7133035d4e6f45daa81827abf5e7}{Composition::setMolarAbundance}}(}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00322}00322\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ std::string\ \&symbol,}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00323}00323\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ \textcolor{keywordtype}{double}\ \&molar\_abundance}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00324}00324\ \ \ \ \ )\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00325}00325\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ \textcolor{keyword}{auto}\ species\ =\ \mbox{\hyperlink{namespacefourdst_1_1composition_adcc2e4ca25ab7b93983730fc78f4deea}{getSpecies}}(symbol);}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00326}00326\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (\_\_builtin\_expect(!species,\ 0))\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00327}00327\ \ \ \ \ \ \ \ \ \ \ \ \ throw\_unknown\_symbol(\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a46a706f9e4c06a45b45ae3dffdde5e9e}{getLogger}}(),\ symbol);}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00328}00328\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00329}00329\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00330}00330\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a262d7133035d4e6f45daa81827abf5e7}{setMolarAbundance}}(species.value(),\ molar\_abundance);}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00331}00331\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00332}00332\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00333}\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_ac386709ef1e872fa558b8e30fc8b4c44}{00333}}\ \ \ \ \ \textcolor{keywordtype}{void}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a262d7133035d4e6f45daa81827abf5e7}{Composition::setMolarAbundance}}(}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00334}00334\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ \mbox{\hyperlink{structfourdst_1_1atomic_1_1_species}{atomic::Species}}\ \&species,}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00335}00335\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ \textcolor{keywordtype}{double}\ \&molar\_abundance}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00336}00336\ \ \ \ \ )\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00337}00337\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (\_\_builtin\_expect(molar\_abundance\ <\ 0.0,\ 0))\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00338}00338\ \ \ \ \ \ \ \ \ \ \ \ \ LOG\_ERROR(\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a46a706f9e4c06a45b45ae3dffdde5e9e}{getLogger}}(),\ \textcolor{stringliteral}{"{}Molar\ abundance\ must\ be\ non-\/negative\ for\ symbol\ \{\}.\ Currently\ it\ is\ \{\}."{}},\ species.\mbox{\hyperlink{structfourdst_1_1atomic_1_1_species_a1fcc01fc978b34ba2531117f10be6741}{name}}(),\ molar\_abundance);}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00339}00339\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{throw}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1exceptions_1_1_invalid_composition_error}{exceptions::InvalidCompositionError}}(\textcolor{stringliteral}{"{}Molar\ abundance\ must\ be\ non-\/negative,\ got\ "{}}\ +\ std::to\_string(molar\_abundance)\ +\ \textcolor{stringliteral}{"{}\ for\ symbol\ "{}}\ +\ std::string(species.\mbox{\hyperlink{structfourdst_1_1atomic_1_1_species_a1fcc01fc978b34ba2531117f10be6741}{name}}())\ +\ \textcolor{stringliteral}{"{}."{}});}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00340}00340\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00341}00341\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00342}00342\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ std::expected<std::ptrdiff\_t,\ SpeciesIndexLookupError>\ speciesIndexResult\ =\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aded88f0ad4a97eaae1e356fa8428cab5}{findSpeciesIndex}}(species);}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00343}00343\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (\_\_builtin\_expect(!speciesIndexResult,\ 0))\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00344}00344\ \ \ \ \ \ \ \ \ \ \ \ \ throw\_unregistered\_symbol(\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a46a706f9e4c06a45b45ae3dffdde5e9e}{getLogger}}(),\ std::string(species.\mbox{\hyperlink{structfourdst_1_1atomic_1_1_species_a1fcc01fc978b34ba2531117f10be6741}{name}}()));}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00345}00345\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00346}00346\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00347}00347\ \ \ \ \ \ \ \ \ assert(\textcolor{keyword}{static\_cast<}\textcolor{keywordtype}{size\_t}\textcolor{keyword}{>}(speciesIndexResult.value())\ <\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_ab2faabe2e64c587bda8106687f752479}{m\_molarAbundances}}.size());}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00348}00348\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00349}00349\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_ab2faabe2e64c587bda8106687f752479}{m\_molarAbundances}}[speciesIndexResult.value()]\ =\ molar\_abundance;}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00350}00350\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a02cd9d9608da082a200fdfa86d14bf5d}{m\_cache}}.clear();}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00351}00351\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00352}00352\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00353}00353\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00358}00358\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00359}\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a6baa22b92a78fd43d10d4941f30c8ac2}{00359}}\ \ \ \ \ \textcolor{keywordtype}{void}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a262d7133035d4e6f45daa81827abf5e7}{Composition::setMolarAbundance}}(}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00360}00360\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ std::vector<std::string>\ \&symbols,}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00361}00361\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ std::vector<double>\ \&molar\_abundances}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00362}00362\ \ \ \ \ )\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00363}00363\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a262d7133035d4e6f45daa81827abf5e7}{setMolarAbundance}}(\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a3f013e33b8978baf81447e5bd177f38b}{symbolVectorToSpeciesVector}}(symbols),\ molar\_abundances);}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00364}00364\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00365}00365\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00366}\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a49b06737a50df9c25a234499a1431388}{00366}}\ \ \ \ \ \textcolor{keywordtype}{void}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a262d7133035d4e6f45daa81827abf5e7}{Composition::setMolarAbundance}}(}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00367}00367\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ std::set<std::string>\ \&symbols,}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00368}00368\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ std::vector<double>\ \&molar\_abundances}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00369}00369\ \ \ \ \ )\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00370}00370\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a262d7133035d4e6f45daa81827abf5e7}{setMolarAbundance}}(\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a3f013e33b8978baf81447e5bd177f38b}{symbolVectorToSpeciesVector}}(symbols\ |\ std::ranges::to<std::vector>()),\ molar\_abundances);}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00371}00371\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00372}00372\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00373}\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_ad7af2f8f3050969a6c5b9a9ef5fead64}{00373}}\ \ \ \ \ \textcolor{keywordtype}{void}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a262d7133035d4e6f45daa81827abf5e7}{Composition::setMolarAbundance}}(}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00374}00374\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ std::set<atomic::Species>\ \&species,}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00375}00375\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ std::vector<double>\ \&molar\_abundances}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00376}00376\ \ \ \ \ )\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00377}00377\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a262d7133035d4e6f45daa81827abf5e7}{setMolarAbundance}}(species\ |\ std::ranges::to<std::vector>(),\ molar\_abundances);}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00378}00378\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00379}00379\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00380}\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_ae908cda3a994292e2eb767fa476b666b}{00380}}\ \ \ \ \ \textcolor{keywordtype}{void}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a262d7133035d4e6f45daa81827abf5e7}{Composition::setMolarAbundance}}(}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00381}00381\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ std::vector<atomic::Species>\ \&species,}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00382}00382\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ std::vector<double>\ \&molar\_abundances}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00383}00383\ \ \ \ \ )\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00384}00384\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (\_\_builtin\_expect(species.size()\ !=\ molar\_abundances.size(),\ 0))\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00385}00385\ \ \ \ \ \ \ \ \ \ \ \ \ LOG\_CRITICAL(\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a46a706f9e4c06a45b45ae3dffdde5e9e}{getLogger}}(),\ \textcolor{stringliteral}{"{}The\ number\ of\ species\ and\ molar\_abundances\ must\ be\ equal\ (got\ \{\}\ species\ and\ \{\}\ molar\_abundances)."{}},\ species.size(),\ molar\_abundances.size());}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00386}00386\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{throw}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1exceptions_1_1_invalid_composition_error}{exceptions::InvalidCompositionError}}(\textcolor{stringliteral}{"{}The\ number\ of\ species\ and\ fractions\ must\ be\ equal.\ Got\ "{}}\ +\ std::to\_string(species.size())\ +\ \textcolor{stringliteral}{"{}\ species\ and\ "{}}\ +\ std::to\_string(molar\_abundances.size())\ +\ \textcolor{stringliteral}{"{}\ fractions."{}});}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00387}00387\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00388}00388\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00389}00389\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (species.empty())\ \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00390}00390\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00391}00391\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (species.size()\ ==\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa0edc4976ccd24f2d9f6ad730f058b27}{m\_species}}.size())\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00392}00392\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (species\ ==\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa0edc4976ccd24f2d9f6ad730f058b27}{m\_species}})\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00393}00393\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{for}\ (\textcolor{keyword}{const}\ \textcolor{keyword}{auto}\&\ [sp,\ y]\ :\ std::views::zip(species,\ molar\_abundances))\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00394}00394\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (\_\_builtin\_expect(y\ <\ 0.0,\ 0))\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00395}00395\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ LOG\_ERROR(\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a46a706f9e4c06a45b45ae3dffdde5e9e}{getLogger}}(),\ \textcolor{stringliteral}{"{}Molar\ abundance\ must\ be\ non-\/negative.\ Instead\ got\ \{\}\ for\ species\ \{\}."{}},\ y,\ sp.name());}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00396}00396\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{throw}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1exceptions_1_1_invalid_composition_error}{exceptions::InvalidCompositionError}}(\textcolor{stringliteral}{"{}Molar\ abundance\ must\ be\ non-\/negative.\ Instead\ got\ "{}}\ +\ std::to\_string(y)\ +\ \textcolor{stringliteral}{"{}\ for\ species\ "{}}\ +\ std::string(sp.name())\ +\ \textcolor{stringliteral}{"{}."{}});}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00397}00397\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00398}00398\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00399}00399\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00400}00400\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_ab2faabe2e64c587bda8106687f752479}{m\_molarAbundances}}\ =\ molar\_abundances;}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00401}00401\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a02cd9d9608da082a200fdfa86d14bf5d}{m\_cache}}.clear();}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00402}00402\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00403}00403\ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00404}00404\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00405}00405\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00406}00406\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{for}\ (\textcolor{keywordtype}{size\_t}\ i\ \ =\ 0;\ i\ <\ species.size();\ ++i)\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00407}00407\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ \textcolor{keywordtype}{double}\ y\ =\ molar\_abundances[i];}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00408}00408\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ \textcolor{keyword}{auto}\&\ sp\ =\ species[i];}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00409}00409\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (\_\_builtin\_expect(y\ <\ 0.0,\ 0))\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00410}00410\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ LOG\_CRITICAL(\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a46a706f9e4c06a45b45ae3dffdde5e9e}{getLogger}}(),\ \textcolor{stringliteral}{"{}Molar\ abundance\ must\ be\ non-\/negative.\ Instead\ got\ \{\}\ for\ species\ \{\}."{}},\ y,\ sp.name());}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00411}00411\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{throw}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1exceptions_1_1_invalid_composition_error}{exceptions::InvalidCompositionError}}(\textcolor{stringliteral}{"{}Molar\ abundance\ must\ be\ non-\/negative.\ Instead\ got\ "{}}\ +\ std::to\_string(y)\ +\ \textcolor{stringliteral}{"{}\ for\ species\ "{}}\ +\ std::string(sp.name())\ +\ \textcolor{stringliteral}{"{}."{}});}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00412}00412\ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00413}00413\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00414}00414\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ std::expected<std::ptrdiff\_t,\ SpeciesIndexLookupError>\ speciesIndexResult\ =\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aded88f0ad4a97eaae1e356fa8428cab5}{findSpeciesIndex}}(sp);}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00415}00415\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (\_\_builtin\_expect(!speciesIndexResult,\ 0))\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00416}00416\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ throw\_unregistered\_symbol(\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a46a706f9e4c06a45b45ae3dffdde5e9e}{getLogger}}(),\ std::string(sp.name()));}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00417}00417\ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00418}00418\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00419}00419\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ std::ptrdiff\_t\ speciesIndex\ =\ speciesIndexResult.value();}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00420}00420\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00421}00421\ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_ab2faabe2e64c587bda8106687f752479}{m\_molarAbundances}}[speciesIndex]\ =\ y;}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00422}00422\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00423}00423\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00424}00424\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a02cd9d9608da082a200fdfa86d14bf5d}{m\_cache}}.clear();}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00425}00425\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00426}00426\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00427}00427\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00428}00428\ \ \ \ \ \textcolor{comment}{//-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00429}00429\ \ \ \ \ \textcolor{comment}{//\ Fraction\ and\ abundance\ getters}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00430}00430\ \ \ \ \ \textcolor{comment}{//-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00431}00431\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00432}\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_ae5d8d21632fca2b35b0898f2b205cd10}{00432}}\ \ \ \ \ \textcolor{keywordtype}{double}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a9ea2b673341fdc67afeb0f0517a54c8c}{Composition::getMassFraction}}(\textcolor{keyword}{const}\ std::string\&\ symbol)\textcolor{keyword}{\ const\ }\{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00433}00433\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ \textcolor{keyword}{auto}\ species\ =\ \mbox{\hyperlink{namespacefourdst_1_1composition_adcc2e4ca25ab7b93983730fc78f4deea}{getSpecies}}(symbol);}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00434}00434\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (!species)\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00435}00435\ \ \ \ \ \ \ \ \ \ \ \ \ throw\_unknown\_symbol(\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a46a706f9e4c06a45b45ae3dffdde5e9e}{getLogger}}(),\ symbol);}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00436}00436\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00437}00437\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a9ea2b673341fdc67afeb0f0517a54c8c}{getMassFraction}}(species.value());}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00438}00438\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00439}00439\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00440}\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_ae8fe4e7158f8317bf29b5cd0c65a9524}{00440}}\ \ \ \ \ \textcolor{keywordtype}{double}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a9ea2b673341fdc67afeb0f0517a54c8c}{Composition::getMassFraction}}(}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00441}00441\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ \mbox{\hyperlink{structfourdst_1_1atomic_1_1_species}{atomic::Species}}\ \&species}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00442}00442\ \ \ \ \ )\textcolor{keyword}{\ const\ }\{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00443}00443\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ std::expected<std::ptrdiff\_t,\ SpeciesIndexLookupError>\ speciesIndexResult\ =\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aded88f0ad4a97eaae1e356fa8428cab5}{findSpeciesIndex}}(species);}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00444}00444\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (!speciesIndexResult)\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00445}00445\ \ \ \ \ \ \ \ \ \ \ \ \ throw\_unregistered\_symbol(\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a46a706f9e4c06a45b45ae3dffdde5e9e}{getLogger}}(),\ std::string(species.\mbox{\hyperlink{structfourdst_1_1atomic_1_1_species_a1fcc01fc978b34ba2531117f10be6741}{name}}()));}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00446}00446\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00447}00447\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00448}00448\ \ \ \ \ \ \ \ \ \textcolor{keywordtype}{double}\ totalMass\ =\ 0;}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00449}00449\ \ \ \ \ \ \ \ \ \textcolor{keywordtype}{double}\ speciesMass\ =\ 0;}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00450}00450\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{for}\ (\textcolor{keyword}{const}\ \textcolor{keyword}{auto}\&\ [sp,\ y]\ :\ *\textcolor{keyword}{this})\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00451}00451\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ \textcolor{keywordtype}{double}\ contrib\ =\ y\ *\ sp.mass();}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00452}00452\ \ \ \ \ \ \ \ \ \ \ \ \ totalMass\ +=\ contrib;}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00453}00453\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (sp\ ==\ species)\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00454}00454\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ speciesMass\ =\ contrib;}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00455}00455\ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00456}00456\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00457}00457\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ speciesMass\ /\ totalMass;}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00458}00458\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00459}00459\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00460}\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a9ea2b673341fdc67afeb0f0517a54c8c}{00460}}\ \ \ \ \ std::unordered\_map<atomic::Species,\ double>\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a9ea2b673341fdc67afeb0f0517a54c8c}{Composition::getMassFraction}}()\ const\ noexcept\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00461}00461\ \ \ \ \ \ \ \ \ std::unordered\_map<atomic::Species,\ double>\ mass\_fractions;}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00462}00462\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{for}\ (\textcolor{keyword}{const}\ \textcolor{keyword}{auto}\ \&species:\ *\textcolor{keyword}{this}\ |\ std::views::keys)\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00463}00463\ \ \ \ \ \ \ \ \ \ \ \ \ mass\_fractions.emplace(species,\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a9ea2b673341fdc67afeb0f0517a54c8c}{getMassFraction}}(species));}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00464}00464\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00465}00465\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ mass\_fractions;}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00466}00466\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00467}00467\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00468}00468\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00469}\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a34f71d4d8f0297c576fd62fabd490305}{00469}}\ \ \ \ \ \textcolor{keywordtype}{double}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a1f87ed64a1be9a6091c852131d24e476}{Composition::getNumberFraction}}(}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00470}00470\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ std::string\&\ symbol}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00471}00471\ \ \ \ \ )\textcolor{keyword}{\ const\ }\{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00472}00472\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ \textcolor{keyword}{auto}\ species\ =\ \mbox{\hyperlink{namespacefourdst_1_1composition_adcc2e4ca25ab7b93983730fc78f4deea}{getSpecies}}(symbol);}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00473}00473\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (!species)\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00474}00474\ \ \ \ \ \ \ \ \ \ \ \ \ throw\_unknown\_symbol(\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a46a706f9e4c06a45b45ae3dffdde5e9e}{getLogger}}(),\ symbol);}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00475}00475\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00476}00476\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a1f87ed64a1be9a6091c852131d24e476}{getNumberFraction}}(species.value());}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00477}00477\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00478}00478\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00479}\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a1aa79993925f16ba3c30a376aa39161b}{00479}}\ \ \ \ \ \textcolor{keywordtype}{double}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a1f87ed64a1be9a6091c852131d24e476}{Composition::getNumberFraction}}(}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00480}00480\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ \mbox{\hyperlink{structfourdst_1_1atomic_1_1_species}{atomic::Species}}\ \&species}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00481}00481\ \ \ \ \ )\textcolor{keyword}{\ const\ }\{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00482}00482\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ std::expected<std::ptrdiff\_t,\ SpeciesIndexLookupError>\ speciesIndexResult\ =\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aded88f0ad4a97eaae1e356fa8428cab5}{findSpeciesIndex}}(species);}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00483}00483\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (!speciesIndexResult)\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00484}00484\ \ \ \ \ \ \ \ \ \ \ \ \ throw\_unregistered\_symbol(\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a46a706f9e4c06a45b45ae3dffdde5e9e}{getLogger}}(),\ std::string(species.\mbox{\hyperlink{structfourdst_1_1atomic_1_1_species_a1fcc01fc978b34ba2531117f10be6741}{name}}()));}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00485}00485\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00486}00486\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ std::ptrdiff\_t\ speciesIndex\ =\ speciesIndexResult.value();}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00487}00487\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00488}00488\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ \textcolor{keywordtype}{double}\ total\_moles\_per\_gram\ =\ std::accumulate(}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00489}00489\ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_ab2faabe2e64c587bda8106687f752479}{m\_molarAbundances}}.begin(),}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00490}00490\ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_ab2faabe2e64c587bda8106687f752479}{m\_molarAbundances}}.end(),}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00491}00491\ \ \ \ \ \ \ \ \ \ \ \ \ 0.0}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00492}00492\ \ \ \ \ \ \ \ \ );}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00493}00493\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_ab2faabe2e64c587bda8106687f752479}{m\_molarAbundances}}[speciesIndex]\ /\ total\_moles\_per\_gram;}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00494}00494\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00495}00495\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00496}\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a1f87ed64a1be9a6091c852131d24e476}{00496}}\ \ \ \ \ std::unordered\_map<atomic::Species,\ double>\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a1f87ed64a1be9a6091c852131d24e476}{Composition::getNumberFraction}}()\ const\ noexcept\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00497}00497\ \ \ \ \ \ \ \ \ std::unordered\_map<atomic::Species,\ double>\ number\_fractions;}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00498}00498\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{for}\ (\textcolor{keyword}{const}\ \textcolor{keyword}{auto}\ \&species:\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa0edc4976ccd24f2d9f6ad730f058b27}{m\_species}})\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00499}00499\ \ \ \ \ \ \ \ \ \ \ \ \ number\_fractions.emplace(species,\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a1f87ed64a1be9a6091c852131d24e476}{getNumberFraction}}(species));}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00500}00500\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00501}00501\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ number\_fractions;}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00502}00502\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00503}00503\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00504}\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_add67a92d73e3a57a2bbdb52bc9ca3bfe}{00504}}\ \ \ \ \ \textcolor{keywordtype}{double}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_add67a92d73e3a57a2bbdb52bc9ca3bfe}{Composition::getMolarAbundance}}(}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00505}00505\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ std::string\ \&symbol}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00506}00506\ \ \ \ \ )\textcolor{keyword}{\ const\ }\{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00507}00507\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ \textcolor{keyword}{auto}\ species\ =\ \mbox{\hyperlink{namespacefourdst_1_1composition_adcc2e4ca25ab7b93983730fc78f4deea}{getSpecies}}(symbol);}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00508}00508\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (!species)\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00509}00509\ \ \ \ \ \ \ \ \ \ \ \ \ throw\_unknown\_symbol(\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a46a706f9e4c06a45b45ae3dffdde5e9e}{getLogger}}(),\ symbol);}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00510}00510\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00511}00511\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_add67a92d73e3a57a2bbdb52bc9ca3bfe}{getMolarAbundance}}(species.value());}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00512}00512\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00513}00513\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00514}00514\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00515}\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a78a43e9e77a9c1b0f27c50b9feb52449}{00515}}\ \ \ \ \ \textcolor{keywordtype}{double}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_add67a92d73e3a57a2bbdb52bc9ca3bfe}{Composition::getMolarAbundance}}(}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00516}00516\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ \mbox{\hyperlink{structfourdst_1_1atomic_1_1_species}{atomic::Species}}\ \&species}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00517}00517\ \ \ \ \ )\textcolor{keyword}{\ const\ }\{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00518}00518\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ std::expected<std::ptrdiff\_t,\ SpeciesIndexLookupError>\ speciesIndexResult\ =\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aded88f0ad4a97eaae1e356fa8428cab5}{findSpeciesIndex}}(species);}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00519}00519\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (!speciesIndexResult)\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00520}00520\ \ \ \ \ \ \ \ \ \ \ \ \ throw\_unregistered\_symbol(\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a46a706f9e4c06a45b45ae3dffdde5e9e}{getLogger}}(),\ std::string(species.\mbox{\hyperlink{structfourdst_1_1atomic_1_1_species_a1fcc01fc978b34ba2531117f10be6741}{name}}()));}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00521}00521\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00522}00522\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ std::ptrdiff\_t\ speciesIndex\ =\ speciesIndexResult.value();}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00523}00523\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_ab2faabe2e64c587bda8106687f752479}{m\_molarAbundances}}[speciesIndex];}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00524}00524\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00525}00525\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00526}00526\ \ \ \ \ \textcolor{comment}{//-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00527}00527\ \ \ \ \ \textcolor{comment}{//\ Derived\ property\ getters}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00528}00528\ \ \ \ \ \textcolor{comment}{//-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00529}00529\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00530}\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_afbbb5e51ad5ae5c0fa6bc0094195aecd}{00530}}\ \ \ \ \ \textcolor{keywordtype}{double}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_afbbb5e51ad5ae5c0fa6bc0094195aecd}{Composition::getMeanParticleMass}}()\ const\ noexcept\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00531}00531\ \ \ \ \ \ \ \ \ \textcolor{keywordtype}{double}\ totalMass\ =\ 0.0;}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00532}00532\ \ \ \ \ \ \ \ \ \textcolor{keywordtype}{double}\ totalMoles\ =\ 0.0;}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00533}00533\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00534}00534\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{for}\ (\textcolor{keywordtype}{size\_t}\ i\ =\ 0;\ i\ <\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa0edc4976ccd24f2d9f6ad730f058b27}{m\_species}}.size();\ ++i)\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00535}00535\ \ \ \ \ \ \ \ \ \ \ \ \ totalMoles\ +=\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_ab2faabe2e64c587bda8106687f752479}{m\_molarAbundances}}[i];}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00536}00536\ \ \ \ \ \ \ \ \ \ \ \ \ totalMass\ \ +=\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_ab2faabe2e64c587bda8106687f752479}{m\_molarAbundances}}[i]\ *\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa0edc4976ccd24f2d9f6ad730f058b27}{m\_species}}[i].mass();}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00537}00537\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00538}00538\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00539}00539\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ totalMass\ /\ totalMoles;}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00540}00540\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00541}00541\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00542}00542\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00543}\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a90fc71d1fe03017ee4c7a1cac69d24fb}{00543}}\ \ \ \ \ \textcolor{keywordtype}{double}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a90fc71d1fe03017ee4c7a1cac69d24fb}{Composition::getElectronAbundance}}()\ const\ noexcept\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00544}00544\ \ \ \ \ \ \ \ \ \textcolor{keywordtype}{double}\ Ye\ =\ 0.0;}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00545}00545\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{for}\ (\textcolor{keyword}{const}\ \textcolor{keyword}{auto}\&\ [species,\ y]\ :\ *\textcolor{keyword}{this})\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00546}00546\ \ \ \ \ \ \ \ \ \ \ \ \ Ye\ +=\ species.z()\ *\ y;}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00547}00547\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00548}00548\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ Ye;}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00549}00549\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00550}00550\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00551}00551\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00552}\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aac5b214a3d1278e127422224cb9cee50}{00552}}\ \ \ \ \ \mbox{\hyperlink{structfourdst_1_1composition_1_1_canonical_composition}{CanonicalComposition}}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aac5b214a3d1278e127422224cb9cee50}{Composition::getCanonicalComposition}}(}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00553}00553\ \ \ \ \ )\textcolor{keyword}{\ const\ }\{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00554}00554\ \ \ \ \ \ \ \ \ \textcolor{keyword}{using\ namespace\ }\mbox{\hyperlink{namespacefourdst_1_1atomic}{fourdst::atomic}};}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00555}00555\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00556}00556\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a02cd9d9608da082a200fdfa86d14bf5d}{m\_cache}}.canonicalComp.has\_value())\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00557}00557\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a02cd9d9608da082a200fdfa86d14bf5d}{m\_cache}}.canonicalComp.value();\ \textcolor{comment}{//\ Short\ circuit\ if\ we\ have\ cached\ the\ canonical\ composition}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00558}00558\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00559}00559\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{structfourdst_1_1composition_1_1_canonical_composition}{CanonicalComposition}}\ canonicalComposition;}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00560}00560\ \ \ \ \ \ \ \ \ \textcolor{keyword}{static}\ \textcolor{keyword}{const}\ std::unordered\_set<Species>\ canonicalH\ =\ \{\mbox{\hyperlink{namespacefourdst_1_1atomic_a6766bc834fd656df51bdcf22f7d97877}{H\_1}},\ \mbox{\hyperlink{namespacefourdst_1_1atomic_a0eac406fa90f2925ea40737380ce0d74}{H\_2}},\ \mbox{\hyperlink{namespacefourdst_1_1atomic_aef4effd489bc5c3048b1d11397e0055d}{H\_3}},\ \mbox{\hyperlink{namespacefourdst_1_1atomic_affc40733f035db6b300952134eb25a29}{H\_4}},\ \mbox{\hyperlink{namespacefourdst_1_1atomic_a7380b7fa06e2d923d2ebdb7eea18ef60}{H\_5}},\ \mbox{\hyperlink{namespacefourdst_1_1atomic_a11a078384fa8a6d313333d92e6d8851a}{H\_6}},\ \mbox{\hyperlink{namespacefourdst_1_1atomic_a0c96e4ac6ca0140e91ff32207c9395e9}{H\_7}}\};}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00561}00561\ \ \ \ \ \ \ \ \ \textcolor{keyword}{static}\ \textcolor{keyword}{const}\ std::unordered\_set<Species>\ canonicalHe\ =\ \{\mbox{\hyperlink{namespacefourdst_1_1atomic_a5ca60b34f7ec098da5d2bfbfc404bf3d}{He\_3}},\ \mbox{\hyperlink{namespacefourdst_1_1atomic_ab665e3014e2a805624227350699f141a}{He\_4}},\ \mbox{\hyperlink{namespacefourdst_1_1atomic_ae26dd796d5688fd18f76563227a36d89}{He\_5}},\ \mbox{\hyperlink{namespacefourdst_1_1atomic_af13ee6f2bbc2d1770746835f6d72ddff}{He\_6}},\ \mbox{\hyperlink{namespacefourdst_1_1atomic_a7e5f3e73bd4fadfce3a1f86dba9fada8}{He\_7}},\ \mbox{\hyperlink{namespacefourdst_1_1atomic_a5bf469759634aaacc63420f84a05b04b}{He\_8}},\ \mbox{\hyperlink{namespacefourdst_1_1atomic_a31064f9bb4ce03b23bebd6d4527bd9ff}{He\_9}},\ \mbox{\hyperlink{namespacefourdst_1_1atomic_a2a9fea0f9d56b153f829192a5c79d64d}{He\_10}}\};}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00562}00562\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00563}00563\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{for}\ (\textcolor{keyword}{const}\ \textcolor{keyword}{auto}\&\ symbol\ :\ canonicalH)\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00564}00564\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a194f715788e7921bd611579440de2ecd}{contains}}(symbol))\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00565}00565\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ canonicalComposition.\mbox{\hyperlink{structfourdst_1_1composition_1_1_canonical_composition_abe5b01574242f8eaabd00c3d653291f7}{X}}\ +=\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a9ea2b673341fdc67afeb0f0517a54c8c}{getMassFraction}}(symbol);}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00566}00566\ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00567}00567\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00568}00568\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{for}\ (\textcolor{keyword}{const}\ \textcolor{keyword}{auto}\&\ symbol\ :\ canonicalHe)\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00569}00569\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a194f715788e7921bd611579440de2ecd}{contains}}(symbol))\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00570}00570\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ canonicalComposition.\mbox{\hyperlink{structfourdst_1_1composition_1_1_canonical_composition_a93927bfccc5d2b3906565d092ed4f7f4}{Y}}\ +=\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a9ea2b673341fdc67afeb0f0517a54c8c}{getMassFraction}}(symbol);}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00571}00571\ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00572}00572\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00573}00573\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00574}00574\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{for}\ (\textcolor{keyword}{const}\ \textcolor{keyword}{auto}\&\ \mbox{\hyperlink{namespacefourdst_1_1atomic_a3f619cc8f8b2cd718a4082c6adb0de90}{species}}\ :\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa0edc4976ccd24f2d9f6ad730f058b27}{m\_species}})\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00575}00575\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (canonicalH.contains(\mbox{\hyperlink{namespacefourdst_1_1atomic_a3f619cc8f8b2cd718a4082c6adb0de90}{species}})\ ||\ canonicalHe.contains(\mbox{\hyperlink{namespacefourdst_1_1atomic_a3f619cc8f8b2cd718a4082c6adb0de90}{species}}))\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00576}00576\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{continue};\ \textcolor{comment}{//\ Skip\ canonical\ H\ and\ He\ symbols}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00577}00577\ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00578}00578\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00579}00579\ \ \ \ \ \ \ \ \ \ \ \ \ canonicalComposition.\mbox{\hyperlink{structfourdst_1_1composition_1_1_canonical_composition_ae1981f5ddd36abd17a4a69fa1f43de18}{Z}}\ +=\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a9ea2b673341fdc67afeb0f0517a54c8c}{getMassFraction}}(\mbox{\hyperlink{namespacefourdst_1_1atomic_a3f619cc8f8b2cd718a4082c6adb0de90}{species}});}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00580}00580\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00581}00581\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00582}00582\ \ \ \ \ \ \ \ \ \textcolor{comment}{//\ ReSharper\ disable\ once\ CppTooWideScopeInitStatement}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00583}00583\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ \textcolor{keywordtype}{double}\ Z\ =\ 1.0\ -\/\ (canonicalComposition.\mbox{\hyperlink{structfourdst_1_1composition_1_1_canonical_composition_abe5b01574242f8eaabd00c3d653291f7}{X}}\ +\ canonicalComposition.\mbox{\hyperlink{structfourdst_1_1composition_1_1_canonical_composition_a93927bfccc5d2b3906565d092ed4f7f4}{Y}});}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00584}00584\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (std::abs(Z\ -\/\ canonicalComposition.\mbox{\hyperlink{structfourdst_1_1composition_1_1_canonical_composition_ae1981f5ddd36abd17a4a69fa1f43de18}{Z}})\ >\ 1e-\/16)\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00585}00585\ \ \ \ \ \ \ \ \ \ \ \ \ LOG\_ERROR(\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a46a706f9e4c06a45b45ae3dffdde5e9e}{getLogger}}(),\ \textcolor{stringliteral}{"{}Validation\ composition\ Z\ (X-\/Y\ =\ \{\})\ is\ different\ than\ canonical\ composition\ Z\ (\{\})\ (∑a\_i\ where\ a\_i\ !=\ H/He)."{}},\ Z,\ canonicalComposition.\mbox{\hyperlink{structfourdst_1_1composition_1_1_canonical_composition_ae1981f5ddd36abd17a4a69fa1f43de18}{Z}});}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00586}00586\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{throw}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1exceptions_1_1_invalid_composition_error}{exceptions::InvalidCompositionError}}(\textcolor{stringliteral}{"{}Validation\ composition\ Z\ (X-\/Y\ =\ "{}}\ +\ std::to\_string(Z)\ +\ \textcolor{stringliteral}{"{})\ is\ different\ than\ canonical\ composition\ Z\ ("{}}\ +\ std::to\_string(canonicalComposition.\mbox{\hyperlink{structfourdst_1_1composition_1_1_canonical_composition_ae1981f5ddd36abd17a4a69fa1f43de18}{Z}})\ +\ \textcolor{stringliteral}{"{})\ (∑a\_i\ where\ a\_i\ !=\ H/He)."{}});}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00587}00587\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00588}00588\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a02cd9d9608da082a200fdfa86d14bf5d}{m\_cache}}.canonicalComp\ =\ canonicalComposition;}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00589}00589\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ canonicalComposition;}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00590}00590\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00591}00591\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00592}00592\ \ \ \ \ \textcolor{comment}{//-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00593}00593\ \ \ \ \ \textcolor{comment}{//\ Vector\ getters}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00594}00594\ \ \ \ \ \textcolor{comment}{//-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00595}00595\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00596}\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_af4f44aaf8b7e0d63872a70b5e2131369}{00596}}\ \ \ \ \ std::vector<double>\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_af4f44aaf8b7e0d63872a70b5e2131369}{Composition::getMassFractionVector}}()\ const\ noexcept\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00597}00597\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a02cd9d9608da082a200fdfa86d14bf5d}{m\_cache}}.massFractions.has\_value())\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00598}00598\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a02cd9d9608da082a200fdfa86d14bf5d}{m\_cache}}.massFractions.value();\ \textcolor{comment}{//\ Short\ circuit\ if\ we\ have\ cached\ the\ mass\ fractions}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00599}00599\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00600}00600\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00601}00601\ \ \ \ \ \ \ \ \ std::vector<double>\ massFractionVector;}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00602}00602\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00603}00603\ \ \ \ \ \ \ \ \ massFractionVector.reserve(\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_ab2faabe2e64c587bda8106687f752479}{m\_molarAbundances}}.size());}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00604}00604\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00605}00605\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{for}\ (\textcolor{keyword}{const}\ \textcolor{keyword}{auto}\ \&\mbox{\hyperlink{namespacefourdst_1_1atomic_a3f619cc8f8b2cd718a4082c6adb0de90}{species}}:\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa0edc4976ccd24f2d9f6ad730f058b27}{m\_species}})\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00606}00606\ \ \ \ \ \ \ \ \ \ \ \ \ massFractionVector.push\_back(\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a9ea2b673341fdc67afeb0f0517a54c8c}{getMassFraction}}(\mbox{\hyperlink{namespacefourdst_1_1atomic_a3f619cc8f8b2cd718a4082c6adb0de90}{species}}));}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00607}00607\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00608}00608\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00609}00609\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a02cd9d9608da082a200fdfa86d14bf5d}{m\_cache}}.massFractions\ =\ massFractionVector;\ \textcolor{comment}{//\ Cache\ the\ result}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00610}00610\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ massFractionVector;}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00611}00611\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00612}00612\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00613}00613\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00614}\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_ae4f72972cf4d1ff422d0790080e11473}{00614}}\ \ \ \ \ std::vector<double>\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_ae4f72972cf4d1ff422d0790080e11473}{Composition::getNumberFractionVector}}()\ const\ noexcept\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00615}00615\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a02cd9d9608da082a200fdfa86d14bf5d}{m\_cache}}.numberFractions.has\_value())\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00616}00616\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a02cd9d9608da082a200fdfa86d14bf5d}{m\_cache}}.numberFractions.value();\ \textcolor{comment}{//\ Short\ circuit\ if\ we\ have\ cached\ the\ number\ fractions}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00617}00617\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00618}00618\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00619}00619\ \ \ \ \ \ \ \ \ std::vector<double>\ numberFractionVector;}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00620}00620\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00621}00621\ \ \ \ \ \ \ \ \ numberFractionVector.reserve(\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_ab2faabe2e64c587bda8106687f752479}{m\_molarAbundances}}.size());}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00622}00622\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00623}00623\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{for}\ (\textcolor{keyword}{const}\ \textcolor{keyword}{auto}\ \&\mbox{\hyperlink{namespacefourdst_1_1atomic_a3f619cc8f8b2cd718a4082c6adb0de90}{species}}:\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa0edc4976ccd24f2d9f6ad730f058b27}{m\_species}})\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00624}00624\ \ \ \ \ \ \ \ \ \ \ \ \ numberFractionVector.push\_back(\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a1f87ed64a1be9a6091c852131d24e476}{getNumberFraction}}(\mbox{\hyperlink{namespacefourdst_1_1atomic_a3f619cc8f8b2cd718a4082c6adb0de90}{species}}));}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00625}00625\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00626}00626\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00627}00627\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a02cd9d9608da082a200fdfa86d14bf5d}{m\_cache}}.numberFractions\ =\ numberFractionVector;\ \textcolor{comment}{//\ Cache\ the\ result}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00628}00628\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ numberFractionVector;}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00629}00629\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00630}00630\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00631}\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_abcb391f5fca2b636127e48e681e4c3ee}{00631}}\ \ \ \ \ std::vector<double>\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_abcb391f5fca2b636127e48e681e4c3ee}{Composition::getMolarAbundanceVector}}()\ const\ noexcept\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00632}00632\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_ab2faabe2e64c587bda8106687f752479}{m\_molarAbundances}};}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00633}00633\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00634}00634\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00635}00635\ \ \ \ \ \textcolor{comment}{//-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00636}00636\ \ \ \ \ \textcolor{comment}{//\ Species\ index\ getters\ and\ lookups}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00637}00637\ \ \ \ \ \textcolor{comment}{//-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00638}00638\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00639}\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a0d94f62402bb90b5d12679faeaa8c5d7}{00639}}\ \ \ \ \ \textcolor{keywordtype}{size\_t}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a0d94f62402bb90b5d12679faeaa8c5d7}{Composition::getSpeciesIndex}}(}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00640}00640\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ std::string\ \&symbol}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00641}00641\ \ \ \ \ )\textcolor{keyword}{\ const\ }\{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00642}00642\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ \textcolor{keyword}{auto}\ \mbox{\hyperlink{namespacefourdst_1_1atomic_a3f619cc8f8b2cd718a4082c6adb0de90}{species}}\ =\ \mbox{\hyperlink{namespacefourdst_1_1composition_adcc2e4ca25ab7b93983730fc78f4deea}{getSpecies}}(symbol);}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00643}00643\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (!\mbox{\hyperlink{namespacefourdst_1_1atomic_a3f619cc8f8b2cd718a4082c6adb0de90}{species}})\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00644}00644\ \ \ \ \ \ \ \ \ \ \ \ \ throw\_unknown\_symbol(\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a46a706f9e4c06a45b45ae3dffdde5e9e}{getLogger}}(),\ symbol);}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00645}00645\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00646}00646\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00647}00647\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a0d94f62402bb90b5d12679faeaa8c5d7}{getSpeciesIndex}}(\mbox{\hyperlink{namespacefourdst_1_1atomic_a3f619cc8f8b2cd718a4082c6adb0de90}{species}}.value());}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00648}00648\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00649}00649\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00650}\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a3d220b42fa06d7d3a43944ee2b8f6a5f}{00650}}\ \ \ \ \ \textcolor{keywordtype}{size\_t}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a0d94f62402bb90b5d12679faeaa8c5d7}{Composition::getSpeciesIndex}}(}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00651}00651\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ \mbox{\hyperlink{structfourdst_1_1atomic_1_1_species}{atomic::Species}}\ \&\mbox{\hyperlink{namespacefourdst_1_1atomic_a3f619cc8f8b2cd718a4082c6adb0de90}{species}}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00652}00652\ \ \ \ \ )\textcolor{keyword}{\ const\ }\{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00653}00653\ \ \ \ \ \ \ \ \ std::expected<std::ptrdiff\_t,\ SpeciesIndexLookupError>\ speciesIndexResult\ =\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aded88f0ad4a97eaae1e356fa8428cab5}{findSpeciesIndex}}(\mbox{\hyperlink{namespacefourdst_1_1atomic_a3f619cc8f8b2cd718a4082c6adb0de90}{species}});}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00654}00654\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (!speciesIndexResult)\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00655}00655\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{switch}\ (speciesIndexResult.error())\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00656}00656\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{case}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aeef903d5b7d02467c6462d183ac47db8ac7cc0e85688b85571f30fd16a46d9891}{SpeciesIndexLookupError::NO\_REGISTERED\_SPECIES}}:}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00657}00657\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ [[fallthrough]];}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00658}00658\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{case}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aeef903d5b7d02467c6462d183ac47db8a3659baf2b06bba6c02bad8316d517761}{SpeciesIndexLookupError::SPECIES\_NOT\_FOUND}}:}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00659}00659\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ throw\_unregistered\_symbol(\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a46a706f9e4c06a45b45ae3dffdde5e9e}{getLogger}}(),\ std::string(\mbox{\hyperlink{namespacefourdst_1_1atomic_a3f619cc8f8b2cd718a4082c6adb0de90}{species}}.name()));}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00660}00660\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00661}00661\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{throw}\ std::logic\_error(\textcolor{stringliteral}{"{}Unhandled\ SpeciesIndexLookupError\ in\ Composition::getSpeciesIndex"{}});}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00662}00662\ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00663}00663\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00664}00664\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00665}00665\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \textcolor{keyword}{static\_cast<}\textcolor{keywordtype}{size\_t}\textcolor{keyword}{>}(speciesIndexResult.value());}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00666}00666\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00667}00667\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00668}\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_ae4f854ded38f5e6fcd157a74a57cbf0c}{00668}}\ \ \ \ \ \mbox{\hyperlink{structfourdst_1_1atomic_1_1_species}{atomic::Species}}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_ae4f854ded38f5e6fcd157a74a57cbf0c}{Composition::getSpeciesAtIndex}}(}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00669}00669\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ \textcolor{keywordtype}{size\_t}\ index}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00670}00670\ \ \ \ \ )\textcolor{keyword}{\ const\ }\{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00671}00671\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (index\ >=\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa0edc4976ccd24f2d9f6ad730f058b27}{m\_species}}.size())\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00672}00672\ \ \ \ \ \ \ \ \ \ \ \ \ LOG\_ERROR(\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a46a706f9e4c06a45b45ae3dffdde5e9e}{getLogger}}(),\ \textcolor{stringliteral}{"{}Index\ \{\}\ is\ out\ of\ bounds\ for\ registered\ species\ (size\ \{\})."{}},\ index,\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa0edc4976ccd24f2d9f6ad730f058b27}{m\_species}}.size());}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00673}00673\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{throw}\ std::out\_of\_range(\textcolor{stringliteral}{"{}Index\ "{}}\ +\ std::to\_string(index)\ +\ \textcolor{stringliteral}{"{}\ is\ out\ of\ bounds\ for\ registered\ species\ (size\ "{}}\ +\ std::to\_string(\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa0edc4976ccd24f2d9f6ad730f058b27}{m\_species}}.size())\ +\ \textcolor{stringliteral}{"{})."{}});}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00674}00674\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00675}00675\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00676}00676\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa0edc4976ccd24f2d9f6ad730f058b27}{m\_species}}[index];}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00677}00677\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00678}00678\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00679}00679\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00680}00680\ \ \ \ \ \textcolor{comment}{//-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00681}00681\ \ \ \ \ \textcolor{comment}{//\ Utility\ methods}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00682}00682\ \ \ \ \ \textcolor{comment}{//-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00683}00683\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00684}\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a5b3631fa33b0c6809ad652b0e31663a1}{00684}}\ \ \ \ \ std::size\_t\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a5b3631fa33b0c6809ad652b0e31663a1}{Composition::hash}}()\textcolor{keyword}{\ const\ }\{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00685}00685\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a02cd9d9608da082a200fdfa86d14bf5d}{m\_cache}}.hash.has\_value())\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00686}00686\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a02cd9d9608da082a200fdfa86d14bf5d}{m\_cache}}.hash.value();}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00687}00687\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00688}00688\ \ \ \ \ \ \ \ \ std::size\_t\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a5b3631fa33b0c6809ad652b0e31663a1}{hash}}\ =\ \mbox{\hyperlink{structfourdst_1_1composition_1_1utils_1_1_composition_hash_af30bb4f60999d9ad99ad3893efa2de65}{utils::CompositionHash::hash\_exact}}(*\textcolor{keyword}{this});}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00689}00689\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a02cd9d9608da082a200fdfa86d14bf5d}{m\_cache}}.hash\ =\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a5b3631fa33b0c6809ad652b0e31663a1}{hash}};}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00690}00690\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a5b3631fa33b0c6809ad652b0e31663a1}{hash}};}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00691}00691\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00692}00692\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00693}\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a194f715788e7921bd611579440de2ecd}{00693}}\ \ \ \ \ \textcolor{keywordtype}{bool}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a194f715788e7921bd611579440de2ecd}{Composition::contains}}(}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00694}00694\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ \mbox{\hyperlink{structfourdst_1_1atomic_1_1_species}{atomic::Species}}\ \&\mbox{\hyperlink{namespacefourdst_1_1atomic_a3f619cc8f8b2cd718a4082c6adb0de90}{species}}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00695}00695\ \ \ \ \ )\ \textcolor{keyword}{const}\ \textcolor{keyword}{noexcept}\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00696}00696\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ std::ranges::binary\_search(\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa0edc4976ccd24f2d9f6ad730f058b27}{m\_species}},\ \mbox{\hyperlink{namespacefourdst_1_1atomic_a3f619cc8f8b2cd718a4082c6adb0de90}{species}});}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00697}00697\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00698}00698\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00699}\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_ac3bfb56a2587215a59894e76d4867ede}{00699}}\ \ \ \ \ \textcolor{keywordtype}{bool}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a194f715788e7921bd611579440de2ecd}{Composition::contains}}(}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00700}00700\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ std::string\ \&symbol}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00701}00701\ \ \ \ \ )\textcolor{keyword}{\ const\ }\{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00702}00702\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ \textcolor{keyword}{auto}\ \mbox{\hyperlink{namespacefourdst_1_1atomic_a3f619cc8f8b2cd718a4082c6adb0de90}{species}}\ =\ \mbox{\hyperlink{namespacefourdst_1_1composition_adcc2e4ca25ab7b93983730fc78f4deea}{getSpecies}}(symbol);}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00703}00703\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (!\mbox{\hyperlink{namespacefourdst_1_1atomic_a3f619cc8f8b2cd718a4082c6adb0de90}{species}})\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00704}00704\ \ \ \ \ \ \ \ \ \ \ \ \ throw\_unknown\_symbol(\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a46a706f9e4c06a45b45ae3dffdde5e9e}{getLogger}}(),\ symbol);}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00705}00705\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00706}00706\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a194f715788e7921bd611579440de2ecd}{contains}}(\mbox{\hyperlink{namespacefourdst_1_1atomic_a3f619cc8f8b2cd718a4082c6adb0de90}{species}}.value());}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00707}00707\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00708}00708\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00709}\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a9d177d36b728442bcbd8cb66712c7c75}{00709}}\ \ \ \ \ \textcolor{keywordtype}{size\_t}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a9d177d36b728442bcbd8cb66712c7c75}{Composition::size}}()\ const\ noexcept\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00710}00710\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa0edc4976ccd24f2d9f6ad730f058b27}{m\_species}}.size();}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00711}00711\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00712}00712\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00713}\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aded88f0ad4a97eaae1e356fa8428cab5}{00713}}\ \ \ \ \ std::expected<std::ptrdiff\_t,\ Composition::SpeciesIndexLookupError>\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aded88f0ad4a97eaae1e356fa8428cab5}{Composition::findSpeciesIndex}}(\textcolor{keyword}{const}\ \mbox{\hyperlink{structfourdst_1_1atomic_1_1_species}{atomic::Species}}\ \&\mbox{\hyperlink{namespacefourdst_1_1atomic_a3f619cc8f8b2cd718a4082c6adb0de90}{species}})\ \textcolor{keyword}{const}\ \textcolor{keyword}{noexcept}\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00714}00714\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa0edc4976ccd24f2d9f6ad730f058b27}{m\_species}}.empty())\ \textcolor{keywordflow}{return}\ std::unexpected(\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aeef903d5b7d02467c6462d183ac47db8ac7cc0e85688b85571f30fd16a46d9891}{SpeciesIndexLookupError::NO\_REGISTERED\_SPECIES}});}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00715}00715\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00716}00716\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ \textcolor{keyword}{auto}\ it\ =\ std::ranges::lower\_bound(\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa0edc4976ccd24f2d9f6ad730f058b27}{m\_species}},\ \mbox{\hyperlink{namespacefourdst_1_1atomic_a3f619cc8f8b2cd718a4082c6adb0de90}{species}});}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00717}00717\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00718}00718\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (it\ ==\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa0edc4976ccd24f2d9f6ad730f058b27}{m\_species}}.end()\ ||\ *it\ !=\ \mbox{\hyperlink{namespacefourdst_1_1atomic_a3f619cc8f8b2cd718a4082c6adb0de90}{species}})\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00719}00719\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ std::unexpected(\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aeef903d5b7d02467c6462d183ac47db8a3659baf2b06bba6c02bad8316d517761}{SpeciesIndexLookupError::SPECIES\_NOT\_FOUND}});}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00720}00720\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00721}00721\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00722}00722\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ std::distance(\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_aa0edc4976ccd24f2d9f6ad730f058b27}{m\_species}}.begin(),\ it);}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00723}00723\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00724}00724\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00725}\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a3f013e33b8978baf81447e5bd177f38b}{00725}}\ \ \ \ \ std::vector<atomic::Species>\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a3f013e33b8978baf81447e5bd177f38b}{Composition::symbolVectorToSpeciesVector}}(\textcolor{keyword}{const}\ std::vector<std::string>\ \&symbols)\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00726}00726\ \ \ \ \ \ \ \ \ std::vector<atomic::Species>\ \mbox{\hyperlink{namespacefourdst_1_1atomic_a3f619cc8f8b2cd718a4082c6adb0de90}{species}};}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00727}00727\ \ \ \ \ \ \ \ \ \mbox{\hyperlink{namespacefourdst_1_1atomic_a3f619cc8f8b2cd718a4082c6adb0de90}{species}}.reserve(symbols.size());}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00728}00728\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00729}00729\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00730}00730\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{for}\ (\textcolor{keyword}{const}\ \textcolor{keyword}{auto}\&\ symbol\ :\ symbols)\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00731}00731\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ \textcolor{keyword}{auto}\ speciesResult\ =\ \mbox{\hyperlink{namespacefourdst_1_1composition_adcc2e4ca25ab7b93983730fc78f4deea}{getSpecies}}(symbol);}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00732}00732\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (!speciesResult)\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00733}00733\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ throw\_unknown\_symbol(\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a46a706f9e4c06a45b45ae3dffdde5e9e}{getLogger}}(),\ symbol);}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00734}00734\ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00735}00735\ \ \ \ \ \ \ \ \ \ \ \ \ \mbox{\hyperlink{namespacefourdst_1_1atomic_a3f619cc8f8b2cd718a4082c6adb0de90}{species}}.push\_back(speciesResult.value());}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00736}00736\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00737}00737\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00738}00738\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ \mbox{\hyperlink{namespacefourdst_1_1atomic_a3f619cc8f8b2cd718a4082c6adb0de90}{species}};}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00739}00739\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00740}00740\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00741}00741\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00742}00742\ \ \ \ \ \textcolor{comment}{//-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00743}00743\ \ \ \ \ \textcolor{comment}{//\ Stream\ operator}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00744}00744\ \ \ \ \ \textcolor{comment}{//-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00745}00745\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00746}\mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a36c2525d21cd932065bb2bb30bc57fb4}{00746}}\ \ \ \ \ std::ostream\&\ \mbox{\hyperlink{namespacefourdst_1_1composition_a5e8ccc2bd9e91eebcd3ef5fe470163a1}{operator<<}}(}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00747}00747\ \ \ \ \ \ \ \ \ std::ostream\&\ os,}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00748}00748\ \ \ \ \ \ \ \ \ \textcolor{keyword}{const}\ \mbox{\hyperlink{classfourdst_1_1composition_1_1_composition_a23b83b76ee025f6fc009184ee19bba88}{Composition}}\&\ \mbox{\hyperlink{namespacefourdst_1_1composition}{composition}}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00749}00749\ \ \ \ \ )\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00750}00750\ \ \ \ \ \ \ \ \ os\ <<\ \textcolor{stringliteral}{"{}Composition(Mass\ Fractions\ =>\ ["{}};}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00751}00751\ \ \ \ \ \ \ \ \ \textcolor{keywordtype}{size\_t}\ count\ =\ 0;}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00752}00752\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{for}\ (\textcolor{keyword}{const}\ \textcolor{keyword}{auto}\ \&\mbox{\hyperlink{namespacefourdst_1_1atomic_a3f619cc8f8b2cd718a4082c6adb0de90}{species}}\ :\ \mbox{\hyperlink{namespacefourdst_1_1composition}{composition}}.m\_species)\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00753}00753\ \ \ \ \ \ \ \ \ \ \ \ \ os\ <<\ \mbox{\hyperlink{namespacefourdst_1_1atomic_a3f619cc8f8b2cd718a4082c6adb0de90}{species}}\ <<\ \textcolor{stringliteral}{"{}:\ "{}}\ <<\ \mbox{\hyperlink{namespacefourdst_1_1composition}{composition}}.getMassFraction(\mbox{\hyperlink{namespacefourdst_1_1atomic_a3f619cc8f8b2cd718a4082c6adb0de90}{species}});}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00754}00754\ \ \ \ \ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{if}\ (count\ <\ \mbox{\hyperlink{namespacefourdst_1_1composition}{composition}}.size()\ -\/\ 1)\ \{}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00755}00755\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ os\ <<\ \textcolor{stringliteral}{"{},\ "{}};}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00756}00756\ \ \ \ \ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00757}00757\ \ \ \ \ \ \ \ \ \ \ \ \ count++;}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00758}00758\ \ \ \ \ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00759}00759\ \ \ \ \ \ \ \ \ os\ <<\ \textcolor{stringliteral}{"{}])"{}};}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00760}00760\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ os;}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00761}00761\ \ \ \ \ \}}
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00762}00762\ }
\DoxyCodeLine{\Hypertarget{composition_8cpp_source_l00763}00763\ \}\ \textcolor{comment}{//\ namespace\ fourdst::composition}}

\end{DoxyCode}
