Functions | |
std::string | reaction (const DenseMatrix< Real > &stoi, unsigned row, const std::vector< std::string > &names, Real stoi_tol=1.0E-6, int precision=4) |
Returns a nicely formatted string corresponding to the reaction defined by the given row of the stoichiometric matrix. More... | |
std::string GeochemistryFormattedOutput::reaction | ( | const DenseMatrix< Real > & | stoi, |
unsigned | row, | ||
const std::vector< std::string > & | names, | ||
Real | stoi_tol = 1.0E-6 , |
||
int | precision = 4 |
||
) |
Returns a nicely formatted string corresponding to the reaction defined by the given row of the stoichiometric matrix.
For instance, if stoi(row, :) = (1, 2, 1E-5, -0.333333333333) and names = ["H2O", "H+", "HCO3-", "O2(aq)"] then this function will return "H2O + 2*H+ - 0.333*O2(aq)" if stoi_tol=1E-4 and precision = 3
stoi | matrix stoichiometric coefficients |
row | row of stoi which defines the reaction of interest |
names | names of the basis species |
stoi_tol | Any stoichiometric coefficients of magnitude less than this value will not appear in the returned string |
precision | Maximum number of digits written for each stoichiometric coefficient in the returned string |
Definition at line 15 of file GeochemistryFormattedOutput.C.
Referenced by GeochemistryConsoleOutput::output(), GeochemistryConsoleOutput::outputNernstInfo(), GeochemicalModelInterrogator::outputReaction(), GeochemicalDatabaseReader::printReactions(), and TEST().