diff options
author | eschnett <> | 2001-03-19 20:30:00 +0000 |
---|---|---|
committer | eschnett <> | 2001-03-19 20:30:00 +0000 |
commit | d95a7e6aa1f6025baf3274b6a3363139539cde8d (patch) | |
tree | db7b32593b44e7281aaa7861fc38a1e4029db57f /Carpet/CarpetLib | |
parent | 9bd41bf11a57d74f72445d4e7d9f3361221138dd (diff) |
Removed unnecessary instantiations.
darcs-hash:20010319203019-f6438-339bf469c6734d21a44ecb7475c7d5d05e6b13fd.gz
Diffstat (limited to 'Carpet/CarpetLib')
-rw-r--r-- | Carpet/CarpetLib/src/bboxset.cc | 12 | ||||
-rw-r--r-- | Carpet/CarpetLib/src/data.cc | 4 | ||||
-rw-r--r-- | Carpet/CarpetLib/src/defs.cc | 16 | ||||
-rw-r--r-- | Carpet/CarpetLib/src/dh.cc | 8 | ||||
-rw-r--r-- | Carpet/CarpetLib/src/gdata.cc | 46 | ||||
-rw-r--r-- | Carpet/CarpetLib/src/gf.cc | 4 | ||||
-rw-r--r-- | Carpet/CarpetLib/src/ggf.cc | 10 | ||||
-rw-r--r-- | Carpet/CarpetLib/src/gh.cc | 8 | ||||
-rw-r--r-- | Carpet/CarpetLib/src/instantiate | 130 | ||||
-rw-r--r-- | Carpet/CarpetLib/src/th.cc | 8 | ||||
-rw-r--r-- | Carpet/CarpetLib/src/vect.cc | 8 |
11 files changed, 149 insertions, 105 deletions
diff --git a/Carpet/CarpetLib/src/bboxset.cc b/Carpet/CarpetLib/src/bboxset.cc index 0e3a08e3d..489856298 100644 --- a/Carpet/CarpetLib/src/bboxset.cc +++ b/Carpet/CarpetLib/src/bboxset.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/bboxset.cc,v 1.3 2001/03/12 16:54:25 eschnett Exp $ + $Header: /home/eschnett/C/carpet/Carpet/Carpet/CarpetLib/src/bboxset.cc,v 1.4 2001/03/19 21:30:19 eschnett Exp $ ***************************************************************************/ @@ -302,16 +302,6 @@ ostream& operator<< (ostream& os, const bboxset<T,D>& s) { #if defined(TMPL_EXPLICIT) -template class bboxset<int,1>; -template bboxset<int,1> operator- (const bbox<int,1>& b1, const bbox<int,1>& b2); -template bboxset<int,1> operator- (const bbox<int,1>& b, const bboxset<int,1>& s); -template ostream& operator<< (ostream& os, const bboxset<int,1>& b); - -template class bboxset<int,2>; -template bboxset<int,2> operator- (const bbox<int,2>& b1, const bbox<int,2>& b2); -template bboxset<int,2> operator- (const bbox<int,2>& b, const bboxset<int,2>& s); -template ostream& operator<< (ostream& os, const bboxset<int,2>& b); - template class bboxset<int,3>; template bboxset<int,3> operator- (const bbox<int,3>& b1, const bbox<int,3>& b3); template bboxset<int,3> operator- (const bbox<int,3>& b, const bboxset<int,3>& s); diff --git a/Carpet/CarpetLib/src/data.cc b/Carpet/CarpetLib/src/data.cc index 449aa7401..932b692e6 100644 --- a/Carpet/CarpetLib/src/data.cc +++ b/Carpet/CarpetLib/src/data.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/data.cc,v 1.6 2001/03/17 00:35:52 eschnett Exp $ + $Header: /home/eschnett/C/carpet/Carpet/Carpet/CarpetLib/src/data.cc,v 1.7 2001/03/19 21:30:19 eschnett Exp $ ***************************************************************************/ @@ -361,8 +361,6 @@ ostream& data<T,D>::out (ostream& os) const { #if defined(TMPL_EXPLICIT) #define INSTANTIATE(T) \ -template data<T,1>; \ -template data<T,2>; \ template data<T,3>; #include "instantiate" diff --git a/Carpet/CarpetLib/src/defs.cc b/Carpet/CarpetLib/src/defs.cc index 94315703d..bbfdf990a 100644 --- a/Carpet/CarpetLib/src/defs.cc +++ b/Carpet/CarpetLib/src/defs.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/defs.cc,v 1.1 2001/03/01 13:40:10 eschnett Exp $ + $Header: /home/eschnett/C/carpet/Carpet/Carpet/CarpetLib/src/defs.cc,v 1.2 2001/03/19 21:30:19 eschnett Exp $ ***************************************************************************/ @@ -73,20 +73,6 @@ ostream& operator<< (ostream& os, const vector<T>& v) { #include "bbox.hh" #include "bboxset.hh" -template ostream& operator<< (ostream& os, const list<bbox<int,1> >& l); -template ostream& operator<< (ostream& os, const set<bbox<int,1> >& s); -template ostream& operator<< (ostream& os, const set<bboxset<int,1> >& s); -template ostream& operator<< (ostream& os, const vector<list<bbox<int,1> > >& v); -template ostream& operator<< (ostream& os, const vector<vector<bbox<int,1> > >& v); -template ostream& operator<< (ostream& os, const vector<vector<vector<bbox<int,1> > > >& v); - -template ostream& operator<< (ostream& os, const list<bbox<int,2> >& l); -template ostream& operator<< (ostream& os, const set<bbox<int,2> >& s); -template ostream& operator<< (ostream& os, const set<bboxset<int,2> >& s); -template ostream& operator<< (ostream& os, const vector<list<bbox<int,2> > >& v); -template ostream& operator<< (ostream& os, const vector<vector<bbox<int,2> > >& v); -template ostream& operator<< (ostream& os, const vector<vector<vector<bbox<int,2> > > >& v); - template ostream& operator<< (ostream& os, const list<bbox<int,3> >& l); template ostream& operator<< (ostream& os, const set<bbox<int,3> >& s); template ostream& operator<< (ostream& os, const set<bboxset<int,3> >& s); diff --git a/Carpet/CarpetLib/src/dh.cc b/Carpet/CarpetLib/src/dh.cc index 573e9b426..09962b96d 100644 --- a/Carpet/CarpetLib/src/dh.cc +++ b/Carpet/CarpetLib/src/dh.cc @@ -6,7 +6,7 @@ copyright : (C) 2000 by Erik Schnetter email : schnetter@astro.psu.edu - $Header: /home/eschnett/C/carpet/Carpet/Carpet/CarpetLib/src/dh.cc,v 1.8 2001/03/16 21:32:17 eschnett Exp $ + $Header: /home/eschnett/C/carpet/Carpet/Carpet/CarpetLib/src/dh.cc,v 1.9 2001/03/19 21:30:19 eschnett Exp $ ***************************************************************************/ @@ -336,12 +336,6 @@ ostream& operator<< (ostream& os, const dh<D>& d) { #if defined(TMPL_EXPLICIT) -template class dh<1>; -template ostream& operator<< (ostream& os, const dh<1>& d); - -template class dh<2>; -template ostream& operator<< (ostream& os, const dh<2>& d); - template class dh<3>; template ostream& operator<< (ostream& os, const dh<3>& d); #endif diff --git a/Carpet/CarpetLib/src/gdata.cc b/Carpet/CarpetLib/src/gdata.cc index 40a6338cf..eb19701ce 100644 --- a/Carpet/CarpetLib/src/gdata.cc +++ b/Carpet/CarpetLib/src/gdata.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/gdata.cc,v 1.7 2001/03/16 21:32:17 eschnett Exp $ + $Header: /home/eschnett/C/carpet/Carpet/Carpet/CarpetLib/src/gdata.cc,v 1.8 2001/03/19 21:30:19 eschnett Exp $ ***************************************************************************/ @@ -136,39 +136,19 @@ ostream& operator<< (ostream& os, const generic_data<D>& f) { #if defined(TMPL_EXPLICIT) -template class generic_data<1>; -template ostream& operator<< (ostream& os, const generic_data<1>& d); - -template class generic_data<2>; -template ostream& operator<< (ostream& os, const generic_data<2>& d); - template class generic_data<3>; template ostream& operator<< (ostream& os, const generic_data<3>& d); -template void generic_data<1>::write_ascii -(const string name, const int time, - const vect<int,1>& org, const vect<int,1>& dirs, - const int tl, const int rl, const int c, const int ml) const; - -template void generic_data<2>::write_ascii -(const string name, const int time, - const vect<int,2>& org, const vect<int,1>& dirs, - const int tl, const int rl, const int c, const int ml) const; -template void generic_data<2>::write_ascii -(const string name, const int time, - const vect<int,2>& org, const vect<int,2>& dirs, - const int tl, const int rl, const int c, const int ml) const; - -template void generic_data<3>::write_ascii - (const string name, const int time, - const vect<int,3>& org, const vect<int,1>& dirs, - const int tl, const int rl, const int c, const int ml) const; -template void generic_data<3>::write_ascii -(const string name, const int time, - const vect<int,3>& org, const vect<int,2>& dirs, - const int tl, const int rl, const int c, const int ml) const; -template void generic_data<3>::write_ascii -(const string name, const int time, - const vect<int,3>& org, const vect<int,3>& dirs, - const int tl, const int rl, const int c, const int ml) const; +template void generic_data<3> +::write_ascii (const string name, const int time, + const vect<int,3>& org, const vect<int,1>& dirs, + const int tl, const int rl, const int c, const int ml) const; +template void generic_data<3> +::write_ascii (const string name, const int time, + const vect<int,3>& org, const vect<int,2>& dirs, + const int tl, const int rl, const int c, const int ml) const; +template void generic_data<3> +::write_ascii (const string name, const int time, + const vect<int,3>& org, const vect<int,3>& dirs, + const int tl, const int rl, const int c, const int ml) const; #endif diff --git a/Carpet/CarpetLib/src/gf.cc b/Carpet/CarpetLib/src/gf.cc index dcac9fccd..86a2d518d 100644 --- a/Carpet/CarpetLib/src/gf.cc +++ b/Carpet/CarpetLib/src/gf.cc @@ -6,7 +6,7 @@ copyright : (C) 2000 by Erik Schnetter email : schnetter@astro.psu.edu - $Header: /home/eschnett/C/carpet/Carpet/Carpet/CarpetLib/src/gf.cc,v 1.1 2001/03/01 13:40:10 eschnett Exp $ + $Header: /home/eschnett/C/carpet/Carpet/Carpet/CarpetLib/src/gf.cc,v 1.2 2001/03/19 21:30:19 eschnett Exp $ ***************************************************************************/ @@ -78,8 +78,6 @@ ostream& gf<T,D>::out (ostream& os) const { #if defined(TMPL_EXPLICIT) #define INSTANTIATE(T) \ -template class gf<T,1>; \ -template class gf<T,2>; \ template class gf<T,3>; #include "instantiate" diff --git a/Carpet/CarpetLib/src/ggf.cc b/Carpet/CarpetLib/src/ggf.cc index 1d0371ac4..53aa15179 100644 --- a/Carpet/CarpetLib/src/ggf.cc +++ b/Carpet/CarpetLib/src/ggf.cc @@ -6,7 +6,7 @@ copyright : (C) 2000 by Erik Schnetter email : schnetter@astro.psu.edu - $Header: /home/eschnett/C/carpet/Carpet/Carpet/CarpetLib/src/ggf.cc,v 1.4 2001/03/14 11:00:26 eschnett Exp $ + $Header: /home/eschnett/C/carpet/Carpet/Carpet/CarpetLib/src/ggf.cc,v 1.5 2001/03/19 21:30:19 eschnett Exp $ ***************************************************************************/ @@ -139,7 +139,7 @@ void generic_gf<D>::recompose () { for (int c=0; c<h.components(rl); ++c) { for (int ml=0; ml<h.mglevels(rl,c); ++ml) { sync (tl,rl,c,ml); - // TODO: assert than reflevel 0 boundaries are copied + // TODO: assert that reflevel 0 boundaries are copied if (rl>0) { ref_bnd_prolongate (tl,rl,c,ml); } // if rl @@ -418,12 +418,6 @@ ostream& operator<< (ostream& os, const generic_gf<D>& f) { #if defined(TMPL_EXPLICIT) -template class generic_gf<1>; -template ostream& operator<< (ostream& os, const generic_gf<1>& f); - -template class generic_gf<2>; -template ostream& operator<< (ostream& os, const generic_gf<2>& f); - template class generic_gf<3>; template ostream& operator<< (ostream& os, const generic_gf<3>& f); #endif diff --git a/Carpet/CarpetLib/src/gh.cc b/Carpet/CarpetLib/src/gh.cc index 0239111df..b1608b6b7 100644 --- a/Carpet/CarpetLib/src/gh.cc +++ b/Carpet/CarpetLib/src/gh.cc @@ -7,7 +7,7 @@ copyright : (C) 2000 by Erik Schnetter email : schnetter@astro.psu.edu - $Header: /home/eschnett/C/carpet/Carpet/Carpet/CarpetLib/src/gh.cc,v 1.3 2001/03/12 16:54:25 eschnett Exp $ + $Header: /home/eschnett/C/carpet/Carpet/Carpet/CarpetLib/src/gh.cc,v 1.4 2001/03/19 21:30:19 eschnett Exp $ ***************************************************************************/ @@ -247,12 +247,6 @@ ostream& operator<< (ostream& os, const gh<D>& h) { #if defined(TMPL_EXPLICIT) -template class gh<1>; -template ostream& operator<< (ostream& os, const gh<1>& h); - -template class gh<2>; -template ostream& operator<< (ostream& os, const gh<2>& h); - template class gh<3>; template ostream& operator<< (ostream& os, const gh<3>& h); #endif diff --git a/Carpet/CarpetLib/src/instantiate b/Carpet/CarpetLib/src/instantiate index c87c16eeb..aafc645d2 100644 --- a/Carpet/CarpetLib/src/instantiate +++ b/Carpet/CarpetLib/src/instantiate @@ -1,7 +1,7 @@ // Instantiate templates for all available types -*-C++-*- // (C) 2001 Erik Schnetter <schnetter@uni-tuebingen.de> -// $Header: /home/eschnett/C/carpet/Carpet/Carpet/CarpetLib/src/instantiate,v 1.1 2001/03/01 13:40:10 eschnett Exp $ +// $Header: /home/eschnett/C/carpet/Carpet/Carpet/CarpetLib/src/instantiate,v 1.2 2001/03/19 21:30:19 eschnett Exp $ // Usage: // Define the macro INSTANTIATE(T) to instantiate for the type T, @@ -12,22 +12,144 @@ #include "cctk.h" + + +// Decide which types to instantiate + +#ifdef CARPET_ALL +# undef CARPET_BYTE +# undef CARPET_INT +# undef CARPET_REAL +# undef CARPET_COMPLEX +# define CARPET_BYTE +# define CARPET_INT +# define CARPET_REAL +# define CARPET_COMPLEX +#endif + +#ifdef CARPET_ALL_INT +# undef CARPET_INT2 +# undef CARPET_INT4 +# undef CARPET_INT8 +# define CARPET_INT2 +# define CARPET_INT4 +# define CARPET_INT8 +#endif + +#ifdef CARPET_ALL_REAL +# undef CARPET_REAL4 +# undef CARPET_REAL8 +# undef CARPET_REAL16 +# define CARPET_REAL4 +# define CARPET_REAL8 +# define CARPET_REAL16 +#endif + +#ifdef CARPET_ALL_COMPLEX +# undef CARPET_COMPLEX8 +# undef CARPET_COMPLEX16 +# undef CARPET_COMPLEX32 +# define CARPET_COMPLEX8 +# define CARPET_COMPLEX16 +# define CARPET_COMPLEX32 +#endif + +#if !defined(CARPET_BYTE) && !defined(CARPET_INT2) && !defined(CARPET_INT4) && !defined(CARPET_INT8) && !defined(CARPET_REAL4) && !defined(CARPET_REAL8) && !defined(CARPET_REAL16) && !defined(CARPET_COMPLEX8) && !defined(CARPET_COMPLEX16) && !defined(CARPET_COMPLEX32) +// Assume the user just wants REAL +# undef CARPET_REAL +# define CARPET_REAL +#endif + +#ifdef CARPET_INT +# ifdef CCTK_INTEGER_PRECISION_2 +# undef CARPET_INT2 +# define CARPET_INT2 +# endif +# ifdef CCTK_INTEGER_PRECISION_4 +# undef CARPET_INT4 +# define CARPET_INT4 +# endif +# ifdef CCTK_INTEGER_PRECISION_8 +# undef CARPET_INT8 +# define CARPET_INT8 +# endif +#endif +#ifdef CARPET_REAL +# ifdef CCTK_REAL_PRECISION_4 +# undef CARPET_REAL4 +# define CARPET_REAL4 +# endif +# ifdef CCTK_REAL_PRECISION_8 +# undef CARPET_REAL8 +# define CARPET_REAL8 +# endif +# ifdef CCTK_REAL_PRECISION_16 +# undef CARPET_REAL16 +# define CARPET_REAL16 +# endif +#endif +#ifdef CARPET_COMPLEX +# ifdef CCTK_REAL_PRECISION_4 +# undef CARPET_COMPLEX8 +# define CARPET_COMPLEX8 +# endif +# ifdef CCTK_REAL_PRECISION_8 +# undef CARPET_COMPLEX16 +# define CARPET_COMPLEX16 +# endif +# ifdef CCTK_REAL_PRECISION_16 +# undef CARPET_COMPLEX32 +# define CARPET_COMPLEX32 +# endif +#endif + + + +// // Check +// #if !defined(CARPET_BYTE) && !defined(CARPET_INT2) && !defined(CARPET_INT4) && !defined(CARPET_INT8) && !defined(CARPET_REAL4) && !defined(CARPET_REAL8) && !defined(CARPET_REAL16) && !defined(CARPET_COMPLEX8) && !defined(CARPET_COMPLEX16) && !defined(CARPET_COMPLEX32) +// # error "You have not defined which grid function types to instantiate." +// #endif + + + +// Instantiate the desired types + +#ifdef CARPET_BYTE INSTANTIATE(CCTK_BYTE) +#endif +#ifdef CARPET_INT2 INSTANTIATE(CCTK_INT2) +#endif +#ifdef CARPET_INT4 INSTANTIATE(CCTK_INT4) -#ifdef CCTK_INT8 +#endif +#ifdef CARPET_INT8 +# ifdef CCTK_INT8 INSTANTIATE(CCTK_INT8) +# endif #endif +#ifdef CARPET_REAL4 INSTANTIATE(CCTK_REAL4) +#endif +#ifdef CARPET_REAL8 INSTANTIATE(CCTK_REAL8) -#ifdef CCTK_REAL16 +#endif +#ifdef CARPET_REAL16 +# ifdef CCTK_REAL16 INSTANTIATE(CCTK_REAL16) +# endif #endif +#ifdef CARPET_COMPLEX8 INSTANTIATE(complex<CCTK_REAL4>) +#endif +#ifdef CARPET_COMPLEX16 INSTANTIATE(complex<CCTK_REAL8>) -#ifdef CCTK_REAL16 +#endif +#ifdef CARPET_COMPLEX32 +# ifdef CCTK_REAL16 INSTANTIATE(complex<CCTK_REAL16>) +# endif #endif diff --git a/Carpet/CarpetLib/src/th.cc b/Carpet/CarpetLib/src/th.cc index 1cf81495a..aab64bc78 100644 --- a/Carpet/CarpetLib/src/th.cc +++ b/Carpet/CarpetLib/src/th.cc @@ -6,7 +6,7 @@ copyright : (C) 2000 by Erik Schnetter email : schnetter@astro.psu.edu - $Header: /home/eschnett/C/carpet/Carpet/Carpet/CarpetLib/src/th.cc,v 1.1 2001/03/01 13:40:10 eschnett Exp $ + $Header: /home/eschnett/C/carpet/Carpet/Carpet/CarpetLib/src/th.cc,v 1.2 2001/03/19 21:30:19 eschnett Exp $ ***************************************************************************/ @@ -95,12 +95,6 @@ ostream& operator<< (ostream& os, const th<D>& t) { #if defined(TMPL_EXPLICIT) -template class th<1>; -template ostream& operator<< (ostream& os, const th<1>& t); - -template class th<2>; -template ostream& operator<< (ostream& os, const th<2>& t); - template class th<3>; template ostream& operator<< (ostream& os, const th<3>& t); #endif diff --git a/Carpet/CarpetLib/src/vect.cc b/Carpet/CarpetLib/src/vect.cc index d9fd90594..6c8d012a2 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.1 2001/03/01 13:40:10 eschnett Exp $ + $Header: /home/eschnett/C/carpet/Carpet/Carpet/CarpetLib/src/vect.cc,v 1.2 2001/03/19 21:30:19 eschnett Exp $ ***************************************************************************/ @@ -45,17 +45,11 @@ ostream& operator<< (ostream& os, const vect<T,D>& a) { #if defined(TMPL_EXPLICIT) template class vect<int,1>; -// template class vect<double,1>; template ostream& operator<< (ostream& os, const vect<int,1>& a); -// template ostream& operator<< (ostream& os, const vect<double,1>& a); template class vect<int,2>; -// template class vect<double,2>; template ostream& operator<< (ostream& os, const vect<int,2>& a); -// template ostream& operator<< (ostream& os, const vect<double,2>& a); template class vect<int,3>; -// template class vect<double,3>; template ostream& operator<< (ostream& os, const vect<int,3>& a); -// template ostream& operator<< (ostream& os, const vect<double,3>& a); #endif |