Skip to content

Commit

Permalink
update parameter dimension on -resume #fixes 1159
Browse files Browse the repository at this point in the history
  • Loading branch information
jordandouglas committed Aug 5, 2024
1 parent 25df72b commit 3916ce5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/beast/base/inference/parameter/Parameter.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import beast.base.core.Description;
import beast.base.core.Function;
import beast.base.core.Input;
import beast.base.core.Log;
import beast.base.inference.StateNode;

import java.io.PrintStream;
Expand Down Expand Up @@ -513,7 +514,8 @@ public void assignFrom(final StateNode other) {
@Override
public void assignFromFragile(final StateNode other) {
@SuppressWarnings("unchecked") final Parameter.Base<T> source = (Parameter.Base<T>) other;
System.arraycopy(source.values, 0, values, 0, Math.min(values.length, source.getDimension()));
this.setDimension(source.values.length);
System.arraycopy(source.values, 0, values, 0, source.values.length);
Arrays.fill(m_bIsDirty, false);
}

Expand Down

0 comments on commit 3916ce5

Please sign in to comment.