Solution of the discrete regulator problem using the sign matrix function