NTupleSorter.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 
14 #ifndef NTUPLESORTER_H
15 #define NTUPLESORTER_H
16 
17 #include "pattern/libhippo.h"
18 
19 #include <vector>
20 
21 namespace hippodraw {
22 
23 class NTuple;
24 
33 {
34 
35 private:
36 
39  NTupleSorter & operator = ( const NTupleSorter & );
40 
43  int m_column;
44 
48 
52 
57  void rowwiseCopy ( std::vector < std::vector < double > * > & row_copy );
58 
59 public:
60 
66  NTupleSorter ( const NTupleSorter & );
67 
72  NTupleSorter ( NTuple * ntuple );
73 
77  virtual ~NTupleSorter () {}
78 
81  NTuple * getNTuple () const;
82 
89  void setSorting ( int column );
90 
92  void sort ( );
93 
95  void clear ();
96 
106  void addRow ( const std::vector < double > & row );
107 
111  virtual void eraseRow ( unsigned int index );
112 
115  unsigned int columns ( ) const;
116 
119  unsigned int rows ( ) const;
120 
123  const std::vector < double > & getRow ( unsigned int index ) const;
124 
129  bool operator () ( std::vector < double > * x,
130  std::vector < double > * y ) const;
131 
132 };
133 
134 } // namespace hippodraw
135 
136 #endif // NTUPLESORTER_H
#define MDL_HIPPOPLOT_API
Definition: libhippo.h:36
A helper class to sort and keep sorted an NTuple.
Definition: NTupleSorter.h:32
column
The column indices for 2 dimension data point tuple.
bool m_increasing
The direction of the sort.
Definition: NTupleSorter.h:47
NTuple * m_ntuple
The NTuple object that will be used.
Definition: NTupleSorter.h:51
A DataSource class implemented with std::vector&lt;double&gt; to store the column data. ...
Definition: NTuple.h:33
return index
Definition: PickTable.cxx:182
int m_column
The column used for sorting, or -1 if sorting is disabled.
Definition: NTupleSorter.h:43
virtual ~NTupleSorter()
The virtual destructor.
Definition: NTupleSorter.h:77

Generated for HippoDraw Class Library by doxygen