GRASS 8 Programmer's Manual
8.6.0dev(2026)-56a9afeb9f
Loading...
Searching...
No Matches
hmgen.c
Go to the documentation of this file.
1
/* hmgen.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
hmgen
(
Cpx
*h,
double
*
ev
,
Cpx
*u,
int
n)
13
{
14
Cpx
*v, *p;
15
16
int
i,
j
;
17
18
double
e;
19
20
v = (
Cpx
*)
calloc
(n * n,
sizeof
(
Cpx
));
21
cmcpy
(v, u, n * n);
22
hconj
(v, n);
23
for
(i = 0, p = v; i < n; ++i) {
24
for
(
j
= 0, e =
ev
[i];
j
< n; ++
j
, ++p) {
25
p->
re
*= e;
26
p->
im
*= e;
27
}
28
}
29
cmmul
(h, u, v, n);
30
free
(v);
31
}
ccmath.h
cmmul
void cmmul(Cpx *c, Cpx *a, Cpx *b, int n)
Definition
cmmul.c:11
cmcpy
void cmcpy(Cpx *a, Cpx *b, int n)
Definition
cmcpy.c:11
hconj
void hconj(Cpx *u, int n)
Definition
hconj.c:11
AMI_STREAM
Definition
ami_stream.h:153
hmgen
void hmgen(Cpx *h, double *ev, Cpx *u, int n)
Definition
hmgen.c:12
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
lib
external
ccmath
hmgen.c
Generated on Sat Apr 4 2026 17:44:23 for GRASS 8 Programmer's Manual by
1.9.8