Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members | Related Pages

NTuple Class Reference

Inheritance diagram for NTuple:

Inheritance graph
[legend]
Collaboration diagram for NTuple:

Collaboration graph
[legend]
List of all members.

Detailed Description

Definition at line 16 of file NTuple.sip.

Public Member Functions

 NTuple (const std::string &)
 Constructs an NTuple object with name name.
 NTuple (const char *)
 Constructs an NTuple object with name name.
 NTuple (const std::vector< std::string > &)
 Constructor taking a vector of column labels as argument.
 NTuple (const NTuple &)
 The copy constructor creates an ntuple that is a copy of an existing one.
 NTuple (const DataSource *)
 A constructor that creates an ntuple from another DataSource object.
 NTuple (unsigned int)
 A constructor that creates an ntuple with n columns.
 NTuple ()
 The default constructor creating an ntuple with 0 columns.
virtual ~NTuple ()
 The destructor.
virtual void copy (const DataSource &)
 Copies rhs data.
virtual void clear ()
 Clears the NTuple.
virtual bool empty () const
 Returns true, if NTuple is empty, i.e.
virtual void addRow (const std::vector< double > &) throw ( DataSourceException )
 Adds a row to the end of the ntuple.
virtual void insertRow (unsigned int, const std::vector< double > &)
 Inserts a Row.
virtual void eraseRow (unsigned int)
 Erases a row from the NTuple.
virtual const std::vector<
double > & 
getRow (unsigned int) const throw ( DataSourceException )
 Returns a temporary vector of data elements in one row.
virtual void reserve (unsigned int)
int addColumn (const std::string &, const std::vector< double > &) throw ( DataSourceException )
 Adds a column to the end of the ntuple and returns the index to the added column.
void replaceColumn (unsigned int, const std::vector< double > &) throw ( DataSourceException )
 Replaces the data in column col.
void replaceColumn (const std::string &, const std::vector< double > &) throw ( DataSourceException )
 Replaces the column.
void replaceRow (unsigned int, const std::vector< double > &) throw ( DataSourceException )
 Replaces the data in the row i.
void setLabels (const std::vector< std::string > &)
 Assigns the label to each column from the vector of strings.
virtual const std::vector<
double > & 
getColumn (unsigned int) const
virtual std::vector< double > & getColumn (unsigned int) throw ( DataSourceException )
 Returns a non-const reference to column at the index index.
const std::vector< double > & getColumn (const std::string &) const
virtual unsigned int indexOfMinElement (unsigned int) const
virtual unsigned int indexOfMaxElement (unsigned int) const
virtual double minElement (unsigned int) const
 Returns the value of the minimum element of column index.
virtual double maxElement (unsigned int) const
 Returns the value of the maximum element of column index.
double columnMin (const std::string &) const
 Returns minimum element in a column whose label is given by name.
double columnMax (const std::string &) const
 Returns minimum element in a column whose label is given by name.
virtual void notifyObservers () const
void setIntervalEnabled (bool=true)
 Sets interval counting to be enabled.
bool isIntervalEnabled () const
 Returns true if interval counting is enabled, otherwise returns false.
void setIntervalCount (int)
 Sets the interval count.
unsigned int getIntervalCount () const
 Returns the current interval count.
virtual double sum (unsigned int) const
virtual unsigned rows () const
virtual int indexOf (const std::string &) const
bool isValidLabel (const std::string &) const


Constructor & Destructor Documentation

NTuple::NTuple const std::string &   ) 
 

Constructs an NTuple object with name name.

NTuple::NTuple const char *   ) 
 

Constructs an NTuple object with name name.

Note:
because explicit is used, this method is different from the one that take std::string & argument"

NTuple::NTuple const std::vector< std::string > &   ) 
 

Constructor taking a vector of column labels as argument.

NTuple::NTuple const NTuple  ) 
 

The copy constructor creates an ntuple that is a copy of an existing one.

NTuple::NTuple const DataSource  ) 
 

A constructor that creates an ntuple from another DataSource object.

NTuple::NTuple unsigned  int  ) 
 

A constructor that creates an ntuple with n columns.

Creates an NTuple with n columns. The objects will be empty, i.e. 0 rows.

NTuple::NTuple  ) 
 

The default constructor creating an ntuple with 0 columns.

virtual NTuple::~NTuple  )  [virtual]
 

The destructor.


Member Function Documentation

int NTuple::addColumn const std::string &  ,
const std::vector< double > & 
throw ( DataSourceException )
 

Adds a column to the end of the ntuple and returns the index to the added column.

If the size of the input vector is the same as the size of the existing columns adds a copy of the input vector to then end of the NTuple. Gives the column the label label. Returns the index of the newly created column. If the size of the input vector differs from the size of existing columns, then throws a DataSourceException object.

virtual void NTuple::addRow const std::vector< double > &   )  throw ( DataSourceException ) [virtual]
 

Adds a row to the end of the ntuple.

If the size of the input vector is the same as the width of the ntuple, adds the row to the end of the ntuple and notifies its Observer objects. Otherwise, throws a DataSourceException object.

Reimplemented in CircularBuffer.

virtual void NTuple::clear  )  [virtual]
 

Clears the NTuple.

Clears all the data elements of the NTuple. Does not change the other attributes or capacity.

Reimplemented in CircularBuffer.

double NTuple::columnMax const std::string &   )  const
 

Returns minimum element in a column whose label is given by name.

double NTuple::columnMin const std::string &   )  const
 

Returns minimum element in a column whose label is given by name.

virtual void NTuple::copy const DataSource  )  [virtual]
 

Copies rhs data.

virtual bool NTuple::empty  )  const [virtual]
 

Returns true, if NTuple is empty, i.e.

has no rows.

Implements DataSource.

virtual void NTuple::eraseRow unsigned  int  )  [virtual]
 

Erases a row from the NTuple.

Removes the row index from the NTuple. Rows beyond the removal point move forward to fill the space. If index is out of range, and exception is thrown.

const std::vector< double >& NTuple::getColumn const std::string &   )  const
 

virtual std::vector< double >& NTuple::getColumn unsigned  int  )  throw ( DataSourceException ) [virtual]
 

Returns a non-const reference to column at the index index.

index is in a valid range, returns a reference to the the column at index index. If index is not in a valid range, throws a DataSourceException object.

virtual const std::vector< double >& NTuple::getColumn unsigned  int  )  const [virtual]
 

unsigned int NTuple::getIntervalCount  )  const
 

Returns the current interval count.

virtual const std::vector< double >& NTuple::getRow unsigned  int  )  const throw ( DataSourceException ) [virtual]
 

Returns a temporary vector of data elements in one row.

Returns a temporary vector with data elements copied from the NTuple row indexed by index. If index is out of range, throws a DataSourceException object.

virtual int NTuple::indexOf const std::string &   )  const [virtual]
 

virtual unsigned int NTuple::indexOfMaxElement unsigned  int  )  const [virtual]
 

virtual unsigned int NTuple::indexOfMinElement unsigned  int  )  const [virtual]
 

virtual void NTuple::insertRow unsigned  int,
const std::vector< double > & 
[virtual]
 

Inserts a Row.

Adds a row before the existing row specified by index from the elements of v.

bool NTuple::isIntervalEnabled  )  const
 

Returns true if interval counting is enabled, otherwise returns false.

bool NTuple::isValidLabel const std::string &   )  const
 

virtual double NTuple::maxElement unsigned  int  )  const [virtual]
 

Returns the value of the maximum element of column index.

virtual double NTuple::minElement unsigned  int  )  const [virtual]
 

Returns the value of the minimum element of column index.

virtual void NTuple::notifyObservers  )  const [virtual]
 

void NTuple::replaceColumn const std::string &  ,
const std::vector< double > & 
throw ( DataSourceException )
 

Replaces the column.

Replaces the column at the column with label label. This is a cnvienence member function for using indexOf() and replaceColumn ( unsigned int, const std::vector< double > & ).

void NTuple::replaceColumn unsigned  int,
const std::vector< double > & 
throw ( DataSourceException )
 

Replaces the data in column col.

If index is in a valid range and if the size of data is the same as the existing column, then replaces the elements of the specified column with a copy of @ data elements. If index is not a valid range or the sizes differ, then throws a DataSourceException object.

void NTuple::replaceRow unsigned  int,
const std::vector< double > & 
throw ( DataSourceException )
 

Replaces the data in the row i.

If index is in a valid range and if the size of data is the same as the existing column, then replaces the elements of the specified column with a copy of @ data elements. If index is not a valid range or the sizes differ, then throws a DataSourceException object

virtual void NTuple::reserve unsigned  int  )  [virtual]
 

Reimplemented in CircularBuffer.

virtual unsigned NTuple::rows  )  const [virtual]
 

Implements DataSource.

void NTuple::setIntervalCount int   ) 
 

Sets the interval count.

One needs to call setIntervalEnabled for this to have effect. When interval counting is enabled, then only each number notifyObsevers messages will trigger an Observer::update message to the list of Observer objects.

void NTuple::setIntervalEnabled bool  = true  ) 
 

Sets interval counting to be enabled.

If yes is false, then a notifyObservers is immediately issued.

void NTuple::setLabels const std::vector< std::string > &   )  [virtual]
 

Assigns the label to each column from the vector of strings.

If the vector is the same size as the width of the ntuple, then it sets the label and returns true; otherwise, it throws a DataSourceException. If the NTuple is empty, i.e. has no rows, then changes the NTuple's number of columns to the size of the vector.

Reimplemented from DataSource.

virtual double NTuple::sum unsigned  int  )  const [virtual]
 


The documentation for this class was generated from the following file:
Generated on Wed Sep 7 14:51:55 2005 for SiHippo by  doxygen 1.4.3