GRASS Programmer's Manual
6.5.svn(2014)-r66266
Main Page
Related Pages
Namespaces
Data Structures
Files
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Pages
cmmult.c
Go to the documentation of this file.
1
/* cmmult.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
cmmult
(
Cpx
* cm,
Cpx
* a,
Cpx
*
b
,
int
n
,
int
m,
int
l
)
11
{
12
Cpx
z, *q0, *p, *
q
;
13
14
int
i, j, k;
15
16
q0 = (
Cpx
*) calloc(m,
sizeof
(
Cpx
));
17
for
(i = 0; i <
l
; ++i, ++cm) {
18
for
(k = 0, p = b + i; k < m; p +=
l
)
19
q0[k++] = *p;
20
for
(j = 0, p = a, q = cm; j <
n
; ++j, q +=
l
) {
21
for
(k = 0, z.
re
= z.
im
= 0.; k < m; ++k, ++p) {
22
z.
re
+= p->
re
* q0[k].
re
- p->
im
* q0[k].
im
;
23
z.
im
+= p->
im
* q0[k].
re
+ p->
re
* q0[k].
im
;
24
}
25
*q = z;
26
}
27
}
28
free
(q0);
29
}
l
int l
Definition:
dataquad.c:292
b
float b
Definition:
named_colr.c:8
forms.q
tuple q
Definition:
forms.py:2019
ccmath.h
cmmult
void cmmult(Cpx *c, Cpx *a, Cpx *b, int m, int k, int n)
Definition:
cmmult.c:10
complex::re
double re
Definition:
ccmath.h:38
complex::im
double im
Definition:
ccmath.h:38
free
void free(void *)
complex
Definition:
ccmath.h:38
n
int n
Definition:
dataquad.c:291
lib
external
ccmath
cmmult.c
Generated on Sat Jan 2 2016 01:46:47 for GRASS Programmer's Manual by
1.8.5