aboutsummaryrefslogtreecommitdiff
path: root/src/jtutil/linear_map.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/jtutil/linear_map.cc')
-rw-r--r--src/jtutil/linear_map.cc36
1 files changed, 15 insertions, 21 deletions
diff --git a/src/jtutil/linear_map.cc b/src/jtutil/linear_map.cc
index 636675e..b44b466 100644
--- a/src/jtutil/linear_map.cc
+++ b/src/jtutil/linear_map.cc
@@ -16,7 +16,12 @@
#include "stdc.h"
#include "util.hh"
#include "linear_map.hh"
-using jtutil::error_exit;
+
+// everything in this file is inside these namespaces
+namespace AHFinderDirect
+ {
+namespace jtutil
+ {
//******************************************************************************
//******************************************************************************
@@ -27,8 +32,6 @@ using jtutil::error_exit;
//
// This function constructs a linear_map<fp_t> object.
//
-namespace jtutil
- {
template <typename fp_t>
linear_map<fp_t>::linear_map(int min_int_in, int max_int_in,
fp_t min_fp_in, fp_t delta_fp_in, fp_t max_fp_in)
@@ -37,7 +40,6 @@ linear_map<fp_t>::linear_map(int min_int_in, int max_int_in,
{
constructor_common(min_fp_in, max_fp_in);
}
- } // namespace jtutil::
//******************************************************************************
@@ -45,8 +47,6 @@ constructor_common(min_fp_in, max_fp_in);
// This function constructs a linear_map<fp_t> object with a subrange
// of an existing one.
//
-namespace jtutil
- {
template <typename fp_t>
linear_map<fp_t>::linear_map(const linear_map<fp_t> &lm_in,
int min_int_in, int max_int_in) // subrange
@@ -65,7 +65,6 @@ if (! (is_in_range(min_int_in) && is_in_range(max_int_in)) )
constructor_common(lm_in.fp_of_int_unchecked(min_int_in),
lm_in.fp_of_int_unchecked(max_int_in));
}
- } // namespace jtutil::
//******************************************************************************
@@ -73,8 +72,6 @@ constructor_common(lm_in.fp_of_int_unchecked(min_int_in),
// This function does the common argument validation and setup for
// all the constructors of class linear_map<fp_t>:: .
//
-namespace jtutil
- {
template <typename fp_t>
void linear_map<fp_t>::constructor_common(fp_t min_fp_in, fp_t max_fp_in)
// assumes
@@ -101,7 +98,6 @@ if (fuzzy<fp_t>::NE(fp_of_int_unchecked(max_int()), max_fp_in))
double(min_fp_in), double(delta_fp()), double(max_fp_in));
/*NOTREACHED*/
}
- } // namespace jtutil::
//******************************************************************************
@@ -109,8 +105,6 @@ if (fuzzy<fp_t>::NE(fp_of_int_unchecked(max_int()), max_fp_in))
// This function converts fp --> int coordinate, returning the result
// as an fp (which need not be fuzzily integral).
//
-namespace jtutil
- {
template <typename fp_t>
fp_t linear_map<fp_t>::fp_int_of_fp(fp_t x)
const
@@ -127,7 +121,6 @@ if (! is_in_range(x))
return inverse_delta_ * (x - origin_);
}
- } // namespace jtutil::
//******************************************************************************
@@ -140,8 +133,6 @@ return inverse_delta_ * (x - origin_);
// Having to explicitly specify the namespace for jtutil::round<fp_t>::
// is ++ugly. :(
//
-namespace jtutil
- {
template <typename fp_t>
int linear_map<fp_t>::int_of_fp(fp_t x, noninteger_action nia /* = nia_error */)
const
@@ -196,7 +187,6 @@ default:
return 0; // dummy return to quiet gcc
// (which doesn't grok that error_exit() never returns)
}
- } // namespace jtutil::
//******************************************************************************
@@ -210,8 +200,6 @@ return 0; // dummy return to quiet gcc
// Having to explicitly specify the namespace for jtutil::round<fp_t>::
// is ++ugly. :(
//
-namespace jtutil
- {
template <typename fp_t>
int linear_map<fp_t>::delta_int_of_delta_fp
(fp_t delta_x, noninteger_action nia /* = nia_error */)
@@ -271,7 +259,6 @@ default:
return 0; // dummy return to quiet gcc
// (which doesn't grok that error_exit() never returns)
}
- } // namespace jtutil::
//******************************************************************************
//******************************************************************************
@@ -281,5 +268,12 @@ return 0; // dummy return to quiet gcc
// ***** template instantiation *****
//
-template class jtutil::linear_map<float>;
-template class jtutil::linear_map<double>;
+template class linear_map<float>;
+template class linear_map<double>;
+
+//******************************************************************************
+//******************************************************************************
+//******************************************************************************
+
+ } // namespace jtutil
+ } // namespace AHFinderDirect