@@ -123,14 +123,16 @@ struct two_filters_smoother {
123123 // Eq (3.39) of "Pattern Recognition, Tracking and Vertex
124124 // Reconstruction in Particle Detectors"
125125 const matrix_type<D, D> R_smt =
126- V - H * smoothed_cov * matrix::transpose (H);
126+ V - H * algebra::matrix::transposed_product<false , true >(
127+ smoothed_cov, H);
127128
128129 // Eq (3.40) of "Pattern Recognition, Tracking and Vertex
129130 // Reconstruction in Particle Detectors"
130131 assert (matrix::determinant (R_smt) != 0 .f );
131- const matrix_type<1 , 1 > chi2_smt = matrix::transpose (residual_smt) *
132- matrix::inverse (R_smt) *
133- residual_smt;
132+ const matrix_type<1 , 1 > chi2_smt =
133+ algebra::matrix::transposed_product<true , false >(
134+ residual_smt, matrix::inverse (R_smt)) *
135+ residual_smt;
134136
135137 if (getter::element (chi2_smt, 0 , 0 ) < 0 .f ) {
136138 return kalman_fitter_status::ERROR_SMOOTHER_CHI2_NEGATIVE;
@@ -156,14 +158,15 @@ struct two_filters_smoother {
156158 matrix::identity<matrix_type<e_bound_size, e_bound_size>>();
157159 const auto I_m = matrix::identity<matrix_type<D, D>>();
158160
159- const matrix_type<D, D> M =
160- H * predicted_cov * matrix::transpose (H) + V;
161+ const matrix_type<e_bound_size, D> projected_cov =
162+ algebra::matrix::transposed_product<false , true >(predicted_cov, H);
163+
164+ const matrix_type<D, D> M = H * projected_cov + V;
161165
162166 // Kalman gain matrix
163167 assert (matrix::determinant (M) != 0 .f );
164168 assert (std::isfinite (matrix::determinant (M)));
165- const matrix_type<6 , D> K =
166- predicted_cov * matrix::transpose (H) * matrix::inverse (M);
169+ const matrix_type<6 , D> K = projected_cov * matrix::inverse (M);
167170
168171 // Calculate the filtered track parameters
169172 const matrix_type<6 , 1 > filtered_vec =
@@ -178,7 +181,9 @@ struct two_filters_smoother {
178181 // assert(matrix::determinant(R) != 0.f);
179182 assert (std::isfinite (matrix::determinant (R)));
180183 const matrix_type<1 , 1 > chi2 =
181- matrix::transpose (residual) * matrix::inverse (R) * residual;
184+ algebra::matrix::transposed_product<true , false >(
185+ residual, matrix::inverse (R)) *
186+ residual;
182187
183188 // Update the bound track parameters
184189 bound_params.set_vector (filtered_vec);
0 commit comments