elements.h

00001 
00002 
00003 //(c) 2006 Suzanne Matthews
00004 /*
00005 This file is part of the RaqApproach software package.
00006 
00007     RaqApproach is free software; you can redistribute it and/or modify
00008     it under the terms of the GNU General Public License as published by
00009     the Free Software Foundation; either version 2 of the License, or
00010     (at your option) any later version.
00011 
00012     RaqApproach is distributed in the hope that it will be useful,
00013     but WITHOUT ANY WARRANTY; without even the implied warranty of
00014     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015     GNU General Public License for more details.
00016 
00017     You should have received a copy of the GNU General Public License
00018     along with RaqApproach; if not, write to the Free Software
00019     Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
00020 */
00021 
00022 #ifndef ELEMENTS_H_
00023 #define ELEMENTS_H_
00024 
00025 #include "common.h"
00026 
00027 using namespace std;
00028 
00030 
00032 class element {
00033  public:
00035 
00040         element(string t, double d);
00042 
00045         element();
00047 
00048         string get_taxa() { return taxa; }
00050 
00051         double get_dist() { return dist; }
00052 
00053  private:
00054         double dist; 
00055         string taxa; 
00056 };
00057 
00058 element::element(string t, double d) { 
00059         taxa = t;
00060         dist = d;
00061 }
00062 
00063 element::element() { 
00064         taxa = "";
00065         dist = 0;
00066 }
00067 
00069 
00071 class helper {
00072 public:
00074 
00078         helper(vector<short> i, vector<int> t);
00080         helper();
00082         /* \return id of taxa */
00083         vector<short> get_id() {return id;}
00085 
00086         vector<int> get_tree() { return taxa_list; }
00088 
00089         void display();
00090 
00091 private:
00092         vector<short> id; 
00093         vector<int> taxa_list; 
00094 };
00095 
00096 helper::helper(vector<short>i, vector<int> t) { 
00097         id = i;
00098         taxa_list = t;
00099 }
00100 
00101 helper::helper() { } 
00102 
00103 void helper::display() { 
00104         cout << "my id is: " << endl;
00105         cout << "| ";
00106         for ( unsigned int i = 0; i < id.size(); ++i ) {
00107                 cout << id[i] << " | ";
00108         }
00109         cout << endl;
00110         cout << endl << "my contents are: " << endl;
00111         cout << ".";
00112         for ( unsigned int i = 0; i < taxa_list.size(); ++i ) {
00113                 cout << taxa_list[i] << ".";
00114         }
00115         cout << endl << endl << endl;
00116 }
00117 #endif

Generated on Wed Jul 26 22:18:14 2006 for RaqApproach by  doxygen 1.4.7