-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -55,19 +55,24 @@ public double getParameterValue(int dim) { | |
|
||
public void setParameterValue(int dim, double value) { | ||
update(); | ||
transformedValues[dim] = value; | ||
unTransformedValues = inverse(transformedValues); | ||
unTransformedValues[dim] = value; | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
mdhall272
Author
Contributor
|
||
/* transformedValues[dim] = value; | ||
unTransformedValues = inverse(transformedValues);*/ | ||
// Need to update all values | ||
parameter.setParameterValueNotifyChangedAll(0, unTransformedValues[0]); // Warn everyone is changed | ||
for (int i = 1; i < parameter.getDimension(); i++) { | ||
parameter.setParameterValueQuietly(i, unTransformedValues[i]); // Do the rest quietly | ||
} | ||
transformedValues = transform(unTransformedValues); | ||
} | ||
|
||
public void setParameterValueQuietly(int dim, double value) { | ||
update(); | ||
transformedValues[dim] = value; | ||
unTransformedValues = inverse(transformedValues); | ||
unTransformedValues[dim] = value; | ||
transformedValues = transform(unTransformedValues); | ||
|
||
/* transformedValues[dim] = value; | ||
unTransformedValues = inverse(transformedValues);*/ | ||
// Need to update all values | ||
for (int i = 0; i < parameter.getDimension(); i++) { | ||
parameter.setParameterValueQuietly(i, unTransformedValues[i]); | ||
|
@@ -91,18 +96,23 @@ public void addBounds(Bounds<Double> bounds) { | |
// } | ||
|
||
private void update() { | ||
if (hasChanged()) { | ||
|
||
// if (hasChanged()) { | ||
unTransformedValues = parameter.getParameterValues(); | ||
transformedValues = transform(unTransformedValues); | ||
} | ||
// } | ||
} | ||
|
||
private boolean hasChanged() { | ||
|
||
|
||
for (int i = 0; i < unTransformedValues.length; i++) { | ||
if (parameter.getParameterValue(i) != unTransformedValues[i]) { | ||
return true; | ||
} | ||
} | ||
|
||
|
||
return false; | ||
} | ||
} |
@mdhall272 This seems like a breaking change to me. Shouldn't
setParameterValue
set the value of the parameter you're calling it on? I feel like this change means thatsetParameterValue
will do something different for TransformedMultivariateParameter objects than it will for other Parameter objects.