summaryrefslogtreecommitdiff
path: root/core/evolve.hpp
diff options
context:
space:
mode:
authorJan Huwald <jh@sotun.de>2012-05-07 20:01:51 (GMT)
committerJan Huwald <jh@sotun.de>2012-05-07 20:01:51 (GMT)
commit420d2ef464d4a741028e132e662d5626806a41f5 (patch)
tree1aca6eb512e4ed0fb5f3c10c528cb998b6ffd695 /core/evolve.hpp
Initial commitHEADmaster
Diffstat (limited to 'core/evolve.hpp')
-rw-r--r--core/evolve.hpp35
1 files changed, 35 insertions, 0 deletions
diff --git a/core/evolve.hpp b/core/evolve.hpp
new file mode 100644
index 0000000..628c170
--- /dev/null
+++ b/core/evolve.hpp
@@ -0,0 +1,35 @@
+#ifndef X66AJaG3Qy6m9CIBTEKhiCYWag0
+#define X66AJaG3Qy6m9CIBTEKhiCYWag0
+
+#include "pla_evolve.hpp"
+
+
+
+namespace EvolveImpl {
+
+ template<typename Quant>
+ struct Evolve {
+ template<class PC>
+ void operator() (PC &pc, const Time ct, const Ptr<Quant> id) {
+ typedef typename QuantChild<Quant>::type Child;
+ // first evolve childs
+ for (Ptr<Child> i : id.childs())
+ Evolve<Child>()(pc, ct, i);
+ // then self
+ pc.cast(PLA_Evolve<Quant>{ContinuousContext<Quant>{id}, ct});
+ }
+ };
+
+ template<>
+ struct Evolve<Synapse> {
+ template<class PC>
+ void operator() (PC &pc, const Time ct, const Ptr<Synapse> id) {
+ // no childs -> evolve only self
+ pc.cast(PLA_Evolve<Synapse>{ContinuousContext<Synapse>{id}, ct});
+ }
+ };
+}
+
+using EvolveImpl::Evolve;
+
+#endif // X66AJaG3Qy6m9CIBTEKhiCYWag0
contact: Jan Huwald // Impressum