Browse Source

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

master
tirons 8 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
 
319
 
320
         Complex ksum = kvals.sum();     // Kernel sum
320
         Complex ksum = kvals.sum();     // Kernel sum
321
         // Evaluate whether or not furthur splitting is needed
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
             // Not a leaf dive further in
323
             // Not a leaf dive further in
324
             for (int ichild=0; ichild<8; ++ichild) {
324
             for (int ichild=0; ichild<8; ++ichild) {
325
                 Vector3r cp = pos; // Eigen complains about combining these
325
                 Vector3r cp = pos; // Eigen complains about combining these
399
 
399
 
400
         Complex ksum = kvals.sum();     // Kernel sum
400
         Complex ksum = kvals.sum();     // Kernel sum
401
         // Evaluate whether or not furthur splitting is needed
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
             oct->SubdivideLeaf(curse);
403
             oct->SubdivideLeaf(curse);
404
             for (int ichild=0; ichild<8; ++ichild) {
404
             for (int ichild=0; ichild<8; ++ichild) {
405
                 curse->ToChild(ichild);
405
                 curse->ToChild(ichild);

+ 2
- 2
src/KernelV0.cpp View File

400
 
400
 
401
         VectorXcr ksum = kvals.colwise().sum();     // Kernel sum
401
         VectorXcr ksum = kvals.colwise().sum();     // Kernel sum
402
         // Evaluate whether or not furthur splitting is needed
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
             // Not a leaf dive further in
404
             // Not a leaf dive further in
405
             for (int ichild=0; ichild<8; ++ichild) {
405
             for (int ichild=0; ichild<8; ++ichild) {
406
                 Vector3r cp = pos; // Eigen complains about combining these
406
                 Vector3r cp = pos; // Eigen complains about combining these
480
 
480
 
481
         VectorXcr ksum = kvals.colwise().sum();     // Kernel sum
481
         VectorXcr ksum = kvals.colwise().sum();     // Kernel sum
482
         // Evaluate whether or not furthur splitting is needed
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
             oct->SubdivideLeaf(curse);
484
             oct->SubdivideLeaf(curse);
485
             for (int ichild=0; ichild<8; ++ichild) {
485
             for (int ichild=0; ichild<8; ++ichild) {
486
                 curse->ToChild(ichild);
486
                 curse->ToChild(ichild);

Loading…
Cancel
Save