Skip to content
Snippets Groups Projects
Commit 12b9c2d8 authored by Ganeva, Marina's avatar Ganeva, Marina
Browse files

Prefactor for 1D distributions was corrected.

parent b0620734
No related branches found
No related tags found
No related merge requests found
......@@ -62,7 +62,7 @@ FTDistribution1DGauss* FTDistribution1DGauss::clone() const
double FTDistribution1DGauss::evaluate(double q) const
{
double sum_sq = q*q*m_omega*m_omega;
return std::exp(-sum_sq/4.0);
return 0.5*std::exp(-sum_sq/4.0);
}
FTDistribution1DVoigt::FTDistribution1DVoigt(double omega, double eta)
......
......@@ -47,7 +47,7 @@ void InterferenceFunction1DLattice::setProbabilityDistribution(
mp_pdf = pdf.clone();
double omega = mp_pdf->getOmega();
// initialize_calc_factors(omega):
m_prefactor = 2.0*M_PI*omega;
m_prefactor = M_PI*omega;
double qa_max = (m_lattice_params.m_length/(2*M_PI))*nmax/omega;
m_na = (int) (std::abs(qa_max) + 0.5);
}
......
......@@ -46,7 +46,7 @@ TEST_F(FTDistributionsTest, FTDistribution1DGaussConstructor)
IFTDistribution1D * iftd1D = new FTDistribution1DGauss(1.0);
EXPECT_EQ(1.0, iftd1D->getOmega());
EXPECT_EQ("1DDistributionGauss", iftd1D->getName());
EXPECT_NEAR(2*0.4950249, iftd1D->evaluate(0.2),0.000001);
EXPECT_NEAR(0.4950249, iftd1D->evaluate(0.2),0.000001);
iftd1D->setOmega(3.0);
EXPECT_EQ(3.0, iftd1D->getOmega());
......@@ -61,7 +61,7 @@ TEST_F(FTDistributionsTest, FTDistribution1DGaussClone)
EXPECT_EQ(-5.0, iftd1DClone->getOmega());
EXPECT_EQ("1DDistributionGauss", iftd1DClone->getName());
EXPECT_NEAR(2*0.389400, iftd1DClone->evaluate(0.2),0.000001);
EXPECT_NEAR(0.389400, iftd1DClone->evaluate(0.2),0.000001);
delete iftd1D;
delete iftd1DClone;
......
......@@ -553,7 +553,6 @@ TEST_F(FormFactorTest, InfLongBox)
{
double height = 15.;
double width = 100.0/M_PI;
double volume = 2*M_PI*height*width;
FormFactorInfLongBox ilbox(width, height);
......
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