Kalman filter Programming

I am trying to program for Kalman filter by using Matrixmath.h file.But i got "Inversion failed due to singular Matrix" output for any matrices i given for A,P,H.
If anyone having Kalman filter coding please help me

What results did your search turn up?

I want to model the GPS using Kalman filter,But the kalman filter algorithm is not working,there is some singular matrix problem occur while compute inversion.if anyone having coding for KF please help me