From ceae788e953b65321df27c4dee03a6c278edd5cd Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Thu, 17 May 2001 13:23:54 +0000 Subject: [PATCH] Simplify the kludge with member templates etc. git-svn-id: https://svn.dealii.org/trunk@4644 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/deal.II/source/numerics/histogram.cc | 125 ++++++++----------- 1 file changed, 55 insertions(+), 70 deletions(-) diff --git a/deal.II/deal.II/source/numerics/histogram.cc b/deal.II/deal.II/source/numerics/histogram.cc index fa6f7a0337..510153d01b 100644 --- a/deal.II/deal.II/source/numerics/histogram.cc +++ b/deal.II/deal.II/source/numerics/histogram.cc @@ -70,82 +70,67 @@ void Histogram::evaluate (const typename std::vector > &values, switch (interval_spacing) { case linear: - min_value = *std::min_element(values[0].begin(), - values[0].end()); - max_value = *std::max_element(values[0].begin(), - values[0].end()); - - for (unsigned int i=1; i -#else - &Histogram::template logarithmic_less -#endif - ); - - max_value = *std::max_element(values[0].begin(), - values[0].end(), -#if (__GNUC__-0==2) && (__GNUC_MINOR__-0 < 95) - &logarithmic_less -#else - &Histogram::template logarithmic_less -#endif - ); - - - for (unsigned int i=1; i -#else - &Histogram::template logarithmic_less -#endif - ), - -#if (__GNUC__-0==2) && (__GNUC_MINOR__-0 < 95) - &logarithmic_less -#else - &Histogram::template logarithmic_less -#endif - ); - - max_value = std::max (max_value, - *std::max_element(values[i].begin(), - values[i].end(), -#if (__GNUC__-0==2) && (__GNUC_MINOR__-0 < 95) - &logarithmic_less + { + typedef bool (*comparator) (const number, const number); + const comparator logarithmic_less_function + = +#ifdef __GNU_CC +#if (__GNUC__==2) && (__GNUC_MINOR__ < 95) + &logarithmic_less #else - &Histogram::template logarithmic_less + &Histogram::template logarithmic_less #endif - ), - -#if (__GNUC__-0==2) && (__GNUC_MINOR__-0 < 95) - &logarithmic_less #else - &Histogram::template logarithmic_less + &Histogram::template logarithmic_less #endif - ); - }; + ; + + min_value = *std::min_element(values[0].begin(), + values[0].end(), + logarithmic_less_function); + + max_value = *std::max_element(values[0].begin(), + values[0].end(), + logarithmic_less_function); + + for (unsigned int i=1; i