Skip to content
This repository has been archived by the owner on Mar 20, 2023. It is now read-only.

Commit

Permalink
Clang format and other minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
jorblancoa authored and sergiorg-hpc committed Aug 30, 2022
1 parent 4f015bc commit 86e1d87
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
29 changes: 14 additions & 15 deletions coreneuron/io/reports/report_event.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,19 +89,19 @@ void ReportEvent::lfp_calc(NrnThread* nt) {
int count = 0;
double sum = 0.0;
for (const auto& kv: cell_mapping->lfp_factors) {
int segment_id = kv.first;
double factor = kv.second;
if(std::isnan(factor)) {
factor = 0.0;
}
double iclamp = 0.0;
for (const auto& value: summation_report.currents_[segment_id]) {
double current_value = *value.first;
int scale = value.second;
iclamp += current_value * scale;
}
sum += (fast_imem_rhs[segment_id] + iclamp) * factor;
count++;
int segment_id = kv.first;
double factor = kv.second;
if (std::isnan(factor)) {
factor = 0.0;
}
double iclamp = 0.0;
for (const auto& value: summation_report.currents_[segment_id]) {
double current_value = *value.first;
int scale = value.second;
iclamp += current_value * scale;
}
sum += (fast_imem_rhs[segment_id] + iclamp) * factor;
count++;
}
*(to_report.front().var_value) = sum;
}
Expand All @@ -115,8 +115,7 @@ void ReportEvent::deliver(double t, NetCvode* nc, NrnThread* nt) {
{
if (report_type == ReportType::SummationReport) {
summation_alu(nt);
}
else if (report_type == ReportType::LFPReport) {
} else if (report_type == ReportType::LFPReport) {
lfp_calc(nt);
}
// each thread needs to know its own step
Expand Down
3 changes: 2 additions & 1 deletion coreneuron/io/reports/report_handler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ void ReportHandler::create_report(double dt, double tstop, double delay) {
case LFPReport:
// 1 lfp value per gid
mapinfo->_lfp.resize(nt.ncell);
vars_to_report = get_lfp_vars_to_report(nt, m_report_config, mapinfo->_lfp.data(), nodes_to_gid);
vars_to_report =
get_lfp_vars_to_report(nt, m_report_config, mapinfo->_lfp.data(), nodes_to_gid);
is_soma_target = m_report_config.section_type == SectionType::Soma ||
m_report_config.section_type == SectionType::Cell;
register_section_report(nt, m_report_config, vars_to_report, is_soma_target);
Expand Down

0 comments on commit 86e1d87

Please sign in to comment.