BornAgain  1.18.0
Simulate and fit neutron and x-ray scattering at grazing incidence
anonymous_namespace{ProfileHelper.cpp} Namespace Reference

Functions

double Transition (double x, double sigma)
 
double TransitionTanh (double x)
 

Variables

const double prefactor = std::sqrt(2.0 / M_PI)
 

Function Documentation

◆ Transition()

double anonymous_namespace{ProfileHelper.cpp}::Transition ( double  x,
double  sigma 
)

Definition at line 83 of file ProfileHelper.cpp.

84 {
85  if (sigma <= 0.0)
86  return x < 0.0 ? 1.0 : 0.0;
87  return TransitionTanh(x / sigma);
88 }

References TransitionTanh().

Referenced by ProfileHelper::calculateProfile().

Here is the call graph for this function:

◆ TransitionTanh()

double anonymous_namespace{ProfileHelper.cpp}::TransitionTanh ( double  x)

Definition at line 89 of file ProfileHelper.cpp.

90 {
91  return (1.0 - std::tanh(prefactor * x)) / 2.0;
92 }

References prefactor.

Referenced by Transition().

Variable Documentation

◆ prefactor

const double anonymous_namespace{ProfileHelper.cpp}::prefactor = std::sqrt(2.0 / M_PI)