summaryrefslogtreecommitdiffstats
path: root/chart2
diff options
context:
space:
mode:
authorTomaž Vajngerl <quikee@gmail.com>2013-07-03 22:05:30 +0200
committerTomaž Vajngerl <quikee@gmail.com>2013-07-03 22:05:30 +0200
commit926275d07184d441b3bfa1ceca26c4c1f2bc61db (patch)
treeb78da04230e51b5ace60a3908fb8f4edbda37661 /chart2
parentRemove "None" Regression curve option and related files and code. (diff)
downloadcore-926275d07184d441b3bfa1ceca26c4c1f2bc61db.tar.gz
core-926275d07184d441b3bfa1ceca26c4c1f2bc61db.zip
Compiler error fixes in PolynomialRegressionCurveCalculator
Change-Id: Ie78e10fea0b798fae5ce2cee96798bcc65bbccbe
Diffstat (limited to 'chart2')
-rw-r--r--chart2/source/tools/PolynomialRegressionCurveCalculator.cxx11
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;
}