30 #include "../util/MyVector.hpp" 36 MyVector<MyVector<T> > table;
50 DataTable(DataTable
const& o)
54 DataTable& operator=(DataTable
const& o) {
91 void init(
int n = 0) {
100 void setNumRows(
int n) {
109 void initRow(
int i,
size_t size) {
111 table[i].resize(size);
139 size_t addColumn(
int i) {
140 table[i].push_back(T());
141 return table[i].size() - 1;
148 int numRows()
const {
156 size_t totalSize()
const {
158 for (
size_t i = 0; i < table.size(); ++i) {
159 k += table[i].size();
169 MyVector<T>& operator[](
int i) {
178 MyVector<T>
const& operator[](
int i)
const {
182 friend std::ostream& operator<<(std::ostream& os, DataTable
const& o) {
183 for (
int i = 0; i < o.numRows(); ++i) {
185 for (
size_t j = 0; j < o[i].size(); ++j) {
186 if (j != 0) os <<
", ";