summaryrefslogtreecommitdiff
path: root/impl/EquationSystem.h
diff options
context:
space:
mode:
Diffstat (limited to 'impl/EquationSystem.h')
-rw-r--r--impl/EquationSystem.h40
1 files changed, 0 insertions, 40 deletions
diff --git a/impl/EquationSystem.h b/impl/EquationSystem.h
deleted file mode 100644
index 9a393c8..0000000
--- a/impl/EquationSystem.h
+++ /dev/null
@@ -1,40 +0,0 @@
-#ifndef EQUATIONSYSTEM_H
-#define EQUATIONSYSTEM_H
-
-#include "Equation.h"
-#include <list>
-
-template<class T>
-struct EquationSystem {
- bool add(Equation<T> e) {
- for (iterator it = equations.begin();
- it != equations.end();
- ++it) {
- if ((*it).var().name() == e.var().name()) {
- return false;
- }
- }
- this->equations.push_back(e);
- return true;
- }
-
- std::map<std::string, T> solve(std::map<std::string, T> start) {
- std::map<std::string, T> result = start;
- std::map<std::string, T> comparison;
- do {
- comparison = result;
- for (iterator it = equations.begin();
- it != equations.end();
- ++it) {
- result = it->solve(result);
- }
- } while (comparison != result);
- return result;
- }
-
- private:
- typedef typename std::list< Equation<T> >::iterator iterator;
- std::list< Equation<T> > equations;
-};
-
-#endif