code: def svd(
      ctx, A, full_matrices=False, compute_uv=True, overwrite_a=False
  ):
      """
      "svd" is a unified interface for "svd_r" and "svd_c". Depending on
      whether A is real or complex the appropriate function is called.
  
      This routine computes the singular value decomposition of a matrix A.
      Given A, two orthogonal (A real) or unitary (A complex) matrices U and V
      are calculated such that
  
             A = U S V        and        U' U = 1         and         V V' = 1
  
      where S is a suitable shaped matrix whose off-diagonal elements are zero.
      Here ' denotes the hermitian transpose (i.e. transposition and complex
      conjugation). The diagonal elements of S are the singular values of A,
      i.e. the squareroots of the eigenvalues of A' A or A A'.
  
      input:
        A             : a real or complex matrix of shape (m, n)
        full_matrices : if true, U and V are of shape (m, m) and (n, n).
                        if false, U and V are of shape (m, min(m, n)) and (min(m, n), n).
        compute_uv    : if true, U and V are calculated. if false, only S is calculated.
        overwrite_a   : if true, allows modification of A which may improve
                        performance. if false, A is not modified.
  
      output:
        U : an orthogonal or unitary matrix: U' U = 1. if full_matrices is true, U is of
            shape (m, m). ortherwise it is of shape (m, min(m, n)).
  
        S : an array of length min(m, n) containing the singular values of A sorted by
            decreasing magnitude.
  
        V : an orthogonal or unitary matrix: V V' = 1. if full_matrices is true, V is of
            shape (n, n). ortherwise it is of shape (min(m, n), n).
  
      return value:
  
             S          if compute_uv is false
         (U, S, V)      if compute_uv is true
  
      overview of the matrices:
  
        full_matrices true:
          A           : m*n
          U           : m*m     U' U  = 1
          S as matrix : m*n
          V           : n*n     V  V' = 1
  
       full_matrices false:
          A           : m*n
          U           : m*min(n,m)             U' U  = 1
          S as matrix : min(m,n)*min(m,n)
          V           : min(m,n)*n             V  V' = 1
  
      examples:
  
         >>> from mpmath import mp
         >>> A = mp.matrix([[2, -2, -1], [3, 4, -2], [-2, -2, 0]])
         >>> S = mp.svd(A, compute_uv = False)
         >>> print(S)
         [6.0]
         [3.0]
         [1.0]
  
         >>> U, S, V = mp.svd(A)
         >>> print(mp.chop(A - U * mp.diag(S) * V))
         [0.0  0.0  0.0]
         [0.0  0.0  0.0]
         [0.0  0.0  0.0]
  
      see also: svd_r, svd_c
      """
  
      iscomplex = any(type(x) is ctx.mpc for x in A)
  
      if iscomplex:
          return ctx.svd_c(
              A,
              full_matrices=full_matrices,
              compute_uv=compute_uv,
              overwrite_a=overwrite_a,
          )
      else:
          return ctx.svd_r(
              A,
              full_matrices=full_matrices,
              compute_uv=compute_uv,
              overwrite_a=overwrite_a,
          )
  
file_path: catboost/contrib/python/mpmath/py3/mpmath/matrices/eigen_symmetric.py
imports: from ..libmp.backend import xrange
  from .eigen import defun
label_desc: Use image node_id 14 for calling a global function with example usage: svd(ctx, A, full_matrices, compute_uv, overwrite_a) and returns: ctx, ctx