From 3cdb1bbb87a1de1220485e6d52ae271da8dbfd72 Mon Sep 17 00:00:00 2001 From: Adam G Nelson Date: Fri, 15 Jun 2018 20:39:57 -0400 Subject: [PATCH] Whew, there we go. Fixed. --- src/mgxs.h | 1 - src/scattdata.cpp | 60 +++++++++++++++++++++++++++++++++-------------- src/xsdata.h | 4 ---- 3 files changed, 42 insertions(+), 23 deletions(-) diff --git a/src/mgxs.h b/src/mgxs.h index 1c98417d6..d7b9a814a 100644 --- a/src/mgxs.h +++ b/src/mgxs.h @@ -10,7 +10,6 @@ #include #include #include -#include #include "constants.h" #include "hdf5_interface.h" diff --git a/src/scattdata.cpp b/src/scattdata.cpp index 6bce75c64..1e33c07c1 100644 --- a/src/scattdata.cpp +++ b/src/scattdata.cpp @@ -337,16 +337,24 @@ void ScattDataLegendre::combine(std::vector& those_scatts, // Find the minimum and maximum group boundaries int gmin_; for (gmin_ = 0; gmin_ < groups; gmin_++) { - bool non_zero = std::all_of(this_matrix[gin][gmin_].begin(), - this_matrix[gin][gmin_].end(), - [](double val){return val != 0.;}); + bool non_zero = false; + for (int l = 0; l < this_matrix[gin][gmin_].size(); l++) { + if (this_matrix[gin][gmin_][l] != 0.) { + non_zero = true; + break; + } + } if (non_zero) break; } int gmax_; for (gmax_ = groups - 1; gmax_ >= 0; gmax_--) { - bool non_zero = std::all_of(this_matrix[gin][gmax_].begin(), - this_matrix[gin][gmax_].end(), - [](double val){return val != 0.;}); + bool non_zero = false; + for (int l = 0; l < this_matrix[gin][gmax_].size(); l++) { + if (this_matrix[gin][gmax_][l] != 0.) { + non_zero = true; + break; + } + } if (non_zero) break; } @@ -646,16 +654,24 @@ void ScattDataHistogram::combine(std::vector& those_scatts, // Find the minimum and maximum group boundaries int gmin_; for (gmin_ = 0; gmin_ < groups; gmin_++) { - bool non_zero = std::all_of(this_matrix[gin][gmin_].begin(), - this_matrix[gin][gmin_].end(), - [](double val){return val != 0.;}); + bool non_zero = false; + for (int l = 0; l < this_matrix[gin][gmin_].size(); l++) { + if (this_matrix[gin][gmin_][l] != 0.) { + non_zero = true; + break; + } + } if (non_zero) break; } int gmax_; for (gmax_ = groups - 1; gmax_ >= 0; gmax_--) { - bool non_zero = std::all_of(this_matrix[gin][gmax_].begin(), - this_matrix[gin][gmax_].end(), - [](double val){return val != 0.;}); + bool non_zero = false; + for (int l = 0; l < this_matrix[gin][gmax_].size(); l++) { + if (this_matrix[gin][gmax_][l] != 0.) { + non_zero = true; + break; + } + } if (non_zero) break; } @@ -956,16 +972,24 @@ void ScattDataTabular::combine(std::vector& those_scatts, // Find the minimum and maximum group boundaries int gmin_; for (gmin_ = 0; gmin_ < groups; gmin_++) { - bool non_zero = std::all_of(this_matrix[gin][gmin_].begin(), - this_matrix[gin][gmin_].end(), - [](double val){return val != 0.;}); + bool non_zero = false; + for (int l = 0; l < this_matrix[gin][gmin_].size(); l++) { + if (this_matrix[gin][gmin_][l] != 0.) { + non_zero = true; + break; + } + } if (non_zero) break; } int gmax_; for (gmax_ = groups - 1; gmax_ >= 0; gmax_--) { - bool non_zero = std::all_of(this_matrix[gin][gmax_].begin(), - this_matrix[gin][gmax_].end(), - [](double val){return val != 0.;}); + bool non_zero = false; + for (int l = 0; l < this_matrix[gin][gmax_].size(); l++) { + if (this_matrix[gin][gmax_][l] != 0.) { + non_zero = true; + break; + } + } if (non_zero) break; } diff --git a/src/xsdata.h b/src/xsdata.h index 478f2e7aa..3d6f1f7bb 100644 --- a/src/xsdata.h +++ b/src/xsdata.h @@ -7,11 +7,7 @@ #include #include #include -#include -#include -#include #include -#include #include "constants.h" #include "hdf5_interface.h"