ChemicalFormula.hpp
A type used to represent the chemical formula of a chemical species.
Definition: ChemicalFormula.hpp:27
ChemicalFormula(const char *formula)
Construct a ChemicalFormula object with given formula.
auto molarMass() const -> double
Return the molar mass of the chemical formula (in kg/mol).
auto symbols() const -> Strings
Return the element symbols in the chemical formula.
auto equivalent(const ChemicalFormula &other) const -> bool
Return true if another chemical formula is equivalent to this one.
auto elements() const -> const Pairs< String, double > &
Return the element symbols and their coefficients in the chemical formula.
ChemicalFormula(String formula)
Construct a ChemicalFormula object with given formula.
ChemicalFormula(String formula, Pairs< String, double > symbols, double charge)
Construct a ChemicalFormula object with given formula, element symbols, and charge.
ChemicalFormula()
Construct a default ChemicalFormula object.
auto str() const -> const String &
Return the chemical formula of the substance as a string.
auto charge() const -> double
Return the electric charge of the chemical formula.
auto coefficients() const -> Vec< double >
Return the coefficients of the elements in the chemical formula.
auto coefficient(const String &symbol) const -> double
Return the coefficient of an element symbol in the chemical formula.
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
std::shared_ptr< T > SharedPtr
Convenient alias for std::shared_ptr<T>.
Definition: Types.hpp:106