An algorithm to compute the Hilbert depth. (January 2015)