This source file includes following definitions.
- get
- get
- get
- get
- get
- get
- getReal
- getImag
- putReal
- putImag
- getBuffer
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21 package mpi;
22
23 import java.nio.*;
24
25
26
27
28 public final class DoubleComplex
29 {
30 private final int offset;
31 private final DoubleBuffer buffer;
32
33 private DoubleComplex(DoubleBuffer buffer, int index)
34 {
35 this.buffer = buffer;
36 this.offset = index * 2;
37 }
38
39
40
41
42
43
44 public static DoubleComplex get(DoubleBuffer buffer)
45 {
46 return new DoubleComplex(buffer, 0);
47 }
48
49
50
51
52
53
54
55
56 public static DoubleComplex get(DoubleBuffer buffer, int index)
57 {
58 return new DoubleComplex(buffer, index);
59 }
60
61
62
63
64
65
66 public static DoubleComplex get(double[] array)
67 {
68 return new DoubleComplex(DoubleBuffer.wrap(array), 0);
69 }
70
71
72
73
74
75
76
77
78 public static DoubleComplex get(double[] array, int index)
79 {
80 return new DoubleComplex(DoubleBuffer.wrap(array), index);
81 }
82
83
84
85
86
87
88 public static DoubleComplex get(ByteBuffer buffer)
89 {
90 return new DoubleComplex(buffer.asDoubleBuffer(), 0);
91 }
92
93
94
95
96
97
98
99
100 public static DoubleComplex get(ByteBuffer buffer, int index)
101 {
102 return new DoubleComplex(buffer.asDoubleBuffer(), index);
103 }
104
105
106
107
108
109 public double getReal()
110 {
111 return buffer.get(offset);
112 }
113
114
115
116
117
118 public double getImag()
119 {
120 return buffer.get(offset + 1);
121 }
122
123
124
125
126
127 public void putReal(double real)
128 {
129 buffer.put(offset, real);
130 }
131
132
133
134
135
136 public void putImag(double imag)
137 {
138 buffer.put(offset + 1, imag);
139 }
140
141
142
143
144
145 public DoubleBuffer getBuffer()
146 {
147 return offset == 0 ? buffer : MPI.slice(buffer, offset);
148 }
149
150 }