The Riemann solution in the one-dimensional inverse problem