/*************************************************************************** defs.hh - Commonly used definitions ------------------- begin : Sun Jun 11 2000 copyright : (C) 2000 by Erik Schnetter email : schnetter@astro.psu.edu $Header: /home/eschnett/C/carpet/Carpet/Carpet/CarpetLib/src/defs.hh,v 1.5 2001/03/27 22:26:31 eschnett Exp $ ***************************************************************************/ /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ #ifndef DEFS_HH #define DEFS_HH #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include using namespace std; // Stringification #define STR(s) #s // Fortranification #define FORTRAN_NAME(x) x##_ // A general type enum centering { vertex_centered, cell_centered }; // Useful helper template inline T square (const T& x) { return x*x; } // Container output template ostream& output (ostream& os, const list& l); template ostream& output (ostream& os, const set& s); template ostream& output (ostream& os, const vector& v); template inline ostream& operator<< (ostream& os, const list& l) { return output(os,l); } template inline ostream& operator<< (ostream& os, const set& s) { return output(os,s); } template inline ostream& operator<< (ostream& os, const vector& v) { return output(os,v); } #if defined(TMPL_IMPLICIT) # include "defs.cc" #endif #endif // DEFS_HH