Commit 6925f6d3 authored by Bryan Cazabonne's avatar Bryan Cazabonne

Fixed null pointer exception in MultiplexedMeasurement.

Fixes issue #617
parent 89436e96
......@@ -21,6 +21,9 @@
</properties>
<body>
<release version="10.1" date="TBD" description="TBD">
<action dev="bryan" type="fix" issue="617">
Fixed null pointer exception in MultiplexedMeasurement.
</action>
<action dev="luc" type="fix" issue="575">
Allow users to provide custom convergence checkers for
batch least squares orbit determination.
......
......@@ -179,6 +179,18 @@ public class EstimatedMeasurement<T extends ObservedMeasurement<T>> implements C
this.status = status;
}
/** Get state size.
* <p>
* Warning, the {@link #setStateDerivatives(int, double[]...)}
* method must have been called before this method is called.
* </p>
* @return state size
* @since 10.1
*/
public int getStateSize() {
return stateDerivatives[0][0].length;
}
/** Get the partial derivatives of the {@link #getEstimatedValue()
* simulated measurement} with respect to state Cartesian coordinates.
* @param index index of the state, according to the {@code states}
......
......@@ -17,6 +17,7 @@
package org.orekit.estimation.measurements;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.IdentityHashMap;
import java.util.List;
import java.util.Map;
......@@ -165,7 +166,13 @@ public class MultiplexedMeasurement extends AbstractMeasurement<MultiplexedMeasu
multiplexed.setEstimatedValue(value);
// combine derivatives
final int stateSize = estimatedMeasurements.get(0).getStateSize();
final double[] zeroDerivative = new double[stateSize];
final double[][][] stateDerivatives = new double[nbSat][dimension][];
for (final double[][] m : stateDerivatives) {
Arrays.fill(m, zeroDerivative);
}
final Map<ParameterDriver, double[]> parametersDerivatives = new IdentityHashMap<>();
index = 0;
for (int i = 0; i < observedMeasurements.size(); ++i) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment