Bug 90441

Summary: getdata LINCOM doesn't use correct rescaling constants
Product: [Applications] kst Reporter: D. V. Wiebe <dvw>
Component: generalAssignee: kst
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: 1.x   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: getdata-LINCOM-test-case.tar.gz

Description D. V. Wiebe 2004-09-29 06:37:58 UTC
Version:           1.0.0_devel (using KDE KDE 3.2.3)
Installed from:    Compiled From Sources
Compiler:          gcc (GCC) 3.3.2 (Mandrake Linux 10.0 3.3.2-6mdk) 
OS:                Linux

Given a dirfile with raw fields data1, data2 and data3, if I want to create a derived field given by

derived = data1 * [m1] + [b1]  +  data2 * [m2] + [b2] +  data3 * [m3] + [b3]

I have to create a format file entry:

derived      LINCOM  3  data1   [m1]/2  [b1]/2  data2  [m2]  [b2]  data3  [m3]  [b3]

whereas I would have expected to have to do something like:

derived      LINCOM  3  data1   [m1]    [b1]    data2  [m2]  [b2]  data3  [m3]  [b3]

For a two field lincom, I need to use:

derived      LINCOM  2  data1   [m1]/2  [b1]/2  data2  [m2]  [b2]

Fortunately, if I'm only using one field, I can get away with:

derived      LINCOM  1  data1   [m1]   [b1]

-dvw
Comment 1 D. V. Wiebe 2004-09-29 06:43:36 UTC
Created attachment 7722 [details]
getdata-LINCOM-test-case.tar.gz

The tiny test dirfile I made while trying to figure out what was happening.
Comment 2 Andrew Walker 2004-10-18 21:36:49 UTC
CVS commit by arwalker: 

Fixed index bug.

CCMAIL: 90441-done@bugs.kde.org


  M +1 -1      getdata.c   1.16


--- kdeextragear-2/kst/kst/datasources/dirfile/getdata.c  #1.15:1.16
@@ -989,5 +989,5 @@ static int DoIfLincom(struct FormatType 
   if (L->n_infields > 1) {
     tmpbuf = AllocTmpbuff(return_type, *n_read);
-    for (i=0; i<L->n_infields; i++) {
+    for (i=1; i<L->n_infields; i++) {
       recurse_level++;
       if (DoField(F, L->in_fields[i],