Skip to content

Commit

Permalink
more accessibility
Browse files Browse the repository at this point in the history
  • Loading branch information
msuchard committed Dec 13, 2024
1 parent 08ab0db commit e72d31f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/dr/inference/hmc/CompoundGradient.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,11 @@ public class CompoundGradient implements GradientWrtParameterProvider, Derivativ
private final DerivativeOrder highestOrder;
private final ParallelGradientExecutor parallelExecutor;

CompoundGradient(List<GradientWrtParameterProvider> derivativeList) {
public CompoundGradient(List<GradientWrtParameterProvider> derivativeList) {
this(derivativeList, 0);
}

CompoundGradient(List<GradientWrtParameterProvider> derivativeList, int threadCount) {
public CompoundGradient(List<GradientWrtParameterProvider> derivativeList, int threadCount) {

this.derivativeList = derivativeList;

Expand Down
13 changes: 10 additions & 3 deletions src/dr/inference/operators/NormalGammaPrecisionGibbsOperator.java
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,13 @@ public NormalGammaPrecisionGibbsOperator(GammaGibbsProvider gammaGibbsProvider,

this.prior = prior;
this.working = working;

if (indices == null) {
indices = new int[precisionParameter.getDimension()];
for (int i = 0; i < precisionParameter.getDimension(); ++i) {
indices[i] = i;
}
}
this.indices = indices;

setWeight(weight);
Expand Down Expand Up @@ -102,11 +109,11 @@ public String getReport() {
return sb.toString();
}

static class GammaParametrization implements GammaStatisticsProvider {
public static class GammaParametrization implements GammaStatisticsProvider {
private final double rate;
private final double shape;

GammaParametrization(double mean, double variance) {
public GammaParametrization(double mean, double variance) {
if (mean == 0) {
rate = 0;
shape = -0.5; // Uninformative prior
Expand All @@ -116,7 +123,7 @@ static class GammaParametrization implements GammaStatisticsProvider {
}
}

GammaParametrization(Distribution distribution) {
public GammaParametrization(Distribution distribution) {
this(distribution.mean(), distribution.variance());
}

Expand Down

0 comments on commit e72d31f

Please sign in to comment.