diff options
author | jthorn <jthorn@f88db872-0e4f-0410-b76b-b9085cfa78c5> | 2001-06-21 17:22:03 +0000 |
---|---|---|
committer | jthorn <jthorn@f88db872-0e4f-0410-b76b-b9085cfa78c5> | 2001-06-21 17:22:03 +0000 |
commit | bf75ea8dee1bdcf146a63c364b11b680046ff828 (patch) | |
tree | bd5fa5cccbfd1ecf4e35b559d3e6e74aac4e3546 /src/jtutil | |
parent | ba31c30788915cc715370762aeea98cc5d0ada02 (diff) |
more mods -- not done yet but .hh is reasonably complete
git-svn-id: http://svn.einsteintoolkit.org/cactus/EinsteinAnalysis/AHFinderDirect/trunk@111 f88db872-0e4f-0410-b76b-b9085cfa78c5
Diffstat (limited to 'src/jtutil')
-rw-r--r-- | src/jtutil/interpolate.cc | 67 | ||||
-rw-r--r-- | src/jtutil/interpolate.hh | 6 |
2 files changed, 57 insertions, 16 deletions
diff --git a/src/jtutil/interpolate.cc b/src/jtutil/interpolate.cc index 8621173..7be9e09 100644 --- a/src/jtutil/interpolate.cc +++ b/src/jtutil/interpolate.cc @@ -26,8 +26,8 @@ // namespace interpolation { -template <class fp> - Lagrange_uniform_1d<fp>::Lagrange_uniform(int N_points_in, int order_in) +template <typename fpt> + Lagrange_uniform_1d<fpt>::Lagrange_uniform_1d(int N_points_in, int order_in) : N_points(N_points_in), order(order_in), x_map_ptr(NULL), y_array(NULL) { @@ -42,19 +42,19 @@ template <class fp> // namespace interpolation { -template <class fp> - Lagrange_uniform_1d<fp>::setup_data_x(const linear_map<fp> &x_map_in) +template <typename fpt> + Lagrange_uniform_1d<fpt>::setup_data_x(const linear_map<fpt>& x_map_in) { if (x_map_in.N_points() != N_points) then error_exit(ERROR_EXIT, -"***** interpolation::Lagrange_uniform_1d<fp>::setup_data_x():\n" +"***** interpolation::Lagrange_uniform_1d<fpt>::setup_data_x():\n" " x_map_in specifies different number of data points\n" " from original constructor call!\n" " x_map_in.N_points()=%d N_points=%d\n" , x_map_in.N_points(), N_points); /*NOTREACHED*/ -x_map_ptr = & x_map_in; +x_map_ptr = &x_map_in; } } @@ -66,10 +66,9 @@ x_map_ptr = & x_map_in; // namespace interpolation { -template <class fp> - void Lagrange_uniform_1d<fp>::setup_data_y(const fp y_array_in[]) +template <typename fpt> + void Lagrange_uniform_1d<fpt>::setup_data_y(const fpt y_array_in[]) { -assert(x_map_ptr != NULL); y_array = y_array_in; } } @@ -79,13 +78,55 @@ y_array = y_array_in; // // This function does the actual interpolation. // -template <class fp> - fp interpolation:: - Lagrange_uniform_1d<fp>::interpolate(fp x, char end_action = 'o') +namespace interpolation + { +template <typename fpt> + fpt Lagrange_uniform_1d<fpt>::interpolate(fpt x, char end_action = 'o') const { assert(x_map_ptr != NULL); assert(y_array != NULL); -FIXME FIXME FIXME +// FIXME FIXME FIXME +} + } + +//***************************************************************************** + +// +// This function computes the backwards domain of dependence of +// interpolate(x,end_action), i.e. it computes the interval of [i] +// such that y[i] is needed to compute interpolate(x,end_action) . +// +namespace interpolation + { +template <typename fpt> + void Lagrange_uniform_1d<fpt>::bdod(fpt x, char end_action = 'o', + int& min_i, int& max_i) + const +{ +assert(x_map_ptr != NULL); + +// FIXME FIXME FIXME } + } + +//***************************************************************************** + +// +// This function computes the Jacobian +// d interpolate(x,end_action) +// --------------------------- +// d y[i] +// +namespace interpolation + { +template <typename fpt> + fpt Lagrange_uniform_1d<fpt>::Jacobian(fpt x, char end_action = 'o', int i) + const +{ +assert(x_map_ptr != NULL); + +// FIXME FIXME FIXME +} + } diff --git a/src/jtutil/interpolate.hh b/src/jtutil/interpolate.hh index 22fcb84..3474255 100644 --- a/src/jtutil/interpolate.hh +++ b/src/jtutil/interpolate.hh @@ -118,12 +118,12 @@ namespace interpolation { -template <class fpt> +template <typename fpt> class Lagrange_uniform_1d { public: // set up x data values - void setup_data_x(const linear_map<fpt> &x_map_in); + void setup_data_x(const linear_map<fpt>& x_map_in); // set up y data values // ... needs setup_data_x() to have already been called @@ -139,7 +139,7 @@ public: // to compute interpolate(x,end_action) // ... needs setup_data_x() to have already been called, // but not setup_data_y() - void bdod(fpt x, char end_action = 'o', int &min_i, int &max_i) const; + void bdod(fpt x, char end_action = 'o', int& i_min, int& i_max) const; // Jacobian d interpolate(x,end_action) / d y[i] // ... needs setup_data_x() to have already been called, |