Particle Identification and Tracking
common_src/include/array.h
Go to the documentation of this file.
00001 //Copyright 2009,2010 Thomas A Caswell
00002 //tcaswell@uchicago.edu
00003 //http://jfi.uchicago.edu/~tcaswell
00004 //
00005 //This program is free software; you can redistribute it and/or modify
00006 //it under the terms of the GNU General Public License as published by
00007 //the Free Software Foundation; either version 3 of the License, or (at
00008 //your option) any later version.
00009 //
00010 //This program is distributed in the hope that it will be useful, but
00011 //WITHOUT ANY WARRANTY; without even the implied warranty of
00012 //MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
00013 //General Public License for more details.
00014 //
00015 //You should have received a copy of the GNU General Public License
00016 //along with this program; if not, see <http://www.gnu.org/licenses>.
00017 //
00018 //Additional permission under GNU GPL version 3 section 7
00019 //
00020 //If you modify this Program, or any covered work, by linking or
00021 //combining it with MATLAB (or a modified version of that library),
00022 //containing parts covered by the terms of MATLAB User License, the
00023 //licensors of this Program grant you additional permission to convey
00024 //the resulting work.
00025 #ifndef ARRAY_T
00026 #define ARRAY_T
00027 
00028 #include <vector>
00029 #include "part_def.h"
00030 
00031 namespace utilities{
00032 class Generic_wrapper_base;
00033 
00040 class Array{
00041 public:
00045   void set_array(Generic_wrapper_base * out_wrapper) const;
00049   void push(const Tuplef& tuple_in);
00053   void print();
00057   Array(int rows);
00061   int get_row_num()const{
00062     return rows_;
00063   }
00067   int get_col_num()const{
00068     return cols_;
00069   }
00073   void clear();
00074 
00078   void clear(int rows);
00079 
00083   void resize(int rows);
00084 protected:
00088   int rows_;
00092   int cols_;
00096   std::vector<double> data_;
00100   int cur_index_;
00101 };
00102 }
00103 
00104 #endif