Skip to content
Snippets Groups Projects
Commit 47c8ebca0b8e authored by f.gundelakh's avatar f.gundelakh
Browse files

1) Added divide by zero checks.

2) Inputs processing fix.

--HG--
branch : FixingIoRefactoring2
parent 73fe5ab3620f
No related branches found
No related tags found
No related merge requests found
......@@ -157,7 +157,7 @@ bool NPac::ACalculate(void)
if(Inputs->size()>0)
{
min_input_data_size=Inputs[0]->GetCols();
for(int i=1;i<NumInputs;i++)
for(int i=1;i<Inputs->size();i++)
if(min_input_data_size>Inputs[i]->GetCols())
min_input_data_size=Inputs[i]->GetCols();
}
......
......@@ -237,7 +237,7 @@ bool NPulseChannel::ACalculate2(void)
channel_input+=*data;
}
if(UseAveragePotential)
if(UseAveragePotential && full_inp_data_size>0)
channel_input/=full_inp_data_size;
}
......
......@@ -326,7 +326,7 @@ bool NPulseSynChannel::ACalculate2(void)
}
NumConnectedSynapsis=num_connected_synapsis;
if(UseAveragePotential)
if(UseAveragePotential && num_connected_channels>0)
channel_input/=num_connected_channels;
if(UseAverageSynapsis && num_connected_synapsis>0)
......@@ -650,7 +650,7 @@ bool NContinuesSynChannel::ACalculate2(void)
}
NumConnectedSynapsis=num_connected_synapsis;
if(UseAveragePotential)
if(UseAveragePotential && num_connected_channels>0)
channel_input/=num_connected_channels;
if(UseAverageSynapsis && num_connected_synapsis>0)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment