17 #include <unordered_map>
53 return std::accumulate(
secmap.begin(),
secmap.end(), 0, [](
int psum,
const auto& item) {
54 return psum + item.second.size();
88 [](
int psum,
const auto& secmap) {
89 return psum + secmap->num_sections();
98 [](
int psum,
const auto& secmap) {
99 return psum + secmap->num_segments();
125 if (
name == secmap->name) {
130 std::cout <<
"Warning: Section mapping list " <<
name <<
" doesn't exist! \n";
139 count =
s->num_segments();
148 count =
s->num_sections();
196 if (mapping->gid == gid) {
215 size_t lfp_size = std::accumulate(
mappingvec.begin(),
218 [](
size_t total,
const auto& mapping) {
219 return total + mapping->num_electrodes();
221 _lfp.resize(lfp_size);
void move(Item *q1, Item *q2, Item *q3)
THIS FILE IS AUTO GENERATED DONT MODIFY IT.
secseg_map_type::iterator secseg_it_type
std::map< int, segvec_type > secseg_map_type
std::vector< int > segvec_type
type to store every section and associated segments
Compartment mapping information for a cell.
SecMapping * get_seclist_mapping(const std::string &name) const
return section list mapping with given name
size_t get_seclist_section_count(const std::string &name) const
return segment count for specific section list with given name
void add_segment_lfp_factor(const int segment_id, std::vector< double > &factors)
add the lfp electrode factors of a segment_id
void add_sec_map(SecMapping *s)
add new SecMapping
std::vector< SecMapping * > secmapvec
list of section lists (like soma, axon, apic)
int num_segments() const
return number of segments in a cell
std::unordered_map< int, std::vector< double > > lfp_factors
map containing segment ids an its respective lfp factors
int num_sections() const
total number of sections in a cell
size_t get_seclist_segment_count(const std::string &name) const
return segment count for specific section list with given name
size_t size() const noexcept
number of section lists
int num_electrodes() const
return the number of electrodes in the lfp_factors map
Compartment mapping information for NrnThread.
size_t size() const
number of cells
std::vector< double > _lfp
CellMapping * get_cell_mapping(int gid) const
get cell mapping information for given gid if exist otherwise return nullptr.
~NrnThreadMappingInfo()
memory cleanup
std::vector< CellMapping * > mappingvec
list of cells mapping
std::vector< int > segment_ids
list of segment ids
void add_cell_mapping(CellMapping *c)
add mapping information of new cell
void add_segment_id(const int segment_id)
add a new segment
void prepare_lfp()
Resize the lfp vector.
Section to segment mapping.
void add_segment(int sec, int seg)
add section to associated segment
size_t num_sections() const noexcept
return total number of sections in section list
std::string name
name of section list
secseg_map_type secmap
map of section and associated segments
SecMapping(std::string s)
size_t num_segments() const
return number of segments in section list