docstr: Procrustes preprocessing.
  
  Parameters
  ----------
  matrix_v : array-like
  matrix_m : array-like
  matrix_n : array-like
  
  Returns
  -------
  matrix_v : array-like
code: def _procrustes_preprocessing(p, matrix_v, matrix_m, matrix_n):
      """Procrustes preprocessing.
  
      Parameters
      ----------
      matrix_v : array-like
      matrix_m : array-like
      matrix_n : array-like
  
      Returns
      -------
      matrix_v : array-like
      """
      [matrix_d, _, matrix_r] = gs.linalg.svd(matrix_v[..., p:, p:])
      matrix_v_final = gs.copy(matrix_v)
      for i in range(1, p + 1):
          matrix_rd = Matrices.mul(
              matrix_r, Matrices.transpose(matrix_d)
          )
          sub_matrix_v = gs.matmul(matrix_v[..., :, p:], matrix_rd)
          matrix_v_final = gs.concatenate(
              [
                  gs.concatenate([matrix_m, matrix_n], axis=-2),
                  sub_matrix_v,
              ],
              axis=-1,
          )
          det = gs.linalg.det(matrix_v_final)
          if gs.all(det > 0):
              break
  
          ones = gs.ones(p)
          reflection_vec = gs.concatenate(
              [ones[:-i], gs.array([-1.0] * i)], axis=0
          )
          mask = gs.cast(det < 0, matrix_v.dtype)
          sign = (
              mask[..., None] * reflection_vec
              + (1.0 - mask)[..., None] * ones
          )
          matrix_d = gs.einsum(
              "...ij,...i->...ij", Matrices.transpose(matrix_d), sign
          )
  
      return matrix_v_final
  
imports: import warnings
  import geomstats.backend
  import geomstats.errors
  from geomstats import algebra_utils
  from geomstats.geometry.base import LevelSet
  from geomstats.geometry.hermitian_matrices import powermh
  from geomstats.geometry.matrices import Matrices
  from geomstats.geometry.riemannian_metric import RiemannianMetric
  from geomstats.vectorization import repeat_out
label_desc: Use image node_id 4 for calling the _StiefelLogSolver obj's underlying member method code with example usage: obj._procrustes_preprocessing(p, matrix_v, matrix_m, matrix_n) and returns: matrix_v_final