Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/vector.cpp

    ra67d19 r717e0c  
    88#include "defs.hpp"
    99#include "helpers.hpp"
    10 #include "info.hpp"
    11 #include "gslmatrix.hpp"
     10#include "memoryallocator.hpp"
    1211#include "leastsquaremin.hpp"
    1312#include "log.hpp"
    14 #include "memoryallocator.hpp"
    1513#include "vector.hpp"
    1614#include "verbose.hpp"
    17 #include "World.hpp"
    18 
    19 #include <gsl/gsl_linalg.h>
    20 #include <gsl/gsl_matrix.h>
    21 #include <gsl/gsl_permutation.h>
    22 #include <gsl/gsl_vector.h>
    2315
    2416/************************************ Functions for class vector ************************************/
     
    2719 */
    2820Vector::Vector() { x[0] = x[1] = x[2] = 0.; };
    29 
    30 /** Constructor of class vector.
    31  */
    32 Vector::Vector(const Vector * const a)
    33 {
    34   x[0] = a->x[0];
    35   x[1] = a->x[1];
    36   x[2] = a->x[2];
    37 };
    38 
    39 /** Constructor of class vector.
    40  */
    41 Vector::Vector(const Vector &a)
    42 {
    43   x[0] = a.x[0];
    44   x[1] = a.x[1];
    45   x[2] = a.x[2];
    46 };
    4721
    4822/** Constructor of class vector.
     
    241215 * \param *Origin first vector of line
    242216 * \param *LineVector second vector of line
    243  * \return true -  \a this contains intersection point on return, false - line is parallel to plane (even if in-plane)
     217 * \return true -  \a this contains intersection point on return, false - line is parallel to plane
    244218 */
    245219bool Vector::GetIntersectionWithPlane(const Vector * const PlaneNormal, const Vector * const PlaneOffset, const Vector * const Origin, const Vector * const LineVector)
    246220{
    247   Info FunctionInfo(__func__);
    248221  double factor;
    249222  Vector Direction, helper;
     
    253226  Direction.SubtractVector(Origin);
    254227  Direction.Normalize();
    255   DoLog(1) && (Log() << Verbose(1) << "INFO: Direction is " << Direction << "." << endl);
    256   //Log() << Verbose(1) << "INFO: PlaneNormal is " << *PlaneNormal << " and PlaneOffset is " << *PlaneOffset << "." << endl;
     228  //Log() << Verbose(4) << "INFO: Direction is " << Direction << "." << endl;
    257229  factor = Direction.ScalarProduct(PlaneNormal);
    258   if (fabs(factor) < MYEPSILON) { // Uniqueness: line parallel to plane?
    259     DoLog(1) && (Log() << Verbose(1) << "BAD: Line is parallel to plane, no intersection." << endl);
     230  if (factor < MYEPSILON) { // Uniqueness: line parallel to plane?
     231    eLog() << Verbose(2) << "Line is parallel to plane, no intersection." << endl;
    260232    return false;
    261233  }
     
    263235  helper.SubtractVector(Origin);
    264236  factor = helper.ScalarProduct(PlaneNormal)/factor;
    265   if (fabs(factor) < MYEPSILON) { // Origin is in-plane
    266     DoLog(1) && (Log() << Verbose(1) << "GOOD: Origin of line is in-plane." << endl);
     237  if (factor < MYEPSILON) { // Origin is in-plane
     238    //Log() << Verbose(2) << "Origin of line is in-plane, simple." << endl;
    267239    CopyVector(Origin);
    268240    return true;
     
    271243  Direction.Scale(factor);
    272244  CopyVector(Origin);
    273   DoLog(1) && (Log() << Verbose(1) << "INFO: Scaled direction is " << Direction << "." << endl);
     245  //Log() << Verbose(4) << "INFO: Scaled direction is " << Direction << "." << endl;
    274246  AddVector(&Direction);
    275247
     
    278250  helper.SubtractVector(PlaneOffset);
    279251  if (helper.ScalarProduct(PlaneNormal) < MYEPSILON) {
    280     DoLog(1) && (Log() << Verbose(1) << "GOOD: Intersection is " << *this << "." << endl);
     252    //Log() << Verbose(2) << "INFO: Intersection at " << *this << " is good." << endl;
    281253    return true;
    282254  } else {
    283     DoeLog(2) && (eLog()<< Verbose(2) << "Intersection point " << *this << " is not on plane." << endl);
     255    eLog() << Verbose(2) << "Intersection point " << *this << " is not on plane." << endl;
    284256    return false;
    285257  }
    286258};
    287259
    288 /** Calculates the minimum distance vector of this vector to the plane.
     260/** Calculates the minimum distance of this vector to the plane.
    289261 * \param *out output stream for debugging
    290262 * \param *PlaneNormal normal of plane
    291263 * \param *PlaneOffset offset of plane
    292  * \return distance vector onto to plane
    293  */
    294 Vector Vector::GetDistanceVectorToPlane(const Vector * const PlaneNormal, const Vector * const PlaneOffset) const
     264 * \return distance to plane
     265 */
     266double Vector::DistanceToPlane(const Vector * const PlaneNormal, const Vector * const PlaneOffset) const
    295267{
    296268  Vector temp;
     
    310282    sign = 0.;
    311283
    312   temp.Normalize();
    313   temp.Scale(sign);
    314   return temp;
    315 };
    316 
    317 /** Calculates the minimum distance of this vector to the plane.
    318  * \sa Vector::GetDistanceVectorToPlane()
    319  * \param *out output stream for debugging
    320  * \param *PlaneNormal normal of plane
    321  * \param *PlaneOffset offset of plane
    322  * \return distance to plane
    323  */
    324 double Vector::DistanceToPlane(const Vector * const PlaneNormal, const Vector * const PlaneOffset) const
    325 {
    326   return GetDistanceVectorToPlane(PlaneNormal,PlaneOffset).Norm();
     284  return (temp.Norm()*sign);
    327285};
    328286
    329287/** Calculates the intersection of the two lines that are both on the same plane.
    330  * This is taken from Weisstein, Eric W. "Line-Line Intersection." From MathWorld--A Wolfram Web Resource. http://mathworld.wolfram.com/Line-LineIntersection.html
     288 * We construct auxiliary plane with its vector normal to one line direction and the PlaneNormal, then a vector
     289 * from the first line's offset onto the plane. Finally, scale by factor is 1/cos(angle(line1,line2..)) = 1/SP(...), and
     290 * project onto the first line's direction and add its offset.
    331291 * \param *out output stream for debugging
    332292 * \param *Line1a first vector of first line
     
    339299bool Vector::GetIntersectionOfTwoLinesOnPlane(const Vector * const Line1a, const Vector * const Line1b, const Vector * const Line2a, const Vector * const Line2b, const Vector *PlaneNormal)
    340300{
    341   Info FunctionInfo(__func__);
    342 
    343   GSLMatrix *M = new GSLMatrix(4,4);
    344 
    345   M->SetAll(1.);
    346   for (int i=0;i<3;i++) {
    347     M->Set(0, i, Line1a->x[i]);
    348     M->Set(1, i, Line1b->x[i]);
    349     M->Set(2, i, Line2a->x[i]);
    350     M->Set(3, i, Line2b->x[i]);
    351   }
    352  
    353   //Log() << Verbose(1) << "Coefficent matrix is:" << endl;
    354   //ostream &output = Log() << Verbose(1);
    355   //for (int i=0;i<4;i++) {
    356   //  for (int j=0;j<4;j++)
    357   //    output << "\t" << M->Get(i,j);
    358   //  output << endl;
    359   //}
    360   if (fabs(M->Determinant()) > MYEPSILON) {
    361     DoLog(1) && (Log() << Verbose(1) << "Determinant of coefficient matrix is NOT zero." << endl);
     301  bool result = true;
     302  Vector Direction, OtherDirection;
     303  Vector AuxiliaryNormal;
     304  Vector Distance;
     305  const Vector *Normal = NULL;
     306  Vector *ConstructedNormal = NULL;
     307  bool FreeNormal = false;
     308
     309  // construct both direction vectors
     310  Zero();
     311  Direction.CopyVector(Line1b);
     312  Direction.SubtractVector(Line1a);
     313  if (Direction.IsZero())
    362314    return false;
    363   }
    364   DoLog(1) && (Log() << Verbose(1) << "INFO: Line1a = " << *Line1a << ", Line1b = " << *Line1b << ", Line2a = " << *Line2a << ", Line2b = " << *Line2b << "." << endl);
    365 
    366 
    367   // constuct a,b,c
    368   Vector a;
    369   Vector b;
    370   Vector c;
    371   Vector d;
    372   a.CopyVector(Line1b);
    373   a.SubtractVector(Line1a);
    374   b.CopyVector(Line2b);
    375   b.SubtractVector(Line2a);
    376   c.CopyVector(Line2a);
    377   c.SubtractVector(Line1a);
    378   d.CopyVector(Line2b);
    379   d.SubtractVector(Line1b);
    380   DoLog(1) && (Log() << Verbose(1) << "INFO: a = " << a << ", b = " << b << ", c = " << c << "." << endl);
    381   if ((a.NormSquared() < MYEPSILON) || (b.NormSquared() < MYEPSILON)) {
    382    Zero();
    383    DoLog(1) && (Log() << Verbose(1) << "At least one of the lines is ill-defined, i.e. offset equals second vector." << endl);
    384    return false;
    385   }
    386 
    387   // check for parallelity
    388   Vector parallel;
    389   double factor = 0.;
    390   if (fabs(a.ScalarProduct(&b)*a.ScalarProduct(&b)/a.NormSquared()/b.NormSquared() - 1.) < MYEPSILON) {
    391     parallel.CopyVector(Line1a);
    392     parallel.SubtractVector(Line2a);
    393     factor = parallel.ScalarProduct(&a)/a.Norm();
    394     if ((factor >= -MYEPSILON) && (factor - 1. < MYEPSILON)) {
    395       CopyVector(Line2a);
    396       DoLog(1) && (Log() << Verbose(1) << "Lines conincide." << endl);
    397       return true;
     315  OtherDirection.CopyVector(Line2b);
     316  OtherDirection.SubtractVector(Line2a);
     317  if (OtherDirection.IsZero())
     318    return false;
     319
     320  Direction.Normalize();
     321  OtherDirection.Normalize();
     322
     323  //Log() << Verbose(4) << "INFO: Normalized Direction " << Direction << " and OtherDirection " << OtherDirection << "." << endl;
     324
     325  if (fabs(OtherDirection.ScalarProduct(&Direction) - 1.) < MYEPSILON) { // lines are parallel
     326    if ((Line1a == Line2a) || (Line1a == Line2b))
     327      CopyVector(Line1a);
     328    else if ((Line1b == Line2b) || (Line1b == Line2b))
     329        CopyVector(Line1b);
     330    else
     331      return false;
     332    Log() << Verbose(4) << "INFO: Intersection is " << *this << "." << endl;
     333    return true;
     334  } else {
     335    // check whether we have a plane normal vector
     336    if (PlaneNormal == NULL) {
     337      ConstructedNormal = new Vector;
     338      ConstructedNormal->MakeNormalVector(&Direction, &OtherDirection);
     339      Normal = ConstructedNormal;
     340      FreeNormal = true;
     341    } else
     342      Normal = PlaneNormal;
     343
     344    AuxiliaryNormal.MakeNormalVector(&OtherDirection, Normal);
     345    //Log() << Verbose(4) << "INFO: PlaneNormal is " << *Normal << " and AuxiliaryNormal " << AuxiliaryNormal << "." << endl;
     346
     347    Distance.CopyVector(Line2a);
     348    Distance.SubtractVector(Line1a);
     349    //Log() << Verbose(4) << "INFO: Distance is " << Distance << "." << endl;
     350    if (Distance.IsZero()) {
     351      // offsets are equal, match found
     352      CopyVector(Line1a);
     353      result = true;
    398354    } else {
    399       parallel.CopyVector(Line1a);
    400       parallel.SubtractVector(Line2b);
    401       factor = parallel.ScalarProduct(&a)/a.Norm();
    402       if ((factor >= -MYEPSILON) && (factor - 1. < MYEPSILON)) {
    403         CopyVector(Line2b);
    404         DoLog(1) && (Log() << Verbose(1) << "Lines conincide." << endl);
    405         return true;
    406       }
     355      CopyVector(Distance.Projection(&AuxiliaryNormal));
     356      //Log() << Verbose(4) << "INFO: Projected Distance is " << *this << "." << endl;
     357      double factor = Direction.ScalarProduct(&AuxiliaryNormal);
     358      //Log() << Verbose(4) << "INFO: Scaling factor is " << factor << "." << endl;
     359      Scale(1./(factor*factor));
     360      //Log() << Verbose(4) << "INFO: Scaled Distance is " << *this << "." << endl;
     361      CopyVector(Projection(&Direction));
     362      //Log() << Verbose(4) << "INFO: Distance, projected into Direction, is " << *this << "." << endl;
     363      if (this->IsZero())
     364        result = false;
     365      else
     366        result = true;
     367      AddVector(Line1a);
    407368    }
    408     DoLog(1) && (Log() << Verbose(1) << "Lines are parallel." << endl);
    409     Zero();
    410     return false;
    411   }
    412 
    413   // obtain s
    414   double s;
    415   Vector temp1, temp2;
    416   temp1.CopyVector(&c);
    417   temp1.VectorProduct(&b);
    418   temp2.CopyVector(&a);
    419   temp2.VectorProduct(&b);
    420   DoLog(1) && (Log() << Verbose(1) << "INFO: temp1 = " << temp1 << ", temp2 = " << temp2 << "." << endl);
    421   if (fabs(temp2.NormSquared()) > MYEPSILON)
    422     s = temp1.ScalarProduct(&temp2)/temp2.NormSquared();
    423   else
    424     s = 0.;
    425   DoLog(1) && (Log() << Verbose(1) << "Factor s is " << temp1.ScalarProduct(&temp2) << "/" << temp2.NormSquared() << " = " << s << "." << endl);
    426 
    427   // construct intersection
    428   CopyVector(&a);
    429   Scale(s);
    430   AddVector(Line1a);
    431   DoLog(1) && (Log() << Verbose(1) << "Intersection is at " << *this << "." << endl);
    432 
    433   return true;
     369
     370    if (FreeNormal)
     371      delete(ConstructedNormal);
     372  }
     373  if (result)
     374    Log() << Verbose(4) << "INFO: Intersection is " << *this << "." << endl;
     375
     376  return result;
    434377};
    435378
     
    537480  else
    538481    return false;
    539 };
    540 
    541 /** Checks whether vector is normal to \a *normal.
    542  * @return true - vector is normalized, false - vector is not
    543  */
    544 bool Vector::IsEqualTo(const Vector * const a) const
    545 {
    546   bool status = true;
    547   for (int i=0;i<NDIM;i++) {
    548     if (fabs(x[i] - a->x[i]) > MYEPSILON)
    549       status = false;
    550   }
    551   return status;
    552482};
    553483
     
    702632void Vector::Output() const
    703633{
    704   DoLog(0) && (Log() << Verbose(0) << "(");
     634  Log() << Verbose(0) << "(";
    705635  for (int i=0;i<NDIM;i++) {
    706     DoLog(0) && (Log() << Verbose(0) << x[i]);
     636    Log() << Verbose(0) << x[i];
    707637    if (i != 2)
    708       DoLog(0) && (Log() << Verbose(0) << ",");
    709   }
    710   DoLog(0) && (Log() << Verbose(0) << ")");
     638      Log() << Verbose(0) << ",";
     639  }
     640  Log() << Verbose(0) << ")";
    711641};
    712642
     
    817747      x[i] = C.x[i];
    818748  } else {
    819     DoeLog(1) && (eLog()<< Verbose(1) << "inverse of matrix does not exists: det A = " << detA << "." << endl);
     749    eLog() << Verbose(1) << "inverse of matrix does not exists: det A = " << detA << "." << endl;
    820750  }
    821751};
     
    843773  projection = ScalarProduct(n)/n->ScalarProduct(n);    // remove constancy from n (keep as logical one)
    844774  // withdraw projected vector twice from original one
    845   DoLog(1) && (Log() << Verbose(1) << "Vector: ");
     775  Log() << Verbose(1) << "Vector: ";
    846776  Output();
    847   DoLog(0) && (Log() << Verbose(0) << "\t");
     777  Log() << Verbose(0) << "\t";
    848778  for (int i=NDIM;i--;)
    849779    x[i] -= 2.*projection*n->x[i];
    850   DoLog(0) && (Log() << Verbose(0) << "Projected vector: ");
     780  Log() << Verbose(0) << "Projected vector: ";
    851781  Output();
    852   DoLog(0) && (Log() << Verbose(0) << endl);
     782  Log() << Verbose(0) << endl;
    853783};
    854784
     
    869799  x2.SubtractVector(y2);
    870800  if ((fabs(x1.Norm()) < MYEPSILON) || (fabs(x2.Norm()) < MYEPSILON) || (fabs(x1.Angle(&x2)) < MYEPSILON)) {
    871     DoeLog(2) && (eLog()<< Verbose(2) << "Given vectors are linear dependent." << endl);
     801    eLog() << Verbose(2) << "Given vectors are linear dependent." << endl;
    872802    return false;
    873803  }
     
    903833  Zero();
    904834  if ((fabs(x1.Norm()) < MYEPSILON) || (fabs(x2.Norm()) < MYEPSILON) || (fabs(x1.Angle(&x2)) < MYEPSILON)) {
    905     DoeLog(2) && (eLog()<< Verbose(2) << "Given vectors are linear dependent." << endl);
     835    eLog() << Verbose(2) << "Given vectors are linear dependent." << endl;
    906836    return false;
    907837  }
     
    954884  double norm;
    955885
    956   DoLog(4) && (Log() << Verbose(4));
     886  Log() << Verbose(4);
    957887  GivenVector->Output();
    958   DoLog(0) && (Log() << Verbose(0) << endl);
     888  Log() << Verbose(0) << endl;
    959889  for (j=NDIM;j--;)
    960890    Components[j] = -1;
     
    963893    if (fabs(GivenVector->x[j]) > MYEPSILON)
    964894      Components[Last++] = j;
    965   DoLog(4) && (Log() << Verbose(4) << Last << " Components != 0: (" << Components[0] << "," << Components[1] << "," << Components[2] << ")" << endl);
     895  Log() << Verbose(4) << Last << " Components != 0: (" << Components[0] << "," << Components[1] << "," << Components[2] << ")" << endl;
    966896
    967897  switch(Last) {
     
    1013943
    1014944  for (j=0;j<num;j++) {
    1015     DoLog(1) && (Log() << Verbose(1) << j << "th atom's vector: ");
     945    Log() << Verbose(1) << j << "th atom's vector: ";
    1016946    (vectors[j])->Output();
    1017     DoLog(0) && (Log() << Verbose(0) << endl);
     947    Log() << Verbose(0) << endl;
    1018948  }
    1019949
     
    11351065    j += i+1;
    11361066    do {
    1137       DoLog(0) && (Log() << Verbose(0) << coords[i] << "[0.." << cell_size[j] << "]: ");
     1067      Log() << Verbose(0) << coords[i] << "[0.." << cell_size[j] << "]: ";
    11381068      cin >> x[i];
    11391069    } while (((x[i] < 0) || (x[i] >= cell_size[j])) && (check));
     
    11661096  B2 = cos(beta) * x2->Norm() * c;
    11671097  C = c * c;
    1168   DoLog(2) && (Log() << Verbose(2) << "A " << A << "\tB " << B1 << "\tC " << C << endl);
     1098  Log() << Verbose(2) << "A " << A << "\tB " << B1 << "\tC " << C << endl;
    11691099  int flag = 0;
    11701100  if (fabs(x1->x[0]) < MYEPSILON) { // check for zero components for the later flipping and back-flipping
     
    12051135  D2 = -y->x[0]/x1->x[0]*x1->x[2]+y->x[2];
    12061136  D3 = y->x[0]/x1->x[0]*A-B1;
    1207   DoLog(2) && (Log() << Verbose(2) << "D1 " << D1 << "\tD2 " << D2 << "\tD3 " << D3 << "\n");
     1137  Log() << Verbose(2) << "D1 " << D1 << "\tD2 " << D2 << "\tD3 " << D3 << "\n";
    12081138  if (fabs(D1) < MYEPSILON) {
    1209     DoLog(2) && (Log() << Verbose(2) << "D1 == 0!\n");
     1139    Log() << Verbose(2) << "D1 == 0!\n";
    12101140    if (fabs(D2) > MYEPSILON) {
    1211       DoLog(3) && (Log() << Verbose(3) << "D2 != 0!\n");
     1141      Log() << Verbose(3) << "D2 != 0!\n";
    12121142      x[2] = -D3/D2;
    12131143      E1 = A/x1->x[0] + x1->x[2]/x1->x[0]*D3/D2;
    12141144      E2 = -x1->x[1]/x1->x[0];
    1215       DoLog(3) && (Log() << Verbose(3) << "E1 " << E1 << "\tE2 " << E2 << "\n");
     1145      Log() << Verbose(3) << "E1 " << E1 << "\tE2 " << E2 << "\n";
    12161146      F1 = E1*E1 + 1.;
    12171147      F2 = -E1*E2;
    12181148      F3 = E1*E1 + D3*D3/(D2*D2) - C;
    1219       DoLog(3) && (Log() << Verbose(3) << "F1 " << F1 << "\tF2 " << F2 << "\tF3 " << F3 << "\n");
     1149      Log() << Verbose(3) << "F1 " << F1 << "\tF2 " << F2 << "\tF3 " << F3 << "\n";
    12201150      if (fabs(F1) < MYEPSILON) {
    1221         DoLog(4) && (Log() << Verbose(4) << "F1 == 0!\n");
    1222         DoLog(4) && (Log() << Verbose(4) << "Gleichungssystem linear\n");
     1151        Log() << Verbose(4) << "F1 == 0!\n";
     1152        Log() << Verbose(4) << "Gleichungssystem linear\n";
    12231153        x[1] = F3/(2.*F2);
    12241154      } else {
    12251155        p = F2/F1;
    12261156        q = p*p - F3/F1;
    1227         DoLog(4) && (Log() << Verbose(4) << "p " << p << "\tq " << q << endl);
     1157        Log() << Verbose(4) << "p " << p << "\tq " << q << endl;
    12281158        if (q < 0) {
    1229           DoLog(4) && (Log() << Verbose(4) << "q < 0" << endl);
     1159          Log() << Verbose(4) << "q < 0" << endl;
    12301160          return false;
    12311161        }
     
    12341164      x[0] =  A/x1->x[0] - x1->x[1]/x1->x[0]*x[1] + x1->x[2]/x1->x[0]*x[2];
    12351165    } else {
    1236       DoLog(2) && (Log() << Verbose(2) << "Gleichungssystem unterbestimmt\n");
     1166      Log() << Verbose(2) << "Gleichungssystem unterbestimmt\n";
    12371167      return false;
    12381168    }
     
    12401170    E1 = A/x1->x[0]+x1->x[1]/x1->x[0]*D3/D1;
    12411171    E2 = x1->x[1]/x1->x[0]*D2/D1 - x1->x[2];
    1242     DoLog(2) && (Log() << Verbose(2) << "E1 " << E1 << "\tE2 " << E2 << "\n");
     1172    Log() << Verbose(2) << "E1 " << E1 << "\tE2 " << E2 << "\n";
    12431173    F1 = E2*E2 + D2*D2/(D1*D1) + 1.;
    12441174    F2 = -(E1*E2 + D2*D3/(D1*D1));
    12451175    F3 = E1*E1 + D3*D3/(D1*D1) - C;
    1246     DoLog(2) && (Log() << Verbose(2) << "F1 " << F1 << "\tF2 " << F2 << "\tF3 " << F3 << "\n");
     1176    Log() << Verbose(2) << "F1 " << F1 << "\tF2 " << F2 << "\tF3 " << F3 << "\n";
    12471177    if (fabs(F1) < MYEPSILON) {
    1248       DoLog(3) && (Log() << Verbose(3) << "F1 == 0!\n");
    1249       DoLog(3) && (Log() << Verbose(3) << "Gleichungssystem linear\n");
     1178      Log() << Verbose(3) << "F1 == 0!\n";
     1179      Log() << Verbose(3) << "Gleichungssystem linear\n";
    12501180      x[2] = F3/(2.*F2);
    12511181    } else {
    12521182      p = F2/F1;
    12531183      q = p*p - F3/F1;
    1254       DoLog(3) && (Log() << Verbose(3) << "p " << p << "\tq " << q << endl);
     1184      Log() << Verbose(3) << "p " << p << "\tq " << q << endl;
    12551185      if (q < 0) {
    1256         DoLog(3) && (Log() << Verbose(3) << "q < 0" << endl);
     1186        Log() << Verbose(3) << "q < 0" << endl;
    12571187        return false;
    12581188      }
     
    12921222    for (j=2;j>=0;j--) {
    12931223      k = (i & pot(2,j)) << j;
    1294       DoLog(2) && (Log() << Verbose(2) << "k " << k << "\tpot(2,j) " << pot(2,j) << endl);
     1224      Log() << Verbose(2) << "k " << k << "\tpot(2,j) " << pot(2,j) << endl;
    12951225      sign[j] = (k == 0) ? 1. : -1.;
    12961226    }
    1297     DoLog(2) && (Log() << Verbose(2) << i << ": sign matrix is " << sign[0] << "\t" << sign[1] << "\t" << sign[2] << "\n");
     1227    Log() << Verbose(2) << i << ": sign matrix is " << sign[0] << "\t" << sign[1] << "\t" << sign[2] << "\n";
    12981228    // apply sign matrix
    12991229    for (j=NDIM;j--;)
     
    13011231    // calculate angle and check
    13021232    ang = x2->Angle (this);
    1303     DoLog(1) && (Log() << Verbose(1) << i << "th angle " << ang << "\tbeta " << cos(beta) << " :\t");
     1233    Log() << Verbose(1) << i << "th angle " << ang << "\tbeta " << cos(beta) << " :\t";
    13041234    if (fabs(ang - cos(beta)) < MYEPSILON) {
    13051235      break;
Note: See TracChangeset for help on using the changeset viewer.