Index: src/vector.cpp
===================================================================
--- src/vector.cpp	(revision bc84ffc76ba4d3b32c0699d8504d57183a64c18f)
+++ src/vector.cpp	(revision a67d19a01c3b0bbb8bd6d255ed9a4ffbe37f3138)
@@ -253,9 +253,9 @@
   Direction.SubtractVector(Origin);
   Direction.Normalize();
-  Log() << Verbose(1) << "INFO: Direction is " << Direction << "." << endl;
+  DoLog(1) && (Log() << Verbose(1) << "INFO: Direction is " << Direction << "." << endl);
   //Log() << Verbose(1) << "INFO: PlaneNormal is " << *PlaneNormal << " and PlaneOffset is " << *PlaneOffset << "." << endl;
   factor = Direction.ScalarProduct(PlaneNormal);
   if (fabs(factor) < MYEPSILON) { // Uniqueness: line parallel to plane?
-    Log() << Verbose(1) << "BAD: Line is parallel to plane, no intersection." << endl;
+    DoLog(1) && (Log() << Verbose(1) << "BAD: Line is parallel to plane, no intersection." << endl);
     return false;
   }
@@ -264,5 +264,5 @@
   factor = helper.ScalarProduct(PlaneNormal)/factor;
   if (fabs(factor) < MYEPSILON) { // Origin is in-plane
-    Log() << Verbose(1) << "GOOD: Origin of line is in-plane." << endl;
+    DoLog(1) && (Log() << Verbose(1) << "GOOD: Origin of line is in-plane." << endl);
     CopyVector(Origin);
     return true;
@@ -271,5 +271,5 @@
   Direction.Scale(factor);
   CopyVector(Origin);
-  Log() << Verbose(1) << "INFO: Scaled direction is " << Direction << "." << endl;
+  DoLog(1) && (Log() << Verbose(1) << "INFO: Scaled direction is " << Direction << "." << endl);
   AddVector(&Direction);
 
@@ -278,5 +278,5 @@
   helper.SubtractVector(PlaneOffset);
   if (helper.ScalarProduct(PlaneNormal) < MYEPSILON) {
-    Log() << Verbose(1) << "GOOD: Intersection is " << *this << "." << endl;
+    DoLog(1) && (Log() << Verbose(1) << "GOOD: Intersection is " << *this << "." << endl);
     return true;
   } else {
@@ -359,8 +359,8 @@
   //}
   if (fabs(M->Determinant()) > MYEPSILON) {
-    Log() << Verbose(1) << "Determinant of coefficient matrix is NOT zero." << endl;
+    DoLog(1) && (Log() << Verbose(1) << "Determinant of coefficient matrix is NOT zero." << endl);
     return false;
   }
-  Log() << Verbose(1) << "INFO: Line1a = " << *Line1a << ", Line1b = " << *Line1b << ", Line2a = " << *Line2a << ", Line2b = " << *Line2b << "." << endl;
+  DoLog(1) && (Log() << Verbose(1) << "INFO: Line1a = " << *Line1a << ", Line1b = " << *Line1b << ", Line2a = " << *Line2a << ", Line2b = " << *Line2b << "." << endl);
 
 
@@ -378,8 +378,8 @@
   d.CopyVector(Line2b);
   d.SubtractVector(Line1b);
-  Log() << Verbose(1) << "INFO: a = " << a << ", b = " << b << ", c = " << c << "." << endl;
+  DoLog(1) && (Log() << Verbose(1) << "INFO: a = " << a << ", b = " << b << ", c = " << c << "." << endl);
   if ((a.NormSquared() < MYEPSILON) || (b.NormSquared() < MYEPSILON)) {
    Zero();
-   Log() << Verbose(1) << "At least one of the lines is ill-defined, i.e. offset equals second vector." << endl;
+   DoLog(1) && (Log() << Verbose(1) << "At least one of the lines is ill-defined, i.e. offset equals second vector." << endl);
    return false;
   }
@@ -394,5 +394,5 @@
     if ((factor >= -MYEPSILON) && (factor - 1. < MYEPSILON)) {
       CopyVector(Line2a);
-      Log() << Verbose(1) << "Lines conincide." << endl;
+      DoLog(1) && (Log() << Verbose(1) << "Lines conincide." << endl);
       return true;
     } else {
@@ -402,9 +402,9 @@
       if ((factor >= -MYEPSILON) && (factor - 1. < MYEPSILON)) {
         CopyVector(Line2b);
-        Log() << Verbose(1) << "Lines conincide." << endl;
+        DoLog(1) && (Log() << Verbose(1) << "Lines conincide." << endl);
         return true;
       }
     }
-    Log() << Verbose(1) << "Lines are parallel." << endl;
+    DoLog(1) && (Log() << Verbose(1) << "Lines are parallel." << endl);
     Zero();
     return false;
@@ -418,10 +418,10 @@
   temp2.CopyVector(&a);
   temp2.VectorProduct(&b);
-  Log() << Verbose(1) << "INFO: temp1 = " << temp1 << ", temp2 = " << temp2 << "." << endl;
+  DoLog(1) && (Log() << Verbose(1) << "INFO: temp1 = " << temp1 << ", temp2 = " << temp2 << "." << endl);
   if (fabs(temp2.NormSquared()) > MYEPSILON)
     s = temp1.ScalarProduct(&temp2)/temp2.NormSquared();
   else
     s = 0.;
-  Log() << Verbose(1) << "Factor s is " << temp1.ScalarProduct(&temp2) << "/" << temp2.NormSquared() << " = " << s << "." << endl;
+  DoLog(1) && (Log() << Verbose(1) << "Factor s is " << temp1.ScalarProduct(&temp2) << "/" << temp2.NormSquared() << " = " << s << "." << endl);
 
   // construct intersection
@@ -429,5 +429,5 @@
   Scale(s);
   AddVector(Line1a);
-  Log() << Verbose(1) << "Intersection is at " << *this << "." << endl;
+  DoLog(1) && (Log() << Verbose(1) << "Intersection is at " << *this << "." << endl);
 
   return true;
@@ -702,11 +702,11 @@
 void Vector::Output() const
 {
-  Log() << Verbose(0) << "(";
+  DoLog(0) && (Log() << Verbose(0) << "(");
   for (int i=0;i<NDIM;i++) {
-    Log() << Verbose(0) << x[i];
+    DoLog(0) && (Log() << Verbose(0) << x[i]);
     if (i != 2)
-      Log() << Verbose(0) << ",";
-  }
-  Log() << Verbose(0) << ")";
+      DoLog(0) && (Log() << Verbose(0) << ",");
+  }
+  DoLog(0) && (Log() << Verbose(0) << ")");
 };
 
@@ -843,12 +843,12 @@
   projection = ScalarProduct(n)/n->ScalarProduct(n);    // remove constancy from n (keep as logical one)
   // withdraw projected vector twice from original one
-  Log() << Verbose(1) << "Vector: ";
+  DoLog(1) && (Log() << Verbose(1) << "Vector: ");
   Output();
-  Log() << Verbose(0) << "\t";
+  DoLog(0) && (Log() << Verbose(0) << "\t");
   for (int i=NDIM;i--;)
     x[i] -= 2.*projection*n->x[i];
-  Log() << Verbose(0) << "Projected vector: ";
+  DoLog(0) && (Log() << Verbose(0) << "Projected vector: ");
   Output();
-  Log() << Verbose(0) << endl;
+  DoLog(0) && (Log() << Verbose(0) << endl);
 };
 
@@ -954,7 +954,7 @@
   double norm;
 
-  Log() << Verbose(4);
+  DoLog(4) && (Log() << Verbose(4));
   GivenVector->Output();
-  Log() << Verbose(0) << endl;
+  DoLog(0) && (Log() << Verbose(0) << endl);
   for (j=NDIM;j--;)
     Components[j] = -1;
@@ -963,5 +963,5 @@
     if (fabs(GivenVector->x[j]) > MYEPSILON)
       Components[Last++] = j;
-  Log() << Verbose(4) << Last << " Components != 0: (" << Components[0] << "," << Components[1] << "," << Components[2] << ")" << endl;
+  DoLog(4) && (Log() << Verbose(4) << Last << " Components != 0: (" << Components[0] << "," << Components[1] << "," << Components[2] << ")" << endl);
 
   switch(Last) {
@@ -1013,7 +1013,7 @@
 
   for (j=0;j<num;j++) {
-    Log() << Verbose(1) << j << "th atom's vector: ";
+    DoLog(1) && (Log() << Verbose(1) << j << "th atom's vector: ");
     (vectors[j])->Output();
-    Log() << Verbose(0) << endl;
+    DoLog(0) && (Log() << Verbose(0) << endl);
   }
 
@@ -1135,5 +1135,5 @@
     j += i+1;
     do {
-      Log() << Verbose(0) << coords[i] << "[0.." << cell_size[j] << "]: ";
+      DoLog(0) && (Log() << Verbose(0) << coords[i] << "[0.." << cell_size[j] << "]: ");
       cin >> x[i];
     } while (((x[i] < 0) || (x[i] >= cell_size[j])) && (check));
@@ -1166,5 +1166,5 @@
   B2 = cos(beta) * x2->Norm() * c;
   C = c * c;
-  Log() << Verbose(2) << "A " << A << "\tB " << B1 << "\tC " << C << endl;
+  DoLog(2) && (Log() << Verbose(2) << "A " << A << "\tB " << B1 << "\tC " << C << endl);
   int flag = 0;
   if (fabs(x1->x[0]) < MYEPSILON) { // check for zero components for the later flipping and back-flipping
@@ -1205,27 +1205,27 @@
   D2 = -y->x[0]/x1->x[0]*x1->x[2]+y->x[2];
   D3 = y->x[0]/x1->x[0]*A-B1;
-  Log() << Verbose(2) << "D1 " << D1 << "\tD2 " << D2 << "\tD3 " << D3 << "\n";
+  DoLog(2) && (Log() << Verbose(2) << "D1 " << D1 << "\tD2 " << D2 << "\tD3 " << D3 << "\n");
   if (fabs(D1) < MYEPSILON) {
-    Log() << Verbose(2) << "D1 == 0!\n";
+    DoLog(2) && (Log() << Verbose(2) << "D1 == 0!\n");
     if (fabs(D2) > MYEPSILON) {
-      Log() << Verbose(3) << "D2 != 0!\n";
+      DoLog(3) && (Log() << Verbose(3) << "D2 != 0!\n");
       x[2] = -D3/D2;
       E1 = A/x1->x[0] + x1->x[2]/x1->x[0]*D3/D2;
       E2 = -x1->x[1]/x1->x[0];
-      Log() << Verbose(3) << "E1 " << E1 << "\tE2 " << E2 << "\n";
+      DoLog(3) && (Log() << Verbose(3) << "E1 " << E1 << "\tE2 " << E2 << "\n");
       F1 = E1*E1 + 1.;
       F2 = -E1*E2;
       F3 = E1*E1 + D3*D3/(D2*D2) - C;
-      Log() << Verbose(3) << "F1 " << F1 << "\tF2 " << F2 << "\tF3 " << F3 << "\n";
+      DoLog(3) && (Log() << Verbose(3) << "F1 " << F1 << "\tF2 " << F2 << "\tF3 " << F3 << "\n");
       if (fabs(F1) < MYEPSILON) {
-        Log() << Verbose(4) << "F1 == 0!\n";
-        Log() << Verbose(4) << "Gleichungssystem linear\n";
+        DoLog(4) && (Log() << Verbose(4) << "F1 == 0!\n");
+        DoLog(4) && (Log() << Verbose(4) << "Gleichungssystem linear\n");
         x[1] = F3/(2.*F2);
       } else {
         p = F2/F1;
         q = p*p - F3/F1;
-        Log() << Verbose(4) << "p " << p << "\tq " << q << endl;
+        DoLog(4) && (Log() << Verbose(4) << "p " << p << "\tq " << q << endl);
         if (q < 0) {
-          Log() << Verbose(4) << "q < 0" << endl;
+          DoLog(4) && (Log() << Verbose(4) << "q < 0" << endl);
           return false;
         }
@@ -1234,5 +1234,5 @@
       x[0] =  A/x1->x[0] - x1->x[1]/x1->x[0]*x[1] + x1->x[2]/x1->x[0]*x[2];
     } else {
-      Log() << Verbose(2) << "Gleichungssystem unterbestimmt\n";
+      DoLog(2) && (Log() << Verbose(2) << "Gleichungssystem unterbestimmt\n");
       return false;
     }
@@ -1240,19 +1240,19 @@
     E1 = A/x1->x[0]+x1->x[1]/x1->x[0]*D3/D1;
     E2 = x1->x[1]/x1->x[0]*D2/D1 - x1->x[2];
-    Log() << Verbose(2) << "E1 " << E1 << "\tE2 " << E2 << "\n";
+    DoLog(2) && (Log() << Verbose(2) << "E1 " << E1 << "\tE2 " << E2 << "\n");
     F1 = E2*E2 + D2*D2/(D1*D1) + 1.;
     F2 = -(E1*E2 + D2*D3/(D1*D1));
     F3 = E1*E1 + D3*D3/(D1*D1) - C;
-    Log() << Verbose(2) << "F1 " << F1 << "\tF2 " << F2 << "\tF3 " << F3 << "\n";
+    DoLog(2) && (Log() << Verbose(2) << "F1 " << F1 << "\tF2 " << F2 << "\tF3 " << F3 << "\n");
     if (fabs(F1) < MYEPSILON) {
-      Log() << Verbose(3) << "F1 == 0!\n";
-      Log() << Verbose(3) << "Gleichungssystem linear\n";
+      DoLog(3) && (Log() << Verbose(3) << "F1 == 0!\n");
+      DoLog(3) && (Log() << Verbose(3) << "Gleichungssystem linear\n");
       x[2] = F3/(2.*F2);
     } else {
       p = F2/F1;
       q = p*p - F3/F1;
-      Log() << Verbose(3) << "p " << p << "\tq " << q << endl;
+      DoLog(3) && (Log() << Verbose(3) << "p " << p << "\tq " << q << endl);
       if (q < 0) {
-        Log() << Verbose(3) << "q < 0" << endl;
+        DoLog(3) && (Log() << Verbose(3) << "q < 0" << endl);
         return false;
       }
@@ -1292,8 +1292,8 @@
     for (j=2;j>=0;j--) {
       k = (i & pot(2,j)) << j;
-      Log() << Verbose(2) << "k " << k << "\tpot(2,j) " << pot(2,j) << endl;
+      DoLog(2) && (Log() << Verbose(2) << "k " << k << "\tpot(2,j) " << pot(2,j) << endl);
       sign[j] = (k == 0) ? 1. : -1.;
     }
-    Log() << Verbose(2) << i << ": sign matrix is " << sign[0] << "\t" << sign[1] << "\t" << sign[2] << "\n";
+    DoLog(2) && (Log() << Verbose(2) << i << ": sign matrix is " << sign[0] << "\t" << sign[1] << "\t" << sign[2] << "\n");
     // apply sign matrix
     for (j=NDIM;j--;)
@@ -1301,5 +1301,5 @@
     // calculate angle and check
     ang = x2->Angle (this);
-    Log() << Verbose(1) << i << "th angle " << ang << "\tbeta " << cos(beta) << " :\t";
+    DoLog(1) && (Log() << Verbose(1) << i << "th angle " << ang << "\tbeta " << cos(beta) << " :\t");
     if (fabs(ang - cos(beta)) < MYEPSILON) {
       break;
