Debian Codegraph @

src/dr/oldevomodel/approxPopTree/AbstractPopulationMRCAModel.java

raw symbols SCIP
1 /*
2 * AbstractPopulationMRCAModel.java
3 *
4 * Copyright (c) 2002-2015 Alexei Drummond, Andrew Rambaut and Marc Suchard
5 *
6 * This file is part of BEAST.
7 * See the NOTICE file distributed with this work for additional
8 * information regarding copyright ownership and licensing.
9 *
10 * BEAST is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU Lesser General Public License as
12 * published by the Free Software Foundation; either version 2
13 * of the License, or (at your option) any later version.
14 *
15 * BEAST is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License for more details.
19 *
20 * You should have received a copy of the GNU Lesser General Public
21 * License along with BEAST; if not, write to the
22 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
23 * Boston, MA 02110-1301 USA
24 */
25
26 package dr.oldevomodel.approxPopTree;
27
28 import dr.evolution.alignment.Patterns;
29 import dr.evolution.tree.NodeRef;
30 import dr.inference.model.AbstractModel;
31
32 import java.util.LinkedList;
33
34 /**
35 * Package: AbstractPopulationMRCAModel
36 * Description:
37 * <p/>
38 * <p/>
39 * Created by
40 *
41 * @author Alexander V. Alekseyenko ([email protected])
42 * Date: Feb 1, 2010
43 * Time: 5:30:01 PM
44 */
45 abstract public class AbstractPopulationMRCAModel extends AbstractModel {
46 protected double time; // time of the population node above
47 protected double tMRCA;
48
49 public AbstractPopulationMRCAModel(String name, double populationTime) {
50 super(name);
51 time = populationTime;
52 }
53
54 public double getMRCATime(LinkedList<NodeRef> nodes) { // get time of actual MRCA for the sequence nodes below
55 return tMRCA;
56 }
57
58 abstract public double drawMRCATime(LinkedList<NodeRef> nodes); // re-draw from the distribution of t(MRCA)
59
60 abstract public double[][] getMRCAPartials(LinkedList<NodeRef> nodes, Patterns patterns); // get partials at Population node
61
62 abstract public double[][] drawMRCAPartials(LinkedList<NodeRef> nodes, Patterns patterns); // re-draw partial at Population node
63
64 protected double[][] computeProfilePartials(LinkedList<NodeRef> nodes, Patterns patterns) { // compute profile partials for the sequence nodes, useful for the above methods
65
66 int patternCount = patterns.getPatternCount();
67 int stateCount = patterns.getStateCount();
68 double partials[][] = new double[patternCount][stateCount];
69 // Do the profile computation here
70 //
71 return partials;
72 }
73 }