Browse Source

Fixes in logic for splitting at min and max level for better readability (clang warning)

master
tirons 7 years ago
parent
commit
ec83617640
2 changed files with 4 additions and 4 deletions
  1. 2
    2
      src/Coupling.cpp
  2. 2
    2
      src/KernelV0.cpp

+ 2
- 2
src/Coupling.cpp View File

@@ -319,7 +319,7 @@ namespace Lemma {
319 319
 
320 320
         Complex ksum = kvals.sum();     // Kernel sum
321 321
         // Evaluate whether or not furthur splitting is needed
322
-        if ( std::abs(ksum-parentVal) > tol || level < minLevel && level < maxLevel ) {
322
+        if ( (std::abs(ksum-parentVal) > tol && level < maxLevel) || level < minLevel ) {
323 323
             // Not a leaf dive further in
324 324
             for (int ichild=0; ichild<8; ++ichild) {
325 325
                 Vector3r cp = pos; // Eigen complains about combining these
@@ -399,7 +399,7 @@ namespace Lemma {
399 399
 
400 400
         Complex ksum = kvals.sum();     // Kernel sum
401 401
         // Evaluate whether or not furthur splitting is needed
402
-        if ( std::abs(ksum-parentVal) > tol || level < minLevel && level < maxLevel ) {
402
+        if ( (std::abs(ksum-parentVal) > tol && level < maxLevel) || level < minLevel ) {
403 403
             oct->SubdivideLeaf(curse);
404 404
             for (int ichild=0; ichild<8; ++ichild) {
405 405
                 curse->ToChild(ichild);

+ 2
- 2
src/KernelV0.cpp View File

@@ -400,7 +400,7 @@ namespace Lemma {
400 400
 
401 401
         VectorXcr ksum = kvals.colwise().sum();     // Kernel sum
402 402
         // Evaluate whether or not furthur splitting is needed
403
-        if ( ((ksum - parentVal).array().abs() > tol).any() || level < minLevel && level < maxLevel ) {
403
+        if ( (((ksum - parentVal).array().abs() > tol).any() && level<maxLevel) || level < minLevel ) {
404 404
             // Not a leaf dive further in
405 405
             for (int ichild=0; ichild<8; ++ichild) {
406 406
                 Vector3r cp = pos; // Eigen complains about combining these
@@ -480,7 +480,7 @@ namespace Lemma {
480 480
 
481 481
         VectorXcr ksum = kvals.colwise().sum();     // Kernel sum
482 482
         // Evaluate whether or not furthur splitting is needed
483
-        if ( ((ksum - parentVal).array().abs() > tol).any() || level < minLevel && level < maxLevel ) {
483
+        if ( (((ksum - parentVal).array().abs() > tol).any() && level<maxLevel) || level < minLevel ) {
484 484
             oct->SubdivideLeaf(curse);
485 485
             for (int ichild=0; ichild<8; ++ichild) {
486 486
                 curse->ToChild(ichild);

Loading…
Cancel
Save