00001
00002
00014 #ifndef NumArrayTuple_H
00015 #define NumArrayTuple_H
00016
00017 #include "datasrcs/DataSource.h"
00018
00019 #include <boost/python.hpp>
00020
00027 class NumArrayTuple : public DataSource
00028 {
00029
00030 private:
00031
00034 std::vector < boost::python::numeric::array > m_data;
00035
00040 mutable std::vector < double > m_row;
00041
00042 public:
00043
00046 NumArrayTuple ();
00047
00050 virtual ~NumArrayTuple();
00051
00055 virtual void copy ( const DataSource & );
00056
00060 virtual void notifyObservers ( ) const;
00061
00064 virtual unsigned int rows () const;
00065
00068 virtual bool empty () const;
00069
00070 virtual double valueAt ( unsigned int row, unsigned int column ) const;
00071
00080 int addColumn ( const std::string & label,
00081 boost::python::numeric::array array );
00082
00088 void replaceColumn ( unsigned int index,
00089 boost::python::numeric::array array );
00090
00096 void replaceColumn ( const std::string & label,
00097 boost::python::numeric::array array );
00098
00100 boost::python::numeric::array
00101 getNumArray( const std::string & label ) const;
00102
00104 boost::python::numeric::array
00105 getNumArray( unsigned int index ) const;
00106
00109 virtual const std::vector < double > & getRow ( unsigned int index ) const;
00110
00117 virtual void setShape ( std::vector < unsigned int > & shape );
00118
00121 const std::vector < unsigned int > & getShape () const;
00122
00126 unsigned int getRank () const;
00127
00129 virtual void clear ();
00130
00132 virtual void reserve ( unsigned int count );
00133
00135 virtual void addRow ( const std::vector < double > & row );
00136
00138 virtual double
00139 operator [] ( std::vector < unsigned int > & indices ) const;
00140
00141 };
00142
00143 #endif // NumArrayTuple_H