From: wolf Date: Thu, 17 May 2001 13:23:54 +0000 (+0000) Subject: Simplify the kludge with member templates etc. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1df217c8745a9f3b18ef3f5eb2002b5cc476fe27;p=dealii-svn.git Simplify the kludge with member templates etc. git-svn-id: https://svn.dealii.org/trunk@4644 0785d39b-7218-0410-832d-ea1e28bc413d --- 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