Testing for linear independence in a non-orthonormal basis