~ubuntu-branches/ubuntu/wily/grass/wily

« back to all changes in this revision

Viewing changes to lib/external/ccmath/ruinv.c

Tags: 7.0.0~rc1+ds1-1~exp1
* New upstream release candidate.
* Repack upstream tarball, remove precompiled Python objects.
* Add upstream metadata.
* Update gbp.conf and Vcs-Git URL to use the experimental branch.
* Update watch file for GRASS 7.0.
* Drop build dependencies for Tcl/Tk, add build dependencies:
  python-numpy, libnetcdf-dev, netcdf-bin, libblas-dev, liblapack-dev
* Update Vcs-Browser URL to use cgit instead of gitweb.
* Update paths to use grass70.
* Add configure options: --with-netcdf, --with-blas, --with-lapack,
  remove --with-tcltk-includes.
* Update patches for GRASS 7.
* Update copyright file, changes:
  - Update copyright years
  - Group files by license
  - Remove unused license sections
* Add patches for various typos.
* Fix desktop file with patch instead of d/rules.
* Use minimal dh rules.
* Bump Standards-Version to 3.9.6, no changes.
* Use dpkg-maintscript-helper to replace directories with symlinks.
  (closes: #776349)
* Update my email to use @debian.org address.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*  ruinv.c    CCMATH mathematics library source code.
 
2
 *
 
3
 *  Copyright (C)  2000   Daniel A. Atkinson    All rights reserved.
 
4
 *  This code may be redistributed under the terms of the GNU library
 
5
 *  public license (LGPL). ( See the lgpl.license file for details.)
 
6
 * ------------------------------------------------------------------------
 
7
 */
 
8
int ruinv(double *a, int n)
 
9
{
 
10
    int j;
 
11
 
 
12
    double fabs();
 
13
 
 
14
    double tt, z, *p, *q, *r, *s, *t;
 
15
 
 
16
    for (j = 0, tt = 0., p = a; j < n; ++j, p += n + 1)
 
17
        if ((z = fabs(*p)) > tt)
 
18
            tt = z;
 
19
    tt *= 1.e-16;
 
20
    for (j = 0, p = a; j < n; ++j, p += n + 1) {
 
21
        if (fabs(*p) < tt)
 
22
            return -1;
 
23
        *p = 1. / *p;
 
24
        for (q = a + j, t = a; q < p; t += n + 1, q += n) {
 
25
            for (s = q, r = t, z = 0.; s < p; s += n)
 
26
                z -= *s * *r++;
 
27
            *q = z * *p;
 
28
        }
 
29
    }
 
30
    return 0;
 
31
}