Debian Codegraph @

src/dr/evomodel/treelikelihood/PartialsRescalingScheme.java

raw symbols SCIP
1 /*
2 * PartialsRescalingScheme.java
3 *
4 * Copyright (c) 2002-2016 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.evomodel.treelikelihood;
27
28 /**
29 * @author Marc Suchard
30 * @author Andrew Rambaut
31 */
32 public enum PartialsRescalingScheme {
33
34 DEFAULT("default"), // what ever our current favourite default is
35 NONE("none"), // no scaling
36 DYNAMIC("dynamic"), // rescale when needed and reuse scaling factors
37 ALWAYS("always"), // rescale every node, every site, every time - slow but safe
38 DELAYED("delayed"), // postpone until first underflow then switch to 'always'
39 AUTO("auto"); // BEAGLE automatic scaling - currently playing it safe with 'always'
40 // KICK_ASS("kickAss"),// should be good, probably still to be discovered
41
42 PartialsRescalingScheme(String text) {
43 this.text = text;
44 }
45
46 public String getText() {
47 return text;
48 }
49
50 private final String text;
51
52 public static PartialsRescalingScheme parseFromString(String text) {
53 for (PartialsRescalingScheme scheme : PartialsRescalingScheme.values()) {
54 if (scheme.getText().compareToIgnoreCase(text) == 0)
55 return scheme;
56 }
57 return DEFAULT;
58 }
59
60 @Override
61 public String toString() {
62 return text;
63 }
64 }