~ubuntu-branches/ubuntu/trusty/argyll/trusty-proposed

« back to all changes in this revision

Viewing changes to numlib/LUtest.c

  • Committer: Package Import Robot
  • Author(s): Artur Rona
  • Date: 2014-02-12 00:35:39 UTC
  • mfrom: (13.1.24 sid)
  • Revision ID: package-import@ubuntu.com-20140212003539-24tautzlitsiz61w
Tags: 1.5.1-5ubuntu1
* Merge from Debian unstable. (LP: #1275572) Remaining changes:
  - debian/control:
    + Build-depend on libtiff-dev rather than libtiff4-dev.
  - debian/control, debian/patches/06_fix_udev_rule.patch:
    + Fix udev rules to actually work; ENV{ACL_MANAGE} has
      stopped working ages ago, and with logind it's now the
      "uaccess" tag. Dropping also consolekit from Recommends.
  - debian/patches/drop-usb-db.patch:
    + Use hwdb builtin, instead of the obsolete usb-db
      in the udev rules.
* debian/patches/05_ftbfs-underlinkage.diff:
  - Dropped change, no needed anymore.
* Refresh the patches.

Show diffs side-by-side

added added

removed removed

Lines of Context:
44
44
        b[0] = 6.0;
45
45
        b[1] = 4.0;
46
46
        b[2] = 4.5;
47
 
        b[2] = -10.0;
 
47
        b[3] = -10.0;
48
48
 
49
49
        if ((rv = test(n, a, b)) != 0) {
50
50
                if (rv == 1)
51
51
                        printf("LU test failed due to singularity\n");
52
 
                else
 
52
                else {
53
53
                        printf("LU test failed to verify\n");
 
54
                        printf("Got solution %f %f %f %f\n",b[0],b[1],b[2],b[3]);
 
55
                }
54
56
        } else {
55
 
                printf("Got solution %f %f %f %f\n",b[0],b[1],b[2],b[3]);
 
57
                printf("Got verified solution %f %f %f %f\n",b[0],b[1],b[2],b[3]);
56
58
        }
57
59
        return 0;
58
60
}
67
69
        int i, j;
68
70
        double rip;             /* Row interchange parity */
69
71
        int *pivx;
 
72
        int rv = 0;
70
73
 
71
74
        double **sa;            /* save input matrix values */
72
75
        double *sb;                     /* save input vector values */
99
102
                        sum += sa[i][j] * b[j];
100
103
//printf("~~ check %d = %f, against %f\n",i,sum,sb[i]);
101
104
                temp = fabs(sum - sb[i]);
102
 
                if (temp > 1e-6) {
103
 
                        free_dvector(sb, 0, n-1);
104
 
                        free_dmatrix(sa, 0, n-1, 0, n-1);
105
 
                        free_ivector(pivx, 0, n-1);
106
 
                        return 2;
107
 
                }
 
105
                if (temp > 1e-6)
 
106
                        rv = 2;
108
107
        }
109
108
        free_dvector(sb, 0, n-1);
110
109
        free_dmatrix(sa, 0, n-1, 0, n-1);
111
110
        free_ivector(pivx, 0, n-1);
112
 
        return 0;
 
111
        return rv;
113
112
}
114
113