1 #ifndef __JTOOLS__JSPLINE__ 
    2 #define __JTOOLS__JSPLINE__ 
   20 namespace JPP { 
using namespace JTOOLS; }
 
   33   template<
class JOrdinate_t>
 
  119         throw JNoValue(
"JSplineBounds: missing 1st derivative.");
 
  133         throw JNoValue(
"JSplineBounds: missing 1st derivative.");
 
  149   template<
class JOrdinate_t>
 
  151                                                        const JOrdinate_t fpAtXmax)
 
  173   template<
class JElement_t, 
template<
class, 
class> 
class JCollection_t, 
class JDistance_t>
 
  175     public JCollection_t<JElement_t, JDistance_t>,
 
  188     typedef typename collection_type::iterator                                   
iterator;
 
  201       const int numberOfElements = this->size();
 
  205       if (numberOfElements > 2) {
 
  214           const double        dx = this->
getDistance(i->getX(),  j->getX());
 
  230         for (
iterator k = this->begin(), i = 
k++, 
j = 
k++; 
k != this->end(); ++i, ++
j, ++
k, ++index) {
 
  241           const double h   = sig * buffer[index-1] + 2.0;
 
  243           buffer[index]    = (sig - 1.0) / h;
 
  248           j->setU((6.0 * j->getU() / this->
getDistance(x1, x3)  -  sig * i->getU()) / h);
 
  257           index = numberOfElements - 2;
 
  259           const double        dx = this->
getDistance(i->getX(),  j->getX());
 
  264           i->setU((i->getU() - 0.5*j->getU()) / (0.5*buffer[index] + 1.0));
 
  275         index = numberOfElements - 2;
 
  277         for ( ; j != this->rend(); ++i, ++
j, --index) {
 
  278           j->setU(j->getU() + i->getU() * buffer[index]);
 
  283         for (
iterator i = this->begin(); i != this->end(); ++i) {
 
  311   template<
class JElement_t, 
 
  312            template<
class, 
class> 
class JCollection_t,
 
  321   template<
class JElement_t, 
template<
class, 
class> 
class JCollection_t, 
class JDistance_t>
 
  327     public JFunction<typename JElement_t::abscissa_type, 
 
  328                      typename JResultType<typename JElement_t::ordinate_type>::result_type>
 
  341     typedef typename collection_type::iterator                                   
iterator;
 
  367       if (this->size() <= 1
u) {
 
  375       if ((p == this->begin() && this->
getDistance(x, (p++)->getX()) > distance_type::precision) ||
 
  376           (p == this->end()   && this->
getDistance((--p)->getX(), x) > distance_type::precision)) {
 
  383       const double dx = this->
getDistance(p->getX(), q->getX());
 
  385       const double b  = 1.0 - 
a;
 
  387       return a * p->getY() + b * q->getY()
 
  388         - a*b * ((a + 1.0)*p->getU() + (b + 1.0)*q->getU()) * dx*dx/6;
 
  396   template<
class JElement_t, 
template<
class, 
class> 
class JCollection_t, 
class JDistance_t>
 
  402     public JFunction<typename JElement_t::abscissa_type, 
 
  403                      JResultDerivative<typename JResultType<typename JElement_t::ordinate_type>::result_type> >
 
  416     typedef typename collection_type::iterator                                   
iterator;
 
  444       if (this->size() <= 1
u) {
 
  453       if ((p == this->begin() && this->
getDistance(x, (p++)->getX()) > distance_type::precision) ||
 
  454           (p == this->end()   && this->
getDistance((--p)->getX(), x) > distance_type::precision)) {
 
  461       const double dx = this->
getDistance(p->getX(), q->getX());
 
  463       const double b  = 1.0 - 
a;
 
  465       result.f   = a * p->getY() + b * q->getY()
 
  466         - a*b * ((a + 1.0)*p->getU() + (b + 1.0)*q->getU()) * dx*dx/6;
 
  468       result.fp  = (q->getY() - p->getY() + (p->getU()*(1.0 - 3*a*
a) -
 
  469                                              q->getU()*(1.0 - 3*b*b)) * dx*dx/6) / dx;
 
  490   template<
class JElement_t, 
template<
class, 
class> 
class JCollection_t, 
class JDistance_t>
 
  496     public JFunction<typename JElement_t::abscissa_type, 
 
  497                      JResultPDF<typename JResultType<typename JElement_t::ordinate_type>::result_type> >
 
  510     typedef typename collection_type::iterator                                   
iterator;
 
  537       if (this->size() >= 2
u) {
 
  539         collection_type::compile(bounds);
 
  543         for (
iterator j = this->begin(), i = 
j++; 
j != this->end(); ++i, ++
j) {
 
  545           const double        dx = this->
getDistance(i->getX(), 
j->getX());
 
  552           j->setIntegral(i->getIntegral() + v - 
w);
 
  566       if (this->size() <= 1
u) {
 
  574       if        (p == this->begin() && this->
getDistance(x, (p++)->getX()) > distance_type::precision) {
 
  583           result.V = this->rbegin()->getIntegral();
 
  591       } 
else if (p == this->end()   && this->
getDistance((--p)->getX(), x) > distance_type::precision) {
 
  599           result.v = this->rbegin()->getIntegral();
 
  600           result.V = this->rbegin()->getIntegral();
 
  611       const double dx = this->
getDistance(p->getX(), q->getX());
 
  613       const double b  = 1.0 - 
a;
 
  615       result.f  = a * p->getY() + b * q->getY()
 
  616         - a*b * ((a + 1.0)*p->getU() + (b + 1.0)*q->getU()) * dx*dx/6;
 
  618       result.fp = (q->getY() - p->getY() + (p->getU()*(1.0 - 3*a*
a) -
 
  619                                             q->getU()*(1.0 - 3*b*b)) * dx*dx/6) / dx;
 
  621       result.v  = p->getIntegral()
 
  622         + 0.5*dx * (p->getY() - 0.5*p->getU()*dx*dx/6)
 
  623         - 0.5*dx * ((a*a*p->getY() - b*b*q->getY()) +
 
  624                     (p->getU() * a*a*(0.5*a*a - 1.0) -
 
  625                      q->getU() * b*b*(0.5*b*b - 1.0)) * dx*dx/6);
 
  627       result.V  = this->rbegin()->getIntegral();
 
  653   template<
class JElement_t,
 
  654            template<
class, 
class> 
class JCollection_t,
 
  655            class JResult_t   = 
typename JElement_t::ordinate_type,
 
  658     public JSplineFunction<JElement_t, JCollection_t, JResult_t, JDistance_t>,
 
  659     public JFunction1D<typename JElement_t::abscissa_type, JResult_t> 
 
  695   template<
class JAbscissa_t, 
class JOrdinate_t>
 
  698   template<
template<
class, 
class, 
class> 
class JMap_t>
 
  705   template<
class JKey_t,
 
  707            template<
class, 
class, 
class> 
class JMap_t,
 
  711     public JMap_t<JKey_t, JValue_t, JDistance_t>,
 
  778       for (
iterator i = this->begin(); i != this->end(); ++i) {
 
  797   template<
class JElement_t,
 
  798            template<
class, 
class> 
class JCollection_t,
 
  801   inline typename JElement_t::ordinate_type 
 
  810     if (input.getSize() > 1) {
 
  812       output.
put(input.begin()->getX(), V);
 
  814       for (const_iterator 
j = input.begin(), i = 
j++; 
j != input.end(); ++i, ++
j) {
 
  816         const double        dx = input.getDistance(i->getX(), 
j->getX());
 
  817         const ordinate_type y  = i->getY()  +  
j->getY();
 
  818         const ordinate_type z  = i->getU()  +  
j->getU();             
 
  819         const ordinate_type 
v  = dx * 0.50 * y;
 
  820         const ordinate_type 
w  = dx * 0.25 * z*dx*dx/6;
 
  824         output.
put(
j->getX(), V);
 
  841   template<
class JElement_t,
 
  842            template<
class, 
class> 
class JCollection_t,
 
  844   inline typename JElement_t::ordinate_type
 
  852     if (input.getSize() > 1) {
 
  854       for (const_iterator i = input.begin(); i != input.end(); ++i) {
 
  855         output.
put(i->getX(), i->getIntegral());
 
  858       return input.rbegin()->getIntegral();
 
then fatal No hydrophone data file $HYDROPHONE_TXT fi sort gr k
 
Exception for a functional operation. 
 
This include file containes various data structures that can be used as specific return types for the...
 
static const JZero zero
Function object to assign zero value. 
 
Definition of zero value for any class. 
 
double getDistance(const JFirst_t &first, const JSecond_t &second)
Get distance between objects. 
 
Exception for missing value. 
 
JArgument< T >::argument_type argument_type
 
Exception for division by zero. 
 
Exception for accessing a value in a collection that is outside of its range.