1 /* 2 * scrm is an implementation of the Sequential-Coalescent-with-Recombination Model. 3 * 4 * Copyright (C) 2013, 2014 Paul R. Staab, Sha (Joe) Zhu, Dirk Metzler and Gerton Lunter 5 * 6 * This file is part of scrm. 7 * 8 * scrm is free software: you can redistribute it and/or modify 9 * it under the terms of the GNU General Public License as published by 10 * the Free Software Foundation, either version 3 of the License, or 11 * (at your option) any later version. 12 * 13 * This program is distributed in the hope that it will be useful, 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 * GNU General Public License for more details. 17 * 18 * You should have received a copy of the GNU General Public License 19 * along with this program. If not, see <http://www.gnu.org/licenses/>. 20 21 */ 22 23 #ifndef scrm_src_summary_statistic_tmrca 24 #define scrm_src_summary_statistic_tmrca 25 26 #include <sstream> 27 #include <iostream> 28 #include <vector> 29 30 #include "summary_statistic.h" 31 #include "../forest.h" 32 33 class TMRCA : public SummaryStatistic 34 { 35 public: TMRCA()36 TMRCA() {}; ~TMRCA()37 ~TMRCA() {}; 38 39 //Virtual methods 40 void calculate(const Forest &forest); 41 void printLocusOutput(std::ostream &output) const; clear()42 void clear() { 43 tmrca_.clear(); 44 tree_length_.clear(); 45 } 46 clone()47 TMRCA* clone() const { return new TMRCA(); } 48 tmrca()49 const std::vector<double> & tmrca() const { return tmrca_; } tree_length()50 const std::vector<double> & tree_length() const { return tree_length_; } 51 52 private: 53 std::vector<double> tmrca_; 54 std::vector<double> tree_length_; 55 }; 56 57 #endif 58