GRASS GIS 8 Programmer's Manual
8.4.1(2025)-45ca3179ab
Loading...
Searching...
No Matches
cmmul.c
Go to the documentation of this file.
1
/* cmmul.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 "
ccmath.h
"
10
11
void
cmmul
(
Cpx
*c,
Cpx
*a,
Cpx
*
b
,
int
n)
12
{
13
Cpx
s, *p, *q;
14
15
int
i, j, k;
16
17
trncm
(
b
, n);
18
for
(i = 0; i < n; ++i, a += n) {
19
for
(j = 0, q =
b
; j < n; ++j) {
20
for
(k = 0, p = a, s.
re
= s.im = 0.; k < n; ++k) {
21
s.re += p->
re
* q->
re
- p->
im
* q->
im
;
22
s.im += p->
im
* q->
re
+ p->
re
* q->
im
;
23
++p;
24
++q;
25
}
26
*c++ = s;
27
}
28
}
29
trncm
(
b
, n);
30
}
ccmath.h
trncm
void trncm(Cpx *a, int n)
Definition
trncm.c:11
Cpx
struct complex Cpx
Definition
ccmath.h:41
cmmul
void cmmul(Cpx *c, Cpx *a, Cpx *b, int n)
Definition
cmmul.c:11
b
double b
Definition
driver/set_window.c:5
complex::re
double re
Definition
ccmath.h:39
complex::im
double im
Definition
ccmath.h:39
external
ccmath
cmmul.c
Generated on Sat Jun 21 2025 21:07:27 for GRASS GIS 8 Programmer's Manual by
1.13.2