GRASS GIS 7 Programmer's Manual
7.8.2(2019)-exported
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
#include <stdlib.h>
9
#include "
ccmath.h
"
10
void
hmgen
(
Cpx
* h,
double
*ev,
Cpx
* u,
int
n)
11
{
12
Cpx
*v, *p;
13
14
int
i, j;
15
16
double
e;
17
18
v = (
Cpx
*) calloc(n * n,
sizeof
(
Cpx
));
19
cmcpy
(v, u, n * n);
20
hconj
(v, n);
21
for
(i = 0, p = v; i < n; ++i) {
22
for
(j = 0, e = ev[i]; j < n; ++j, ++p) {
23
p->
re
*= e;
24
p->
im
*= e;
25
}
26
}
27
cmmul
(h, u, v, n);
28
free(v);
29
}
complex::im
double im
Definition:
ccmath.h:38
hconj
void hconj(Cpx *u, int n)
Definition:
hconj.c:9
cmcpy
void cmcpy(Cpx *a, Cpx *b, int n)
Definition:
cmcpy.c:9
ccmath.h
cmmul
void cmmul(Cpx *c, Cpx *a, Cpx *b, int n)
Definition:
cmmul.c:9
hmgen
void hmgen(Cpx *h, double *ev, Cpx *u, int n)
Definition:
hmgen.c:10
complex::re
double re
Definition:
ccmath.h:38
complex
Definition:
ccmath.h:38
external
ccmath
hmgen.c
Generated on Mon Apr 25 2022 14:03:04 for GRASS GIS 7 Programmer's Manual by
1.8.17