1 | /*
|
---|
2 | * analysis.cpp
|
---|
3 | *
|
---|
4 | * Created on: Oct 13, 2009
|
---|
5 | * Author: heber
|
---|
6 | */
|
---|
7 |
|
---|
8 | #include <iostream>
|
---|
9 |
|
---|
10 | #include "analysis_correlation.hpp"
|
---|
11 | #include "element.hpp"
|
---|
12 | #include "log.hpp"
|
---|
13 | #include "molecule.hpp"
|
---|
14 | #include "tesselation.hpp"
|
---|
15 | #include "tesselationhelpers.hpp"
|
---|
16 | #include "vector.hpp"
|
---|
17 | #include "verbose.hpp"
|
---|
18 |
|
---|
19 |
|
---|
20 | /** Calculates the pair correlation between given elements.
|
---|
21 | * Note given element order is unimportant (i.e. g(Si, O) === g(O, Si))
|
---|
22 | * \param *out output stream for debugging
|
---|
23 | * \param *molecules list of molecules structure
|
---|
24 | * \param *type1 first element or NULL (if any element)
|
---|
25 | * \param *type2 second element or NULL (if any element)
|
---|
26 | * \return Map of doubles with values the pair of the two atoms.
|
---|
27 | */
|
---|
28 | PairCorrelationMap *PairCorrelation(MoleculeListClass * const &molecules, const element * const type1, const element * const type2 )
|
---|
29 | {
|
---|
30 | PairCorrelationMap *outmap = NULL;
|
---|
31 | double distance = 0.;
|
---|
32 |
|
---|
33 | if (molecules->ListOfMolecules.empty()) {
|
---|
34 | eLog() << Verbose(1) <<"No molecule given." << endl;
|
---|
35 | return outmap;
|
---|
36 | }
|
---|
37 | outmap = new PairCorrelationMap;
|
---|
38 | for (MoleculeList::const_iterator MolWalker = molecules->ListOfMolecules.begin(); MolWalker != molecules->ListOfMolecules.end(); MolWalker++)
|
---|
39 | if ((*MolWalker)->ActiveFlag) {
|
---|
40 | eLog() << Verbose(2) << "Current molecule is " << *MolWalker << "." << endl;
|
---|
41 | atom *Walker = (*MolWalker)->start;
|
---|
42 | while (Walker->next != (*MolWalker)->end) {
|
---|
43 | Walker = Walker->next;
|
---|
44 | Log() << Verbose(3) << "Current atom is " << *Walker << "." << endl;
|
---|
45 | if ((type1 == NULL) || (Walker->type == type1)) {
|
---|
46 | for (MoleculeList::const_iterator MolOtherWalker = MolWalker; MolOtherWalker != molecules->ListOfMolecules.end(); MolOtherWalker++)
|
---|
47 | if ((*MolOtherWalker)->ActiveFlag) {
|
---|
48 | Log() << Verbose(2) << "Current other molecule is " << *MolOtherWalker << "." << endl;
|
---|
49 | atom *OtherWalker = (*MolOtherWalker)->start;
|
---|
50 | while (OtherWalker->next != (*MolOtherWalker)->end) { // only go up to Walker
|
---|
51 | OtherWalker = OtherWalker->next;
|
---|
52 | Log() << Verbose(3) << "Current otheratom is " << *OtherWalker << "." << endl;
|
---|
53 | if (Walker->nr < OtherWalker->nr)
|
---|
54 | if ((type2 == NULL) || (OtherWalker->type == type2)) {
|
---|
55 | distance = Walker->node->PeriodicDistance(OtherWalker->node, (*MolWalker)->cell_size);
|
---|
56 | //Log() << Verbose(1) <<"Inserting " << *Walker << " and " << *OtherWalker << endl;
|
---|
57 | outmap->insert ( pair<double, pair <atom *, atom*> > (distance, pair<atom *, atom*> (Walker, OtherWalker) ) );
|
---|
58 | }
|
---|
59 | }
|
---|
60 | }
|
---|
61 | }
|
---|
62 | }
|
---|
63 | }
|
---|
64 |
|
---|
65 | return outmap;
|
---|
66 | };
|
---|
67 |
|
---|
68 | /** Calculates the pair correlation between given elements.
|
---|
69 | * Note given element order is unimportant (i.e. g(Si, O) === g(O, Si))
|
---|
70 | * \param *out output stream for debugging
|
---|
71 | * \param *molecules list of molecules structure
|
---|
72 | * \param *type1 first element or NULL (if any element)
|
---|
73 | * \param *type2 second element or NULL (if any element)
|
---|
74 | * \param ranges[NDIM] interval boundaries for the periodic images to scan also
|
---|
75 | * \return Map of doubles with values the pair of the two atoms.
|
---|
76 | */
|
---|
77 | PairCorrelationMap *PeriodicPairCorrelation(MoleculeListClass * const &molecules, const element * const type1, const element * const type2, const int ranges[NDIM] )
|
---|
78 | {
|
---|
79 | PairCorrelationMap *outmap = NULL;
|
---|
80 | double distance = 0.;
|
---|
81 | int n[NDIM];
|
---|
82 | Vector checkX;
|
---|
83 | Vector periodicX;
|
---|
84 | int Othern[NDIM];
|
---|
85 | Vector checkOtherX;
|
---|
86 | Vector periodicOtherX;
|
---|
87 |
|
---|
88 | if (molecules->ListOfMolecules.empty()) {
|
---|
89 | eLog() << Verbose(1) <<"No molecule given." << endl;
|
---|
90 | return outmap;
|
---|
91 | }
|
---|
92 | outmap = new PairCorrelationMap;
|
---|
93 | for (MoleculeList::const_iterator MolWalker = molecules->ListOfMolecules.begin(); MolWalker != molecules->ListOfMolecules.end(); MolWalker++)
|
---|
94 | if ((*MolWalker)->ActiveFlag) {
|
---|
95 | const double * const FullMatrix = ReturnFullMatrixforSymmetric((*MolWalker)->cell_size);
|
---|
96 | const double * const FullInverseMatrix = InverseMatrix(FullMatrix);
|
---|
97 | eLog() << Verbose(2) << "Current molecule is " << *MolWalker << "." << endl;
|
---|
98 | atom *Walker = (*MolWalker)->start;
|
---|
99 | while (Walker->next != (*MolWalker)->end) {
|
---|
100 | Walker = Walker->next;
|
---|
101 | Log() << Verbose(3) << "Current atom is " << *Walker << "." << endl;
|
---|
102 | if ((type1 == NULL) || (Walker->type == type1)) {
|
---|
103 | periodicX.CopyVector(Walker->node);
|
---|
104 | periodicX.MatrixMultiplication(FullInverseMatrix); // x now in [0,1)^3
|
---|
105 | // go through every range in xyz and get distance
|
---|
106 | for (n[0]=-ranges[0]; n[0] <= ranges[0]; n[0]++)
|
---|
107 | for (n[1]=-ranges[1]; n[1] <= ranges[1]; n[1]++)
|
---|
108 | for (n[2]=-ranges[2]; n[2] <= ranges[2]; n[2]++) {
|
---|
109 | checkX.Init(n[0], n[1], n[2]);
|
---|
110 | checkX.AddVector(&periodicX);
|
---|
111 | checkX.MatrixMultiplication(FullMatrix);
|
---|
112 | for (MoleculeList::const_iterator MolOtherWalker = MolWalker; MolOtherWalker != molecules->ListOfMolecules.end(); MolOtherWalker++)
|
---|
113 | if ((*MolOtherWalker)->ActiveFlag) {
|
---|
114 | Log() << Verbose(2) << "Current other molecule is " << *MolOtherWalker << "." << endl;
|
---|
115 | atom *OtherWalker = (*MolOtherWalker)->start;
|
---|
116 | while (OtherWalker->next != (*MolOtherWalker)->end) { // only go up to Walker
|
---|
117 | OtherWalker = OtherWalker->next;
|
---|
118 | Log() << Verbose(3) << "Current otheratom is " << *OtherWalker << "." << endl;
|
---|
119 | if (Walker->nr < OtherWalker->nr)
|
---|
120 | if ((type2 == NULL) || (OtherWalker->type == type2)) {
|
---|
121 | periodicOtherX.CopyVector(OtherWalker->node);
|
---|
122 | periodicOtherX.MatrixMultiplication(FullInverseMatrix); // x now in [0,1)^3
|
---|
123 | // go through every range in xyz and get distance
|
---|
124 | for (Othern[0]=-ranges[0]; Othern[0] <= ranges[0]; Othern[0]++)
|
---|
125 | for (Othern[1]=-ranges[1]; Othern[1] <= ranges[1]; Othern[1]++)
|
---|
126 | for (Othern[2]=-ranges[2]; Othern[2] <= ranges[2]; Othern[2]++) {
|
---|
127 | checkOtherX.Init(Othern[0], Othern[1], Othern[2]);
|
---|
128 | checkOtherX.AddVector(&periodicOtherX);
|
---|
129 | checkOtherX.MatrixMultiplication(FullMatrix);
|
---|
130 | distance = checkX.Distance(&checkOtherX);
|
---|
131 | //Log() << Verbose(1) <<"Inserting " << *Walker << " and " << *OtherWalker << endl;
|
---|
132 | outmap->insert ( pair<double, pair <atom *, atom*> > (distance, pair<atom *, atom*> (Walker, OtherWalker) ) );
|
---|
133 | }
|
---|
134 | }
|
---|
135 | }
|
---|
136 | }
|
---|
137 | }
|
---|
138 | }
|
---|
139 | }
|
---|
140 | }
|
---|
141 |
|
---|
142 | return outmap;
|
---|
143 | };
|
---|
144 |
|
---|
145 | /** Calculates the distance (pair) correlation between a given element and a point.
|
---|
146 | * \param *out output stream for debugging
|
---|
147 | * \param *molecules list of molecules structure
|
---|
148 | * \param *type element or NULL (if any element)
|
---|
149 | * \param *point vector to the correlation point
|
---|
150 | * \return Map of dobules with values as pairs of atom and the vector
|
---|
151 | */
|
---|
152 | CorrelationToPointMap *CorrelationToPoint(MoleculeListClass * const &molecules, const element * const type, const Vector *point )
|
---|
153 | {
|
---|
154 | CorrelationToPointMap *outmap = NULL;
|
---|
155 | double distance = 0.;
|
---|
156 |
|
---|
157 | if (molecules->ListOfMolecules.empty()) {
|
---|
158 | Log() << Verbose(1) <<"No molecule given." << endl;
|
---|
159 | return outmap;
|
---|
160 | }
|
---|
161 | outmap = new CorrelationToPointMap;
|
---|
162 | for (MoleculeList::const_iterator MolWalker = molecules->ListOfMolecules.begin(); MolWalker != molecules->ListOfMolecules.end(); MolWalker++)
|
---|
163 | if ((*MolWalker)->ActiveFlag) {
|
---|
164 | Log() << Verbose(2) << "Current molecule is " << *MolWalker << "." << endl;
|
---|
165 | atom *Walker = (*MolWalker)->start;
|
---|
166 | while (Walker->next != (*MolWalker)->end) {
|
---|
167 | Walker = Walker->next;
|
---|
168 | Log() << Verbose(3) << "Current atom is " << *Walker << "." << endl;
|
---|
169 | if ((type == NULL) || (Walker->type == type)) {
|
---|
170 | distance = Walker->node->PeriodicDistance(point, (*MolWalker)->cell_size);
|
---|
171 | Log() << Verbose(4) << "Current distance is " << distance << "." << endl;
|
---|
172 | outmap->insert ( pair<double, pair<atom *, const Vector*> >(distance, pair<atom *, const Vector*> (Walker, point) ) );
|
---|
173 | }
|
---|
174 | }
|
---|
175 | }
|
---|
176 |
|
---|
177 | return outmap;
|
---|
178 | };
|
---|
179 |
|
---|
180 | /** Calculates the distance (pair) correlation between a given element, all its periodic images and a point.
|
---|
181 | * \param *out output stream for debugging
|
---|
182 | * \param *molecules list of molecules structure
|
---|
183 | * \param *type element or NULL (if any element)
|
---|
184 | * \param *point vector to the correlation point
|
---|
185 | * \param ranges[NDIM] interval boundaries for the periodic images to scan also
|
---|
186 | * \return Map of dobules with values as pairs of atom and the vector
|
---|
187 | */
|
---|
188 | CorrelationToPointMap *PeriodicCorrelationToPoint(MoleculeListClass * const &molecules, const element * const type, const Vector *point, const int ranges[NDIM] )
|
---|
189 | {
|
---|
190 | CorrelationToPointMap *outmap = NULL;
|
---|
191 | double distance = 0.;
|
---|
192 | int n[NDIM];
|
---|
193 | Vector periodicX;
|
---|
194 | Vector checkX;
|
---|
195 |
|
---|
196 | if (molecules->ListOfMolecules.empty()) {
|
---|
197 | Log() << Verbose(1) <<"No molecule given." << endl;
|
---|
198 | return outmap;
|
---|
199 | }
|
---|
200 | outmap = new CorrelationToPointMap;
|
---|
201 | for (MoleculeList::const_iterator MolWalker = molecules->ListOfMolecules.begin(); MolWalker != molecules->ListOfMolecules.end(); MolWalker++)
|
---|
202 | if ((*MolWalker)->ActiveFlag) {
|
---|
203 | const double * const FullMatrix = ReturnFullMatrixforSymmetric((*MolWalker)->cell_size);
|
---|
204 | const double * const FullInverseMatrix = InverseMatrix(FullMatrix);
|
---|
205 | Log() << Verbose(2) << "Current molecule is " << *MolWalker << "." << endl;
|
---|
206 | atom *Walker = (*MolWalker)->start;
|
---|
207 | while (Walker->next != (*MolWalker)->end) {
|
---|
208 | Walker = Walker->next;
|
---|
209 | Log() << Verbose(3) << "Current atom is " << *Walker << "." << endl;
|
---|
210 | if ((type == NULL) || (Walker->type == type)) {
|
---|
211 | periodicX.CopyVector(Walker->node);
|
---|
212 | periodicX.MatrixMultiplication(FullInverseMatrix); // x now in [0,1)^3
|
---|
213 | // go through every range in xyz and get distance
|
---|
214 | for (n[0]=-ranges[0]; n[0] <= ranges[0]; n[0]++)
|
---|
215 | for (n[1]=-ranges[1]; n[1] <= ranges[1]; n[1]++)
|
---|
216 | for (n[2]=-ranges[2]; n[2] <= ranges[2]; n[2]++) {
|
---|
217 | checkX.Init(n[0], n[1], n[2]);
|
---|
218 | checkX.AddVector(&periodicX);
|
---|
219 | checkX.MatrixMultiplication(FullMatrix);
|
---|
220 | distance = checkX.Distance(point);
|
---|
221 | Log() << Verbose(4) << "Current distance is " << distance << "." << endl;
|
---|
222 | outmap->insert ( pair<double, pair<atom *, const Vector*> >(distance, pair<atom *, const Vector*> (Walker, point) ) );
|
---|
223 | }
|
---|
224 | }
|
---|
225 | }
|
---|
226 | }
|
---|
227 |
|
---|
228 | return outmap;
|
---|
229 | };
|
---|
230 |
|
---|
231 | /** Calculates the distance (pair) correlation between a given element and a surface.
|
---|
232 | * \param *out output stream for debugging
|
---|
233 | * \param *molecules list of molecules structure
|
---|
234 | * \param *type element or NULL (if any element)
|
---|
235 | * \param *Surface pointer to Tesselation class surface
|
---|
236 | * \param *LC LinkedCell structure to quickly find neighbouring atoms
|
---|
237 | * \return Map of doubles with values as pairs of atom and the BoundaryTriangleSet that's closest
|
---|
238 | */
|
---|
239 | CorrelationToSurfaceMap *CorrelationToSurface(MoleculeListClass * const &molecules, const element * const type, const Tesselation * const Surface, const LinkedCell *LC )
|
---|
240 | {
|
---|
241 | CorrelationToSurfaceMap *outmap = NULL;
|
---|
242 | double distance = 0;
|
---|
243 | class BoundaryTriangleSet *triangle = NULL;
|
---|
244 | Vector centroid;
|
---|
245 |
|
---|
246 | if ((Surface == NULL) || (LC == NULL) || (molecules->ListOfMolecules.empty())) {
|
---|
247 | Log() << Verbose(1) <<"No Tesselation, no LinkedCell or no molecule given." << endl;
|
---|
248 | return outmap;
|
---|
249 | }
|
---|
250 | outmap = new CorrelationToSurfaceMap;
|
---|
251 | for (MoleculeList::const_iterator MolWalker = molecules->ListOfMolecules.begin(); MolWalker != molecules->ListOfMolecules.end(); MolWalker++)
|
---|
252 | if ((*MolWalker)->ActiveFlag) {
|
---|
253 | Log() << Verbose(2) << "Current molecule is " << *MolWalker << "." << endl;
|
---|
254 | atom *Walker = (*MolWalker)->start;
|
---|
255 | while (Walker->next != (*MolWalker)->end) {
|
---|
256 | Walker = Walker->next;
|
---|
257 | Log() << Verbose(3) << "Current atom is " << *Walker << "." << endl;
|
---|
258 | if ((type == NULL) || (Walker->type == type)) {
|
---|
259 | triangle = Surface->FindClosestTriangleToPoint(Walker->node, LC );
|
---|
260 | if (triangle != NULL) {
|
---|
261 | distance = DistanceToTrianglePlane(Walker->node, triangle);
|
---|
262 | outmap->insert ( pair<double, pair<atom *, BoundaryTriangleSet*> >(distance, pair<atom *, BoundaryTriangleSet*> (Walker, triangle) ) );
|
---|
263 | }
|
---|
264 | }
|
---|
265 | }
|
---|
266 | }
|
---|
267 |
|
---|
268 | return outmap;
|
---|
269 | };
|
---|
270 |
|
---|
271 | /** Calculates the distance (pair) correlation between a given element, all its periodic images and and a surface.
|
---|
272 | * Note that we also put all periodic images found in the cells given by [ -ranges[i], ranges[i] ] and i=0,...,NDIM-1.
|
---|
273 | * I.e. We multiply the atom::node with the inverse of the domain matrix, i.e. transform it to \f$[0,0^3\f$, then add per
|
---|
274 | * axis an integer from [ -ranges[i], ranges[i] ] onto it and multiply with the domain matrix to bring it back into
|
---|
275 | * the real space. Then, we Tesselation::FindClosestTriangleToPoint() and DistanceToTrianglePlane().
|
---|
276 | * \param *out output stream for debugging
|
---|
277 | * \param *molecules list of molecules structure
|
---|
278 | * \param *type element or NULL (if any element)
|
---|
279 | * \param *Surface pointer to Tesselation class surface
|
---|
280 | * \param *LC LinkedCell structure to quickly find neighbouring atoms
|
---|
281 | * \param ranges[NDIM] interval boundaries for the periodic images to scan also
|
---|
282 | * \return Map of doubles with values as pairs of atom and the BoundaryTriangleSet that's closest
|
---|
283 | */
|
---|
284 | CorrelationToSurfaceMap *PeriodicCorrelationToSurface(MoleculeListClass * const &molecules, const element * const type, const Tesselation * const Surface, const LinkedCell *LC, const int ranges[NDIM] )
|
---|
285 | {
|
---|
286 | CorrelationToSurfaceMap *outmap = NULL;
|
---|
287 | double distance = 0;
|
---|
288 | class BoundaryTriangleSet *triangle = NULL;
|
---|
289 | Vector centroid;
|
---|
290 | int n[NDIM];
|
---|
291 | Vector periodicX;
|
---|
292 | Vector checkX;
|
---|
293 |
|
---|
294 | if ((Surface == NULL) || (LC == NULL) || (molecules->ListOfMolecules.empty())) {
|
---|
295 | Log() << Verbose(1) <<"No Tesselation, no LinkedCell or no molecule given." << endl;
|
---|
296 | return outmap;
|
---|
297 | }
|
---|
298 | outmap = new CorrelationToSurfaceMap;
|
---|
299 | for (MoleculeList::const_iterator MolWalker = molecules->ListOfMolecules.begin(); MolWalker != molecules->ListOfMolecules.end(); MolWalker++)
|
---|
300 | if ((*MolWalker)->ActiveFlag) {
|
---|
301 | const double * const FullMatrix = ReturnFullMatrixforSymmetric((*MolWalker)->cell_size);
|
---|
302 | const double * const FullInverseMatrix = InverseMatrix(FullMatrix);
|
---|
303 | Log() << Verbose(2) << "Current molecule is " << *MolWalker << "." << endl;
|
---|
304 | atom *Walker = (*MolWalker)->start;
|
---|
305 | while (Walker->next != (*MolWalker)->end) {
|
---|
306 | Walker = Walker->next;
|
---|
307 | Log() << Verbose(3) << "Current atom is " << *Walker << "." << endl;
|
---|
308 | if ((type == NULL) || (Walker->type == type)) {
|
---|
309 | periodicX.CopyVector(Walker->node);
|
---|
310 | periodicX.MatrixMultiplication(FullInverseMatrix); // x now in [0,1)^3
|
---|
311 | // go through every range in xyz and get distance
|
---|
312 | for (n[0]=-ranges[0]; n[0] <= ranges[0]; n[0]++)
|
---|
313 | for (n[1]=-ranges[1]; n[1] <= ranges[1]; n[1]++)
|
---|
314 | for (n[2]=-ranges[2]; n[2] <= ranges[2]; n[2]++) {
|
---|
315 | checkX.Init(n[0], n[1], n[2]);
|
---|
316 | checkX.AddVector(&periodicX);
|
---|
317 | checkX.MatrixMultiplication(FullMatrix);
|
---|
318 | triangle = Surface->FindClosestTriangleToPoint(&checkX, LC );
|
---|
319 | if (triangle != NULL) {
|
---|
320 | distance = DistanceToTrianglePlane(&checkX, triangle);
|
---|
321 | outmap->insert ( pair<double, pair<atom *, BoundaryTriangleSet*> >(distance, pair<atom *, BoundaryTriangleSet*> (Walker, triangle) ) );
|
---|
322 | }
|
---|
323 | }
|
---|
324 | }
|
---|
325 | }
|
---|
326 | }
|
---|
327 |
|
---|
328 | return outmap;
|
---|
329 | };
|
---|
330 |
|
---|
331 | /** Returns the start of the bin for a given value.
|
---|
332 | * \param value value whose bin to look for
|
---|
333 | * \param BinWidth width of bin
|
---|
334 | * \param BinStart first bin
|
---|
335 | */
|
---|
336 | double GetBin ( const double value, const double BinWidth, const double BinStart )
|
---|
337 | {
|
---|
338 | double bin =(double) (floor((value - BinStart)/BinWidth));
|
---|
339 | return (bin*BinWidth+BinStart);
|
---|
340 | };
|
---|
341 |
|
---|
342 |
|
---|
343 | /** Prints correlation (double, int) pairs to file.
|
---|
344 | * \param *file file to write to
|
---|
345 | * \param *map map to write
|
---|
346 | */
|
---|
347 | void OutputCorrelation( ofstream * const file, const BinPairMap * const map )
|
---|
348 | {
|
---|
349 | *file << "# BinStart\tCount" << endl;
|
---|
350 | for (BinPairMap::const_iterator runner = map->begin(); runner != map->end(); ++runner) {
|
---|
351 | *file << runner->first << "\t" << runner->second << endl;
|
---|
352 | }
|
---|
353 | };
|
---|
354 |
|
---|
355 | /** Prints correlation (double, (atom*,atom*) ) pairs to file.
|
---|
356 | * \param *file file to write to
|
---|
357 | * \param *map map to write
|
---|
358 | */
|
---|
359 | void OutputPairCorrelation( ofstream * const file, const PairCorrelationMap * const map )
|
---|
360 | {
|
---|
361 | *file << "# BinStart\tAtom1\tAtom2" << endl;
|
---|
362 | for (PairCorrelationMap::const_iterator runner = map->begin(); runner != map->end(); ++runner) {
|
---|
363 | *file << runner->first << "\t" << *(runner->second.first) << "\t" << *(runner->second.second) << endl;
|
---|
364 | }
|
---|
365 | };
|
---|
366 |
|
---|
367 | /** Prints correlation (double, int) pairs to file.
|
---|
368 | * \param *file file to write to
|
---|
369 | * \param *map map to write
|
---|
370 | */
|
---|
371 | void OutputCorrelationToPoint( ofstream * const file, const CorrelationToPointMap * const map )
|
---|
372 | {
|
---|
373 | *file << "# BinStart\tAtom::x[i]-point.x[i]" << endl;
|
---|
374 | for (CorrelationToPointMap::const_iterator runner = map->begin(); runner != map->end(); ++runner) {
|
---|
375 | *file << runner->first;
|
---|
376 | for (int i=0;i<NDIM;i++)
|
---|
377 | *file << "\t" << (runner->second.first->node->x[i] - runner->second.second->x[i]);
|
---|
378 | *file << endl;
|
---|
379 | }
|
---|
380 | };
|
---|
381 |
|
---|
382 | /** Prints correlation (double, int) pairs to file.
|
---|
383 | * \param *file file to write to
|
---|
384 | * \param *map map to write
|
---|
385 | */
|
---|
386 | void OutputCorrelationToSurface( ofstream * const file, const CorrelationToSurfaceMap * const map )
|
---|
387 | {
|
---|
388 | *file << "# BinStart\tTriangle" << endl;
|
---|
389 | for (CorrelationToSurfaceMap::const_iterator runner = map->begin(); runner != map->end(); ++runner) {
|
---|
390 | *file << runner->first << "\t" << *(runner->second.second) << endl;
|
---|
391 | }
|
---|
392 | };
|
---|
393 |
|
---|