#pragma once #include "math.hpp" namespace matrix { template void kalman_correct( const Matrix & P, const Matrix & C, const Matrix & R, const Vector &r, Vector & dx, float & beta ) { SquareMatrix S_I = SquareMatrix(C*P*C.T() + R).I(); dx = P*C.T()*S_I*r; beta = Scalar(r.T()*S_I*r); } }; // namespace matrix