Changeset 1f591b for molecuilder/src/analysis_correlation.cpp
- Timestamp:
- Apr 13, 2010, 1:22:42 PM (16 years ago)
- Children:
- e7ea64
- Parents:
- 0f55b2
- File:
-
- 1 edited
-
molecuilder/src/analysis_correlation.cpp (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
molecuilder/src/analysis_correlation.cpp
r0f55b2 r1f591b 55 55 if (Walker->nr < OtherWalker->nr) 56 56 if ((type2 == NULL) || (OtherWalker->type == type2)) { 57 distance = Walker->node->PeriodicDistance( OtherWalker->node, (*MolWalker)->cell_size);57 distance = Walker->node->PeriodicDistance(*(OtherWalker->node), (*MolWalker)->cell_size); 58 58 //Log() << Verbose(1) <<"Inserting " << *Walker << " and " << *OtherWalker << endl; 59 59 outmap->insert ( pair<double, pair <atom *, atom*> > (distance, pair<atom *, atom*> (Walker, OtherWalker) ) ); … … 104 104 Log() << Verbose(3) << "Current atom is " << *Walker << "." << endl; 105 105 if ((type1 == NULL) || (Walker->type == type1)) { 106 periodicX .CopyVector(Walker->node);106 periodicX = *(Walker->node); 107 107 periodicX.MatrixMultiplication(FullInverseMatrix); // x now in [0,1)^3 108 108 // go through every range in xyz and get distance … … 110 110 for (n[1]=-ranges[1]; n[1] <= ranges[1]; n[1]++) 111 111 for (n[2]=-ranges[2]; n[2] <= ranges[2]; n[2]++) { 112 checkX.Init(n[0], n[1], n[2]); 113 checkX.AddVector(&periodicX); 112 checkX = Vector(n[0], n[1], n[2]) + periodicX; 114 113 checkX.MatrixMultiplication(FullMatrix); 115 114 for (MoleculeList::const_iterator MolOtherWalker = MolWalker; MolOtherWalker != molecules->ListOfMolecules.end(); MolOtherWalker++) … … 122 121 if (Walker->nr < OtherWalker->nr) 123 122 if ((type2 == NULL) || (OtherWalker->type == type2)) { 124 periodicOtherX .CopyVector(OtherWalker->node);123 periodicOtherX = *(OtherWalker->node); 125 124 periodicOtherX.MatrixMultiplication(FullInverseMatrix); // x now in [0,1)^3 126 125 // go through every range in xyz and get distance … … 128 127 for (Othern[1]=-ranges[1]; Othern[1] <= ranges[1]; Othern[1]++) 129 128 for (Othern[2]=-ranges[2]; Othern[2] <= ranges[2]; Othern[2]++) { 130 checkOtherX.Init(Othern[0], Othern[1], Othern[2]); 131 checkOtherX.AddVector(&periodicOtherX); 129 checkOtherX = Vector(Othern[0], Othern[1], Othern[2]) + periodicOtherX; 132 130 checkOtherX.MatrixMultiplication(FullMatrix); 133 distance = checkX.Distance( &checkOtherX);131 distance = checkX.Distance(checkOtherX); 134 132 //Log() << Verbose(1) <<"Inserting " << *Walker << " and " << *OtherWalker << endl; 135 133 outmap->insert ( pair<double, pair <atom *, atom*> > (distance, pair<atom *, atom*> (Walker, OtherWalker) ) ); … … 174 172 Log() << Verbose(3) << "Current atom is " << *Walker << "." << endl; 175 173 if ((type == NULL) || (Walker->type == type)) { 176 distance = Walker->node->PeriodicDistance( point, (*MolWalker)->cell_size);174 distance = Walker->node->PeriodicDistance(*point, (*MolWalker)->cell_size); 177 175 Log() << Verbose(4) << "Current distance is " << distance << "." << endl; 178 176 outmap->insert ( pair<double, pair<atom *, const Vector*> >(distance, pair<atom *, const Vector*> (Walker, point) ) ); … … 216 214 Log() << Verbose(3) << "Current atom is " << *Walker << "." << endl; 217 215 if ((type == NULL) || (Walker->type == type)) { 218 periodicX .CopyVector(Walker->node);216 periodicX = *(Walker->node); 219 217 periodicX.MatrixMultiplication(FullInverseMatrix); // x now in [0,1)^3 220 218 // go through every range in xyz and get distance … … 222 220 for (n[1]=-ranges[1]; n[1] <= ranges[1]; n[1]++) 223 221 for (n[2]=-ranges[2]; n[2] <= ranges[2]; n[2]++) { 224 checkX.Init(n[0], n[1], n[2]); 225 checkX.AddVector(&periodicX); 222 checkX = Vector(n[0], n[1], n[2]) + periodicX; 226 223 checkX.MatrixMultiplication(FullMatrix); 227 distance = checkX.Distance( point);224 distance = checkX.Distance(*point); 228 225 Log() << Verbose(4) << "Current distance is " << distance << "." << endl; 229 226 outmap->insert ( pair<double, pair<atom *, const Vector*> >(distance, pair<atom *, const Vector*> (Walker, point) ) ); … … 320 317 Log() << Verbose(3) << "Current atom is " << *Walker << "." << endl; 321 318 if ((type == NULL) || (Walker->type == type)) { 322 periodicX .CopyVector(Walker->node);319 periodicX = *(Walker->node); 323 320 periodicX.MatrixMultiplication(FullInverseMatrix); // x now in [0,1)^3 324 321 // go through every range in xyz and get distance … … 327 324 for (n[1]=-ranges[1]; n[1] <= ranges[1]; n[1]++) 328 325 for (n[2]=-ranges[2]; n[2] <= ranges[2]; n[2]++) { 329 checkX.Init(n[0], n[1], n[2]); 330 checkX.AddVector(&periodicX); 326 checkX = Vector(n[0], n[1], n[2]) + periodicX; 331 327 checkX.MatrixMultiplication(FullMatrix); 332 328 triangle = Surface->FindClosestTriangleToVector(&checkX, LC);
Note:
See TracChangeset
for help on using the changeset viewer.
