diff options
author | Tomaž Vajngerl <quikee@gmail.com> | 2013-07-03 22:05:30 +0200 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2013-07-03 22:05:30 +0200 |
commit | 926275d07184d441b3bfa1ceca26c4c1f2bc61db (patch) | |
tree | b78da04230e51b5ace60a3908fb8f4edbda37661 | |
parent | 9c22f181ac19fc9a45dd9eb4f8e34d454575f671 (diff) |
Compiler error fixes in PolynomialRegressionCurveCalculator
Change-Id: Ie78e10fea0b798fae5ce2cee96798bcc65bbccbe
-rw-r--r-- | chart2/source/tools/PolynomialRegressionCurveCalculator.cxx | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/chart2/source/tools/PolynomialRegressionCurveCalculator.cxx b/chart2/source/tools/PolynomialRegressionCurveCalculator.cxx index 50de7d3fe23a..ce64ed6cf019 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; } |