GRASS 8 Programmer's Manual
8.6.0dev(2026)-ddeab64dbf
Loading...
Searching...
No Matches
utrnhm.c
Go to the documentation of this file.
1
/* utrnhm.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
9
#include <
stdlib.h
>
10
#include "
ccmath.h
"
11
12
void
utrnhm
(
Cpx
*
hm
,
Cpx
*a,
Cpx
*
b
,
int
n)
13
{
14
Cpx
z, *
q0
, *p, *s, *
t
;
15
16
int
i,
j
, k;
17
18
q0
= (
Cpx
*)
calloc
(n,
sizeof
(
Cpx
));
19
for
(i = 0; i < n; ++i) {
20
for
(
j
= 0,
t
=
b
;
j
< n; ++
j
) {
21
z.
re
= z.
im
= 0.;
22
for
(k = 0, s = a + i * n; k < n; ++k, ++s, ++
t
) {
23
z.
re
+=
t
->re * s->re +
t
->im * s->im;
24
z.
im
+=
t
->im * s->re -
t
->re * s->im;
25
}
26
q0
[
j
] = z;
27
}
28
for
(
j
= 0, p =
hm
+ i,
t
= a;
j
<= i; ++
j
, p += n) {
29
z.
re
= z.
im
= 0.;
30
for
(k = 0, s =
q0
; k < n; ++k, ++
t
, ++s) {
31
z.
re
+=
t
->re * s->
re
-
t
->im * s->
im
;
32
z.
im
+=
t
->im * s->
re
+
t
->re * s->
im
;
33
}
34
*p = z;
35
if
(
j
< i) {
36
z.
im
= -z.
im
;
37
hm
[i * n +
j
] = z;
38
}
39
}
40
}
41
free
(
q0
);
42
}
ccmath.h
AMI_STREAM
Definition
ami_stream.h:153
b
double b
Definition
r_raster.c:39
t
double t
Definition
r_raster.c:39
free
void free(void *)
stdlib.h
complex
Definition
ccmath.h:38
complex::re
double re
Definition
ccmath.h:39
complex::im
double im
Definition
ccmath.h:39
utrnhm
void utrnhm(Cpx *hm, Cpx *a, Cpx *b, int n)
Definition
utrnhm.c:12
lib
external
ccmath
utrnhm.c
Generated on Sun Apr 5 2026 06:59:55 for GRASS 8 Programmer's Manual by
1.9.8