Scine::Kinetx  3.0.0
Kinetic models for reaction networks.
 All Classes Files Functions Variables Enumerations Pages
Scine::Kinetx::NetworkBuilder Class Reference

A class allowing for easier building of reaction networks. More...

#include <NetworkBuilder.h>

Collaboration diagram for Scine::Kinetx::NetworkBuilder:
Collaboration graph

Public Member Functions

 NetworkBuilder ()=default
 Default constructor.
 
Network generate ()
 Generates the final network. More...
 
void reserve (unsigned int nCompounds, unsigned int nReactions, unsigned int nChannelsPerReaction)
 Reserves space in the underlying data objects, allowing for faster inserts. More...
 
void addReaction (std::vector< double > rfs, std::vector< double > rbs, std::vector< std::pair< unsigned int, int >> lhs, std::vector< std::pair< unsigned int, int >> rhs)
 Adds a new reaction to the network, auto expands fields if required. More...
 
void addReactionChannel (unsigned int reaction, double rf, double rb)
 Adds a single reaction channel to an existing reaction. More...
 
void addCompound (double mass, std::string label="")
 Adds a single new compound to the network. More...
 

Detailed Description

A class allowing for easier building of reaction networks.

Member Function Documentation

void Scine::Kinetx::NetworkBuilder::addCompound ( double  mass,
std::string  label = "" 
)

Adds a single new compound to the network.

(Expands fields if required.)

Parameters
massThe molecular mass of the compound to add.
labelOptional: The label of the compound.
void Scine::Kinetx::NetworkBuilder::addReaction ( std::vector< double >  rfs,
std::vector< double >  rbs,
std::vector< std::pair< unsigned int, int >>  lhs,
std::vector< std::pair< unsigned int, int >>  rhs 
)

Adds a new reaction to the network, auto expands fields if required.

Parameters
rfsReaction rates for the forward reaction (one per channel).
rbsReaction rates for the backward reaction (one per channel).
lhsStoichiometry of the LHS of the reaction. (Format: {{Compound1, Equivalents1}, {Compound1, Equivalents2}, ...}).
rhsStoichiometry of the RHS of the reaction. (Format: {{Compound1, Equivalents1}, {Compound1, Equivalents2}, ...}).
void Scine::Kinetx::NetworkBuilder::addReactionChannel ( unsigned int  reaction,
double  rf,
double  rb 
)

Adds a single reaction channel to an existing reaction.

(Expands fields if required.)

Parameters
reactionThe number (index, 0 based) of the reaction to add to.
rfThe reaction rate for the forward reaction.
rbThe reaction rate fot the backward reaction.
Network Scine::Kinetx::NetworkBuilder::generate ( )

Generates the final network.

Returns
Network The network containing all previously added data.
void Scine::Kinetx::NetworkBuilder::reserve ( unsigned int  nCompounds,
unsigned int  nReactions,
unsigned int  nChannelsPerReaction 
)

Reserves space in the underlying data objects, allowing for faster inserts.

Parameters
nCompoundsThe maximum number of compounds.
nReactionsThe maximum number of reactions.
nChannelsPerReactionThe maximum number of reaction channels per reaction.

The documentation for this class was generated from the following files: