Skip to content
Snippets Groups Projects
Commit a867d77b authored by Sam Yates's avatar Sam Yates
Browse files

Voltage and current probes

* First implementation of simple current/voltage probe
  interface
* Sample a specific collection of voltage or current
  values at independent dt (current implementation
  chooses to provide at most one sample per simulation
  dt per request.)
* Miniapp uses samplers to write soma and dendrite
  membrane potentials from first three cells.
* Also: fix noncompliant use of nullptr -> bool conversion
  in test_optional.cpp
parent 1130c9f2
No related branches found
No related tags found
No related merge requests found
......@@ -138,7 +138,7 @@ public:
value_type probe(uint32_t i) const {
auto p = probes_[i];
return (*p.first)[p.second];
return (this->*p.first)[p.second];
}
std::size_t num_probes() const { return probes_.size(); }
......@@ -187,7 +187,7 @@ private:
std::vector<std::pair<uint32_t, i_clamp>> stimulii_;
std::vector<std::pair<const vector_type*, uint32_t>> probes_;
std::vector<std::pair<const vector_type fvm_cell::*, uint32_t>> probes_;
/*
/// spike event queue
......@@ -415,10 +415,10 @@ fvm_cell<T, I>::fvm_cell(nest::mc::cell const& cell)
uint32_t comp = find_compartment_index(probe.first, graph);
switch (probe.second) {
case nest::mc::cell::membrane_voltage:
probes_.push_back({&voltage_, comp});
probes_.push_back({&fvm_cell::voltage_, comp});
break;
case nest::mc::cell::membrane_current:
probes_.push_back({&current_, comp});
probes_.push_back({&fvm_cell::current_, comp});
break;
default:
throw std::logic_error("unrecognized probe sort");
......
......@@ -282,7 +282,7 @@ TEST(optionalm,conversion) {
TEST(optionalm,or_operator) {
optional<const char *> default_msg="default";
auto x=nullptr | default_msg;
auto x=(char *)0 | default_msg;
EXPECT_TRUE((bool)x);
EXPECT_STREQ("default",x.get());
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment