Skip to content
Snippets Groups Projects
Commit 6724cd32 authored by Tammo Jan Dijkema's avatar Tammo Jan Dijkema
Browse files

Task #11550: cherry-pick r40722 into release branch

parent 8b2746df
No related branches found
No related tags found
No related merge requests found
...@@ -877,7 +877,6 @@ namespace LOFAR { ...@@ -877,7 +877,6 @@ namespace LOFAR {
// Put solution weights in a contiguous piece of memory // Put solution weights in a contiguous piece of memory
vector<double> weights; vector<double> weights;
if (!itsConstraintSols[0][constraintNum][solNameNum].weights.empty()) { if (!itsConstraintSols[0][constraintNum][solNameNum].weights.empty()) {
std::cout << "Has weights.\n";
weights.resize(numSols); weights.resize(numSols);
vector<double>::iterator nextpos = weights.begin(); vector<double>::iterator nextpos = weights.begin();
for (uint time=0; time<itsSols.size(); ++time) { for (uint time=0; time<itsSols.size(); ++time) {
......
...@@ -167,7 +167,7 @@ bool MultiDirSolver::assignSolutions(std::vector<std::vector<DComplex> >& soluti ...@@ -167,7 +167,7 @@ bool MultiDirSolver::assignSolutions(std::vector<std::vector<DComplex> >& soluti
// The stepsize is taken out, so that a small stepsize won't cause // The stepsize is taken out, so that a small stepsize won't cause
// a premature stopping criterion. // a premature stopping criterion.
double stepMagnitude = avgAbsDiff/_stepSize/n; double stepMagnitude = (n==0 ? 0 : avgAbsDiff/_stepSize/n);
stepMagnitudes.emplace_back(stepMagnitude); stepMagnitudes.emplace_back(stepMagnitude);
if(useConstraintAccuracy) if(useConstraintAccuracy)
...@@ -375,7 +375,7 @@ void MultiDirSolver::performScalarIteration(size_t channelBlockIndex, ...@@ -375,7 +375,7 @@ void MultiDirSolver::performScalarIteration(size_t channelBlockIndex,
// solve x^H in [g C] x^H = v // solve x^H in [g C] x^H = v
bool success = solver.Solve(gTimesCs[ant].data(), vs[ant].data()); bool success = solver.Solve(gTimesCs[ant].data(), vs[ant].data());
Matrix& x = vs[ant]; Matrix& x = vs[ant];
if(success) if(success && x(0, 0) != 0.)
{ {
for(size_t d=0; d!=_nDirections; ++d) for(size_t d=0; d!=_nDirections; ++d)
nextSolutions[ant*_nDirections + d] = x(d, 0); nextSolutions[ant*_nDirections + d] = x(d, 0);
...@@ -639,7 +639,7 @@ void MultiDirSolver::performFullMatrixIteration(size_t channelBlockIndex, ...@@ -639,7 +639,7 @@ void MultiDirSolver::performFullMatrixIteration(size_t channelBlockIndex,
// solve x^H in [g C] x^H = v // solve x^H in [g C] x^H = v
bool success = solver.Solve(gTimesCs[ant].data(), vs[ant].data()); bool success = solver.Solve(gTimesCs[ant].data(), vs[ant].data());
Matrix& x = vs[ant]; Matrix& x = vs[ant];
if(success) if(success && x(0, 0) != 0.)
{ {
for(size_t d=0; d!=_nDirections; ++d) for(size_t d=0; d!=_nDirections; ++d)
{ {
...@@ -650,8 +650,9 @@ void MultiDirSolver::performFullMatrixIteration(size_t channelBlockIndex, ...@@ -650,8 +650,9 @@ void MultiDirSolver::performFullMatrixIteration(size_t channelBlockIndex,
} }
} }
else { else {
for(size_t i=0; i!=_nDirections*4; ++i) for(size_t i=0; i!=_nDirections*4; ++i) {
nextSolutions[ant*_nDirections + i] = std::numeric_limits<double>::quiet_NaN(); nextSolutions[ant*_nDirections*4 + i] = std::numeric_limits<double>::quiet_NaN();
}
} }
} }
_timerSolve.Pause(); _timerSolve.Pause();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment