14 #ifndef NumArrayTuple_H
15 #define NumArrayTuple_H
23 #include <numpy/noprefix.h>
26 #include <Numeric/arrayobject.h>
28 #include <numarray/arrayobject.h>
61 std::vector < boost::python::numeric::array >
m_data;
67 mutable std::vector < double >
m_row;
91 virtual unsigned int rows ()
const;
95 virtual bool empty ()
const;
97 virtual double valueAt (
unsigned int row,
unsigned int column )
const;
107 int addColumn (
const std::string & label,
108 boost::python::numeric::array array );
116 boost::python::numeric::array array );
124 boost::python::numeric::array array );
127 boost::python::numeric::array
131 boost::python::numeric::array
136 virtual const std::vector < double > &
getRow (
unsigned int index )
const;
144 virtual void setShape ( std::vector < unsigned int > &
shape );
148 const std::vector < unsigned int > &
getShape ()
const;
156 virtual void fillShape ( std::vector < intptr_t > & v,
157 unsigned int column )
const;
160 virtual void clear ();
163 virtual void reserve (
unsigned int count );
167 operator [] ( std::vector < unsigned int > & indices )
const;
173 #endif // NumArrayTuple_H
column
The column indices for 2 dimension data point tuple.
const std::vector< unsigned int > & getShape() const
Returns the shape of the data elements.
virtual void setShape(std::vector< unsigned int > &shape)
Sets the shape of the data elements.
virtual bool empty() const
Returns true, if NumArrayTuple is empty, i.e.
std::vector< boost::python::numeric::array > m_data
The numarray objects that contains the data.
void replaceColumn(unsigned int index, boost::python::numeric::array array)
Replaces the column indexed by index with the array.
NumArrayTuple()
The default constructor.
virtual void copy(const DataSource &)
Raises exception because with this release making a copy is not supported.
std::vector< double > m_row
A temporary array of data from one row of each column.
virtual ~NumArrayTuple()
The destructor.
virtual double valueAt(unsigned int row, unsigned int column) const
hippodraw::DataSource class interface.
Base class for DataSource.
virtual const std::vector< double > & getRow(unsigned int index) const
Returns a const reference to slice along the axis known as a row.
boost::python::numeric::array getNumArray(const std::string &label) const
Return the reference to the desired numarray by column label.
virtual void fillShape(std::vector< intptr_t > &v, unsigned int column) const
Fills the vector with the shape of a column.
virtual void clear()
Raises assertion as this method is not implemented yet.
virtual double operator[](std::vector< unsigned int > &indices) const
Raises assertion as this method is not implemented yet.
virtual unsigned int rows() const
Returns the size of the slice for the next to last dimension.
int addColumn(const std::string &label, boost::python::numeric::array array)
Adds a column to the end of the NumArrayTuple.
virtual void reserve(unsigned int count)
Raises assertion as this method is not implemented yet.
std::vector< intptr_t > shape(numeric::array arr)
virtual void notifyObservers() const
Notifies observers.
A DataSource class implemented with a Python numarray array to store the column data.