Skip to content
Snippets Groups Projects
Commit 0abe2b59 authored by Bertram Kopf's avatar Bertram Kopf
Browse files

protection against numerical instabilities

parent fcf70178
No related branches found
No related tags found
No related merge requests found
......@@ -50,7 +50,8 @@ void KPole::evalMatrix(const double mass, Spin OrbMom){
double denom=_poleMass*_poleMass-mass*mass;
if( std::abs(denom) < 1.e-10){
denom = 1.e-10;
if(denom<0.) denom = -1.e-10;
else denom = 1.e-10;
}
for (int i=0; i< int(_g_i.size()); ++i){
......
......@@ -59,7 +59,8 @@ void KPoleBarrier::evalMatrix(const double mass, Spin OrbMom){
double denom=_poleMass*_poleMass-mass*mass;
if(std::abs(denom) < 1e-10){
denom = 1.E-10;
if(denom<0.) denom = -1.E-10;
else denom = 1.E-10;
}
for (int i=0; i< int(_g_i.size()); ++i){
......
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