Ignore:
Timestamp:
Apr 13, 2010, 1:22:42 PM (16 years ago)
Author:
Tillmann Crueger <crueger@…>
Children:
e7ea64
Parents:
0f55b2
Message:

Prepared interface of Vector Class for transition to VectorComposites

File:
1 edited

Legend:

Unmodified
Added
Removed
  • molecuilder/src/analysis_correlation.cpp

    r0f55b2 r1f591b  
    5555                if (Walker->nr < OtherWalker->nr)
    5656                  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);
    5858                    //Log() << Verbose(1) <<"Inserting " << *Walker << " and " << *OtherWalker << endl;
    5959                    outmap->insert ( pair<double, pair <atom *, atom*> > (distance, pair<atom *, atom*> (Walker, OtherWalker) ) );
     
    104104        Log() << Verbose(3) << "Current atom is " << *Walker << "." << endl;
    105105        if ((type1 == NULL) || (Walker->type == type1)) {
    106           periodicX.CopyVector(Walker->node);
     106          periodicX = *(Walker->node);
    107107          periodicX.MatrixMultiplication(FullInverseMatrix);  // x now in [0,1)^3
    108108          // go through every range in xyz and get distance
     
    110110            for (n[1]=-ranges[1]; n[1] <= ranges[1]; n[1]++)
    111111              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;
    114113                checkX.MatrixMultiplication(FullMatrix);
    115114                for (MoleculeList::const_iterator MolOtherWalker = MolWalker; MolOtherWalker != molecules->ListOfMolecules.end(); MolOtherWalker++)
     
    122121                      if (Walker->nr < OtherWalker->nr)
    123122                        if ((type2 == NULL) || (OtherWalker->type == type2)) {
    124                           periodicOtherX.CopyVector(OtherWalker->node);
     123                          periodicOtherX = *(OtherWalker->node);
    125124                          periodicOtherX.MatrixMultiplication(FullInverseMatrix);  // x now in [0,1)^3
    126125                          // go through every range in xyz and get distance
     
    128127                            for (Othern[1]=-ranges[1]; Othern[1] <= ranges[1]; Othern[1]++)
    129128                              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;
    132130                                checkOtherX.MatrixMultiplication(FullMatrix);
    133                                 distance = checkX.Distance(&checkOtherX);
     131                                distance = checkX.Distance(checkOtherX);
    134132                                //Log() << Verbose(1) <<"Inserting " << *Walker << " and " << *OtherWalker << endl;
    135133                                outmap->insert ( pair<double, pair <atom *, atom*> > (distance, pair<atom *, atom*> (Walker, OtherWalker) ) );
     
    174172        Log() << Verbose(3) << "Current atom is " << *Walker << "." << endl;
    175173        if ((type == NULL) || (Walker->type == type)) {
    176           distance = Walker->node->PeriodicDistance(point, (*MolWalker)->cell_size);
     174          distance = Walker->node->PeriodicDistance(*point, (*MolWalker)->cell_size);
    177175          Log() << Verbose(4) << "Current distance is " << distance << "." << endl;
    178176          outmap->insert ( pair<double, pair<atom *, const Vector*> >(distance, pair<atom *, const Vector*> (Walker, point) ) );
     
    216214        Log() << Verbose(3) << "Current atom is " << *Walker << "." << endl;
    217215        if ((type == NULL) || (Walker->type == type)) {
    218           periodicX.CopyVector(Walker->node);
     216          periodicX = *(Walker->node);
    219217          periodicX.MatrixMultiplication(FullInverseMatrix);  // x now in [0,1)^3
    220218          // go through every range in xyz and get distance
     
    222220            for (n[1]=-ranges[1]; n[1] <= ranges[1]; n[1]++)
    223221              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;
    226223                checkX.MatrixMultiplication(FullMatrix);
    227                 distance = checkX.Distance(point);
     224                distance = checkX.Distance(*point);
    228225                Log() << Verbose(4) << "Current distance is " << distance << "." << endl;
    229226                outmap->insert ( pair<double, pair<atom *, const Vector*> >(distance, pair<atom *, const Vector*> (Walker, point) ) );
     
    320317        Log() << Verbose(3) << "Current atom is " << *Walker << "." << endl;
    321318        if ((type == NULL) || (Walker->type == type)) {
    322           periodicX.CopyVector(Walker->node);
     319          periodicX = *(Walker->node);
    323320          periodicX.MatrixMultiplication(FullInverseMatrix);  // x now in [0,1)^3
    324321          // go through every range in xyz and get distance
     
    327324            for (n[1]=-ranges[1]; n[1] <= ranges[1]; n[1]++)
    328325              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;
    331327                checkX.MatrixMultiplication(FullMatrix);
    332328                triangle = Surface->FindClosestTriangleToVector(&checkX, LC);
Note: See TracChangeset for help on using the changeset viewer.