summaryrefslogtreecommitdiff
path: root/chart2
diff options
context:
space:
mode:
authorTomaž Vajngerl <quikee@gmail.com>2013-07-01 19:30:49 +0200
committerTomaž Vajngerl <quikee@gmail.com>2013-07-03 21:46:47 +0200
commit0a21c4faea3a444a3b6c5a7561754c73310fb77c (patch)
treee7396e956c2d5e49f7de6295e6ebdca9cd12ce1e /chart2
parent28293399e263a64299cfadafdfaf2817bc505713 (diff)
use sal_Int32 instead of int in PolynomialRegressionCurveCalculator
Change-Id: Icc3ffdda71482d1a716ea99e6cf8410bc2e39aa0
Diffstat (limited to 'chart2')
-rw-r--r--chart2/source/tools/PolynomialRegressionCurveCalculator.cxx20
1 files changed, 10 insertions, 10 deletions
diff --git a/chart2/source/tools/PolynomialRegressionCurveCalculator.cxx b/chart2/source/tools/PolynomialRegressionCurveCalculator.cxx
index 0d3d4d1dbc7f..50de7d3fe23a 100644
--- a/chart2/source/tools/PolynomialRegressionCurveCalculator.cxx
+++ b/chart2/source/tools/PolynomialRegressionCurveCalculator.cxx
@@ -48,14 +48,14 @@ void SAL_CALL PolynomialRegressionCurveCalculator::recalculateRegression(
RegressionCalculationHelper::tDoubleVectorPair aValues(
RegressionCalculationHelper::cleanup( aXValues, aYValues, RegressionCalculationHelper::isValid()));
- int aNoElements = mForceIntercept ? mDegree : mDegree + 1;
- int aNumberOfPowers = 2 * aNoElements - 1;
+ sal_Int32 aNoElements = mForceIntercept ? mDegree : mDegree + 1;
+ sal_Int32 aNumberOfPowers = 2 * aNoElements - 1;
std::vector<double> aPowers;
aPowers.resize(aNumberOfPowers, 0.0);
- int aNoColumns = aNoElements;
- int aNoRows = aNoElements + 1;
+ sal_Int32 aNoColumns = aNoElements;
+ sal_Int32 aNoRows = aNoElements + 1;
std::vector<double> aMatrix;
aMatrix.resize(aNoColumns * aNoRows, 0.0);
@@ -69,7 +69,7 @@ void SAL_CALL PolynomialRegressionCurveCalculator::recalculateRegression(
double x = aValues.first[i];
double y = aValues.second[i];
- for (int j = 0; j < aNumberOfPowers; j++)
+ for (sal_Int32 j = 0; j < aNumberOfPowers; j++)
{
if (mForceIntercept)
aPowers[j] += std::pow(x, j + 2);
@@ -77,7 +77,7 @@ void SAL_CALL PolynomialRegressionCurveCalculator::recalculateRegression(
aPowers[j] += std::pow(x, j);
}
- for (int j = 0; j < aNoElements; j++)
+ for (sal_Int32 j = 0; j < aNoElements; j++)
{
if (mForceIntercept)
aMatrix[j * aNoRows + aNoElements] += std::pow(x, j + 1) * ( y - mInterceptValue );
@@ -90,9 +90,9 @@ void SAL_CALL PolynomialRegressionCurveCalculator::recalculateRegression(
yAverage = yAverage / aNoValues;
- for (int y = 0; y < aNoElements; y++)
+ for (sal_Int32 y = 0; y < aNoElements; y++)
{
- for (int x = 0; x < aNoElements; x++)
+ for (sal_Int32 x = 0; x < aNoElements; x++)
{
aMatrix[y * aNoRows + x] = aPowers[y + x];
}
@@ -166,8 +166,8 @@ OUString PolynomialRegressionCurveCalculator::ImplGetRepresentation(
{
OUStringBuffer aBuf( "f(x) = ");
- int aLastIndex = mResult.size() - 1;
- for (int i = aLastIndex; i >= 0; i--)
+ sal_Int32 aLastIndex = mResult.size() - 1;
+ for (sal_Int32 i = aLastIndex; i >= 0; i--)
{
double aValue = mResult[i];
if (aValue == 0.0)