GRASS GIS 8 Programmer's Manual  8.2.2dev(2023)-3d2c704037
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 #include "ccmath.h"
9 void cmmul(Cpx * c, Cpx * a, Cpx * b, int n)
10 {
11  Cpx s, *p, *q;
12 
13  int i, j, k;
14 
15  trncm(b, n);
16  for (i = 0; i < n; ++i, a += n) {
17  for (j = 0, q = b; j < n; ++j) {
18  for (k = 0, p = a, s.re = s.im = 0.; k < n; ++k) {
19  s.re += p->re * q->re - p->im * q->im;
20  s.im += p->im * q->re + p->re * q->im;
21  ++p;
22  ++q;
23  }
24  *c++ = s;
25  }
26  }
27  trncm(b, n);
28 }
void trncm(Cpx *a, int n)
Definition: trncm.c:9
double b
Definition: r_raster.c:39
double re
Definition: ccmath.h:38
double im
Definition: ccmath.h:38
void cmmul(Cpx *c, Cpx *a, Cpx *b, int n)
Definition: cmmul.c:9
Definition: la.h:54