GRASS 8 Programmer's Manual
8.6.0dev(2026)-1d1e47ad9d
Loading...
Searching...
No Matches
solvru.c
Go to the documentation of this file.
1
/* solvru.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
solvru
(
double
*a,
double
*
b
,
int
n)
9
{
10
int
j
, k;
11
12
double
fabs
(
double
);
13
14
double
s,
t
, *p, *q;
15
16
for
(
j
= 0, s = 0., p = a;
j
< n; ++
j
, p += n + 1)
17
if
((
t
=
fabs
(*p)) > s)
18
s =
t
;
19
s *= 1.e-16;
20
for
(
j
= n - 1, p = a + n * n - 1;
j
>= 0; --
j
, p -= n + 1) {
21
for
(k =
j
+ 1, q = p + 1; k < n;)
22
b
[
j
] -=
b
[k++] * *q++;
23
if
(
fabs
(*p) < s)
24
return
-1;
25
b
[
j
] /= *p;
26
}
27
return
0;
28
}
AMI_STREAM
Definition
ami_stream.h:153
b
double b
Definition
r_raster.c:39
t
double t
Definition
r_raster.c:39
solvru
int solvru(double *a, double *b, int n)
Definition
solvru.c:8
lib
external
ccmath
solvru.c
Generated on Fri Apr 3 2026 06:59:52 for GRASS 8 Programmer's Manual by
1.9.8