GRASS 8 Programmer's Manual
8.6.0dev(2026)-1d1e47ad9d
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
}
AMI_STREAM
Definition
ami_stream.h:153
t
double t
Definition
r_raster.c:39
r
double r
Definition
r_raster.c:39
ruinv
int ruinv(double *a, int n)
Definition
ruinv.c:8
lib
external
ccmath
ruinv.c
Generated on Fri Apr 3 2026 06:59:52 for GRASS 8 Programmer's Manual by
1.9.8