[Kst] extragear/graphics/kst/plugins/discretizing_filters
Nicolas Brisset
nicolas.brisset at eurocopter.com
Sat Nov 26 00:31:50 CET 2005
SVN commit 483316 by brisset:
Some fixes, still a problem left but it's getting late...
M +5 -4 kstfilter_generic.cpp
--- trunk/extragear/graphics/kst/plugins/discretizing_filters/kstfilter_generic.cpp #483315:483316
@@ -28,9 +28,9 @@
int i = 0, length = inArrayLens[0];
// Extract polynom coefficients and instantiate polynoms
-QStringList numCoeffs = QStringList::split(QRegExp("\\s*(,|;|:)*\\s*"), inStrings[0]);
-QStringList numden = QStringList::split(QRegExp("\\s*(,|;|:)*\\s*"), inStrings[1]);
-int numDegree = numCoeffs.count(), denDegree = numden.count();
+QStringList numCoeffs = QStringList::split(QRegExp("\\s*(,|;|:)\\s*"), inStrings[0]);
+QStringList numden = QStringList::split(QRegExp("\\s*(,|;|:)\\s*"), inStrings[1]);
+int numDegree = numCoeffs.count() - 1, denDegree = numden.count() - 1;
polynom<long double> Num(numDegree), Den(denDegree);
double tmpDouble = 0.0;
bool ok = false;
@@ -54,12 +54,13 @@
// Create filter
filter<long double> theFilter(Num,Den,DeltaT);
-long double in = 0.0;
+long double in = inArrays[0][0];
theFilter.ConnectTo(in);
theFilter.Reset();
for (int i=0; i<length; i++) {
theFilter.NextTimeStep();
outArrays[0][i] = (double) theFilter.out;
+ in = (long double) inArrays[0][i];
}
return 0;
More information about the Kst
mailing list