NTuple.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 
14 #ifndef NTUPLE_H
15 #define NTUPLE_H
16 
17 #ifdef _MSC_VER
18 # pragma warning(disable:4217)
19 # pragma warning(disable:4290) // exception spec ignored except to indicate
20 #endif
21 
22 #include "DataSource.h"
23 
24 namespace hippodraw {
25 
34 {
35 
36  private:
37 
42  int m_i_count;
43 
48  mutable int m_i_current;
49 
53 
58  std::vector< std::vector<double> *> m_data;
59 
63  mutable std::vector < double > m_row;
64 
67  NTuple & operator= ( const NTuple & rhs );
68 
75  void resizeColumns ( size_t new_size );
76 
77  public:
78 
81  explicit NTuple ( const std::string & name );
82 
88  explicit NTuple ( const char * name );
89 
92  explicit NTuple ( const std::vector < std::string > & labels );
93 
97  explicit NTuple ( const NTuple & nt);
98 
102  explicit NTuple ( const DataSource * ds );
103 
108  explicit NTuple ( unsigned int n );
109 
120  explicit NTuple ( bool dummy );
121 
124  NTuple ();
125 
128  virtual ~NTuple();
129 
132  virtual void copy ( const DataSource & rhs );
133 
136  virtual void append ( const DataSource * source );
137 
142  virtual void clear();
143 
146  virtual bool empty () const;
147 
150  virtual unsigned int rows () const;
151 
157  virtual void addRow ( const std::vector<double> & v );
158 
162  virtual void insertRow ( unsigned int index,
163  const std::vector < double > & v );
164 
170  virtual void eraseRow ( unsigned int index );
171 
177  virtual const std::vector < double > & getRow ( unsigned int index ) const;
178 
179  virtual void reserve ( unsigned int count );
180 
190  virtual int addColumn ( const std::string &,
191  const std::vector < double > & column );
192 
199  virtual void replaceColumn ( unsigned int index,
200  const std::vector< double > & data );
201 
208  void replaceRow ( unsigned int i,
209  const std::vector < double > & data );
210 
211 
219  void setLabels ( const std::vector<std::string> & v );
220 
221 
222  virtual double
223  operator [] ( std::vector < unsigned int > & indices ) const;
224 
225  virtual double valueAt ( unsigned int row, unsigned int column ) const;
226 
227  virtual const std::vector< double > &
228  getColumn ( unsigned int index ) const;
229 
235  virtual std::vector< double > & getColumn ( unsigned int index );
236 
237  const std::vector< double > & getColumn ( const std::string & label ) const;
238 
239  virtual unsigned int indexOfMinElement ( unsigned int index ) const;
240  virtual unsigned int indexOfMaxElement ( unsigned int index ) const;
241 
244  virtual double minElement ( unsigned int index ) const;
245 
248  virtual double maxElement ( unsigned int index ) const;
249 
252  double columnMin( const std::string & name ) const;
253 
256  double columnMax( const std::string & name ) const;
257 
258  virtual void notifyObservers () const;
259 
263  void setIntervalEnabled ( bool yes = true );
264 
268  bool isIntervalEnabled () const;
269 
275  void setIntervalCount ( int number );
276 
279  unsigned int getIntervalCount ( ) const;
280 
284  virtual bool fillRange ( unsigned int column, Range & ) const;
285  virtual double sum ( unsigned int column ) const;
286 
287 };
288 
289 } // namespace hippodraw
290 
291 #endif // NTUPLE_H

Generated for HippoDraw Class Library by doxygen