diff options
author | Laurent Balland-Poirier <laurent.balland-poirier@laposte.net> | 2015-04-16 22:32:07 +0200 |
---|---|---|
committer | Philippe Jung <phil.jung@free.fr> | 2015-06-22 09:57:49 +0000 |
commit | 35fd66e8648c6d82396486a9469dcb061c832b91 (patch) | |
tree | 964896be8feecb3203eada29bc2a9bc77d0c1588 /chart2/source/inc | |
parent | cad19fa8414b419f2e0f9ee88139e9b7a2dd4ff4 (diff) |
tdf#70673 Power trendline: enable negative Y values
With a negative intercept, Y values can be negative
Change-Id: I9c23cc89b74498f7e7c7bcee00057627768f48aa
Reviewed-on: https://gerrit.libreoffice.org/15357
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Philippe Jung <phil.jung@free.fr>
Diffstat (limited to 'chart2/source/inc')
-rw-r--r-- | chart2/source/inc/PotentialRegressionCurveCalculator.hxx | 3 | ||||
-rw-r--r-- | chart2/source/inc/RegressionCalculationHelper.hxx | 13 |
2 files changed, 15 insertions, 1 deletions
diff --git a/chart2/source/inc/PotentialRegressionCurveCalculator.hxx b/chart2/source/inc/PotentialRegressionCurveCalculator.hxx index dba739e214cc..d9ad473fc116 100644 --- a/chart2/source/inc/PotentialRegressionCurveCalculator.hxx +++ b/chart2/source/inc/PotentialRegressionCurveCalculator.hxx @@ -57,9 +57,10 @@ private: throw (css::lang::IllegalArgumentException, css::uno::RuntimeException, std::exception) SAL_OVERRIDE; - // formula is: f(x) = x ^ m_fSlope * m_fIntercept + // formula is: f(x) = x ^ m_fSlope * m_fSign * m_fIntercept double m_fSlope; double m_fIntercept; + double m_fSign; }; } // namespace chart diff --git a/chart2/source/inc/RegressionCalculationHelper.hxx b/chart2/source/inc/RegressionCalculationHelper.hxx index 2e0e3a4adc53..7f0a69368467 100644 --- a/chart2/source/inc/RegressionCalculationHelper.hxx +++ b/chart2/source/inc/RegressionCalculationHelper.hxx @@ -127,6 +127,19 @@ public: } }; +class isValidAndXPositiveAndYNegative : public ::std::binary_function< double, double, bool > +{ +public: + inline bool operator()( double x, double y ) + { return ! ( ::rtl::math::isNan( x ) || + ::rtl::math::isNan( y ) || + ::rtl::math::isInf( x ) || + ::rtl::math::isInf( y ) || + x <= 0.0 || + y >= 0.0 ); + } +}; + } // namespace RegressionCalculationHelper } // namespace chart |