ElementalComposition.hpp
A type used to describe the elemental composition of chemical species.
Definition: ElementalComposition.hpp:28
auto molarMass() const -> double
Return the molar mass of the elemental composition (in kg/mol).
auto repr() const -> String
Return a string representation of the elemental composition.
auto symbols() const -> Strings
Return the symbols of the elements.
ElementalComposition(std::initializer_list< Pair< Element, double >> const &elements)
Construct an ElementalComposition object with given elements and respective coefficients.
auto end()
Return end iterator of this ElementalComposition instance (for STL compatibility reasons).
Definition: ElementalComposition.hpp:87
ElementalComposition(Pairs< String, double > const &elements)
Construct an ElementalComposition object with given element symbols and respective coefficients.
ElementalComposition(Pairs< Element, double > const &elements)
Construct an ElementalComposition object with given elements and respective coefficients.
ElementalComposition()
Construct a default ElementalComposition object.
auto coefficients() const -> Vec< double >
Return the coefficients of the elements.
auto begin() const
Return begin const iterator of this ElementalComposition instance (for STL compatibility reasons).
Definition: ElementalComposition.hpp:78
auto begin()
Return begin iterator of this ElementalComposition instance (for STL compatibility reasons).
Definition: ElementalComposition.hpp:81
auto coefficient(const String &symbol) const -> double
Return the coefficient of an element symbol in the elemental composition.
auto end() const
Return end const iterator of this ElementalComposition instance (for STL compatibility reasons).
Definition: ElementalComposition.hpp:84
The namespace containing all components of the Reaktoro library.
Definition: Algorithms.hpp:29
Vec< Pair< T, U > > Pairs
Convenient alias for std::vector<std::pair<T, U>>.
Definition: Types.hpp:90
std::vector< std::string > Strings
Convenient alias for std::vector<String>.
Definition: Types.hpp:55
auto operator!=(const ElementalComposition &l, const ElementalComposition &r) -> bool
Return true if two ElementalComposition objects are different.
auto operator==(const ChemicalFormula &lhs, const ChemicalFormula &rhs) -> bool
Compare two ChemicalFormula objects for equality.