GRASS GIS 8 Programmer's Manual
8.3.2(2024)-exported
Loading...
Searching...
No Matches
ruinv.c
Go to the documentation of this file.
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(
double
);
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
}
t
double t
Definition
driver/set_window.c:5
r
double r
Definition
driver/set_window.c:5
ruinv
int ruinv(double *a, int n)
Definition
ruinv.c:8
external
ccmath
ruinv.c
Generated on Fri May 24 2024 09:06:59 for GRASS GIS 8 Programmer's Manual by
1.9.8