Skip to content

Commit

Permalink
Merge commit 'aa8ff6c55849eccf5df90c86fc7b86fb8bb72e6e'
Browse files Browse the repository at this point in the history
  • Loading branch information
ftomei committed Mar 15, 2024
2 parents 47a0309 + aa8ff6c commit fd4022f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
4 changes: 3 additions & 1 deletion agrolib/mathFunctions/furtherMathFunctions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1227,7 +1227,7 @@ namespace interpolation
}
}
iterationNr++;
} while (iterationNr <= maxIterationsNr && fabs(diffSSE) > myEpsilon);
} while (fabs(diffSSE) > myEpsilon && iterationNr <= maxIterationsNr);
return (fabs(diffSSE) <= myEpsilon);
}

Expand Down Expand Up @@ -1255,6 +1255,7 @@ namespace interpolation
std::vector<double> firstEst(nrData);
std::vector<std::vector<double>> a(nrParametersTotal, std::vector<double>(nrParametersTotal));
std::vector<std::vector<double>> P(nrParametersTotal, std::vector<double>(nrData));
// matrix P corresponds to the Jacobian
// first set of estimates
for (i = 0; i < nrData; i++)
{
Expand Down Expand Up @@ -1341,6 +1342,7 @@ namespace interpolation
}
}

// linear system resolution in order to get the Delta of each parameter
parametersChange[nrPredictors - 1][nrParameters[nrPredictors-1]-1] = g[nrParametersTotal - 1] / a[nrParametersTotal - 1][nrParametersTotal - 1];


Expand Down
11 changes: 9 additions & 2 deletions agrolib/pragaProject/pragaProject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -944,16 +944,23 @@ bool PragaProject::elaborationPointsCycleGrid(bool isAnomaly, bool showInfo)
}
}

QDate startDate(climaUsed->yearStart(), climaUsed->genericPeriodDateStart().month(), climaUsed->genericPeriodDateStart().day());
QDate endDate(climaUsed->yearEnd(), climaUsed->genericPeriodDateEnd().month(), climaUsed->genericPeriodDateEnd().day());
QDate startDate;
QDate endDate;

if (climaUsed->nYears() > 0)
{
startDate.setDate(climaUsed->yearStart(), climaUsed->genericPeriodDateStart().month(), climaUsed->genericPeriodDateStart().day());
endDate.setDate(climaUsed->yearEnd() + climaUsed->nYears(), climaUsed->genericPeriodDateEnd().month(), climaUsed->genericPeriodDateEnd().day());
}
else if (climaUsed->nYears() < 0)
{
startDate.setDate(climaUsed->yearStart() + climaUsed->nYears(), climaUsed->genericPeriodDateStart().month(), climaUsed->genericPeriodDateStart().day());
endDate.setDate(climaUsed->yearEnd(), climaUsed->genericPeriodDateEnd().month(), climaUsed->genericPeriodDateEnd().day());
}
else
{
startDate.setDate(climaUsed->yearStart(), climaUsed->genericPeriodDateStart().month(), climaUsed->genericPeriodDateStart().day());
endDate.setDate(climaUsed->yearEnd(), climaUsed->genericPeriodDateEnd().month(), climaUsed->genericPeriodDateEnd().day());
}

bool dataAlreadyLoaded = false;
Expand Down
2 changes: 1 addition & 1 deletion agrolib/project/interpolationCmd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ bool interpolateProxyGridSeries(const Crit3DProxyGridSeries& mySeries, QDate myD
return false;
}

if (! gis::readEsriGrid(gridNames[second].toStdString(), &secondGrid, myError)) return false;
if (! gis::readEsriGrid(gridNames[second].toStdString(), &secondGrid, myError))
{
*error = QString::fromStdString(myError);
return false;
Expand Down

0 comments on commit fd4022f

Please sign in to comment.