class_docstr: Class for PSD(n,k).
  
  The manifold of Positive Semi Definite matrices of rank k: PSD(n,k).
  
  Parameters
  ----------
  n : int
      Integer representing the shape of the matrices: n x n.
  k : int
      Integer representing the rank of the matrix (k<n).
class_docstr_tok: ["Class","for","PSD","(","n",",","k",")",".","The","manifold","of","Positive","Semi","Definite","matrices","of","rank","k",":","PSD","(","n",",","k",")",".","Parameters","--","--","--","--","--","n",":","int","Integer","representing","the","shape","of","the","matrices",":","n","x","n.","k",":","int","Integer","representing","the","rank","of","the","matrix","(","k","<","n",")","."]
docstr: Check if the matrix belongs to the space.
  
  Parameters
  ----------
  mat : array-like, shape=[..., n, n]
      Matrix to be checked.
  atol : float
      Tolerance.
      Optional, default: backend atol.
  
  Returns
  -------
  belongs : array-like, shape=[...,]
      Boolean denoting if mat is an SPD matrix.
docstr_tok: ["Check","if","the","matrix","belongs","to","the","space",".","Parameters","--","--","--","--","--","mat",":","array-like",",","shape=","[","...",",","n",",","n","]","Matrix","to","be","checked",".","atol",":","float","Tolerance",".","Optional",",","default",":","backend","atol",".","Returns","--","--","--","-","belongs",":","array-like",",","shape=","[","...",",","]","Boolean","denoting","if","mat","is","an","SPD","matrix","."]
code: def belongs(self, point, atol=gs.atol):
      r"""Check if the matrix belongs to the space.
  
      Parameters
      ----------
      mat : array-like, shape=[..., n, n]
          Matrix to be checked.
      atol : float
          Tolerance.
          Optional, default: backend atol.
  
      Returns
      -------
      belongs : array-like, shape=[...,]
          Boolean denoting if mat is an SPD matrix.
      """
      shape_belongs = self.shape == point.shape[-self.point_ndim :]
      if not shape_belongs:
          shape = point.shape[: -self.point_ndim]
          return gs.zeros(shape, dtype=bool)
  
      is_symmetric = self.sym.belongs(point, atol)
      eigvalues = gs.linalg.eigvalsh(point)
      is_semipositive = gs.all(eigvalues > -atol, axis=-1)
      sum_eig = gs.sum(gs.where(eigvalues < atol, 0, 1), axis=-1)
      is_rankk = gs.isclose(sum_eig, self.rank, atol=atol)
      return gs.logical_and(
          gs.logical_and(is_symmetric, is_semipositive), is_rankk
      )
  
imports: import geomstats.backend
  from geomstats.geometry.fiber_bundle import FiberBundle
  from geomstats.geometry.full_rank_matrices import FullRankMatrices
  from geomstats.geometry.general_linear import GeneralLinear
  from geomstats.geometry.manifold import Manifold
  from geomstats.geometry.matrices import Matrices, MatricesMetric
  from geomstats.geometry.quotient_metric import QuotientMetric
  from geomstats.geometry.spd_matrices import SPDEuclideanMetric, SPDMatrices
  from geomstats.geometry.special_orthogonal import SpecialOrthogonal
  from geomstats.geometry.symmetric_matrices import SymmetricMatrices
label_desc: Use image node_id 3 for calling the RankKPSDMatrices obj's underlying member method code with example usage: obj.belongs(point, atol) and returns: gs, gs