GRASS Programmer's Manual
6.4.3(2013)-r
Main Page
Related Pages
Namespaces
Data Structures
Files
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Macros
Pages
mult.c
Go to the documentation of this file.
1
/* Author: Bill Hoff,2-114C,8645,3563478 (hoff) at uicsl */
2
22
int
23
mult
(
double
*v1[2],
int
size1,
double
*v2[2],
int
size2,
double
*v3[2],
24
int
size3)
25
{
26
int
i,
n
;
27
28
n = (size1 < size2 ? size1 : size2);
/* get the smaller size */
29
for
(i = 0; i <
n
; i++) {
30
*(v3[0] + i) =
31
*(v1[0] + i) * *(v2[0] + i) - *(v1[1] + i) * *(v2[1] + i);
32
*(v3[1] + i) =
33
*(v1[0] + i) * *(v2[1] + i) + *(v2[0] + i) * *(v1[1] + i);
34
}
35
36
/* if unequal size, zero out remaining elements of larger vector */
37
if
(size1 != size2)
38
for
(i = n; i < size3; i++) {
39
*(v3[0] + i) = 0.0;
40
*(v3[1] + i) = 0.0;
41
}
42
43
return
0;
44
}
mult
int mult(double *v1[2], int size1, double *v2[2], int size2, double *v3[2], int size3)
Multiply two complex vectors, point by point.
Definition:
mult.c:23
n
int n
Definition:
dataquad.c:291
lib
gmath
mult.c
Generated on Mon Dec 16 2013 12:20:02 for GRASS Programmer's Manual by
1.8.5