diff options
author | jthorn <jthorn@f88db872-0e4f-0410-b76b-b9085cfa78c5> | 2002-04-07 11:07:51 +0000 |
---|---|---|
committer | jthorn <jthorn@f88db872-0e4f-0410-b76b-b9085cfa78c5> | 2002-04-07 11:07:51 +0000 |
commit | c7b8ce1a09e1fe64ff5de918da6b8a06f387610a (patch) | |
tree | 0116e17752424ca110780a207b3b6e5dbfd71864 /src/jtutil/array.hh | |
parent | 78563bbb7139447c629183580c83197564309ded (diff) |
rename template type: fp --> T since it need not be floating point
git-svn-id: http://svn.einsteintoolkit.org/cactus/EinsteinAnalysis/AHFinderDirect/trunk@454 f88db872-0e4f-0410-b76b-b9085cfa78c5
Diffstat (limited to 'src/jtutil/array.hh')
-rw-r--r-- | src/jtutil/array.hh | 72 |
1 files changed, 36 insertions, 36 deletions
diff --git a/src/jtutil/array.hh b/src/jtutil/array.hh index 400c6ae..d2532e0 100644 --- a/src/jtutil/array.hh +++ b/src/jtutil/array.hh @@ -60,7 +60,7 @@ namespace jtutil { -template <typename fp> +template <typename T> class array1d { public: @@ -94,22 +94,22 @@ public: // normal-use access functions // ... rvalue - fp operator()(int i) const { return array_[ subscript(i) ]; } + T operator()(int i) const { return array_[ subscript(i) ]; } // ... lvalue - fp& operator()(int i) { return array_[ subscript(i) ]; } + T& operator()(int i) { return array_[ subscript(i) ]; } // get access to internal 0-origin 1D storage array // (low-level, dangerous, use with caution!) // ... semantics of N_array() may not be what you want // if strides specify noncontiguous storage int N_array() const { return max_subscript_+stride_i_; } - fp* get_array() const { return array_; } + T* get_array() const { return array_; } // constructor, destructor - // ... constructor initializes all array elements to fp(0.0) + // ... constructor initializes all array elements to T(0.0) // ... omitted strides default to C storage order array1d(int min_i_in, int max_i_in, - fp *array_in = NULL, // caller-provided storage array + T *array_in = NULL, // caller-provided storage array // if non-NULL int stride_i_in = 0); ~array1d(); @@ -118,14 +118,14 @@ private: // we forbid copying and passing by value // by declaring the copy constructor and assignment operator // private, but never defining them - array1d(const array1d<fp>& rhs); - array1d<fp>& operator=(const array1d<fp>& rhs); + array1d(const array1d<T>& rhs); + array1d<T>& operator=(const array1d<T>& rhs); private: // n.b. we declare the array pointer first in the class // ==> it's probably at 0 offset // ==> we may get slightly faster array access - fp* array_; // --> new-allocated 1D storage array + T* array_; // --> new-allocated 1D storage array // subscripting info // n.b. put this next in class so it should be in the same @@ -146,7 +146,7 @@ private: namespace jtutil { -template <typename fp> +template <typename T> class array2d { public: @@ -185,10 +185,10 @@ public: // normal-use access functions // ... rvalue - fp operator()(int i, int j) const + T operator()(int i, int j) const { return array_[ subscript(i,j) ]; } // ... lvalue - fp& operator()(int i, int j) + T& operator()(int i, int j) { return array_[ subscript(i,j) ]; } // get access to internal 0-origin 1D storage array @@ -196,14 +196,14 @@ public: // ... semantics of N_array() may not be what you want // if strides specify noncontiguous storage int N_array() const { return max_subscript_+stride_j_; } - fp* get_array() const { return array_; } + T* get_array() const { return array_; } // constructor, destructor - // ... constructor initializes all array elements to fp(0.0) + // ... constructor initializes all array elements to T(0.0) // ... omitted strides default to C storage order array2d(int min_i_in, int max_i_in, int min_j_in, int max_j_in, - fp *array_in = NULL, // caller-provided storage array + T *array_in = NULL, // caller-provided storage array // if non-NULL int stride_i_in = 0, int stride_j_in = 0); ~array2d(); @@ -212,14 +212,14 @@ private: // we forbid copying and passing by value // by declaring the copy constructor and assignment operator // private, but never defining them - array2d(const array2d<fp>& rhs); - array2d<fp>& operator=(const array2d<fp>& rhs); + array2d(const array2d<T>& rhs); + array2d<T>& operator=(const array2d<T>& rhs); private: // n.b. we declare the array pointer first in the class // ==> it's probably at 0 offset // ==> we may get slightly faster array access - fp* array_; // --> new-allocated 1D storage array + T* array_; // --> new-allocated 1D storage array // subscripting info // n.b. put this next in class so it should be in the same @@ -241,7 +241,7 @@ private: namespace jtutil { -template <typename fp> +template <typename T> class array3d { public: @@ -285,10 +285,10 @@ public: // normal-use access functions // ... rvalue - fp operator()(int i, int j, int k) const + T operator()(int i, int j, int k) const { return array_[ subscript(i,j,k) ]; } // ... lvalue - fp& operator()(int i, int j, int k) + T& operator()(int i, int j, int k) { return array_[ subscript(i,j,k) ]; } // get access to internal 0-origin 1D storage array @@ -296,15 +296,15 @@ public: // ... semantics of N_array() may not be what you want // if strides specify noncontiguous storage int N_array() const { return max_subscript_+stride_k_; } - fp* get_array() const { return array_; } + T* get_array() const { return array_; } // constructor, destructor - // ... constructor initializes all array elements to fp(0.0) + // ... constructor initializes all array elements to T(0.0) // ... omitted strides default to C storage order array3d(int min_i_in, int max_i_in, int min_j_in, int max_j_in, int min_k_in, int max_k_in, - fp *array_in = NULL, // caller-provided storage array + T *array_in = NULL, // caller-provided storage array // if non-NULL int stride_i_in = 0, int stride_j_in = 0, int stride_k_in = 0); ~array3d(); @@ -313,14 +313,14 @@ private: // we forbid copying and passing by value // by declaring the copy constructor and assignment operator // private, but never defining them - array3d(const array3d<fp>& rhs); - array3d<fp>& operator=(const array3d<fp>& rhs); + array3d(const array3d<T>& rhs); + array3d<T>& operator=(const array3d<T>& rhs); private: // n.b. we declare the array pointer first in the class // ==> it's probably at 0 offset // ==> we may get slightly faster array access - fp* array_; // --> new-allocated 1D storage array + T* array_; // --> new-allocated 1D storage array // subscripting info // n.b. put this next in class so it should be in the same @@ -343,7 +343,7 @@ private: namespace jtutil { -template <typename fp> +template <typename T> class array4d { public: @@ -398,10 +398,10 @@ public: // normal-use access functions // ... rvalue - fp operator()(int i, int j, int k, int l) const + T operator()(int i, int j, int k, int l) const { return array_[ subscript(i,j,k,l) ]; } // ... lvalue - fp& operator()(int i, int j, int k, int l) + T& operator()(int i, int j, int k, int l) { return array_[ subscript(i,j,k,l) ]; } // get access to internal 0-origin 1D storage array @@ -409,16 +409,16 @@ public: // ... semantics of N_array() may not be what you want // if strides specify noncontiguous storage int N_array() const { return max_subscript_+stride_l_; } - fp* get_array() const { return array_; } + T* get_array() const { return array_; } // constructor, destructor - // ... constructor initializes all array elements to fp(0.0) + // ... constructor initializes all array elements to T(0.0) // ... omitted strides default to C storage order array4d(int min_i_in, int max_i_in, int min_j_in, int max_j_in, int min_k_in, int max_k_in, int min_l_in, int max_l_in, - fp *array_in = NULL, // caller-provided storage array + T *array_in = NULL, // caller-provided storage array // if non-NULL int stride_i_in = 0, int stride_j_in = 0, int stride_k_in = 0, int stride_l_in = 0); @@ -428,14 +428,14 @@ private: // we forbid copying and passing by value // by declaring the copy constructor and assignment operator // private, but never defining them - array4d(const array4d<fp>& rhs); - array4d<fp>& operator=(const array4d<fp>& rhs); + array4d(const array4d<T>& rhs); + array4d<T>& operator=(const array4d<T>& rhs); private: // n.b. we declare the array pointer first in the class // ==> it's probably at 0 offset // ==> we may get slightly faster array access - fp* array_; // --> new-allocated 1D storage array + T* array_; // --> new-allocated 1D storage array // subscripting info // n.b. put this next in class so it should be in the same |