Jpp  18.2.1
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
JHermiteSpline.hh
Go to the documentation of this file.
1 #ifndef __JTOOLS__JHERMITESPLINE__
2 #define __JTOOLS__JHERMITESPLINE__
3 
4 #include <utility>
5 #include <sstream>
6 #include <cmath>
7 
8 #include "JMath/JZero.hh"
9 #include "JLang/JException.hh"
10 #include "JLang/JClass.hh"
11 #include "JTools/JFunctional.hh"
12 #include "JTools/JDistance.hh"
13 #include "JTools/JResult.hh"
14 #include "JTools/JMapCollection.hh"
15 
16 
17 /**
18  * \author mdejong
19  */
20 
21 namespace JTOOLS {}
22 namespace JPP { using namespace JTOOLS; }
23 
24 namespace JTOOLS {
25 
26  using JLANG::JNoValue;
30 
31 
32  /**
33  * Template base class spline interpolations.
34  *
35  * This class implements the JFunctional interface.
36  *
37  * Note that the data structure of the elements in the collection should have the additional methods:
38  * <pre>
39  * ordinate_type getU() const;
40  * void setU(ordinate_type u);
41  * </pre>
42  * to get and set the derivatives, respectively.
43  *
44  * Note that -by default- the compilation is for a monotonous interpolation.
45  */
46  template<class JElement_t, template<class, class> class JCollection_t, class JDistance_t>
48  public JCollection_t<JElement_t, JDistance_t>,
49  public virtual JFunctional<>
50  {
51  public:
52 
53  typedef JCollection_t<JElement_t, JDistance_t> collection_type;
54 
55  typedef typename collection_type::abscissa_type abscissa_type;
56  typedef typename collection_type::ordinate_type ordinate_type;
57  typedef typename collection_type::value_type value_type;
58  typedef typename collection_type::distance_type distance_type;
59 
60  typedef typename collection_type::const_iterator const_iterator;
61  typedef typename collection_type::const_reverse_iterator const_reverse_iterator;
62  typedef typename collection_type::iterator iterator;
63  typedef typename collection_type::reverse_iterator reverse_iterator;
64 
66 
67 
68  /**
69  * Determination of derivatives.
70  *
71  * \param monotone monotone
72  */
73  void compile(const bool monotone)
74  {
75  using namespace std;
76 
77  if (this->size() >= 2u) {
78 
79  {
80  iterator j = this->begin(), i = j++;
81 
82  i->setU((j->getY() - i->getY()) / this->getDistance(i->getX(), j->getX()));
83  }
84 
85  {
86  reverse_iterator j = this->rbegin(), i = j++;
87 
88  i->setU((j->getY() - i->getY()) / this->getDistance(i->getX(), j->getX()));
89  }
90 
91  for (iterator k = this->begin(), i = k++, j = k++; k != this->end(); ++i, ++j, ++k) {
92  j->setU(0.5 * ((j->getY() - i->getY()) / this->getDistance(i->getX(), j->getX()) +
93  (k->getY() - j->getY()) / this->getDistance(j->getX(), k->getX())));
94  }
95 
96  if (monotone) {
97 
98  for (iterator j = this->begin(), i = j++; j != this->end(); ++i, ++j) {
99  if (i->getY() == j->getY()) {
100  j->setU(JMATH::zero);
101  }
102  }
103 
104  for (iterator j = this->begin(), i = j++; j != this->end(); ++i, ++j) {
105 
106  const ordinate_type u = (j->getY() - i->getY()) / this->getDistance(i->getX(), j->getX());
107  const ordinate_type w = (i->getU()*i->getU() + j->getU()*j->getU());
108 
109  if (w > 9.0*u*u) {
110 
111  const ordinate_type v = 3.0*u/sqrt(w);
112 
113  i->setU(v*i->getU());
114  j->setU(v*j->getU());
115  }
116  }
117  }
118  }
119  }
120 
121 
122  protected:
123 
124  static abscissa_type h00 (abscissa_type t) { return (1.0 + 2*t) * (1.0 - t) * (1.0 - t); }
125  static abscissa_type h10 (abscissa_type t) { return t * (1.0 - t) * (1.0 - t); }
126  static abscissa_type h01 (abscissa_type t) { return t * t * (3.0 - 2*t); }
127  static abscissa_type h11 (abscissa_type t) { return t * t * (t - 1.0); }
128 
129  static abscissa_type h00p(abscissa_type t) { return 6 * t * (t - 1.0); }
130  static abscissa_type h10p(abscissa_type t) { return t * (3*t - 4.0) + 1.0; }
131  static abscissa_type h01p(abscissa_type t) { return 6 * t * (1.0 -t); }
132  static abscissa_type h11p(abscissa_type t) { return t * (3*t - 2.0); }
133 
134  static abscissa_type H00 (abscissa_type t) { return t * (t * t * (0.5*t - 1.0) + 1.0); }
135  static abscissa_type H10 (abscissa_type t) { return t * t * (t * (0.25*t - 2.0/3.0) + 0.5); }
136  static abscissa_type H01 (abscissa_type t) { return t * t * t * (1.0 - 0.5*t); }
137  static abscissa_type H11 (abscissa_type t) { return t * t * t * (0.25*t - 1.0/3.0); }
138 
139 
140  /**
141  * Default constructor.
142  */
144  {}
145 
146 
147  /**
148  * Determination of derivatives.
149  */
150  virtual void do_compile() override
151  {
152  compile(true);
153  }
154  };
155 
156 
157  /**
158  * Template definition for functional collection with spline interpolation.
159  */
160  template<class JElement_t,
161  template<class, class> class JCollection_t,
162  class JResult_t,
163  class JDistance_t>
165 
166 
167  /**
168  * Template specialisation for functional collection with spline interpolation.
169  */
170  template<class JElement_t, template<class, class> class JCollection_t, class JDistance_t>
171  class JHermiteSplineFunction<JElement_t,
172  JCollection_t,
173  typename JResultType<typename JElement_t::ordinate_type>::result_type,
174  JDistance_t> :
175  public JHermiteSplineCollection<JElement_t, JCollection_t, JDistance_t>,
176  public virtual JFunction<typename JElement_t::abscissa_type,
177  typename JResultType<typename JElement_t::ordinate_type>::result_type>
178  {
179  public:
180 
182 
183  typedef typename collection_type::abscissa_type abscissa_type;
184  typedef typename collection_type::ordinate_type ordinate_type;
185  typedef typename collection_type::value_type value_type;
186  typedef typename collection_type::distance_type distance_type;
187 
188  typedef typename collection_type::const_iterator const_iterator;
189  typedef typename collection_type::const_reverse_iterator const_reverse_iterator;
190  typedef typename collection_type::iterator iterator;
191  typedef typename collection_type::reverse_iterator reverse_iterator;
192 
195 
199 
200 
201  /**
202  * Default constructor.
203  */
205  {}
206 
207 
208  /**
209  * Recursive interpolation method implementation.
210  *
211  * \param pX pointer to abscissa values
212  * \return function value
213  */
214  virtual result_type evaluate(const argument_type* pX) const override
215  {
216  const argument_type x = *pX;
217 
218  if (this->size() <= 1u) {
219 
220  try {
221  return this->getExceptionHandler().action();
222  }
223  catch (const JException& error) {
224 
225  std::ostringstream os;
226 
227  os << __FILE__ << ':' << __LINE__ << " not enough data " << STREAM("?") << x;
228 
229  throw JFunctionalException(os.str());
230  }
231  }
232 
233  const_iterator p = this->lower_bound(x);
234 
235  if ((p == this->begin() && this->getDistance(x, (p++)->getX()) > distance_type::precision) ||
236  (p == this->end() && this->getDistance((--p)->getX(), x) > distance_type::precision)) {
237 
238  try {
239  return this->getExceptionHandler().action();
240  }
241  catch (const JException& error) {
242 
243  std::ostringstream os;
244 
245  os << __FILE__ << ':' << __LINE__ << " abscissa out of range "
246  << STREAM("?") << x << " <> "
247  << STREAM("?") << this->begin() ->getX() << ' '
248  << STREAM("?") << this->rbegin()->getX();
249 
250  throw JValueOutOfRange(os.str());
251  }
252  }
253 
254  const_iterator q = p--;
255 
256  const double dx = this->getDistance(p->getX(), q->getX());
257  const double t = this->getDistance(p->getX(), x) / dx;
258 
259  return h00(t)*p->getY() + h10(t)*p->getU()*dx + h01(t)*q->getY() + h11(t)*q->getU()*dx;
260  }
261 
262  protected:
263 
264  using collection_type::h00;
265  using collection_type::h10;
266  using collection_type::h01;
267  using collection_type::h11;
268  };
269 
270 
271  /**
272  * Template specialisation for spline interpolation method with returning JResultDerivative data structure.
273  */
274  template<class JElement_t, template<class, class> class JCollection_t, class JDistance_t>
275  class JHermiteSplineFunction<JElement_t,
276  JCollection_t,
277  JResultDerivative<typename JResultType<typename JElement_t::ordinate_type>::result_type>,
278  JDistance_t> :
279  public JHermiteSplineCollection<JElement_t, JCollection_t, JDistance_t>,
280  public virtual JFunction<typename JElement_t::abscissa_type,
281  JResultDerivative<typename JResultType<typename JElement_t::ordinate_type>::result_type> >
282  {
283  public:
284 
286 
287  typedef typename collection_type::abscissa_type abscissa_type;
288  typedef typename collection_type::ordinate_type ordinate_type;
289  typedef typename collection_type::value_type value_type;
290  typedef typename collection_type::distance_type distance_type;
291 
292  typedef typename collection_type::const_iterator const_iterator;
293  typedef typename collection_type::const_reverse_iterator const_reverse_iterator;
294  typedef typename collection_type::iterator iterator;
295  typedef typename collection_type::reverse_iterator reverse_iterator;
296 
299 
303 
304 
305  /**
306  * Default constructor.
307  */
309  {}
310 
311 
312  /**
313  * Recursive interpolation method implementation.
314  *
315  * \param pX pointer to abscissa values
316  * \return function value
317  */
318  virtual result_type evaluate(const argument_type* pX) const override
319  {
320  const argument_type x = *pX;
321 
322  if (this->size() <= 1u) {
323 
324  try {
325  return this->getExceptionHandler().action();
326  }
327  catch (const JException& error) {
328 
329  std::ostringstream os;
330 
331  os << __FILE__ << ':' << __LINE__ << " not enough data " << STREAM("?") << x;
332 
333  throw JFunctionalException(os.str());
334  }
335  }
336 
337  const_iterator p = this->lower_bound(x);
338 
339 
340  if ((p == this->begin() && this->getDistance(x, (p++)->getX()) > distance_type::precision) ||
341  (p == this->end() && this->getDistance((--p)->getX(), x) > distance_type::precision)) {
342 
343  try {
344  return this->getExceptionHandler().action();
345  }
346  catch (const JException& error) {
347 
348  std::ostringstream os;
349 
350  os << __FILE__ << ':' << __LINE__ << " abscissa out of range "
351  << STREAM("?") << x << " <> "
352  << STREAM("?") << this->begin() ->getX() << ' '
353  << STREAM("?") << this->rbegin()->getX();
354 
355  throw JValueOutOfRange(os.str());
356  }
357  }
358 
359  const_iterator q = p--;
360 
361  const double dx = this->getDistance(p->getX(), q->getX());
362  const double t = this->getDistance(p->getX(), x) / dx;
363 
364  result.f = h00 (t)*p->getY() + h10 (t)*p->getU()*dx + h01 (t)*q->getY() + h11 (t)*q->getU()*dx;
365  result.fp = h00p(t)*p->getY()/dx + h10p(t)*p->getU() + h01p(t)*q->getY()/dx + h11p(t)*q->getU();
366 
367  return result;
368  }
369 
370 
371  protected:
372 
373  using collection_type::h00;
374  using collection_type::h10;
375  using collection_type::h01;
376  using collection_type::h11;
377 
378  using collection_type::h00p;
379  using collection_type::h10p;
380  using collection_type::h01p;
381  using collection_type::h11p;
382 
383  private:
385  };
386 
387 
388  /**
389  * Template specialisation for spline interpolation method with returning JResultPDF data structure.
390  *
391  * Note that the data structure of the elements in the collection should have the additional methods:
392  * <pre>
393  * ordinate_type getIntegral() const;
394  * void setIntegral(ordinate_type v);
395  * </pre>
396  * to get and set the integral values, respectively.
397  */
398  template<class JElement_t, template<class, class> class JCollection_t, class JDistance_t>
399  class JHermiteSplineFunction<JElement_t,
400  JCollection_t,
401  JResultPDF<typename JResultType<typename JElement_t::ordinate_type>::result_type>,
402  JDistance_t> :
403  public JHermiteSplineCollection<JElement_t, JCollection_t, JDistance_t>,
404  public virtual JFunction<typename JElement_t::abscissa_type,
405  JResultPDF<typename JResultType<typename JElement_t::ordinate_type>::result_type> >
406  {
407  public:
408 
410 
411  typedef typename collection_type::abscissa_type abscissa_type;
412  typedef typename collection_type::ordinate_type ordinate_type;
413  typedef typename collection_type::value_type value_type;
414  typedef typename collection_type::distance_type distance_type;
415 
416  typedef typename collection_type::const_iterator const_iterator;
417  typedef typename collection_type::const_reverse_iterator const_reverse_iterator;
418  typedef typename collection_type::iterator iterator;
419  typedef typename collection_type::reverse_iterator reverse_iterator;
420 
423 
427 
428 
429  /**
430  * Default constructor.
431  */
433  {}
434 
435 
436  /**
437  * Recursive interpolation method implementation.
438  *
439  * \param pX pointer to abscissa values
440  * \return function value
441  */
442  virtual result_type evaluate(const argument_type* pX) const override
443  {
444  const argument_type x = *pX;
445 
446  if (this->size() <= 1u) {
447 
448  try {
449  return this->getExceptionHandler().action();
450  }
451  catch (const JException& error) {
452 
453  std::ostringstream os;
454 
455  os << __FILE__ << ':' << __LINE__ << " not enough data " << STREAM("?") << x;
456 
457  throw JFunctionalException(os.str());
458  }
459  }
460 
461  const_iterator p = this->lower_bound(x);
462 
463  if (p == this->begin() && this->getDistance(x, (p++)->getX()) > distance_type::precision) {
464 
465  try {
466 
467  result = this->getExceptionHandler().action();
468 
469  // overwrite integral values
470 
471  result.v = 0;
472  result.V = this->rbegin()->getIntegral();
473 
474  } catch(const JException& error) {
475 
476  std::ostringstream os;
477 
478  os << __FILE__ << ':' << __LINE__ << " abscissa out of range " << STREAM("?") << x << " < " << STREAM("?") << this->begin() ->getX();
479 
480  throw JValueOutOfRange(os.str());
481  }
482 
483  return result;
484 
485  } else if (p == this->end() && this->getDistance((--p)->getX(), x) > distance_type::precision) {
486 
487  try {
488 
489  result = this->getExceptionHandler().action();
490 
491  // overwrite integral values
492 
493  result.v = this->rbegin()->getIntegral();
494  result.V = this->rbegin()->getIntegral();
495 
496  } catch(const JException& error) {
497 
498  std::ostringstream os;
499 
500  os << __FILE__ << ':' << __LINE__ << " abscissa out of range " << STREAM("?") << x << " > " << STREAM("?") << this->rbegin()->getX();
501 
502  throw JValueOutOfRange(os.str());
503  }
504 
505  return result;
506  }
507 
508  const_iterator q = p--;
509 
510  const double dx = this->getDistance(p->getX(), q->getX());
511  const double t = this->getDistance(p->getX(), x) / dx;
512 
513  result.f = h00 (t)*p->getY() + h10 (t)*p->getU()*dx + h01 (t)*q->getY() + h11 (t)*q->getU()*dx;
514  result.fp = h00p(t)*p->getY()/dx + h10p(t)*p->getU() + h01p(t)*q->getY()/dx + h11p(t)*q->getU();
515  result.v = (p->getIntegral() +
516  (H00 (t)*p->getY() + H10 (t)*p->getU()*dx + H01 (t)*q->getY() + H11 (t)*q->getU()*dx)*dx);
517  result.V = this->rbegin()->getIntegral();
518 
519  return result;
520  }
521 
522 
523  protected:
524 
525  using collection_type::h00;
526  using collection_type::h10;
527  using collection_type::h01;
528  using collection_type::h11;
529 
530  using collection_type::h00p;
531  using collection_type::h10p;
532  using collection_type::h01p;
533  using collection_type::h11p;
534 
535  using collection_type::H00;
536  using collection_type::H10;
537  using collection_type::H01;
538  using collection_type::H11;
539 
540  /**
541  * Determination of derivatives.
542  */
543  virtual void do_compile() override
544  {
545  if (!this->empty()) {
546 
548 
549  this->begin()->setIntegral(JMATH::zero);
550 
551  for (iterator j = this->begin(), i = j++; j != this->end(); ++i, ++j) {
552 
553  const double dx = this->getDistance(i->getX(), j->getX());
554  const ordinate_type y = i->getY() + j->getY();
555  const ordinate_type z = i->getU() - j->getU();
556 
557  const ordinate_type v = dx * 0.50 * y;
558  const ordinate_type w = dx * 1.00 * z*dx/12.0;
559 
560  j->setIntegral(i->getIntegral() + v + w);
561  }
562  }
563  }
564 
565  private:
567  };
568 
569 
570  /**
571  * Template class for spline interpolation in 1D
572  *
573  * This class implements the JFunction1D interface.
574  */
575  template<class JElement_t,
576  template<class, class> class JCollection_t,
577  class JResult_t = typename JElement_t::ordinate_type,
580  public JHermiteSplineFunction<JElement_t, JCollection_t, JResult_t, JDistance_t>,
581  public virtual JFunction1D<typename JElement_t::abscissa_type, JResult_t>
582  {
583  public:
584 
586 
591 
596 
598 
602 
603 
604  /**
605  * Default contructor.
606  */
608  {}
609  };
610 
611 
612  /**
613  * Functional map with spline interpolation.
614  */
615  template<class JKey_t,
616  class JValue_t,
617  template<class, class, class> class JMap_t,
618  class JResult_t,
619  class JDistance_t = JDistance<JKey_t> >
621  public JMap_t<JKey_t, JValue_t, JDistance_t>,
622  public JFunction<JKey_t, JResult_t>
623  {
624  public:
625 
626  typedef JMap_t<JKey_t, JValue_t, JDistance_t> collection_type;
628 
629  typedef typename collection_type::abscissa_type abscissa_type;
630  typedef typename collection_type::ordinate_type ordinate_type;
631  typedef typename collection_type::value_type value_type;
632  typedef typename collection_type::distance_type distance_type;
633 
634  typedef typename collection_type::const_iterator const_iterator;
635  typedef typename collection_type::const_reverse_iterator const_reverse_iterator;
636  typedef typename collection_type::iterator iterator;
637  typedef typename collection_type::reverse_iterator reverse_iterator;
638 
641  typedef typename function_type::JExceptionHandler exceptionhandler_type;
642 
647 
648 
649  /**
650  * Default constructor.
651  */
653  {}
654 
655 
656  /**
657  * Recursive interpolation method implementation.
658  *
659  * \param pX pointer to abscissa values
660  * \return function value
661  */
662  virtual result_type evaluate(const argument_type* pX) const override
663  {
664  const argument_type x = *pX;
665 
666  ++pX; // next argument value
667 
668  const_iterator p = this->begin();
669 
670  for (typename JHermiteSplineFunction1D_t::iterator q = buffer.begin(); q != buffer.end(); ++q, ++p) {
671  q->getY() = JFunction<argument_type, data_type>::getValue(p->getY(), pX);
672  }
673 
674  buffer.compile();
675 
676  return buffer(x);
677  }
678 
679 
680  private:
681  /**
682  * Function compilation.
683  */
684  virtual void do_compile() override
685  {
686  buffer.clear();
687 
688  for (iterator i = this->begin(); i != this->end(); ++i) {
689  buffer.put(i->getX(), data_type());
690  }
691  }
692 
693 
695  };
696 
697 
698  /**
699  * Conversion of data points to integral values.
700  *
701  * The integration includes the use of 2nd derivatives of the data points of the input spline interpolating function.
702  *
703  * \param input collection
704  * \param output mappable collection
705  * \return integral
706  */
707  template<class JElement_t,
708  template<class, class> class JCollection_t,
709  class JResult_t,
710  class JDistance_t>
711  inline typename JElement_t::ordinate_type
713  typename JMappable<JElement_t>::map_type& output)
714  {
715  typedef typename JElement_t::ordinate_type ordinate_type;
717 
718  ordinate_type V(JMATH::zero);
719 
720  if (input.getSize() > 1) {
721 
722  output.put(input.begin()->getX(), V);
723 
724  for (const_iterator j = input.begin(), i = j++; j != input.end(); ++i, ++j) {
725 
726  const double dx = input.getDistance(i->getX(), j->getX());
727  const ordinate_type y = i->getY() + j->getY();
728  const ordinate_type z = i->getU() - j->getU();
729 
730  const ordinate_type v = dx * 0.50 * y;
731  const ordinate_type w = dx * 1.00 * z*dx/12.0;
732 
733  V += v + w;
734 
735  output.put(j->getX(), V);
736  }
737  }
738 
739  return V;
740  }
741 
742 
743  /**
744  * Conversion of data points to integral values.
745  *
746  * The integration directly uses the integral values of the input spline interpolating function.
747  *
748  * \param input collection
749  * \param output mappable collection
750  * \return integral
751  */
752  template<class JElement_t,
753  template<class, class> class JCollection_t,
754  class JDistance_t>
755  inline typename JElement_t::ordinate_type
756  integrate(const JHermiteSplineFunction1D<JElement_t, JCollection_t, JResultPDF<typename JElement_t::ordinate_type>, JDistance_t>& input,
757  typename JMappable<JElement_t>::map_type& output)
758  {
759  typedef typename JElement_t::ordinate_type ordinate_type;
762 
763  if (input.getSize() > 1) {
764 
765  for (const_iterator i = input.begin(); i != input.end(); ++i) {
766  output.put(i->getX(), i->getIntegral());
767  }
768 
769  return input.rbegin()->getIntegral();
770  }
771 
772  return JMATH::zero;
773  }
774 }
775 
776 #endif
static abscissa_type h01p(abscissa_type t)
function_type::argument_type argument_type
JHermiteSplineFunction1D_t buffer
collection_type::value_type value_type
General exception.
Definition: JException.hh:24
data_type w[N+1][M+1]
Definition: JPolint.hh:867
collection_type::value_type value_type
Exceptions.
then fatal No hydrophone data file $HYDROPHONE_TXT fi sort gr k
collection_type::const_iterator const_iterator
void compile(const bool monotone)
Determination of derivatives.
collection_type::ordinate_type ordinate_type
std::vector< event_type > data_type
Definition: JPerth.cc:78
static abscissa_type h00(abscissa_type t)
Exception for a functional operation.
Definition: JException.hh:142
collection_type::const_reverse_iterator const_reverse_iterator
JHermiteSplineFunction1D()
Default contructor.
Template class for distance evaluation.
Definition: JDistance.hh:24
This include file containes various data structures that can be used as specific return types for the...
functional_type::argument_type argument_type
Definition: JFunctional.hh:338
JHermiteSplineMap()
Default constructor.
virtual void do_compile() override
Function compilation.
JCollection_t< JElement_t, JDistance_t > collection_type
collection_type::value_type value_type
static abscissa_type H01(abscissa_type t)
Template interface definition for associative collection of elements.
virtual void do_compile() override
Function compilation.
Definition: JPolint.hh:860
static const JZero zero
Function object to assign zero value.
Definition: JZero.hh:105
static abscissa_type h11(abscissa_type t)
V(JDAQEvent-JTriggerReprocessor)*1.0/(JDAQEvent+1.0e-10)
Definition of zero value for any class.
Template definition of function object interface in one dimension.
Definition: JFunctional.hh:332
collection_type::const_iterator const_iterator
double getDistance(const JFirst_t &first, const JSecond_t &second)
Get distance between objects.
JFunction1D< abscissa_type, JResult_t > function_type
JResultType< ordinate_type >::result_type data_type
Exception for missing value.
Definition: JException.hh:214
JMap_t< JKey_t, JValue_t, JDistance_t > collection_type
collection_type::abscissa_type abscissa_type
static result_type getValue(const JFunctional &function, const argument_type *pX)
Recursive function value evaluation.
Definition: JFunctional.hh:107
collection_type::reverse_iterator reverse_iterator
static abscissa_type h00p(abscissa_type t)
virtual void do_compile() override
Determination of derivatives.
static abscissa_type h11p(abscissa_type t)
collection_type::distance_type distance_type
virtual result_type evaluate(const argument_type *pX) const override
Recursive interpolation method implementation.
virtual result_type evaluate(const argument_type *pX) const override
Recursive interpolation method implementation.
collection_type::distance_type distance_type
collection_type::abscissa_type abscissa_type
static abscissa_type h10p(abscissa_type t)
function_type::result_type result_type
Data structure for result including value, first derivative and integrals of function.
Definition: JResult.hh:337
static abscissa_type H10(abscissa_type t)
Auxiliary data structure for handling std::ostream.
Template definition of function object interface.
Definition: JFunctional.hh:32
functional_type::result_type result_type
Definition: JFunctional.hh:339
Auxiliary class to evaluate result type.
Definition: JFunctional.hh:392
static abscissa_type h01(abscissa_type t)
collection_type::const_reverse_iterator const_reverse_iterator
void put(typename JClass< key_type >::argument_type key, typename JClass< mapped_type >::argument_type value)
Put pair-wise element (key,value) into collection.
collection_type::iterator iterator
Template class to define the corresponding JCollection for a given template JMap. ...
collection_type::abscissa_type abscissa_type
collection_type::reverse_iterator reverse_iterator
Template base class spline interpolations.
Data structure for result including value and first derivative of function.
Definition: JResult.hh:43
function_type::argument_type argument_type
virtual result_type evaluate(const argument_type *pX) const override
Recursive interpolation method implementation.
Exception handler for functional object.
Definition: JFunctional.hh:131
Template class for spline interpolation in 1D.
Template definition of function object interface in multidimensions.
Definition: JFunctional.hh:318
static abscissa_type H00(abscissa_type t)
function_type::JExceptionHandler exceptionhandler_type
collection_type::ordinate_type ordinate_type
functional_type::result_type result_type
Definition: JFunctional.hh:323
Functional map with spline interpolation.
collection_type::iterator iterator
const JExceptionHandler & getExceptionHandler() const
Get exception handler.
Definition: JFunctional.hh:292
Exception for division by zero.
Definition: JException.hh:286
JHermiteSplineCollection()
Default constructor.
collection_type::iterator iterator
collection_type::reverse_iterator reverse_iterator
JFunction< JKey_t, JResult_t > function_type
JHermiteSplineFunction1D< JSplineElement2D< argument_type, data_type >, JMapCollection< JMap_t >::template collection_type, result_type > JHermiteSplineFunction1D_t
int j
Definition: JPolint.hh:792
JHermiteSplineCollection< JElement_t, JCollection_t, JDistance_t > collection_type
collection_type::distance_type distance_type
Exception for accessing a value in a collection that is outside of its range.
Definition: JException.hh:178
Template definition for functional collection with spline interpolation.
functional_type::argument_type argument_type
Definition: JFunctional.hh:322
static abscissa_type H11(abscissa_type t)
collection_type::ordinate_type ordinate_type
data_type v[N+1][M+1]
Definition: JPolint.hh:866
double u[N+1]
Definition: JPolint.hh:865
static abscissa_type h10(abscissa_type t)
function_type::result_type result_type
collection_type::const_reverse_iterator const_reverse_iterator
JElement_t::ordinate_type integrate(const JCollection< JElement_t, JDistance_t > &input, typename JMappable< JElement_t >::map_type &output)
Conversion of data points to integral values.
Definition: JCollection.hh:812
collection_type::const_iterator const_iterator
function_type::JExceptionHandler exceptionhandler_type