Skip to content

Commit

Permalink
Merge pull request #124 from decargroup/numpy_compatibility
Browse files Browse the repository at this point in the history
Minor fix in np.linalg.solve dimensions
  • Loading branch information
mitchellcohen3 authored Jun 26, 2024
2 parents 978d8b8 + 56724d5 commit 6b511a4
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion navlie/utils/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -1212,8 +1212,14 @@ def __getitem__(self, key):
out.nees = out.error**2 / out.covariance.flatten()
out.dof = np.ones_like(out.stamp)
else:
n_times = out.covariance.shape[0]
n_error = out.covariance.shape[1]
out.nees = np.sum(
out.error * np.linalg.solve(out.covariance, out.error), axis=1
out.error
* np.linalg.solve(
out.covariance, out.error.reshape((n_times, n_error, 1))
).reshape((n_times, n_error)),
axis=1,
)
out.dof = out.error.shape[1] * np.ones_like(out.stamp)

Expand Down

0 comments on commit 6b511a4

Please sign in to comment.