diff --git a/stuff/logging.hh b/stuff/logging.hh index 7e01b575a1bacb9f4041f6992d155913473e6f8b..7420393eff5b213e3ae8d96b2fe7e99e67c05101 100644 --- a/stuff/logging.hh +++ b/stuff/logging.hh @@ -10,7 +10,7 @@ #include <sstream> #include <ctime> #include <iomanip> -#include "misc.hh" +#include <assert.h> #include "parametercontainer.hh" diff --git a/stuff/misc.hh b/stuff/misc.hh index 910a88e7d63cfa213187e61643a003c1a449115a..690a8c0fb3e191c15ba8b158bec6dbe1ec8fb299 100644 --- a/stuff/misc.hh +++ b/stuff/misc.hh @@ -2,15 +2,20 @@ * \file stuff.hh * \brief contains some stuff **/ -#ifndef STUFF_HH_INCLUDED -#define STUFF_HH_INCLUDED +#ifndef STUFF_MISC_HH_INCLUDED +#define STUFF_MISC_HH_INCLUDED #define SEGFAULT \ { \ int* J = 0; \ *J = 9; \ } -#define isnan(x) !(x == x) + +template <typename T> +bool isnan(T x) +{ + return !(x == x); +} #ifndef NDEBUG #ifndef LOGIC_ERROR @@ -27,8 +32,10 @@ #define LOGIC_ERROR #endif -#include <iomanip> +#include <fstream> +#include <ostream> #include <vector> +#include <assert.h> #include <cmath> namespace Stuff { @@ -102,7 +109,7 @@ public: { current_h_ = info_.grid_width; double factor = prevh_ / current_h_; - double eoc = log(prevError_ / error_) / log(factor); + double eoc = std::log(prevError_ / error_) / log(factor); outputFile_ << " & " << error_ << " & " << eoc; } diff --git a/stuff/printing.hh b/stuff/printing.hh index de10c98491dbcf54919b275b65ae06667c51318b..7392171a2c7f18193f77ea6ae43ceb7abd19a8c9 100644 --- a/stuff/printing.hh +++ b/stuff/printing.hh @@ -1,6 +1,10 @@ #ifndef DUNESTUFF_PRINTING_HH_INCLUDED #define DUNESTUFF_PRINTING_HH_INCLUDED +#include <string> +#include <iostream> +#include <iomanip> + namespace Stuff { /**