diff options
author | eschnett <> | 2001-03-22 17:42:00 +0000 |
---|---|---|
committer | eschnett <> | 2001-03-22 17:42:00 +0000 |
commit | 68f39ddf2186d84194d7b5f8446b4b2f003a6c11 (patch) | |
tree | 5a6ec27e40ef1d942f12ee7ba59fa1f3f3a00913 /Carpet/CarpetLib/src/vect.cc | |
parent | a34f1f5e75afa08c73d09d2d8f614020fac8e951 (diff) |
Brought in latest differences from the SGI version. This is work
Brought in latest differences from the SGI version. This is work
towards a code that compiles on both architectures.
darcs-hash:20010322174200-f6438-23ab5f26cf84d2666312791c6bdb5a0fc1d0390a.gz
Diffstat (limited to 'Carpet/CarpetLib/src/vect.cc')
-rw-r--r-- | Carpet/CarpetLib/src/vect.cc | 38 |
1 files changed, 36 insertions, 2 deletions
diff --git a/Carpet/CarpetLib/src/vect.cc b/Carpet/CarpetLib/src/vect.cc index 6c8d012a2..5a622fd1c 100644 --- a/Carpet/CarpetLib/src/vect.cc +++ b/Carpet/CarpetLib/src/vect.cc @@ -5,7 +5,7 @@ copyright : (C) 2000 by Erik Schnetter email : schnetter@astro.psu.edu - $Header: /home/eschnett/C/carpet/Carpet/Carpet/CarpetLib/src/vect.cc,v 1.2 2001/03/19 21:30:19 eschnett Exp $ + $Header: /home/eschnett/C/carpet/Carpet/Carpet/CarpetLib/src/vect.cc,v 1.3 2001/03/22 18:42:06 eschnett Exp $ ***************************************************************************/ @@ -18,7 +18,8 @@ * * ***************************************************************************/ -#include <cassert> +#include <assert.h> + #include <iostream> #include "defs.hh" @@ -27,9 +28,13 @@ # include "vect.hh" #endif +using namespace std; + // Output +#ifndef SGI +// This doesn't work on SGIs. Is this legal C++? template<class T,int D> ostream& operator<< (ostream& os, const vect<T,D>& a) { os << "["; @@ -40,6 +45,35 @@ ostream& operator<< (ostream& os, const vect<T,D>& a) { os << "]"; return os; } +#else +ostream& operator<< (ostream& os, const vect<int,1>& a) { + os << "["; + for (int d=0; d<1; ++d) { + if (d>0) os << ","; + os << a[d]; + } + os << "]"; + return os; +} +ostream& operator<< (ostream& os, const vect<int,2>& a) { + os << "["; + for (int d=0; d<2; ++d) { + if (d>0) os << ","; + os << a[d]; + } + os << "]"; + return os; +} +ostream& operator<< (ostream& os, const vect<int,3>& a) { + os << "["; + for (int d=0; d<3; ++d) { + if (d>0) os << ","; + os << a[d]; + } + os << "]"; + return os; +} +#endif |