From 68f39ddf2186d84194d7b5f8446b4b2f003a6c11 Mon Sep 17 00:00:00 2001 From: eschnett <> Date: Thu, 22 Mar 2001 17:42:00 +0000 Subject: 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 --- Carpet/CarpetLib/src/vect.cc | 38 ++++++++++++++++++++++++++++++++++++-- 1 file changed, 36 insertions(+), 2 deletions(-) (limited to 'Carpet/CarpetLib/src/vect.cc') 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 +#include + #include #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 ostream& operator<< (ostream& os, const vect& a) { os << "["; @@ -40,6 +45,35 @@ ostream& operator<< (ostream& os, const vect& a) { os << "]"; return os; } +#else +ostream& operator<< (ostream& os, const vect& 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& 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& a) { + os << "["; + for (int d=0; d<3; ++d) { + if (d>0) os << ","; + os << a[d]; + } + os << "]"; + return os; +} +#endif -- cgit v1.2.3