Jpp
JTuple.hh
Go to the documentation of this file.
1 #ifndef __JTOOLS__JTUPLE__
2 #define __JTOOLS__JTUPLE__
3 
4 #include <istream>
5 #include <ostream>
6 #include <stdarg.h>
7 
8 #include "JLang/JTypeList.hh"
9 #include "JLang/JNullType.hh"
10 #include "JLang/JClass.hh"
11 #include "JLang/JComparable.hh"
12 #include "JLang/JType.hh"
13 #include "JLang/JNumber.hh"
14 #include "JMath/JMath.hh"
15 #include "JIO/JSerialisable.hh"
16 
17 
18 /**
19  * \file
20  * Data structure based on type list.
21  * \author mdejong
22  */
23 namespace JTOOLS {}
24 namespace JPP { using namespace JTOOLS; }
25 
26 namespace JTOOLS {
27 
28  using JLANG::JTypeList;
29  using JLANG::JTYPELIST;
30  using JLANG::JNullType;
31  using JLANG::JClass;
32  using JLANG::JType;
33  using JLANG::JNumber;
34  using JLANG::for_each;
35  using JMATH::JMath;
36  using JLANG::JComparable;
37  using JIO::JReader;
38  using JIO::JWriter;
39 
40 
41  /**
42  * Template data structure.
43  */
44  template<class T>
45  struct JTuple :
46  public JMath < JTuple<T> >,
47  public JComparable< JTuple<T> >
48  {
49 
51 
52  /**
53  * Default constructor.
54  */
56  {}
57 
58 
59  /**
60  * Constructor.
61  *
62  * \param __first first
63  */
64  JTuple(typename JClass<T>::argument_type __first) :
65  first(__first)
66  {}
67 
68 
69  /**
70  * Negate tuple.
71  *
72  * \return this tuple
73  */
75  {
76  first = -first;
77 
78  return *this;
79  }
80 
81 
82  /**
83  * Add tuple.
84  *
85  * \param tuple tuple
86  * \return this tuple
87  */
88  JTuple& add(const JTuple& tuple)
89  {
90  first += tuple.first;
91 
92  return *this;
93  }
94 
95 
96  /**
97  * Subtract tuple.
98  *
99  * \param tuple tuple
100  * \return this tuple
101  */
102  JTuple& sub(const JTuple& tuple)
103  {
104  first -= tuple.first;
105 
106  return *this;
107  }
108 
109 
110  /**
111  * Scale tuple.
112  *
113  * \param factor multiplication factor
114  * \return this tuple
115  */
116  JTuple& mul(const double factor)
117  {
118  first *= factor;
119 
120  return *this;
121  }
122 
123 
124  /**
125  * Scale tuple.
126  *
127  * \param factor division factor
128  * \return this tuple
129  */
130  JTuple& div(const double factor)
131  {
132  first /= factor;
133 
134  return *this;
135  }
136 
137 
138  /**
139  * Compare tuple.
140  *
141  * \param tuple tuple
142  * \return true if this tuple less than given tuple; else false
143  */
144  bool less(const JTuple& tuple) const
145  {
146  return first < tuple.first;
147  }
148 
149 
150  /**
151  * Initialise values.
152  *
153  * \param ap argument list
154  */
155  void valueOf(va_list& ap)
156  {
157  first = va_arg(ap, T);
158  }
159 
160 
161  /**
162  * Read tuple from input.
163  *
164  * \param in input stream
165  * \param tuple tuple
166  * \return input stream
167  */
168  friend inline std::istream& operator>>(std::istream& in, JTuple& tuple)
169  {
170  return in >> tuple.first;
171  }
172 
173 
174  /**
175  * Write tuple to output.
176  *
177  * \param out output stream
178  * \param tuple tuple
179  * \return output stream
180  */
181  friend inline std::ostream& operator<<(std::ostream& out, const JTuple& tuple)
182  {
183  return out << tuple.first;
184  }
185 
186 
187  /**
188  * Read tuple from input.
189  *
190  * \param in reader
191  * \param tuple tuple
192  * \return reader
193  */
194  friend inline JReader& operator>>(JReader& in, JTuple& tuple)
195  {
196  return in >> tuple.first;
197  }
198 
199 
200  /**
201  * Write tuple to output.
202  *
203  * \param out writer
204  * \param tuple tuple
205  * \return writer
206  */
207  friend inline JWriter& operator<<(JWriter& out, const JTuple& tuple)
208  {
209  return out << tuple.first;
210  }
211 
212 
213  T first;
214  };
215 
216 
217 
218  /**
219  * Template specialisation of JTuple for multiple data types.
220  */
221  template<class JHead_t, class JTail_t>
222  struct JTuple< JTypeList<JHead_t, JTail_t> > :
223  public JMath < JTuple< JTypeList<JHead_t, JTail_t> > >,
224  public JComparable< JTuple< JTypeList<JHead_t, JTail_t> > >
225  {
226 
228 
229 
230  /**
231  * Default constructor.
232  */
234  {}
235 
236 
237  /**
238  * Constructor.
239  *
240  * \param __first first
241  * \param __second second
242  */
243  JTuple(typename JClass<JHead_t>::argument_type __first, const JTuple<JTail_t>& __second) :
244  first (__first),
245  second(__second)
246  {}
247 
248 
249  /**
250  * Initialise constructor.
251  *
252  * \param x comma seperated argument list
253  */
255  {
256  va_list ap;
257 
258  first = x;
259 
260  va_start(ap, x);
261 
262  second.valueOf(ap);
263 
264  va_end(ap);
265  }
266 
267 
268  /**
269  * Negate tuple.
270  *
271  * \return this tuple
272  */
274  {
275  first = -first;
276  second.negate();
277 
278  return *this;
279  }
280 
281 
282  /**
283  * Add tuple.
284  *
285  * \param tuple tuple
286  * \return this tuple
287  */
288  JTuple& add(const JTuple& tuple)
289  {
290  first += tuple.first;
291  second.add(tuple.second);
292 
293  return *this;
294  }
295 
296 
297  /**
298  * Subtract tuple.
299  *
300  * \param tuple tuple
301  * \return this tuple
302  */
303  JTuple& sub(const JTuple& tuple)
304  {
305  first -= tuple.first;
306  second.sub(tuple.second);
307 
308  return *this;
309  }
310 
311 
312  /**
313  * Scale tuple.
314  *
315  * \param factor multiplication factor
316  * \return this tuple
317  */
318  JTuple& mul(const double factor)
319  {
320  first *= factor;
321  second.mul(factor);
322 
323  return *this;
324  }
325 
326 
327  /**
328  * Scale tuple.
329  *
330  * \param factor division factor
331  * \return this tuple
332  */
333  JTuple& div(const double factor)
334  {
335  first /= factor;
336  second.div(factor);
337 
338  return *this;
339  }
340 
341 
342  /**
343  * Compare tuple.
344  *
345  * \param tuple tuple
346  * \return true if this tuple less than given tuple; else false
347  */
348  bool less(const JTuple& tuple) const
349  {
350  if (first == tuple.first)
351  return second < tuple.second;
352  else
353  return first < tuple.first;
354  }
355 
356 
357  /**
358  * Initialise values.
359  *
360  * \param ap argument list
361  */
362  void valueOf(va_list& ap)
363  {
364  first = va_arg(ap, JHead_t);
365 
366  second.valueOf(ap);
367  }
368 
369 
370  /**
371  * Read tuple from input.
372  *
373  * \param in input stream
374  * \param tuple tuple
375  * \return input stream
376  */
377  friend inline std::istream& operator>>(std::istream& in, JTuple& tuple)
378  {
379  in >> tuple.first;
380  in >> tuple.second;
381 
382  return in;
383  }
384 
385 
386  /**
387  * Write tuple to output.
388  *
389  * \param out output stream
390  * \param tuple tuple
391  * \return output stream
392  */
393  friend inline std::ostream& operator<<(std::ostream& out, const JTuple& tuple)
394  {
395  out << tuple.first;
396  out << ' ';
397  out << tuple.second;
398 
399  return out;
400  }
401 
402 
403  /**
404  * Read tuple from input.
405  *
406  * \param in reader
407  * \param tuple tuple
408  * \return reader
409  */
410  friend inline JReader& operator>>(JReader& in, JTuple& tuple)
411  {
412  in >> tuple.first;
413  in >> tuple.second;
414 
415  return in;
416  }
417 
418 
419  /**
420  * Write tuple to output.
421  *
422  * \param out writer
423  * \param tuple tuple
424  * \return writer
425  */
426  friend inline JWriter& operator<<(JWriter& out, const JTuple& tuple)
427  {
428  out << tuple.first;
429  out << tuple.second;
430 
431  return out;
432  }
433 
434 
435  JHead_t first;
437  };
438 
439 
440  /**
441  * Template specialisation of JTuple for two data types.
442  */
443  template<class JHead_t, class JTail_t>
444  struct JTuple< JTypeList<JHead_t, JTypeList<JTail_t, JNullType> > > :
445  public JMath < JTuple<JTypeList<JHead_t, JTypeList<JTail_t, JNullType> > > >,
446  public JComparable< JTuple<JTypeList<JHead_t, JTypeList<JTail_t, JNullType> > > >
447  {
448 
450 
451  /**
452  * Default constructor.
453  */
455  {}
456 
457 
458  /**
459  * Constructor.
460  *
461  * \param __first first
462  * \param __second second
463  */
465  typename JClass<JTail_t>::argument_type __second) :
466  first (__first),
467  second(__second)
468  {}
469 
470 
471  /**
472  * Constructor.
473  *
474  * \param __first first
475  * \param __second second
476  */
477  JTuple(typename JClass<JHead_t>::argument_type __first, const JTuple<JTail_t>& __second) :
478  first (__first),
479  second(__second.first)
480  {}
481 
482 
483  /**
484  * Negate tuple.
485  *
486  * \return this tuple
487  */
489  {
490  first = -first;
491  second = -second;
492 
493  return *this;
494  }
495 
496 
497  /**
498  * Add tuple.
499  *
500  * \param tuple tuple
501  * \return this tuple
502  */
503  JTuple& add(const JTuple& tuple)
504  {
505  first += tuple.first;
506  second += tuple.second;
507 
508  return *this;
509  }
510 
511 
512  /**
513  * Subtract tuple.
514  *
515  * \param tuple tuple
516  * \return this tuple
517  */
518  JTuple& sub(const JTuple& tuple)
519  {
520  first -= tuple.first;
521  second -= tuple.second;
522 
523  return *this;
524  }
525 
526 
527  /**
528  * Scale tuple.
529  *
530  * \param factor multiplication factor
531  * \return this tuple
532  */
533  JTuple& mul(const double factor)
534  {
535  first *= factor;
536  second *= factor;
537 
538  return *this;
539  }
540 
541 
542  /**
543  * Scale tuple.
544  *
545  * \param factor division factor
546  * \return this tuple
547  */
548  JTuple& div(const double factor)
549  {
550  first /= factor;
551  second /= factor;
552 
553  return *this;
554  }
555 
556 
557  /**
558  * Compare tuple.
559  *
560  * \param tuple tuple
561  * \return true if this tuple less than given tuple; else false
562  */
563  bool less(const JTuple& tuple) const
564  {
565  if (first == tuple.first)
566  return second < tuple.second;
567  else
568  return first < tuple.first;
569  }
570 
571 
572  /**
573  * Initialise values.
574  *
575  * \param ap argument list
576  */
577  void valueOf(va_list& ap)
578  {
579  first = va_arg(ap, JHead_t);
580  second = va_arg(ap, JTail_t);
581  }
582 
583 
584  /**
585  * Read tuple from input.
586  *
587  * \param in input stream
588  * \param tuple tuple
589  * \return input stream
590  */
591  friend inline std::istream& operator>>(std::istream& in, JTuple& tuple)
592  {
593  in >> tuple.first;
594  in >> tuple.second;
595 
596  return in;
597  }
598 
599 
600  /**
601  * Write tuple to output.
602  *
603  * \param out output stream
604  * \param tuple tuple
605  * \return output stream
606  */
607  friend inline std::ostream& operator<<(std::ostream& out, const JTuple& tuple)
608  {
609  out << tuple.first;
610  out << ' ';
611  out << tuple.second;
612 
613  return out;
614  }
615 
616 
617  /**
618  * Read tuple from input.
619  *
620  * \param in reader
621  * \param tuple tuple
622  * \return reader
623  */
624  friend inline JReader& operator>>(JReader& in, JTuple& tuple)
625  {
626  in >> tuple.first;
627  in >> tuple.second;
628 
629  return in;
630  }
631 
632 
633  /**
634  * Write tuple to output.
635  *
636  * \param out writer
637  * \param tuple tuple
638  * \return writer
639  */
640  friend inline JWriter& operator<<(JWriter& out, const JTuple& tuple)
641  {
642  out << tuple.first;
643  out << tuple.second;
644 
645  return out;
646  }
647 
648 
649  JHead_t first;
650  JTail_t second;
651  };
652 
653 
654  /**
655  * Terminator class of recursive JTuple class.
656  */
657  template<class JHead_t>
658  struct JTuple< JTypeList<JHead_t, JNullType> > :
659  public JTuple<JHead_t>
660  {
661 
663 
664  /**
665  * Default constructor.
666  */
668  {}
669 
670 
671  /**
672  * Constructor.
673  *
674  * \param __first first
675  */
677  JTuple<JHead_t>(__first)
678  {}
679 
680 
681  /**
682  * Constructor.
683  *
684  * \param __first first
685  * \param __second second
686  */
687  JTuple(typename JClass<JHead_t>::argument_type __first, const JTuple<JNullType>& __second) :
688  JTuple<JHead_t>(__first)
689  {}
690  };
691 
692 
693  /**
694  * Helper method for tuple.
695  *
696  * \param b null type
697  * \param c null type
698  * \param d null type
699  * \param e null type
700  * \param f null type
701  * \param g null type
702  * \param h null type
703  * \param i null type
704  * \param j null type
705  * \param k null type
706  * \param l null type
707  * \param m null type
708  * \param n null type
709  * \param o null type
710  * \param p null type
711  * \param q null type
712  * \param r null type
713  * \param s null type
714  * \param t null type
715  * \param u null type
716  * \param v null type
717  * \param w null type
718  * \param x null type
719  * \param y null type
720  * \param z null type
721  * \return tuple
722  */
725  const JNullType& c,
726  const JNullType& d,
727  const JNullType& e,
728  const JNullType& f,
729  const JNullType& g,
730  const JNullType& h,
731  const JNullType& i,
732  const JNullType& j,
733  const JNullType& k,
734  const JNullType& l,
735  const JNullType& m,
736  const JNullType& n,
737  const JNullType& o,
738  const JNullType& p,
739  const JNullType& q,
740  const JNullType& r,
741  const JNullType& s,
742  const JNullType& t,
743  const JNullType& u,
744  const JNullType& v,
745  const JNullType& w,
746  const JNullType& x,
747  const JNullType& y,
748  const JNullType& z)
749  {
751  }
752 
753 
754  /**
755  * Helper method for tuple.
756  *
757  * \param a a-th parameter
758  * \param b b-th parameter
759  * \param c c-th parameter
760  * \param d d-th parameter
761  * \param e e-th parameter
762  * \param f f-th parameter
763  * \param g g-th parameter
764  * \param h h-th parameter
765  * \param i i-th parameter
766  * \param j j-th parameter
767  * \param k k-th parameter
768  * \param l l-th parameter
769  * \param m m-th parameter
770  * \param n n-th parameter
771  * \param o o-th parameter
772  * \param p p-th parameter
773  * \param q q-th parameter
774  * \param r r-th parameter
775  * \param s s-th parameter
776  * \param t t-th parameter
777  * \param u u-th parameter
778  * \param v v-th parameter
779  * \param w w-th parameter
780  * \param x x-th parameter
781  * \param y y-th parameter
782  * \param z z-th parameter
783  * \return tuple
784  */
785  template<class A,
786  class B = JNullType,
787  class C = JNullType,
788  class D = JNullType,
789  class E = JNullType,
790  class F = JNullType,
791  class G = JNullType,
792  class H = JNullType,
793  class I = JNullType,
794  class J = JNullType,
795  class K = JNullType,
796  class L = JNullType,
797  class M = JNullType,
798  class N = JNullType,
799  class O = JNullType,
800  class P = JNullType,
801  class Q = JNullType,
802  class R = JNullType,
803  class S = JNullType,
804  class T = JNullType,
805  class U = JNullType,
806  class V = JNullType,
807  class W = JNullType,
808  class X = JNullType,
809  class Y = JNullType,
810  class Z = JNullType>
812  make_tuple(const A& a,
813  const B& b = JNullType(),
814  const C& c = JNullType(),
815  const D& d = JNullType(),
816  const E& e = JNullType(),
817  const F& f = JNullType(),
818  const G& g = JNullType(),
819  const H& h = JNullType(),
820  const I& i = JNullType(),
821  const J& j = JNullType(),
822  const K& k = JNullType(),
823  const L& l = JNullType(),
824  const M& m = JNullType(),
825  const N& n = JNullType(),
826  const O& o = JNullType(),
827  const P& p = JNullType(),
828  const Q& q = JNullType(),
829  const R& r = JNullType(),
830  const S& s = JNullType(),
831  const T& t = JNullType(),
832  const U& u = JNullType(),
833  const V& v = JNullType(),
834  const W& w = JNullType(),
835  const X& x = JNullType(),
836  const Y& y = JNullType(),
837  const Z& z = JNullType())
838  {
840  }
841 
842  /**
843  * For each data type method.
844  *
845  * The given object should provide for the function object operator
846  * <pre>
847  * template<class T>
848  * void object()(JType<T> type, tuple);
849  * </pre>
850  *
851  * \param object object
852  * \param typelist type list
853  * \param tuple tuple
854  * \return object
855  */
856  template<class JObject_t, class JHead_t, class JTail_t, class T>
857  JObject_t& for_each(JObject_t& object, JType< JTypeList<JHead_t, JTail_t> > typelist, const JTuple<T>& tuple)
858  {
859  for_each(object, JType<JHead_t>(), tuple);
860  for_each(object, JType<JTail_t>(), tuple);
861 
862  return object;
863  }
864 
865 
866  /**
867  * For each data type method.
868  *
869  * The given object should provide for the function object operator
870  * <pre>
871  * template<class T>
872  * void object()(JType<T> type, tuple);
873  * </pre>
874  *
875  * \param object object
876  * \param type type
877  * \param tuple tuple
878  * \return object
879  */
880  template<class JObject_t, class JTypelist_t, class T>
881  JObject_t& for_each(JObject_t& object, JType<JTypelist_t> type, const JTuple<T>& tuple)
882  {
883  object(type, tuple);
884 
885  return object;
886  }
887 
888 
889  /**
890  * Termination method of for each data type method.
891  *
892  * \param object object
893  * \param type null type
894  * \param tuple tuple
895  * \return object
896  */
897  template<class JObject_t, class T>
898  JObject_t& for_each(JObject_t& object, JType<JNullType> type, const JTuple<T>& tuple)
899  {
900  return object;
901  }
902 }
903 
904 #endif
JTOOLS::JTuple< JTypeList< JHead_t, JTypeList< JTail_t, JNullType > > >::add
JTuple & add(const JTuple &tuple)
Add tuple.
Definition: JTuple.hh:503
JTOOLS::JTuple::operator>>
friend std::istream & operator>>(std::istream &in, JTuple &tuple)
Read tuple from input.
Definition: JTuple.hh:168
JTOOLS::JTuple< JTypeList< JHead_t, JTail_t > >::mul
JTuple & mul(const double factor)
Scale tuple.
Definition: JTuple.hh:318
JIO::JReader
Interface for binary input.
Definition: JSerialisable.hh:62
JTOOLS::JTuple< JTypeList< JHead_t, JTypeList< JTail_t, JNullType > > >::typelist
JTypeList< JHead_t, JTail_t > typelist
Definition: JTuple.hh:449
JTOOLS::JTuple< JTypeList< JHead_t, JNullType > >::JTuple
JTuple(typename JClass< JHead_t >::argument_type __first)
Constructor.
Definition: JTuple.hh:676
JTOOLS::JTuple::add
JTuple & add(const JTuple &tuple)
Add tuple.
Definition: JTuple.hh:88
JTOOLS::w
data_type w[N+1][M+1]
Definition: JPolint.hh:708
JTOOLS::JTuple< JTypeList< JHead_t, JTail_t > >::second
JTuple< JTail_t > second
Definition: JTuple.hh:436
JLANG::JType
Auxiliary class for a type holder.
Definition: JType.hh:19
JTOOLS::JTuple::typelist
JTypeList< T > typelist
Definition: JTuple.hh:50
JTOOLS::JTuple< JTypeList< JHead_t, JTail_t > >::valueOf
void valueOf(va_list &ap)
Initialise values.
Definition: JTuple.hh:362
JTOOLS::JTuple::operator<<
friend std::ostream & operator<<(std::ostream &out, const JTuple &tuple)
Write tuple to output.
Definition: JTuple.hh:181
JTOOLS::JTuple< JTypeList< JHead_t, JTail_t > >::div
JTuple & div(const double factor)
Scale tuple.
Definition: JTuple.hh:333
JTOOLS::u
double u[N+1]
Definition: JPolint.hh:706
JTOOLS::JTuple< JTypeList< JHead_t, JTail_t > >::operator<<
friend std::ostream & operator<<(std::ostream &out, const JTuple &tuple)
Write tuple to output.
Definition: JTuple.hh:393
JTOOLS::JTuple< JTypeList< JHead_t, JTypeList< JTail_t, JNullType > > >::operator>>
friend JReader & operator>>(JReader &in, JTuple &tuple)
Read tuple from input.
Definition: JTuple.hh:624
JTOOLS::JTuple::sub
JTuple & sub(const JTuple &tuple)
Subtract tuple.
Definition: JTuple.hh:102
JTOOLS::n
const int n
Definition: JPolint.hh:628
JLANG::JNullType
Auxiliary class for no type definition.
Definition: JNullType.hh:19
JLANG::JClass::argument_type
JArgument< T >::argument_type argument_type
Definition: JClass.hh:82
JTOOLS::JTuple< JTypeList< JHead_t, JTypeList< JTail_t, JNullType > > >::JTuple
JTuple(typename JClass< JHead_t >::argument_type __first, const JTuple< JTail_t > &__second)
Constructor.
Definition: JTuple.hh:477
JTOOLS::JTuple< JTypeList< JHead_t, JTypeList< JTail_t, JNullType > > >::sub
JTuple & sub(const JTuple &tuple)
Subtract tuple.
Definition: JTuple.hh:518
JTOOLS::H
static const double H
Planck constant [eV s].
Definition: JConstants.hh:25
JLANG::JTYPELIST
Auxiliary class for recursive type list generation.
Definition: JTypeList.hh:377
JTOOLS::j
int j
Definition: JPolint.hh:634
JTOOLS::JTuple< JTypeList< JHead_t, JNullType > >::JTuple
JTuple()
Default constructor.
Definition: JTuple.hh:667
JTOOLS::JTuple< JTypeList< JHead_t, JTail_t > >::less
bool less(const JTuple &tuple) const
Compare tuple.
Definition: JTuple.hh:348
JLANG::JClass
Template for generic class types.
Definition: JClass.hh:80
JTOOLS::JTuple< JTypeList< JHead_t, JTypeList< JTail_t, JNullType > > >::valueOf
void valueOf(va_list &ap)
Initialise values.
Definition: JTuple.hh:577
JTOOLS::JTuple< JTypeList< JHead_t, JTypeList< JTail_t, JNullType > > >::negate
JTuple & negate()
Negate tuple.
Definition: JTuple.hh:488
JTOOLS::JTuple::less
bool less(const JTuple &tuple) const
Compare tuple.
Definition: JTuple.hh:144
JTOOLS::C
static const double C
Speed of light in vacuum [m/ns].
Definition: JConstants.hh:22
JTOOLS::JTuple< JTypeList< JHead_t, JTail_t > >::first
JHead_t first
Definition: JTuple.hh:435
JMATH::JMath
Auxiliary base class for aritmetic operations of derived class types.
Definition: JMath.hh:26
JTOOLS::JTuple< JTypeList< JHead_t, JTypeList< JTail_t, JNullType > > >::second
JTail_t second
Definition: JTuple.hh:650
JTOOLS::JTuple::mul
JTuple & mul(const double factor)
Scale tuple.
Definition: JTuple.hh:116
JTOOLS::make_tuple
JTuple< typename JTYPELIST< A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z >::typelist > make_tuple(const A &a, const B &b=JNullType(), const C &c=JNullType(), const D &d=JNullType(), const E &e=JNullType(), const F &f=JNullType(), const G &g=JNullType(), const H &h=JNullType(), const I &i=JNullType(), const J &j=JNullType(), const K &k=JNullType(), const L &l=JNullType(), const M &m=JNullType(), const N &n=JNullType(), const O &o=JNullType(), const P &p=JNullType(), const Q &q=JNullType(), const R &r=JNullType(), const S &s=JNullType(), const T &t=JNullType(), const U &u=JNullType(), const V &v=JNullType(), const W &w=JNullType(), const X &x=JNullType(), const Y &y=JNullType(), const Z &z=JNullType())
Helper method for tuple.
Definition: JTuple.hh:812
JTOOLS::JTuple< JTypeList< JHead_t, JTypeList< JTail_t, JNullType > > >::operator<<
friend std::ostream & operator<<(std::ostream &out, const JTuple &tuple)
Write tuple to output.
Definition: JTuple.hh:607
JTOOLS::JTuple< JTypeList< JHead_t, JTail_t > >::operator<<
friend JWriter & operator<<(JWriter &out, const JTuple &tuple)
Write tuple to output.
Definition: JTuple.hh:426
JPP
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Definition: JAAnetToolkit.hh:37
JTOOLS::JTuple< JTypeList< JHead_t, JTail_t > >::JTuple
JTuple(typename JClass< JHead_t >::argument_type __first, const JTuple< JTail_t > &__second)
Constructor.
Definition: JTuple.hh:243
JSerialisable.hh
JTOOLS::JTuple< JTypeList< JHead_t, JTail_t > >::sub
JTuple & sub(const JTuple &tuple)
Subtract tuple.
Definition: JTuple.hh:303
JComparable.hh
JTOOLS::JTuple::operator<<
friend JWriter & operator<<(JWriter &out, const JTuple &tuple)
Write tuple to output.
Definition: JTuple.hh:207
JNumber.hh
JIO::JWriter
Interface for binary output.
Definition: JSerialisable.hh:130
K
static const uint32_t K[64]
Definition: crypt.cc:77
JTOOLS::JTuple< JTypeList< JHead_t, JTypeList< JTail_t, JNullType > > >::first
JHead_t first
Definition: JTuple.hh:649
JTOOLS::JTuple::negate
JTuple & negate()
Negate tuple.
Definition: JTuple.hh:74
JTOOLS::JTuple::valueOf
void valueOf(va_list &ap)
Initialise values.
Definition: JTuple.hh:155
JLANG::for_each
JObject_t & for_each(JObject_t &object, JType< JTypeList< JHead_t, JTail_t > > typelist)
For each data type method.
Definition: JTypeList.hh:572
JLANG::JTypeList
Type list.
Definition: JTypeList.hh:22
JTOOLS::JTuple< JTypeList< JHead_t, JNullType > >::typelist
JTypeList< JHead_t > typelist
Definition: JTuple.hh:662
JTOOLS::JTuple::first
T first
Definition: JTuple.hh:213
JTOOLS::JTuple< JTypeList< JHead_t, JTypeList< JTail_t, JNullType > > >::operator>>
friend std::istream & operator>>(std::istream &in, JTuple &tuple)
Read tuple from input.
Definition: JTuple.hh:591
JTOOLS::JTuple< JTypeList< JHead_t, JTypeList< JTail_t, JNullType > > >::mul
JTuple & mul(const double factor)
Scale tuple.
Definition: JTuple.hh:533
JTOOLS::JTuple::operator>>
friend JReader & operator>>(JReader &in, JTuple &tuple)
Read tuple from input.
Definition: JTuple.hh:194
JTOOLS::v
data_type v[N+1][M+1]
Definition: JPolint.hh:707
JMath.hh
JTOOLS::JTuple< JTypeList< JHead_t, JTypeList< JTail_t, JNullType > > >::operator<<
friend JWriter & operator<<(JWriter &out, const JTuple &tuple)
Write tuple to output.
Definition: JTuple.hh:640
JTOOLS::JTuple< JTypeList< JHead_t, JTypeList< JTail_t, JNullType > > >::div
JTuple & div(const double factor)
Scale tuple.
Definition: JTuple.hh:548
JLANG::JComparable
Template definition of auxiliary base class for comparison of data structures.
Definition: JComparable.hh:24
JLANG::JNumber
Wrapper class for integer value.
Definition: JLang/JNumber.hh:18
JTOOLS::for_each
JObject_t & for_each(JObject_t &object, JType< JNullType > type, const JTuple< T > &tuple)
Termination method of for each data type method.
Definition: JTuple.hh:898
JTOOLS::JTuple< JTypeList< JHead_t, JTypeList< JTail_t, JNullType > > >::JTuple
JTuple()
Default constructor.
Definition: JTuple.hh:454
JTOOLS::JTuple
Template data structure.
Definition: JTuple.hh:45
JTOOLS::JTuple::JTuple
JTuple(typename JClass< T >::argument_type __first)
Constructor.
Definition: JTuple.hh:64
JTOOLS::JTuple< JTypeList< JHead_t, JTypeList< JTail_t, JNullType > > >::less
bool less(const JTuple &tuple) const
Compare tuple.
Definition: JTuple.hh:563
JTypeList.hh
JTOOLS::JTuple< JTypeList< JHead_t, JTail_t > >::operator>>
friend std::istream & operator>>(std::istream &in, JTuple &tuple)
Read tuple from input.
Definition: JTuple.hh:377
JNullType.hh
JTOOLS::JTuple< JTypeList< JHead_t, JTail_t > >::JTuple
JTuple(typename JClass< JHead_t >::argument_type x,...)
Initialise constructor.
Definition: JTuple.hh:254
JClass.hh
JTOOLS::r
data_type r[M+1]
Definition: JPolint.hh:709
JTOOLS::JTuple< JTypeList< JHead_t, JNullType > >::JTuple
JTuple(typename JClass< JHead_t >::argument_type __first, const JTuple< JNullType > &__second)
Constructor.
Definition: JTuple.hh:687
JTOOLS::JTuple< JTypeList< JHead_t, JTail_t > >::add
JTuple & add(const JTuple &tuple)
Add tuple.
Definition: JTuple.hh:288
JTOOLS
Auxiliary classes and methods for multi-dimensional interpolations and histograms.
Definition: JAbstractCollection.hh:9
JTOOLS::JTuple< JTypeList< JHead_t, JTypeList< JTail_t, JNullType > > >::JTuple
JTuple(typename JClass< JHead_t >::argument_type __first, typename JClass< JTail_t >::argument_type __second)
Constructor.
Definition: JTuple.hh:464
JType.hh
JTOOLS::JTuple< JTypeList< JHead_t, JTail_t > >::JTuple
JTuple()
Default constructor.
Definition: JTuple.hh:233
JTOOLS::JTuple::div
JTuple & div(const double factor)
Scale tuple.
Definition: JTuple.hh:130
JTOOLS::JTuple< JTypeList< JHead_t, JTail_t > >::negate
JTuple & negate()
Negate tuple.
Definition: JTuple.hh:273
JTOOLS::JTuple::JTuple
JTuple()
Default constructor.
Definition: JTuple.hh:55
JTOOLS::JTuple< JTypeList< JHead_t, JTail_t > >::operator>>
friend JReader & operator>>(JReader &in, JTuple &tuple)
Read tuple from input.
Definition: JTuple.hh:410
JTOOLS::JTuple< JTypeList< JHead_t, JTail_t > >::typelist
JTypeList< JHead_t, JTail_t > typelist
Definition: JTuple.hh:227