[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [labplot/analysis_interpolation] src/backend/worksheet/plots/cartesian: code cleanup
From:       Stefan Gerlach <stefan.gerlach () uni-konstanz ! de>
Date:       2016-04-30 22:07:10
Message-ID: E1awd2c-0003jC-C4 () scm ! kde ! org
[Download RAW message or body]

Git commit 0a2e1768f9e41caba2da50651920ed6299bdccdd by Stefan Gerlach.
Committed on 30/04/2016 at 22:06.
Pushed by sgerlach into branch 'analysis_interpolation'.

code cleanup

M  +3    -2    src/backend/worksheet/plots/cartesian/XYInterpolationCurve.cpp

http://commits.kde.org/labplot/0a2e1768f9e41caba2da50651920ed6299bdccdd

diff --git a/src/backend/worksheet/plots/cartesian/XYInterpolationCurve.cpp \
b/src/backend/worksheet/plots/cartesian/XYInterpolationCurve.cpp index \
                3567552..d32316f 100644
--- a/src/backend/worksheet/plots/cartesian/XYInterpolationCurve.cpp
+++ b/src/backend/worksheet/plots/cartesian/XYInterpolationCurve.cpp
@@ -41,7 +41,7 @@
 #include "backend/lib/commandtemplates.h"
 
 #include <cmath>	// isnan
-#include <values.h>	// DBL_MIN
+#include <cfloat>	// DBL_MIN
 #include <gsl_errno.h>
 #include <gsl/gsl_interp.h>
 #include <gsl/gsl_spline.h>
@@ -477,7 +477,8 @@ void XYInterpolationCurvePrivate::recalculate() {
 			break;
 		case XYInterpolationCurve::PCH: {
 			t = (x-xdata[a])/(xdata[b]-xdata[a]);
-			double h1=2.*t*t*t-3.*t*t+1, h2=-2.*t*t*t+3.*t*t, h3=t*t*t-2*t*t+t, h4=t*t*t-t*t;
+			double t2=t*t, t3=t2*t;
+			double h1=2.*t3-3.*t2+1, h2=-2.*t3+3.*t2, h3=t3-2*t2+t, h4=t3-t2;
 			double m1=0.,m2=0.;
 			switch(variant) {
 			case XYInterpolationCurve::FiniteDifference:


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic