mirror of
https://github.com/holub/mame
synced 2025-06-08 05:44:09 +03:00
Fixed a bug in the SOR solvers. (nw)
This commit is contained in:
parent
b2bbc99e76
commit
6fd6de50ff
@ -183,18 +183,6 @@ ATTR_HOT inline int netlist_matrix_solver_SOR_t<m_N, _storage_N>::vsolve_non_dyn
|
|||||||
resched_cnt++;
|
resched_cnt++;
|
||||||
} while (resched && (resched_cnt < this->m_params.m_gs_loops));
|
} while (resched && (resched_cnt < this->m_params.m_gs_loops));
|
||||||
|
|
||||||
if (newton_raphson)
|
|
||||||
{
|
|
||||||
//printf("here %s\n", this->name().cstr());
|
|
||||||
for (int k = 0; k < iN; k++)
|
|
||||||
this->m_nets[k]->m_cur_Analog += 1.0 * (new_V[k] - this->m_nets[k]->m_cur_Analog);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
for (int k = 0; k < iN; k++)
|
|
||||||
this->m_nets[k]->m_cur_Analog = new_V[k];
|
|
||||||
}
|
|
||||||
|
|
||||||
this->m_gs_total += resched_cnt;
|
this->m_gs_total += resched_cnt;
|
||||||
this->m_stat_calculations++;
|
this->m_stat_calculations++;
|
||||||
|
|
||||||
@ -204,9 +192,19 @@ ATTR_HOT inline int netlist_matrix_solver_SOR_t<m_N, _storage_N>::vsolve_non_dyn
|
|||||||
this->m_gs_fail++;
|
this->m_gs_fail++;
|
||||||
return netlist_matrix_solver_direct_t<m_N, _storage_N>::vsolve_non_dynamic(newton_raphson);
|
return netlist_matrix_solver_direct_t<m_N, _storage_N>::vsolve_non_dynamic(newton_raphson);
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
return resched_cnt;
|
if (newton_raphson)
|
||||||
|
{
|
||||||
|
for (int k = 0; k < iN; k++)
|
||||||
|
this->m_nets[k]->m_cur_Analog += 1.0 * (new_V[k] - this->m_nets[k]->m_cur_Analog);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
for (int k = 0; k < iN; k++)
|
||||||
|
this->m_nets[k]->m_cur_Analog = new_V[k];
|
||||||
|
}
|
||||||
|
|
||||||
|
return resched_cnt;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -217,20 +217,19 @@ ATTR_HOT inline int netlist_matrix_solver_SOR_mat_t<m_N, _storage_N>::vsolve_non
|
|||||||
resched_cnt++;
|
resched_cnt++;
|
||||||
} while (resched && (resched_cnt < this->m_params.m_gs_loops));
|
} while (resched && (resched_cnt < this->m_params.m_gs_loops));
|
||||||
|
|
||||||
this->store(new_v);
|
this->m_stat_calculations++;
|
||||||
this->m_gs_total += resched_cnt;
|
this->m_gs_total += resched_cnt;
|
||||||
|
|
||||||
if (resched)
|
if (resched)
|
||||||
{
|
{
|
||||||
//this->netlist().warning("Falling back to direct solver .. Consider increasing RESCHED_LOOPS");
|
//this->netlist().warning("Falling back to direct solver .. Consider increasing RESCHED_LOOPS");
|
||||||
this->m_gs_fail++;
|
this->m_gs_fail++;
|
||||||
|
|
||||||
this->LE_solve();
|
this->LE_solve();
|
||||||
this->m_stat_calculations++;
|
|
||||||
return netlist_matrix_solver_direct_t<m_N, _storage_N>::solve_non_dynamic(newton_raphson);
|
return netlist_matrix_solver_direct_t<m_N, _storage_N>::solve_non_dynamic(newton_raphson);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
this->m_stat_calculations++;
|
this->store(new_v);
|
||||||
|
|
||||||
return resched_cnt;
|
return resched_cnt;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user