Changes in src/vector.cpp [717e0c:a67d19]
- File:
-
- 1 edited
-
src/vector.cpp (modified) (25 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/vector.cpp
r717e0c ra67d19 8 8 #include "defs.hpp" 9 9 #include "helpers.hpp" 10 #include "memoryallocator.hpp" 10 #include "info.hpp" 11 #include "gslmatrix.hpp" 11 12 #include "leastsquaremin.hpp" 12 13 #include "log.hpp" 14 #include "memoryallocator.hpp" 13 15 #include "vector.hpp" 14 16 #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> 15 23 16 24 /************************************ Functions for class vector ************************************/ … … 19 27 */ 20 28 Vector::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 }; 21 47 22 48 /** Constructor of class vector. … … 215 241 * \param *Origin first vector of line 216 242 * \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) 218 244 */ 219 245 bool Vector::GetIntersectionWithPlane(const Vector * const PlaneNormal, const Vector * const PlaneOffset, const Vector * const Origin, const Vector * const LineVector) 220 246 { 247 Info FunctionInfo(__func__); 221 248 double factor; 222 249 Vector Direction, helper; … … 226 253 Direction.SubtractVector(Origin); 227 254 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; 229 257 factor = Direction.ScalarProduct(PlaneNormal); 230 if (fa ctor< 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); 232 260 return false; 233 261 } … … 235 263 helper.SubtractVector(Origin); 236 264 factor = helper.ScalarProduct(PlaneNormal)/factor; 237 if (fa ctor< MYEPSILON) { // Origin is in-plane238 //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); 239 267 CopyVector(Origin); 240 268 return true; … … 243 271 Direction.Scale(factor); 244 272 CopyVector(Origin); 245 //Log() << Verbose(4) << "INFO: Scaled direction is " << Direction << "." << endl;273 DoLog(1) && (Log() << Verbose(1) << "INFO: Scaled direction is " << Direction << "." << endl); 246 274 AddVector(&Direction); 247 275 … … 250 278 helper.SubtractVector(PlaneOffset); 251 279 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); 253 281 return true; 254 282 } 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); 256 284 return false; 257 285 } 258 286 }; 259 287 260 /** Calculates the minimum distance of this vector to the plane.288 /** Calculates the minimum distance vector of this vector to the plane. 261 289 * \param *out output stream for debugging 262 290 * \param *PlaneNormal normal of plane 263 291 * \param *PlaneOffset offset of plane 264 * \return distance to plane265 */ 266 double Vector::DistanceToPlane(const Vector * const PlaneNormal, const Vector * const PlaneOffset) const292 * \return distance vector onto to plane 293 */ 294 Vector Vector::GetDistanceVectorToPlane(const Vector * const PlaneNormal, const Vector * const PlaneOffset) const 267 295 { 268 296 Vector temp; … … 282 310 sign = 0.; 283 311 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 */ 324 double Vector::DistanceToPlane(const Vector * const PlaneNormal, const Vector * const PlaneOffset) const 325 { 326 return GetDistanceVectorToPlane(PlaneNormal,PlaneOffset).Norm(); 285 327 }; 286 328 287 329 /** 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 291 331 * \param *out output stream for debugging 292 332 * \param *Line1a first vector of first line … … 299 339 bool Vector::GetIntersectionOfTwoLinesOnPlane(const Vector * const Line1a, const Vector * const Line1b, const Vector * const Line2a, const Vector * const Line2b, const Vector *PlaneNormal) 300 340 { 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); 314 362 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(); 318 410 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; 377 434 }; 378 435 … … 480 537 else 481 538 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; 482 552 }; 483 553 … … 632 702 void Vector::Output() const 633 703 { 634 Log() << Verbose(0) << "(";704 DoLog(0) && (Log() << Verbose(0) << "("); 635 705 for (int i=0;i<NDIM;i++) { 636 Log() << Verbose(0) << x[i];706 DoLog(0) && (Log() << Verbose(0) << x[i]); 637 707 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) << ")"); 641 711 }; 642 712 … … 747 817 x[i] = C.x[i]; 748 818 } 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); 750 820 } 751 821 }; … … 773 843 projection = ScalarProduct(n)/n->ScalarProduct(n); // remove constancy from n (keep as logical one) 774 844 // withdraw projected vector twice from original one 775 Log() << Verbose(1) << "Vector: ";845 DoLog(1) && (Log() << Verbose(1) << "Vector: "); 776 846 Output(); 777 Log() << Verbose(0) << "\t";847 DoLog(0) && (Log() << Verbose(0) << "\t"); 778 848 for (int i=NDIM;i--;) 779 849 x[i] -= 2.*projection*n->x[i]; 780 Log() << Verbose(0) << "Projected vector: ";850 DoLog(0) && (Log() << Verbose(0) << "Projected vector: "); 781 851 Output(); 782 Log() << Verbose(0) << endl;852 DoLog(0) && (Log() << Verbose(0) << endl); 783 853 }; 784 854 … … 799 869 x2.SubtractVector(y2); 800 870 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); 802 872 return false; 803 873 } … … 833 903 Zero(); 834 904 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); 836 906 return false; 837 907 } … … 884 954 double norm; 885 955 886 Log() << Verbose(4);956 DoLog(4) && (Log() << Verbose(4)); 887 957 GivenVector->Output(); 888 Log() << Verbose(0) << endl;958 DoLog(0) && (Log() << Verbose(0) << endl); 889 959 for (j=NDIM;j--;) 890 960 Components[j] = -1; … … 893 963 if (fabs(GivenVector->x[j]) > MYEPSILON) 894 964 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); 896 966 897 967 switch(Last) { … … 943 1013 944 1014 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: "); 946 1016 (vectors[j])->Output(); 947 Log() << Verbose(0) << endl;1017 DoLog(0) && (Log() << Verbose(0) << endl); 948 1018 } 949 1019 … … 1065 1135 j += i+1; 1066 1136 do { 1067 Log() << Verbose(0) << coords[i] << "[0.." << cell_size[j] << "]: ";1137 DoLog(0) && (Log() << Verbose(0) << coords[i] << "[0.." << cell_size[j] << "]: "); 1068 1138 cin >> x[i]; 1069 1139 } while (((x[i] < 0) || (x[i] >= cell_size[j])) && (check)); … … 1096 1166 B2 = cos(beta) * x2->Norm() * c; 1097 1167 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); 1099 1169 int flag = 0; 1100 1170 if (fabs(x1->x[0]) < MYEPSILON) { // check for zero components for the later flipping and back-flipping … … 1135 1205 D2 = -y->x[0]/x1->x[0]*x1->x[2]+y->x[2]; 1136 1206 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"); 1138 1208 if (fabs(D1) < MYEPSILON) { 1139 Log() << Verbose(2) << "D1 == 0!\n";1209 DoLog(2) && (Log() << Verbose(2) << "D1 == 0!\n"); 1140 1210 if (fabs(D2) > MYEPSILON) { 1141 Log() << Verbose(3) << "D2 != 0!\n";1211 DoLog(3) && (Log() << Verbose(3) << "D2 != 0!\n"); 1142 1212 x[2] = -D3/D2; 1143 1213 E1 = A/x1->x[0] + x1->x[2]/x1->x[0]*D3/D2; 1144 1214 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"); 1146 1216 F1 = E1*E1 + 1.; 1147 1217 F2 = -E1*E2; 1148 1218 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"); 1150 1220 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"); 1153 1223 x[1] = F3/(2.*F2); 1154 1224 } else { 1155 1225 p = F2/F1; 1156 1226 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); 1158 1228 if (q < 0) { 1159 Log() << Verbose(4) << "q < 0" << endl;1229 DoLog(4) && (Log() << Verbose(4) << "q < 0" << endl); 1160 1230 return false; 1161 1231 } … … 1164 1234 x[0] = A/x1->x[0] - x1->x[1]/x1->x[0]*x[1] + x1->x[2]/x1->x[0]*x[2]; 1165 1235 } else { 1166 Log() << Verbose(2) << "Gleichungssystem unterbestimmt\n";1236 DoLog(2) && (Log() << Verbose(2) << "Gleichungssystem unterbestimmt\n"); 1167 1237 return false; 1168 1238 } … … 1170 1240 E1 = A/x1->x[0]+x1->x[1]/x1->x[0]*D3/D1; 1171 1241 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"); 1173 1243 F1 = E2*E2 + D2*D2/(D1*D1) + 1.; 1174 1244 F2 = -(E1*E2 + D2*D3/(D1*D1)); 1175 1245 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"); 1177 1247 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"); 1180 1250 x[2] = F3/(2.*F2); 1181 1251 } else { 1182 1252 p = F2/F1; 1183 1253 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); 1185 1255 if (q < 0) { 1186 Log() << Verbose(3) << "q < 0" << endl;1256 DoLog(3) && (Log() << Verbose(3) << "q < 0" << endl); 1187 1257 return false; 1188 1258 } … … 1222 1292 for (j=2;j>=0;j--) { 1223 1293 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); 1225 1295 sign[j] = (k == 0) ? 1. : -1.; 1226 1296 } 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"); 1228 1298 // apply sign matrix 1229 1299 for (j=NDIM;j--;) … … 1231 1301 // calculate angle and check 1232 1302 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"); 1234 1304 if (fabs(ang - cos(beta)) < MYEPSILON) { 1235 1305 break;
Note:
See TracChangeset
for help on using the changeset viewer.
