class_docstr: Class for the space of matrices (m, n).
  
  Parameters
  ----------
  m, n : int
      Integers representing the shapes of the matrices: m x n.
class_docstr_tok: ["Class","for","the","space","of","matrices","(","m",",","n",")",".","Parameters","--","--","--","--","--","m",",","n",":","int","Integers","representing","the","shapes","of","the","matrices",":","m","x","n","."]
docstr: Align matrices.
  
  Find the optimal rotation R in SO(m) such that the base point and
  R.point are well positioned.
  
  Parameters
  ----------
  point : array-like, shape=[..., m, n]
      Point on the manifold.
  base_point : array-like, shape=[..., m, n]
      Point on the manifold.
  
  Returns
  -------
  aligned : array-like, shape=[..., m, n]
      R.point.
docstr_tok: ["Align","matrices",".","Find","the","optimal","rotation","R","in","SO","(","m",")","such","that","the","base","point","and","R.point","are","well","positioned",".","Parameters","--","--","--","--","--","point",":","array-like",",","shape=","[","...",",","m",",","n","]","Point","on","the","manifold",".","base_point",":","array-like",",","shape=","[","...",",","m",",","n","]","Point","on","the","manifold",".","Returns","--","--","--","-","aligned",":","array-like",",","shape=","[","...",",","m",",","n","]","R.point","."]
code: def align_matrices(cls, point, base_point):
      """Align matrices.
  
      Find the optimal rotation R in SO(m) such that the base point and
      R.point are well positioned.
  
      Parameters
      ----------
      point : array-like, shape=[..., m, n]
          Point on the manifold.
      base_point : array-like, shape=[..., m, n]
          Point on the manifold.
  
      Returns
      -------
      aligned : array-like, shape=[..., m, n]
          R.point.
      """
      mat = gs.matmul(cls.transpose(point), base_point)
      left, singular_values, right = gs.linalg.svd(
          mat, full_matrices=False
      )
      det = gs.linalg.det(mat)
      conditioning = (
          singular_values[..., -2]
          + gs.sign(det) * singular_values[..., -1]
      ) / singular_values[..., 0]
      if gs.any(conditioning < gs.atol):
          logging.warning(
              f"Singularity close, ill-conditioned matrix "
              f"encountered: "
              f"{conditioning[conditioning < 1e-10]}"
          )
      if gs.any(gs.isclose(conditioning, 0.0)):
          logging.warning("Alignment matrix is not unique.")
      flipped = flip_determinant(cls.transpose(right), det)
      return Matrices.mul(point, left, cls.transpose(flipped))
  
imports: import logging
  import math
  from functools import reduce
  import geomstats.backend
  import geomstats.errors
  from geomstats.algebra_utils import flip_determinant, from_vector_to_diagonal_matrix
  from geomstats.geometry.base import MatrixVectorSpace
  from geomstats.geometry.euclidean import EuclideanMetric
  from geomstats.vectorization import repeat_out
label_desc: Use image node_id 34 for calling the Matrices obj's underlying member method code with example usage: obj.align_matrices(cls, point, base_point) and returns: Matrices