[Libreoffice-commits] core.git: chart2/source
Tomaž Vajngerl
quikee at gmail.com
Wed Jul 3 13:08:34 PDT 2013
chart2/source/tools/PolynomialRegressionCurveCalculator.cxx | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
New commits:
commit 926275d07184d441b3bfa1ceca26c4c1f2bc61db
Author: Tomaž Vajngerl <quikee at gmail.com>
Date: Wed Jul 3 22:05:30 2013 +0200
Compiler error fixes in PolynomialRegressionCurveCalculator
Change-Id: Ie78e10fea0b798fae5ce2cee96798bcc65bbccbe
diff --git a/chart2/source/tools/PolynomialRegressionCurveCalculator.cxx b/chart2/source/tools/PolynomialRegressionCurveCalculator.cxx
index 50de7d3..ce64ed6 100644
--- a/chart2/source/tools/PolynomialRegressionCurveCalculator.cxx
+++ b/chart2/source/tools/PolynomialRegressionCurveCalculator.cxx
@@ -21,6 +21,7 @@
#include "macros.hxx"
#include "RegressionCalculationHelper.hxx"
+#include <cmath>
#include <rtl/math.hxx>
#include <rtl/ustrbuf.hxx>
#include "gauss.hxx"
@@ -72,17 +73,17 @@ void SAL_CALL PolynomialRegressionCurveCalculator::recalculateRegression(
for (sal_Int32 j = 0; j < aNumberOfPowers; j++)
{
if (mForceIntercept)
- aPowers[j] += std::pow(x, j + 2);
+ aPowers[j] += std::pow(x, (int) j + 2);
else
- aPowers[j] += std::pow(x, j);
+ aPowers[j] += std::pow(x, (int) j);
}
for (sal_Int32 j = 0; j < aNoElements; j++)
{
if (mForceIntercept)
- aMatrix[j * aNoRows + aNoElements] += std::pow(x, j + 1) * ( y - mInterceptValue );
+ aMatrix[j * aNoRows + aNoElements] += std::pow(x, (int) j + 1) * ( y - mInterceptValue );
else
- aMatrix[j * aNoRows + aNoElements] += std::pow(x, j) * y;
+ aMatrix[j * aNoRows + aNoElements] += std::pow(x, (int) j) * y;
}
yAverage += y;
@@ -143,7 +144,7 @@ double SAL_CALL PolynomialRegressionCurveCalculator::getCurveValue( double x )
fResult = 0.0;
for (size_t i = 0; i<mResult.size(); i++)
{
- fResult += mResult[i] * std::pow(x, i);
+ fResult += mResult[i] * std::pow(x, (int) i);
}
return fResult;
}
More information about the Libreoffice-commits
mailing list