Commit 7ecc96dd authored by Yaroslav Gevorkov's avatar Yaroslav Gevorkov
Browse files

allow choosing less fitted nodes if they are fitted significantly better in multi seed refinement

parent 00d340dd
......@@ -104,12 +104,12 @@ void PinkIndexer::refine(Lattice& indexedLattice, Vector2f& centerShift, const M
break;
case RefinementType::firstFixedThenVariableLatticeParametersMultiSeed:
{
constexpr int refinementTries = 1500;
constexpr int refinementTries = 1000;
int fittedNodesCount[refinementTries];
double fittedNodesMeanDefects[refinementTries];
Lattice fittedLattices[refinementTries];
float maxRelativeDeviation = 0.014;
float maxRelativeDeviation = 0.0125;
Array<float, 1, 3> columnDeviationNorms = indexedLattice.getBasis().colwise().norm() * maxRelativeDeviation;
#pragma omp parallel for
for (int i = 0; i < refinementTries; ++i)
......@@ -195,8 +195,11 @@ void PinkIndexer::refine(Lattice& indexedLattice, Vector2f& centerShift, const M
double minFittedNodesMeanDefect = refinement.getMeanDefect(indexedLattice.getBasis(), ucsDirections, ucsBorderNorms);
for (int i = 0; i < refinementTries; ++i)
{
if (fittedNodesCount[i] > maxFittedNodesCount ||
(fittedNodesCount[i] == maxFittedNodesCount && fittedNodesMeanDefects[i] < minFittedNodesMeanDefect))
// if (fittedNodesCount[i] > maxFittedNodesCount ||
// (fittedNodesCount[i] == maxFittedNodesCount && fittedNodesMeanDefects[i] < minFittedNodesMeanDefect))
if (fittedNodesCount[i] / maxFittedNodesCount > 1.2 ||
(fittedNodesCount[i] > maxFittedNodesCount || fittedNodesMeanDefects[i] < minFittedNodesMeanDefect) &&
(fittedNodesCount[i] / maxFittedNodesCount - 1) * 3 > (minFittedNodesMeanDefect / fittedNodesMeanDefects[i] - 1))
{
maxFittedNodesCount = fittedNodesCount[i];
minFittedNodesMeanDefect = fittedNodesMeanDefects[i];
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment