7 #ifndef KINETX_NETWORKBUILDER_H_
8 #define KINETX_NETWORKBUILDER_H_
10 #include <Eigen/Dense>
11 #include <Eigen/Sparse>
37 void reserve(
unsigned int nCompounds,
unsigned int nReactions,
unsigned int nChannelsPerReaction);
47 void addReaction(std::vector<double> rfs, std::vector<double> rbs, std::vector<std::pair<unsigned int, int>> lhs,
48 std::vector<std::pair<unsigned int, int>> rhs);
67 void addCompound(
double mass, std::string label =
"");
70 unsigned int _nCompounds = 0;
71 unsigned int _nReactions = 0;
72 unsigned int _nChannels = 0;
73 Eigen::VectorXi _channelCounts;
74 Eigen::VectorXd _masses;
75 std::vector<std::string> _labels;
76 Eigen::SparseMatrix<double> _ratesForward;
77 Eigen::SparseMatrix<double> _ratesBackward;
78 Eigen::SparseMatrix<int> _stoichiometryForward;
79 Eigen::SparseMatrix<int> _stoichiometryBackward;
85 #endif // KINETX_NETWORKBUILDER_H_
A class allowing for easier building of reaction networks.
Definition: NetworkBuilder.h:21
void addReactionChannel(unsigned int reaction, double rf, double rb)
Adds a single reaction channel to an existing reaction.
Definition: NetworkBuilder.cpp:98
void addCompound(double mass, std::string label="")
Adds a single new compound to the network.
Definition: NetworkBuilder.cpp:111
void reserve(unsigned int nCompounds, unsigned int nReactions, unsigned int nChannelsPerReaction)
Reserves space in the underlying data objects, allowing for faster inserts.
Definition: NetworkBuilder.cpp:34
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.
Definition: NetworkBuilder.cpp:54
NetworkBuilder()=default
Default constructor.
Network generate()
Generates the final network.
Definition: NetworkBuilder.cpp:14