@@ -1384,7 +1384,7 @@ std::tuple<std::vector<double>, std::vector<double>> DiscusMultipleScatteringCor
1384
1384
weightsM2[i] += deltas[i] * (weights[i] - weightsMeans[i]);
1385
1385
// calculate sample SD (M2/n-1)
1386
1386
// will give NaN for m_events=1, but that's correct
1387
- weightsErrors[i] = sqrt (weightsM2[i] / static_cast <double >(ie));
1387
+ weightsErrors[i] = sqrt (weightsM2[i] / static_cast <double >(ie + 1 ));
1388
1388
}
1389
1389
1390
1390
} else
@@ -1441,7 +1441,7 @@ std::tuple<bool, std::vector<double>> DiscusMultipleScatteringCorrection::scatte
1441
1441
for (auto &SQWSMapping : currentComponentWorkspaces)
1442
1442
SQWSMapping.InvPOfQ = SQWSMapping.InvPOfQ ->createCopy ();
1443
1443
prepareCumulativeProbForQ (k, newComponentWorkspaces);
1444
- currentComponentWorkspaces = newComponentWorkspaces;
1444
+ currentComponentWorkspaces = std::move ( newComponentWorkspaces) ;
1445
1445
}
1446
1446
}
1447
1447
auto trackStillAlive =
@@ -1507,7 +1507,7 @@ std::tuple<bool, std::vector<double>> DiscusMultipleScatteringCorrection::scatte
1507
1507
const double q = qVector.norm ();
1508
1508
const double finalW = fromWaveVector (k) - finalE;
1509
1509
auto componentWSIt = findMatchingComponent (componentWorkspaces, shapeObjectWithScatter);
1510
- auto componentWSMapping = *componentWSIt; // to help debugging
1510
+ auto & componentWSMapping = *componentWSIt; // to help debugging
1511
1511
double SQ = Interpolate2D (componentWSMapping, q, finalW);
1512
1512
scatteringXSection = m_NormalizeSQ ? scatteringXSection / interpolateFlat (*(componentWSMapping.QSQScaleFactor ), k)
1513
1513
: scatteringXSectionFull;
0 commit comments