diff options
Diffstat (limited to 'impl/EquationSystem.hpp')
-rw-r--r-- | impl/EquationSystem.hpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/impl/EquationSystem.hpp b/impl/EquationSystem.hpp index efd34b3..3232620 100644 --- a/impl/EquationSystem.hpp +++ b/impl/EquationSystem.hpp @@ -10,6 +10,9 @@ struct EquationSystem { void add(std::string k, Expression<T> v) { equations.insert(std::pair<std::string, Expression<T> >(k, v)); } + unsigned int count() const { + return equations.size(); + } /** init is the value where it STARTS, it's working the other way if there's no stability then it ends with -init @@ -42,6 +45,16 @@ struct EquationSystem { return result; } + std::string output() const { + std::string output = ""; + for (typename std::map<std::string, Expression<T> >::const_iterator it = equations.begin(); + it != equations.end(); + ++it) { + output += it->first + " = " + it->second.output() + "\n"; + } + return output; + } + private: std::map<std::string, T> eval(const std::map<std::string, T>& assignment, bool infinity, const T& infValue) const { std::map<std::string, T> result; |