Jpp
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
JCollection.hh
Go to the documentation of this file.
1 #ifndef __JTOOLS__JCOLLECTION__
2 #define __JTOOLS__JCOLLECTION__
3 
4 #include <vector>
5 #include <cmath>
6 #include <limits>
7 #include <algorithm>
8 
9 #include "JLang/JClass.hh"
10 #include "JLang/JException.hh"
11 #include "JLang/JLangToolkit.hh"
12 #include "JMath/JZero.hh"
13 #include "JMath/JMath.hh"
14 #include "JIO/JSerialisable.hh"
15 #include "JTools/JDistance.hh"
16 #include "JTools/JTransformer.hh"
19 
20 /**
21  * \file
22  *
23  * General purpose class for a collection of sorted elements.
24  * \author mdejong
25  */
26 namespace JTOOLS {}
27 namespace JPP { using namespace JTOOLS; }
28 
29 namespace JTOOLS {
30 
31  using JIO::JReader;
32  using JIO::JWriter;
33  using JLANG::JClass;
34  using JLANG::JException;
35 
36 
37  /**
38  * General purpose class for collection of elements, see:
39  \htmlonly
40  <a href="JTools.PDF";>Collection of elements.</a>
41  \endhtmlonly
42  *
43  * This class implements the JMappableCollection and JAbstractCollection interfaces.
44  *
45  * The data type of the elements of the collection should have the following policy
46  * type definition and member methods.
47  * <pre>
48  * typedef <abscissa type> abscissa_type;
49  * typedef <ordinate type> ordinate_type;
50  *
51  * (constructor)(abscissa_type, ordinate_type);
52  *
53  * abscissa_type %getX() const;
54  * ordinate_type %getY() const;
55  * ordinate_type& %getY();
56  * </pre>
57  *
58  * The elements in a collection are sorted according to their abscissa values and
59  * the given distance operator.
60  * The distance operator constitues a binary method returning the distance between
61  * two abscissa values; The default distance operator is JDistance.
62  *
63  * For the binary I/O of a collection of elements, the data structure of the elements
64  * should provide for an implementation of the following operators:
65  * <pre>
66  * JReader& operator>>(JReader& in);
67  * JWriter& operator<<(JWriter& out);
68  * </pre>
69  */
70  template<class JElement_t, class JDistance_t = JDistance<typename JElement_t::abscissa_type> >
71  class JCollection :
72  public std::vector<JElement_t>,
73  public JMappableCollection<typename JElement_t::abscissa_type,
74  typename JElement_t::ordinate_type>,
75  public JAbstractCollection<typename JElement_t::abscissa_type>,
76  public JMATH::JMath< JCollection<JElement_t, JDistance_t> >
77  {
78  public:
79 
80  typedef typename JElement_t::abscissa_type abscissa_type;
81  typedef typename JElement_t::ordinate_type ordinate_type;
82  typedef JElement_t value_type;
83  typedef JDistance_t distance_type;
84 
86 
88 
89  typedef typename container_type::const_iterator const_iterator;
90  typedef typename container_type::const_reverse_iterator const_reverse_iterator;
91  typedef typename container_type::iterator iterator;
92  typedef typename container_type::reverse_iterator reverse_iterator;
93 
96 
98 
99 
100  /**
101  * Auxiliary class for ordering of objects in the collection by their abscissa values.
102  */
103  struct JComparator {
104  /**
105  * Comparison of elements.
106  *
107  * \param first first element
108  * \param second second element
109  * \return true if first element less than second element; else false
110  */
111  inline bool operator()(const JElement_t& first,
112  const JElement_t& second) const
113  {
114  return this->getDistance(first.getX(), second.getX()) > 0.0;
115  }
116 
117 
118  /**
119  * Comparison of element and abscissa value.
120  *
121  * \param element element
122  * \param x abscissa value
123  * \return true if element less than abscissa value; else false
124  */
125  inline bool operator()(const JElement_t& element, typename JClass<abscissa_type>::argument_type x) const
126  {
127  return this->getDistance(element.getX(), x) > 0.0;
128  }
129 
130 
131  /**
132  * Function object for distance evaluation.
133  */
134  JDistance_t getDistance;
135  };
136 
137 
138  /**
139  * Default constructor.
140  */
142  {}
143 
144 
145  /**
146  * Clear.
147  */
148  virtual void clear()
149  {
150  container_type::clear();
151  }
152 
153 
154  /**
155  * Get ordinate value.
156  *
157  * \param x abscissa value
158  * \return ordinate value
159  */
161  {
162  iterator i = this->lower_bound(x);
163 
164  if (i == this->end() || this->getDistance(x, i->getX()) > 0.0) {
165  i = container_type::insert(i, value_type(x, ordinate_type()));
166  }
167 
168  return i->getY();
169  }
170 
171 
172  /**
173  * Get number of elements.
174  *
175  * \return number of elements
176  */
177  virtual int getSize() const
178  {
179  return (int) this->size();
180  }
181 
182 
183  /**
184  * Get abscissa value.
185  *
186  * \param index index
187  * \return abscissa value
188  */
189  virtual abscissa_type getX(int index) const
190  {
191  return this->at(index).getX();
192  }
193 
194 
195  /**
196  * Get minimal abscissa value.
197  *
198  * \return abscissa value
199  */
200  virtual abscissa_type getXmin() const
201  {
202  return this->begin()->getX();
203  }
204 
205 
206  /**
207  * Get maximal abscissa value.
208  *
209  * \return abscissa value
210  */
211  virtual abscissa_type getXmax() const
212  {
213  return this->rbegin()->getX();
214  }
215 
216 
217 
218  /**
219  * Get ordinate value.
220  *
221  * \param index index
222  * \return ordinate value
223  */
224  const ordinate_type& getY(int index) const
225  {
226  return this->at(index).getY();
227  }
228 
229 
230  /**
231  * Get ordinate value.
232  *
233  * \param index index
234  * \return ordinate value
235  */
236  ordinate_type& getY(int index)
237  {
238  return this->at(index).getY();
239  }
240 
241 
242  /**
243  * Transform collection.
244  *
245  * \param transformer element transformer
246  */
247  void transform(const transformer_type& transformer)
248  {
249  collection_type buffer;
250 
251  this->swap(buffer);
252 
253  for (const_iterator i = buffer.begin(); i != buffer.end(); ++i) {
254  this->insert(transformer(*i));
255  }
256  }
257 
258 
259  /**
260  * Sort elements.
261  */
262  void sort()
263  {
264  std::sort(this->begin(), this->end(), compare);
265  }
266 
267 
268  /**
269  * Get first position of element <tt>i</tt>, where <tt>x >= i->getX()</tt>.
270  *
271  * \param x abscissa value
272  * \return position of corresponding element
273  */
275  {
276  return std::lower_bound(this->begin(), this->end(), x, compare);
277  }
278 
279 
280  /**
281  * Get first position of element <tt>i</tt>, where <tt>x >= i->getX()</tt>.
282  *
283  * \param x abscissa value
284  * \return position of corresponding element
285  */
287  {
288  return std::lower_bound(this->begin(), this->end(), x, compare);
289  }
290 
291 
292  /**
293  * Insert element.
294  *
295  * \param element element
296  * \return (iterator, status), where status is true if inserted; else false
297  */
298  pair_type insert(const value_type& element)
299  {
300  iterator i = this->lower_bound(element.getX());
301 
302  if (i == this->end() || this->getDistance(element.getX(), i->getX()) > 0.0)
303  return pair_type(container_type::insert(i, element), true);
304  else
305  return pair_type(this->end(), false);
306  }
307 
308 
309  /**
310  * Configure collection.
311  *
312  * \param bounds abscissa values
313  */
315  {
316  configure(bounds, JMATH::getZero<ordinate_type>());
317  }
318 
319 
320  /**
321  * Configure collection.
322  *
323  * \param bounds abscissa values
324  * \param value ordinate value
325  */
328  {
329  this->resize(bounds.getSize());
330 
331  for (iterator i = this->begin(); i != this->end(); ++i) {
332 
333  const abscissa_type x = bounds.getX(std::distance(this->begin(),i));
334 
335  *i = value_type(x,value);
336  }
337  }
338 
339 
340  /**
341  * Configure collection.
342  *
343  * \param bounds abscissa values
344  * \param function function
345  */
346  template<class JFunction1D_t>
348  const JFunction1D_t& function)
349  {
350  using namespace JLANG;
351 
352  collection_type* out = (is_identical(*this, function) ? new collection_type() : this);
353 
354  for (int i = 0; i != bounds.getSize(); ++i) {
355 
356  const abscissa_type x = bounds.getX(i);
357 
358  out->put(x, function(x));
359  }
360 
361  if (is_identical(*this, function)) {
362 
363  this->swap(*out);
364 
365  delete out;
366  }
367  }
368 
369 
370  /**
371  * Test whether collections are compatible.
372  *
373  * \param collection collection
374  * \return true if collections are compatible; else false
375  */
376  bool is_compatible(const JCollection& collection) const
377  {
378  if (this->empty() || collection.empty()) {
379 
380  return true;
381 
382  } else {
383 
384  const double precision = JDistance<abscissa_type>::precision;
385 
386  const_iterator p = this->begin();
387  const_iterator q = collection.begin();
388 
389  if (getDistance(p->getX(), q->getX()) > precision) {
390 
391  do {
392  ++p;
393  } while (p != this->end() && getDistance(p->getX(), q->getX()) > precision);
394 
395  } else if (getDistance(q->getX(), p->getX()) > precision) {
396 
397  do {
398  ++q;
399  } while (q != collection.end() && getDistance(q->getX(), p->getX()) > precision);
400  }
401 
402  for ( ; p != this->end() && q != collection.end(); ++p, ++q) {
403  if (fabs(getDistance(p->getX(), q->getX())) > precision) {
404  return false;
405  }
406  }
407 
408  return true;
409  }
410  }
411 
412 
413  /**
414  * Negate collection.
415  *
416  * \return this collection
417  */
419  {
420  for (iterator i = this->begin(); i != this->end(); ++i) {
421  i->getY() = -i->getY();
422  }
423 
424  return *this;
425  }
426 
427 
428  /**
429  * Add collection.
430  *
431  * \param collection collection
432  * \return this collection
433  */
434  JCollection& add(const JCollection& collection)
435  {
436  if (!collection.empty()) {
437 
438  if (this->empty()) {
439 
440  for (const_iterator i = collection.begin(); i != collection.end(); ++i) {
441  this->put(i->getX(), +i->getY());
442  }
443 
444  } else if (this->is_compatible(collection)) {
445 
446  const double precision = JDistance<abscissa_type>::precision;
447 
448  iterator p = this->begin();
449  const_iterator q = collection.begin();
450 
451  if (getDistance(p->getX(), q->getX()) > precision) {
452 
453  do {
454  ++p;
455  } while (p != this->end() && getDistance(p->getX(), q->getX()) > precision);
456 
457  } else if (getDistance(q->getX(), p->getX()) > precision) {
458 
459  do {
460  ++q;
461  } while (q != collection.end() && getDistance(q->getX(), p->getX()) > precision);
462  }
463 
464  const_iterator i = q;
465 
466  for ( ; p != this->end() && i != collection.end(); ++p, ++i) {
467  p->getY() += i->getY();
468  }
469 
470  for ( ; i != collection.end(); ++i) {
471  this->put(i->getX(), +i->getY());
472  }
473 
474  for (i = collection.begin(); i != q; ++i) {
475  this->put(i->getX(), +i->getY());
476  }
477  }
478  }
479 
480  return *this;
481  }
482 
483 
484  /**
485  * Subtract collection.
486  *
487  * \param collection collection
488  * \return this collection
489  */
490  JCollection& sub(const JCollection& collection)
491  {
492  if (!collection.empty()) {
493 
494  if (this->empty()) {
495 
496  for (const_iterator i = collection.begin(); i != collection.end(); ++i) {
497  this->put(i->getX(), -i->getY());
498  }
499 
500  } else if (this->is_compatible(collection)) {
501 
502  const double precision = JDistance<abscissa_type>::precision;
503 
504  iterator p = this->begin();
505  const_iterator q = collection.begin();
506 
507  if (getDistance(p->getX(), q->getX()) > precision) {
508 
509  do {
510  ++p;
511  } while (p != this->end() && getDistance(p->getX(), q->getX()) > precision);
512 
513  } else if (getDistance(q->getX(), p->getX()) > precision) {
514 
515  do {
516  ++q;
517  } while (q != collection.end() && getDistance(q->getX(), p->getX()) > precision);
518  }
519 
520  const_iterator i = q;
521 
522  for ( ; p != this->end() && i != collection.end(); ++p, ++i) {
523  p->getY() -= i->getY();
524  }
525 
526  for ( ; i != collection.end(); ++i) {
527  this->put(i->getX(), -i->getY());
528  }
529 
530  for (i = collection.begin(); i != q; ++i) {
531  this->put(i->getX(), -i->getY());
532  }
533 
534  } else {
535 
536  throw JException("JCollection::add() collections incompatible.");
537  }
538  }
539 
540  return *this;
541  }
542 
543 
544  /**
545  * Scale contents.
546  *
547  * \param value multiplication factor
548  * \return this collection
549  */
550  JCollection& mul(const double value)
551  {
552  for (iterator i = this->begin(); i != this->end(); ++i) {
553  i->getY() *= value;
554  }
555 
556  return *this;
557  }
558 
559 
560  /**
561  * Scale contents.
562  *
563  * \param value division factor
564  * \return this collection
565  */
566  JCollection& div(const double value)
567  {
568  for (iterator i = this->begin(); i != this->end(); ++i) {
569  i->getY() /= value;
570  }
571 
572  return *this;
573  }
574 
575 
576  /**
577  * Add offset.
578  *
579  * \param value offset
580  * \return this collection
581  */
583  {
584  for (iterator i = this->begin(); i != this->end(); ++i) {
585  i->getY() += value;
586  }
587 
588  return *this;
589  }
590 
591 
592  /**
593  * Subtract offset.
594  *
595  * \param value offset
596  * \return this collection
597  */
599  {
600  for (iterator i = this->begin(); i != this->end(); ++i) {
601  i->getY() -= value;
602  }
603 
604  return *this;
605  }
606 
607 
608  /**
609  * Add function.
610  *
611  * \param function function
612  * \return this collection
613  */
614  template<class JFunction1D_t>
615  JCollection& add(const JFunction1D_t& function)
616  {
617  for (iterator i = this->begin(); i != this->end(); ++i) {
618  i->getY() += function(i->getX());
619  }
620 
621  return *this;
622  }
623 
624 
625  /**
626  * Subtract function.
627  *
628  * \param function function
629  * \return this collection
630  */
631  template<class JFunction1D_t>
632  JCollection& sub(const JFunction1D_t& function)
633  {
634  for (iterator i = this->begin(); i != this->end(); ++i) {
635  i->getY() -= function(i->getX());
636  }
637 
638  return *this;
639  }
640 
641 
642  /**
643  * Add offset to collaction.
644  *
645  * \param collection collection
646  * \param value offset
647  * \return collection
648  */
650  {
651  return collection.add(value);
652  }
653 
654 
655  /**
656  * Subtract offset from collaction.
657  *
658  * \param collection collection
659  * \param value offset
660  * \return collection
661  */
663  {
664  return collection.sub(value);
665  }
666 
667 
668  /**
669  * Add function.
670  *
671  * \param collection collection
672  * \param function function
673  * \return this collection
674  */
675  template<class JFunction1D_t>
676  friend JCollection& operator+=(JCollection& collection, const JFunction1D_t& function)
677  {
678  return collection.add(function);
679  }
680 
681 
682  /**
683  * Subtract function.
684  *
685  * \param collection collection
686  * \param function function
687  * \return this collection
688  */
689  template<class JFunction1D_t>
690  friend JCollection& operator-=(JCollection& collection, const JFunction1D_t& function)
691  {
692  return collection.sub(function);
693  }
694 
695 
696  /**
697  * Read collection from input.
698  *
699  * \param in reader
700  * \param collection collection
701  * \return reader
702  */
703  friend inline JReader& operator>>(JReader& in, JCollection& collection)
704  {
705  int n;
706 
707  in >> n;
708 
709  collection.resize(n);
710 
711  for (typename JCollection::iterator i = collection.begin(); i != collection.end(); ++i) {
712  in >> *i;
713  }
714 
715  return in;
716  }
717 
718 
719  /**
720  * Write collection to output.
721  *
722  * \param out writer
723  * \param collection collection
724  * \return writer
725  */
726  friend inline JWriter& operator<<(JWriter& out, const JCollection& collection)
727  {
728  const int n = collection.size();
729 
730  out << n;
731 
732  for (typename JCollection::const_iterator i = collection.begin(); i != collection.end(); ++i) {
733  out << *i;
734  }
735 
736  return out;
737  }
738 
739 
740  /**
741  * Get comparator.
742  *
743  * \return comparator
744  */
745  const JComparator& getComparator() const
746  {
747  return compare;
748  }
749 
750 
751  /**
752  * Function object for distance evaluation.
753  */
754  JDistance_t getDistance;
755 
756 
757  protected:
758  /**
759  * Function object for comparison.
760  */
762 
763 
764  /**
765  * Resize collection
766  *
767  * \param size size
768  */
769  void resize(typename container_type::size_type size)
770  {
771  container_type::resize(size);
772  }
773 
774  private:
775  void erase();
776  void push_back();
777  void pop_back();
778  };
779 
780 
781  /**
782  * Conversion of data points to integral values.
783  *
784  * The integration is based on the trapezoidal rule applied to the input data points.
785  *
786  * \param input collection
787  * \param output mappable collection
788  * \return integral
789  */
790  template<class JElement_t,
791  class JDistance_t>
792  inline typename JElement_t::ordinate_type
794  {
795  typedef typename JElement_t::ordinate_type ordinate_type;
797 
798  ordinate_type V(JMATH::zero);
799 
800  if (input.getSize() > 1) {
801 
802  output.put(input.begin()->getX(), V);
803 
804  for (const_iterator j = input.begin(), i = j++; j != input.end(); ++i, ++j) {
805 
806  V += 0.5 * input.getDistance(i->getX(), j->getX()) * (i->getY() + j->getY());
807 
808  output.put(j->getX(), V);
809  }
810  }
811 
812  return V;
813  }
814 }
815 
816 #endif
virtual abscissa_type getXmin() const
Get minimal abscissa value.
Definition: JCollection.hh:200
std::pair< const_iterator, bool > pair_type
Definition: JCollection.hh:95
container_type::reverse_iterator reverse_iterator
Definition: JCollection.hh:92
JCollection & add(const JFunction1D_t &function)
Add function.
Definition: JCollection.hh:615
General exception.
Definition: JException.hh:40
void sort()
Sort elements.
Definition: JCollection.hh:262
JCollection< JElement_t, JDistance_t > collection_type
Definition: JCollection.hh:85
Exceptions.
Interface for binary output.
abscissa_type getX() const
Get abscissa value.
Definition: JElement.hh:78
2D Element.
Definition: JElement.hh:44
Auxiliary class for ordering of objects in the collection by their abscissa values.
Definition: JCollection.hh:103
Auxiliary base class for aritmetic operations of derived class types.
Definition: JMath.hh:26
JCollection & sub(typename JClass< ordinate_type >::argument_type value)
Subtract offset.
Definition: JCollection.hh:598
JElement_t value_type
Definition: JCollection.hh:82
General purpose class for collection of elements, see: &lt;a href=&quot;JTools.PDF&quot;;&gt;Collection of elements...
Definition: JCollection.hh:71
JCollection & mul(const double value)
Scale contents.
Definition: JCollection.hh:550
Abstract interface for abscissa values of a collection of elements.
friend JCollection & operator+=(JCollection &collection, const JFunction1D_t &function)
Add function.
Definition: JCollection.hh:676
JCollection & add(const JCollection &collection)
Add collection.
Definition: JCollection.hh:434
Template class for distance evaluation.
Definition: JDistance.hh:24
friend JReader & operator>>(JReader &in, JCollection &collection)
Read collection from input.
Definition: JCollection.hh:703
friend JCollection & operator-=(JCollection &collection, const JFunction1D_t &function)
Subtract function.
Definition: JCollection.hh:690
JDistance_t getDistance
Function object for distance evaluation.
Definition: JCollection.hh:754
virtual int getSize() const
Get number of elements.
Definition: JCollection.hh:177
void configure(const JAbstractCollection< abscissa_type > &bounds, typename JClass< ordinate_type >::argument_type value)
Configure collection.
Definition: JCollection.hh:326
Template interface definition for associative collection of elements.
friend JWriter & operator<<(JWriter &out, const JCollection &collection)
Write collection to output.
Definition: JCollection.hh:726
JCollection & sub(const JFunction1D_t &function)
Subtract function.
Definition: JCollection.hh:632
static const JZero zero
Function object to assign zero value.
Definition: JZero.hh:94
bool operator()(const JElement_t &first, const JElement_t &second) const
Comparison of elements.
Definition: JCollection.hh:111
JCollection & add(typename JClass< ordinate_type >::argument_type value)
Add offset.
Definition: JCollection.hh:582
Definition of zero value for any class.
void resize(typename container_type::size_type size)
Resize collection.
Definition: JCollection.hh:769
JElement_t::abscissa_type abscissa_type
Definition: JCollection.hh:80
JCollection & negate()
Negate collection.
Definition: JCollection.hh:418
void transform(const transformer_type &transformer)
Transform collection.
Definition: JCollection.hh:247
JComparator compare
Function object for comparison.
Definition: JCollection.hh:761
bool is_compatible(const JCollection &collection) const
Test whether collections are compatible.
Definition: JCollection.hh:376
const_iterator lower_bound(typename JClass< abscissa_type >::argument_type x) const
Get first position of element i, where x &gt;= i-&gt;getX().
Definition: JCollection.hh:274
bool is_identical(JFirst_t &first, JSecond_t &second)
Check if two objects are indentical.
Definition: JLangToolkit.hh:46
JArgument< T >::argument_type argument_type
Definition: JClass.hh:64
virtual void clear()
Clear.
Definition: JCollection.hh:148
virtual abscissa_type getX(int index) const
Get abscissa value.
Definition: JCollection.hh:189
bool operator()(const JElement_t &element, typename JClass< abscissa_type >::argument_type x) const
Comparison of element and abscissa value.
Definition: JCollection.hh:125
JCollection & div(const double value)
Scale contents.
Definition: JCollection.hh:566
container_type::iterator iterator
Definition: JCollection.hh:91
friend JCollection & operator+=(JCollection &collection, typename JClass< ordinate_type >::argument_type value)
Add offset to collaction.
Definition: JCollection.hh:649
JDistance_t getDistance
Function object for distance evaluation.
Definition: JCollection.hh:134
Template definition of auxiliary class to compare objects.
Definition: JComparator.hh:23
void configure(const JAbstractCollection< abscissa_type > &bounds)
Configure collection.
Definition: JCollection.hh:314
container_type::const_reverse_iterator const_reverse_iterator
Definition: JCollection.hh:90
virtual abscissa_type getX(int index) const =0
Get abscissa value.
iterator lower_bound(typename JClass< abscissa_type >::argument_type x)
Get first position of element i, where x &gt;= i-&gt;getX().
Definition: JCollection.hh:286
void put(typename JClass< key_type >::argument_type key, typename JClass< mapped_type >::argument_type value)
Put pair-wise element (key,value) into collection.
Interface for binary input.
friend JCollection & operator-=(JCollection &collection, typename JClass< ordinate_type >::argument_type value)
Subtract offset from collaction.
Definition: JCollection.hh:662
JCollection & sub(const JCollection &collection)
Subtract collection.
Definition: JCollection.hh:490
Interface for transformation of collection of elements.
Definition: JTransformer.hh:18
JDistance_t distance_type
Definition: JCollection.hh:83
const ordinate_type & getY(int index) const
Get ordinate value.
Definition: JCollection.hh:224
virtual abscissa_type getXmax() const
Get maximal abscissa value.
Definition: JCollection.hh:211
std::vector< value_type > container_type
Definition: JCollection.hh:87
Template for generic class types.
Definition: JClass.hh:62
JElement_t::ordinate_type ordinate_type
Definition: JCollection.hh:81
Base class for data structures with artithmetic capabilities.
virtual int getSize() const =0
Get number of elements.
container_type::const_iterator const_iterator
Definition: JCollection.hh:89
pair_type insert(const value_type &element)
Insert element.
Definition: JCollection.hh:298
JCollection()
Default constructor.
Definition: JCollection.hh:141
void configure(const JAbstractCollection< abscissa_type > &bounds, const JFunction1D_t &function)
Configure collection.
Definition: JCollection.hh:347
JCollectionElementTransformer< value_type > transformer_type
Definition: JCollection.hh:94
ordinate_type & getY(int index)
Get ordinate value.
Definition: JCollection.hh:236
const JComparator & getComparator() const
Get comparator.
Definition: JCollection.hh:745
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:793