|
@@ -0,0 +1,42 @@
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+void cmVOCR_MultVVV( cmComplexR_t* y, const cmComplex_t* x0, const cmComplexR_t* x1, unsigned n )
|
|
4
|
+{
|
|
5
|
+ unsigned i;
|
|
6
|
+ for(i=0; i<n; ++i)
|
|
7
|
+ {
|
|
8
|
+ cmReal_t ab = x0[i].r * x1[i].r;
|
|
9
|
+ cmReal_t bd = x0[i].i * x1[i].i;
|
|
10
|
+ cmReal_t bc = x0[i].i * x1[i].r;
|
|
11
|
+ cmReal_t ad = x0[i].r * x1[i].i;
|
|
12
|
+ y[i].r = ab - bd;
|
|
13
|
+ y[i].i = bc + ad;
|
|
14
|
+ }
|
|
15
|
+
|
|
16
|
+}
|
|
17
|
+
|
|
18
|
+void cmVOCR_Abs( cmReal_t* y, const cmComplexR_t* x, unsigned n )
|
|
19
|
+{
|
|
20
|
+ for(i=0; i<n; ++i)
|
|
21
|
+ y[i] = cmAbsR(x[i]);
|
|
22
|
+}
|
|
23
|
+
|
|
24
|
+void cmVOCR_MultR_VV( cmComplexR_t* y, const cmReal_t* x, unsigned n )
|
|
25
|
+{
|
|
26
|
+ unsigned i;
|
|
27
|
+ for(i=0; i<n; ++i)
|
|
28
|
+ {
|
|
29
|
+ y[i].r *= x[i];
|
|
30
|
+ y[i].i *= x[i];
|
|
31
|
+ }
|
|
32
|
+}
|
|
33
|
+
|
|
34
|
+void cmVOCR_DivR_VV( cmComplexR_t* y, const cmReal_t* x, unsigned n )
|
|
35
|
+{
|
|
36
|
+ unsigned i;
|
|
37
|
+ for(i=0; i<n; ++i)
|
|
38
|
+ {
|
|
39
|
+ y[i].r /= x[i];
|
|
40
|
+ y[i].i /= x[i];
|
|
41
|
+ }
|
|
42
|
+}
|