[Kst] extragear/graphics/kst/kst
George Staikos
staikos at kde.org
Tue Aug 2 04:57:15 CEST 2005
SVN commit 442254 by staikos:
- fix compile
- I like the idea of factoring out this math stuff, but let's keep it all in
one file.
M +1 -1 kst2dplot.cpp
M +1 -1 kstimage.cpp
M +25 -0 kstmath.h
D kstmathutils.h
M +4 -2 kstvcurve.cpp
--- trunk/extragear/graphics/kst/kst/kst2dplot.cpp #442253:442254
@@ -53,7 +53,7 @@
#include "kstlegend.h"
#include "kstlinestyle.h"
#include "kstmatrixdialog_i.h"
-#include "kstmathutils.h"
+#include "kstmath.h"
#include "kstnumbersequence.h"
#include "kstplotdialog_i.h"
#include "kstsettings.h"
--- trunk/extragear/graphics/kst/kst/kstimage.cpp #442253:442254
@@ -20,7 +20,7 @@
#include "kstdatacollection.h"
#include "kstdebug.h"
#include "kstimage.h"
-#include "kstmathutils.h"
+#include "kstmath.h"
#include <kdebug.h>
#include <klocale.h>
--- trunk/extragear/graphics/kst/kst/kstmath.h #442253:442254
@@ -21,11 +21,15 @@
#define KSTMATH_H
#include <math.h>
+#include <float.h>
+#include <stdlib.h>
+#include <limits.h>
#ifdef __sun
#include <ieeefp.h>
#endif
+
/*
** For systems without NAN, this is a NAN in IEEE double format.
** Code lifted from kde screensavers.
@@ -59,7 +63,28 @@
#define KST_ISNAN(a) isnan(a)
#endif
+
+inline int d2i(double x) {
+ return int(floor(x+0.5));
+}
+
+
+#if defined(__SVR4) && defined(__sun)
+inline int isinf(double x) { return x == x && !finite(x); }
#endif
+
+
+inline double logX(double x) {
+ return x > 0.0 ? log10(x) : -350.0;
+}
+
+
+inline double logY(double y) {
+ return y > 0.0 ? log10(y) : -350.0;
+}
+
+
+#endif
// vim: ts=2 sw=2 et
--- trunk/extragear/graphics/kst/kst/kstvcurve.cpp #442253:442254
@@ -28,11 +28,13 @@
#include "kstdatacollection.h"
#include "kstdebug.h"
#include "kstlinestyle.h"
-#include "kstmathutils.h"
+#include "kstmath.h"
#include "kstrvector.h"
#include "kstvcurve.h"
#include "ksttimers.h"
+#include <time.h>
+
// for painting
#define MAX_NUM_POLYLINES 1000
@@ -1442,7 +1444,7 @@
#endif
#ifdef BENCHMARK
int i = bench_time.elapsed();
- kdDebug() << "Plotting curve " << i_curve << ": " << i << "ms" << endl;
+ kdDebug() << "Plotting curve " << (void *)this << ": " << i << "ms" << endl;
kdDebug() << " Without locks: " << b_4 << "ms" << endl;
if (b_1 > 0) kdDebug() << " Lines: " << b_1 << "ms" << endl;
if (b_2 - b_1 > 0) kdDebug() << " Bars: " << (b_2 - b_1) << "ms" << endl;
More information about the Kst
mailing list