13 #include <type_traits>
20 template <
typename SL,
size_t M,
bool ReadOnly>
23 : m_traj(&trajectory), m_istate(istate) {}
25 template <
typename SL,
size_t M,
bool ReadOnly>
30 mask |= PM::Predicted;
42 if (hasUncalibrated()) {
43 mask |= PM::Uncalibrated;
45 if (hasCalibrated()) {
46 mask |= PM::Calibrated;
52 template <
typename SL,
size_t M,
bool ReadOnly>
56 idx =
data().ismoothed;
57 }
else if (hasFiltered()) {
58 idx =
data().ifiltered;
60 idx =
data().ipredicted;
63 return Parameters(m_traj->m_params.data.col(idx).data());
66 template <
typename SL,
size_t M,
bool ReadOnly>
70 idx =
data().ismoothed;
71 }
else if (hasFiltered()) {
72 idx =
data().ifiltered;
74 idx =
data().ipredicted;
76 return Covariance(m_traj->m_cov.data.col(idx).data());
79 template <
typename SL,
size_t M,
bool ReadOnly>
85 template <
typename SL,
size_t M,
bool ReadOnly>
92 template <
typename SL,
size_t M,
bool ReadOnly>
98 template <
typename SL,
size_t M,
bool ReadOnly>
105 template <
typename SL,
size_t M,
bool ReadOnly>
111 template <
typename SL,
size_t M,
bool ReadOnly>
118 template <
typename SL,
size_t M,
bool ReadOnly>
124 template <
typename SL,
size_t M,
bool ReadOnly>
127 return bitsetToMatrix<Projector>(m_traj->m_projectors[
data().iprojector]);
130 template <
typename SL,
size_t M,
bool ReadOnly>
134 return m_traj->m_sourceLinks[
data().iuncalibrated];
137 template <
typename SL,
size_t M,
bool ReadOnly>
144 template <
typename SL,
size_t M,
bool ReadOnly>
148 return m_traj->m_sourceLinks[
data().icalibratedsourcelink];
151 template <
typename SL,
size_t M,
bool ReadOnly>
156 m_traj->m_measCov.col(
data().icalibrated).data());
161 template <
typename SL>
166 m_index.emplace_back();
168 size_t index = m_index.size() - 1;
170 if (iprevious != SIZE_MAX) {
175 m_referenceSurfaces.emplace_back(
nullptr);
202 m_sourceLinks.emplace_back();
211 m_sourceLinks.emplace_back();
214 m_projectors.emplace_back();
221 template <
typename SL>
222 template <
typename F>
224 static_assert(detail_lt::VisitorConcept<F, ConstTrackStateProxy>,
225 "Callable needs to satisfy VisitorConcept");
228 if constexpr (std::is_same_v<std::invoke_result_t<F, ConstTrackStateProxy>,
230 bool proceed = callable(getTrackState(iendpoint));
238 callable(getTrackState(iendpoint));
244 iendpoint = m_index[iendpoint].iprevious;
248 template <
typename SL>
249 template <
typename F>
251 static_assert(detail_lt::VisitorConcept<F, TrackStateProxy>,
252 "Callable needs to satisfy VisitorConcept");
255 if constexpr (std::is_same_v<std::invoke_result_t<F, TrackStateProxy>,
257 bool proceed = callable(getTrackState(iendpoint));
265 callable(getTrackState(iendpoint));
271 iendpoint = m_index[iendpoint].iprevious;