Bug 90441 - getdata LINCOM doesn't use correct rescaling constants
Summary: getdata LINCOM doesn't use correct rescaling constants
Status: RESOLVED FIXED
Alias: None
Product: kst
Classification: Applications
Component: general (show other bugs)
Version: 1.x
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: kst
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-09-29 06:37 UTC by D. V. Wiebe
Modified: 2004-10-18 21:36 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
getdata-LINCOM-test-case.tar.gz (2.11 KB, application/x-gzip)
2004-09-29 06:43 UTC, D. V. Wiebe
Details

Note You need to log in before you can comment on or make changes to this bug.
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],