| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
package dr.evolution.coalescent; |
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
public class ScaledDemographic extends DemographicFunction.Abstract { |
| 37 |
private final double scale; |
| 38 |
private final DemographicFunction demo; |
| 39 |
|
| 40 |
public ScaledDemographic(DemographicFunction demo, double scale) { |
| 41 |
super(demo.getUnits()); |
| 42 |
this.scale = scale; |
| 43 |
this.demo = demo; |
| 44 |
} |
| 45 |
|
| 46 |
public double getDemographic(double t) { |
| 47 |
return demo.getDemographic(t) * scale; |
| 48 |
} |
| 49 |
|
| 50 |
public double getIntensity(double t) { |
| 51 |
return demo.getIntensity(t) / scale; |
| 52 |
} |
| 53 |
|
| 54 |
public double getIntegral(double start, double finish) { |
| 55 |
return (demo.getIntensity(finish) - demo.getIntensity(start)) / scale; |
| 56 |
} |
| 57 |
|
| 58 |
public double getInverseIntensity(double x) { |
| 59 |
throw new RuntimeException("unimplemented"); |
| 60 |
} |
| 61 |
|
| 62 |
public int getNumArguments() { |
| 63 |
throw new RuntimeException("unimplemented"); |
| 64 |
} |
| 65 |
|
| 66 |
public String getArgumentName(int n) { |
| 67 |
throw new RuntimeException("unimplemented"); |
| 68 |
} |
| 69 |
|
| 70 |
public double getArgument(int n) { |
| 71 |
throw new RuntimeException("unimplemented"); |
| 72 |
} |
| 73 |
|
| 74 |
public void setArgument(int n, double value) { |
| 75 |
throw new RuntimeException("unimplemented"); |
| 76 |
} |
| 77 |
|
| 78 |
public double getLowerBound(int n) { |
| 79 |
throw new RuntimeException("unimplemented"); |
| 80 |
} |
| 81 |
|
| 82 |
public double getUpperBound(int n) { |
| 83 |
throw new RuntimeException("unimplemented"); |
| 84 |
} |
| 85 |
|
| 86 |
public DemographicFunction getCopy() { |
| 87 |
throw new RuntimeException("unimplemented"); |
| 88 |
} |
| 89 |
} |