1 #ifndef __JTOOLS__JPOLFIT__
2 #define __JTOOLS__JPOLFIT__
26 namespace JPP {
using namespace JTOOLS; }
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() <= 1
u) {
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;
Auxiliary methods for mathematics.
Exception for a functional operation.
Definition of zero value for any class.
double getDistance(const JFirst_t &first, const JSecond_t &second)
Get distance between objects.
Auxiliary data structure for handling std::ostream.
Exception for numerical precision error.
then usage $script< input file >[option[primary[working directory]]] nWhere option can be N
#define STATIC_CHECK(expr)
Exception for accessing a value in a collection that is outside of its range.
Double_t g1(const Double_t x)
Function.