17 #include <unordered_map>
38 std::unordered_map<int, std::vector<int>>
secmap;
52 return std::accumulate(
secmap.begin(),
secmap.end(), 0, [](
int psum,
const auto& item) {
53 return psum + item.second.size();
87 [](
int psum,
const auto& secmap) {
88 return psum + secmap->num_sections();
97 [](
int psum,
const auto& secmap) {
98 return psum + secmap->num_compartments();
124 if (
type == secmap->type) {
129 std::cout <<
"Warning: Section mapping list " <<
to_string(
type) <<
" doesn't exist! \n";
139 return s->num_compartments();
147 return s->num_sections();
190 std::cerr <<
"CellMapping for gid " <<
std::to_string(
c->gid) <<
" already exists!\n";
205 [](
size_t total,
const auto& mapping) {
206 return total + mapping.second->num_electrodes();
208 _lfp.resize(lfp_size);
THIS FILE IS AUTO GENERATED DONT MODIFY IT.
void nrn_abort(int errcode)
std::string to_string(EnumT e, const std::array< std::pair< EnumT, std::string_view >, N > &mapping, const std::string_view enum_name)
Converts an enum value to its corresponding string representation.
Compartment mapping information for a cell.
void add_segment_lfp_factor(const int segment_id, std::vector< double > &factors)
add the lfp electrode factors of a segment_id
int num_compartments() const
return number of compartments in a cell
std::shared_ptr< SecMapping > get_seclist_mapping(const SectionType type) const
return section list mapping with given type
std::unordered_map< int, std::vector< double > > lfp_factors
map containing segment ids an its respective lfp factors
size_t get_seclist_compartment_count(const SectionType type) const
return compartment count for specific section list with given type
size_t get_seclist_section_count(const SectionType type) const
return segment count for specific section list with given type
int num_sections() const
total number of sections in a cell
void add_sec_map(std::shared_ptr< SecMapping > s)
add new SecMapping
std::vector< std::shared_ptr< SecMapping > > sec_mappings
list of section lists (like soma, axon, apic)
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.
void add_cell_mapping(std::shared_ptr< CellMapping > c)
add mapping information of new cell
size_t size() const
number of cells
std::unordered_map< int, std::shared_ptr< CellMapping > > cell_mappings
list of cells mapping
std::vector< double > _lfp
std::shared_ptr< CellMapping > get_cell_mapping(int gid) const
get cell mapping information for given gid if exist otherwise return nullptr.
std::vector< int > segment_ids
list of segment ids
void add_segment_id(const int segment_id)
add a new segment
void prepare_lfp()
Resize the lfp vector.
Section to segment mapping.
std::unordered_map< int, std::vector< int > > secmap
map of section and associated compartments
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
SectionType type
name of section list
size_t num_compartments() const
return number of compartments in section list
SecMapping(SectionType t)