Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/vector.cpp

    r717e0c ra67d19  
    88#include "defs.hpp"
    99#include "helpers.hpp"
    10 #include "memoryallocator.hpp"
     10#include "info.hpp"
     11#include "gslmatrix.hpp"
    1112#include "leastsquaremin.hpp"
    1213#include "log.hpp"
     14#include "memoryallocator.hpp"
    1315#include "vector.hpp"
    1416#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>
    1523
    1624/************************************ Functions for class vector ************************************/
     
    1927 */
    2028Vector::Vector() { x[0] = x[1] = x[2] = 0.; };
     29
     30/** Constructor of class vector.
     31 */
     32Vector::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 */
     41Vector::Vector(const Vector &a)
     42{
     43  x[0] = a.x[0];
     44  x[1] = a.x[1];
     45  x[2] = a.x[2];
     46};
    2147
    2248/** Constructor of class vector.
     
    215241 * \param *Origin first vector of line
    216242 * \param *LineVector second vector of line
    217  * \return true -  \a this contains intersection point on return, false - line is parallel to plane
     243 * \return true -  \a this contains intersection point on return, false - line is parallel to plane (even if in-plane)
    218244 */
    219245bool Vector::GetIntersectionWithPlane(const Vector * const PlaneNormal, const Vector * const PlaneOffset, const Vector * const Origin, const Vector * const LineVector)
    220246{
     247  Info FunctionInfo(__func__);
    221248  double factor;
    222249  Vector Direction, helper;
     
    226253  Direction.SubtractVector(Origin);
    227254  Direction.Normalize();
    228   //Log() << Verbose(4) << "INFO: Direction is " << Direction << "." << endl;
     255  DoLog(1) && (Log() << Verbose(1) << "INFO: Direction is " << Direction << "." << endl);
     256  //Log() << Verbose(1) << "INFO: PlaneNormal is " << *PlaneNormal << " and PlaneOffset is " << *PlaneOffset << "." << endl;
    229257  factor = Direction.ScalarProduct(PlaneNormal);
    230   if (factor < MYEPSILON) { // Uniqueness: line parallel to plane?
    231     eLog() << Verbose(2) << "Line is parallel to plane, no intersection." << endl;
     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);
    232260    return false;
    233261  }
     
    235263  helper.SubtractVector(Origin);
    236264  factor = helper.ScalarProduct(PlaneNormal)/factor;
    237   if (factor < MYEPSILON) { // Origin is in-plane
    238     //Log() << Verbose(2) << "Origin of line is in-plane, simple." << endl;
     265  if (fabs(factor) < MYEPSILON) { // Origin is in-plane
     266    DoLog(1) && (Log() << Verbose(1) << "GOOD: Origin of line is in-plane." << endl);
    239267    CopyVector(Origin);
    240268    return true;
     
    243271  Direction.Scale(factor);
    244272  CopyVector(Origin);
    245   //Log() << Verbose(4) << "INFO: Scaled direction is " << Direction << "." << endl;
     273  DoLog(1) && (Log() << Verbose(1) << "INFO: Scaled direction is " << Direction << "." << endl);
    246274  AddVector(&Direction);
    247275
     
    250278  helper.SubtractVector(PlaneOffset);
    251279  if (helper.ScalarProduct(PlaneNormal) < MYEPSILON) {
    252     //Log() << Verbose(2) << "INFO: Intersection at " << *this << " is good." << endl;
     280    DoLog(1) && (Log() << Verbose(1) << "GOOD: Intersection is " << *this << "." << endl);
    253281    return true;
    254282  } else {
    255     eLog() << Verbose(2) << "Intersection point " << *this << " is not on plane." << endl;
     283    DoeLog(2) && (eLog()<< Verbose(2) << "Intersection point " << *this << " is not on plane." << endl);
    256284    return false;
    257285  }
    258286};
    259287
    260 /** Calculates the minimum distance of this vector to the plane.
     288/** Calculates the minimum distance vector of this vector to the plane.
    261289 * \param *out output stream for debugging
    262290 * \param *PlaneNormal normal of plane
    263291 * \param *PlaneOffset offset of plane
    264  * \return distance to plane
    265  */
    266 double Vector::DistanceToPlane(const Vector * const PlaneNormal, const Vector * const PlaneOffset) const
     292 * \return distance vector onto to plane
     293 */
     294Vector Vector::GetDistanceVectorToPlane(const Vector * const PlaneNormal, const Vector * const PlaneOffset) const
    267295{
    268296  Vector temp;
     
    282310    sign = 0.;
    283311
    284   return (temp.Norm()*sign);
     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 */
     324double Vector::DistanceToPlane(const Vector * const PlaneNormal, const Vector * const PlaneOffset) const
     325{
     326  return GetDistanceVectorToPlane(PlaneNormal,PlaneOffset).Norm();
    285327};
    286328
    287329/** Calculates the intersection of the two lines that are both on the same plane.
    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.
     330 * This is taken from Weisstein, Eric W. "Line-Line Intersection." From MathWorld--A Wolfram Web Resource. http://mathworld.wolfram.com/Line-LineIntersection.html
    291331 * \param *out output stream for debugging
    292332 * \param *Line1a first vector of first line
     
    299339bool Vector::GetIntersectionOfTwoLinesOnPlane(const Vector * const Line1a, const Vector * const Line1b, const Vector * const Line2a, const Vector * const Line2b, const Vector *PlaneNormal)
    300340{
    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())
     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);
    314362    return false;
    315   OtherDirection.CopyVector(Line2b);
    316   OtherDirection.SubtractVector(Line2a);
    317   if (OtherDirection.IsZero())
     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;
     398    } 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      }
     407    }
     408    DoLog(1) && (Log() << Verbose(1) << "Lines are parallel." << endl);
     409    Zero();
    318410    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;
    354     } else {
    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);
    368     }
    369 
    370     if (FreeNormal)
    371       delete(ConstructedNormal);
    372   }
    373   if (result)
    374     Log() << Verbose(4) << "INFO: Intersection is " << *this << "." << endl;
    375 
    376   return result;
     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;
    377434};
    378435
     
    480537  else
    481538    return false;
     539};
     540
     541/** Checks whether vector is normal to \a *normal.
     542 * @return true - vector is normalized, false - vector is not
     543 */
     544bool 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;
    482552};
    483553
     
    632702void Vector::Output() const
    633703{
    634   Log() << Verbose(0) << "(";
     704  DoLog(0) && (Log() << Verbose(0) << "(");
    635705  for (int i=0;i<NDIM;i++) {
    636     Log() << Verbose(0) << x[i];
     706    DoLog(0) && (Log() << Verbose(0) << x[i]);
    637707    if (i != 2)
    638       Log() << Verbose(0) << ",";
    639   }
    640   Log() << Verbose(0) << ")";
     708      DoLog(0) && (Log() << Verbose(0) << ",");
     709  }
     710  DoLog(0) && (Log() << Verbose(0) << ")");
    641711};
    642712
     
    747817      x[i] = C.x[i];
    748818  } else {
    749     eLog() << Verbose(1) << "inverse of matrix does not exists: det A = " << detA << "." << endl;
     819    DoeLog(1) && (eLog()<< Verbose(1) << "inverse of matrix does not exists: det A = " << detA << "." << endl);
    750820  }
    751821};
     
    773843  projection = ScalarProduct(n)/n->ScalarProduct(n);    // remove constancy from n (keep as logical one)
    774844  // withdraw projected vector twice from original one
    775   Log() << Verbose(1) << "Vector: ";
     845  DoLog(1) && (Log() << Verbose(1) << "Vector: ");
    776846  Output();
    777   Log() << Verbose(0) << "\t";
     847  DoLog(0) && (Log() << Verbose(0) << "\t");
    778848  for (int i=NDIM;i--;)
    779849    x[i] -= 2.*projection*n->x[i];
    780   Log() << Verbose(0) << "Projected vector: ";
     850  DoLog(0) && (Log() << Verbose(0) << "Projected vector: ");
    781851  Output();
    782   Log() << Verbose(0) << endl;
     852  DoLog(0) && (Log() << Verbose(0) << endl);
    783853};
    784854
     
    799869  x2.SubtractVector(y2);
    800870  if ((fabs(x1.Norm()) < MYEPSILON) || (fabs(x2.Norm()) < MYEPSILON) || (fabs(x1.Angle(&x2)) < MYEPSILON)) {
    801     eLog() << Verbose(2) << "Given vectors are linear dependent." << endl;
     871    DoeLog(2) && (eLog()<< Verbose(2) << "Given vectors are linear dependent." << endl);
    802872    return false;
    803873  }
     
    833903  Zero();
    834904  if ((fabs(x1.Norm()) < MYEPSILON) || (fabs(x2.Norm()) < MYEPSILON) || (fabs(x1.Angle(&x2)) < MYEPSILON)) {
    835     eLog() << Verbose(2) << "Given vectors are linear dependent." << endl;
     905    DoeLog(2) && (eLog()<< Verbose(2) << "Given vectors are linear dependent." << endl);
    836906    return false;
    837907  }
     
    884954  double norm;
    885955
    886   Log() << Verbose(4);
     956  DoLog(4) && (Log() << Verbose(4));
    887957  GivenVector->Output();
    888   Log() << Verbose(0) << endl;
     958  DoLog(0) && (Log() << Verbose(0) << endl);
    889959  for (j=NDIM;j--;)
    890960    Components[j] = -1;
     
    893963    if (fabs(GivenVector->x[j]) > MYEPSILON)
    894964      Components[Last++] = j;
    895   Log() << Verbose(4) << Last << " Components != 0: (" << Components[0] << "," << Components[1] << "," << Components[2] << ")" << endl;
     965  DoLog(4) && (Log() << Verbose(4) << Last << " Components != 0: (" << Components[0] << "," << Components[1] << "," << Components[2] << ")" << endl);
    896966
    897967  switch(Last) {
     
    9431013
    9441014  for (j=0;j<num;j++) {
    945     Log() << Verbose(1) << j << "th atom's vector: ";
     1015    DoLog(1) && (Log() << Verbose(1) << j << "th atom's vector: ");
    9461016    (vectors[j])->Output();
    947     Log() << Verbose(0) << endl;
     1017    DoLog(0) && (Log() << Verbose(0) << endl);
    9481018  }
    9491019
     
    10651135    j += i+1;
    10661136    do {
    1067       Log() << Verbose(0) << coords[i] << "[0.." << cell_size[j] << "]: ";
     1137      DoLog(0) && (Log() << Verbose(0) << coords[i] << "[0.." << cell_size[j] << "]: ");
    10681138      cin >> x[i];
    10691139    } while (((x[i] < 0) || (x[i] >= cell_size[j])) && (check));
     
    10961166  B2 = cos(beta) * x2->Norm() * c;
    10971167  C = c * c;
    1098   Log() << Verbose(2) << "A " << A << "\tB " << B1 << "\tC " << C << endl;
     1168  DoLog(2) && (Log() << Verbose(2) << "A " << A << "\tB " << B1 << "\tC " << C << endl);
    10991169  int flag = 0;
    11001170  if (fabs(x1->x[0]) < MYEPSILON) { // check for zero components for the later flipping and back-flipping
     
    11351205  D2 = -y->x[0]/x1->x[0]*x1->x[2]+y->x[2];
    11361206  D3 = y->x[0]/x1->x[0]*A-B1;
    1137   Log() << Verbose(2) << "D1 " << D1 << "\tD2 " << D2 << "\tD3 " << D3 << "\n";
     1207  DoLog(2) && (Log() << Verbose(2) << "D1 " << D1 << "\tD2 " << D2 << "\tD3 " << D3 << "\n");
    11381208  if (fabs(D1) < MYEPSILON) {
    1139     Log() << Verbose(2) << "D1 == 0!\n";
     1209    DoLog(2) && (Log() << Verbose(2) << "D1 == 0!\n");
    11401210    if (fabs(D2) > MYEPSILON) {
    1141       Log() << Verbose(3) << "D2 != 0!\n";
     1211      DoLog(3) && (Log() << Verbose(3) << "D2 != 0!\n");
    11421212      x[2] = -D3/D2;
    11431213      E1 = A/x1->x[0] + x1->x[2]/x1->x[0]*D3/D2;
    11441214      E2 = -x1->x[1]/x1->x[0];
    1145       Log() << Verbose(3) << "E1 " << E1 << "\tE2 " << E2 << "\n";
     1215      DoLog(3) && (Log() << Verbose(3) << "E1 " << E1 << "\tE2 " << E2 << "\n");
    11461216      F1 = E1*E1 + 1.;
    11471217      F2 = -E1*E2;
    11481218      F3 = E1*E1 + D3*D3/(D2*D2) - C;
    1149       Log() << Verbose(3) << "F1 " << F1 << "\tF2 " << F2 << "\tF3 " << F3 << "\n";
     1219      DoLog(3) && (Log() << Verbose(3) << "F1 " << F1 << "\tF2 " << F2 << "\tF3 " << F3 << "\n");
    11501220      if (fabs(F1) < MYEPSILON) {
    1151         Log() << Verbose(4) << "F1 == 0!\n";
    1152         Log() << Verbose(4) << "Gleichungssystem linear\n";
     1221        DoLog(4) && (Log() << Verbose(4) << "F1 == 0!\n");
     1222        DoLog(4) && (Log() << Verbose(4) << "Gleichungssystem linear\n");
    11531223        x[1] = F3/(2.*F2);
    11541224      } else {
    11551225        p = F2/F1;
    11561226        q = p*p - F3/F1;
    1157         Log() << Verbose(4) << "p " << p << "\tq " << q << endl;
     1227        DoLog(4) && (Log() << Verbose(4) << "p " << p << "\tq " << q << endl);
    11581228        if (q < 0) {
    1159           Log() << Verbose(4) << "q < 0" << endl;
     1229          DoLog(4) && (Log() << Verbose(4) << "q < 0" << endl);
    11601230          return false;
    11611231        }
     
    11641234      x[0] =  A/x1->x[0] - x1->x[1]/x1->x[0]*x[1] + x1->x[2]/x1->x[0]*x[2];
    11651235    } else {
    1166       Log() << Verbose(2) << "Gleichungssystem unterbestimmt\n";
     1236      DoLog(2) && (Log() << Verbose(2) << "Gleichungssystem unterbestimmt\n");
    11671237      return false;
    11681238    }
     
    11701240    E1 = A/x1->x[0]+x1->x[1]/x1->x[0]*D3/D1;
    11711241    E2 = x1->x[1]/x1->x[0]*D2/D1 - x1->x[2];
    1172     Log() << Verbose(2) << "E1 " << E1 << "\tE2 " << E2 << "\n";
     1242    DoLog(2) && (Log() << Verbose(2) << "E1 " << E1 << "\tE2 " << E2 << "\n");
    11731243    F1 = E2*E2 + D2*D2/(D1*D1) + 1.;
    11741244    F2 = -(E1*E2 + D2*D3/(D1*D1));
    11751245    F3 = E1*E1 + D3*D3/(D1*D1) - C;
    1176     Log() << Verbose(2) << "F1 " << F1 << "\tF2 " << F2 << "\tF3 " << F3 << "\n";
     1246    DoLog(2) && (Log() << Verbose(2) << "F1 " << F1 << "\tF2 " << F2 << "\tF3 " << F3 << "\n");
    11771247    if (fabs(F1) < MYEPSILON) {
    1178       Log() << Verbose(3) << "F1 == 0!\n";
    1179       Log() << Verbose(3) << "Gleichungssystem linear\n";
     1248      DoLog(3) && (Log() << Verbose(3) << "F1 == 0!\n");
     1249      DoLog(3) && (Log() << Verbose(3) << "Gleichungssystem linear\n");
    11801250      x[2] = F3/(2.*F2);
    11811251    } else {
    11821252      p = F2/F1;
    11831253      q = p*p - F3/F1;
    1184       Log() << Verbose(3) << "p " << p << "\tq " << q << endl;
     1254      DoLog(3) && (Log() << Verbose(3) << "p " << p << "\tq " << q << endl);
    11851255      if (q < 0) {
    1186         Log() << Verbose(3) << "q < 0" << endl;
     1256        DoLog(3) && (Log() << Verbose(3) << "q < 0" << endl);
    11871257        return false;
    11881258      }
     
    12221292    for (j=2;j>=0;j--) {
    12231293      k = (i & pot(2,j)) << j;
    1224       Log() << Verbose(2) << "k " << k << "\tpot(2,j) " << pot(2,j) << endl;
     1294      DoLog(2) && (Log() << Verbose(2) << "k " << k << "\tpot(2,j) " << pot(2,j) << endl);
    12251295      sign[j] = (k == 0) ? 1. : -1.;
    12261296    }
    1227     Log() << Verbose(2) << i << ": sign matrix is " << sign[0] << "\t" << sign[1] << "\t" << sign[2] << "\n";
     1297    DoLog(2) && (Log() << Verbose(2) << i << ": sign matrix is " << sign[0] << "\t" << sign[1] << "\t" << sign[2] << "\n");
    12281298    // apply sign matrix
    12291299    for (j=NDIM;j--;)
     
    12311301    // calculate angle and check
    12321302    ang = x2->Angle (this);
    1233     Log() << Verbose(1) << i << "th angle " << ang << "\tbeta " << cos(beta) << " :\t";
     1303    DoLog(1) && (Log() << Verbose(1) << i << "th angle " << ang << "\tbeta " << cos(beta) << " :\t");
    12341304    if (fabs(ang - cos(beta)) < MYEPSILON) {
    12351305      break;
Note: See TracChangeset for help on using the changeset viewer.