1 #ifndef __JTOOLS__JPOLFIT__
2 #define __JTOOLS__JPOLFIT__
39 template<
unsigned int N,
42 template<
class,
class>
class JCollection_t,
46 public JCollection_t<JElement_t, JDistance_t>,
47 public JFunction<typename JElement_t::abscissa_type,
48 typename JResultType<typename JElement_t::ordinate_type>::result_type>
61 typedef typename collection_type::iterator
iterator;
94 if (this->size() <= 1u) {
101 std::ostringstream os;
103 os << __FILE__ <<
':' << __LINE__ <<
" not enough data " <<
STREAM(
"?") <<
x;
111 if ((p == this->begin() && this->
getDistance(x, (p++)->getX()) > distance_type::precision) ||
112 (p == this->end() && this->
getDistance((--p)->getX(),
x) > distance_type::precision)) {
119 std::ostringstream os;
121 os << __FILE__ <<
':' << __LINE__ <<
" abscissa out of range "
123 <<
STREAM(
"?") << this->begin() ->getX() <<
' '
124 <<
STREAM(
"?") << this->rbegin()->getX();
133 int n = std::min((
int) (N + 1), (
int) this->size());
135 for (
int i =
n/2; i != 0 && p != this->end(); --i, ++p) {}
136 for (
int i =
n ; i != 0 && p != this->begin(); --i, --p) {}
165 template<
unsigned int N,
168 template<
class,
class>
class JCollection_t,
169 class JResult_t =
typename JElement_t::ordinate_type,
172 public JPolfitFunction<N, M, JElement_t, JCollection_t, JResult_t, JDistance_t>,
173 public JFunction1D<typename JElement_t::abscissa_type, JResult_t>
186 typedef typename collection_type::iterator
iterator;
#define STATIC_CHECK(expr)
Auxiliary methods for mathematics.
Double_t g1(const Double_t x)
Function.
Definition of zero value for any class.
Exception for a functional operation.
Exception for numerical precision error.
Exception for accessing a value in a collection that is outside of its range.
double getDistance(const JFirst_t &first, const JSecond_t &second)
Get distance between objects.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Template definition for function evaluation of Legendre polynome.
Auxiliary data structure for handling std::ostream.