class_docstr: Class for the general linear group GL(n) and its identity component.
  
  If `positive_det=True`, this is the connected component of the identity,
  i.e. the space of matrices with positive determinant.
  
  Parameters
  ----------
  n : int
      Integer representing the shape of the matrices: n x n.
  positive_det : bool
      Whether to restrict to the identity connected component of the
      general linear group, i.e. matrices with positive determinant.
      Optional, default: False.
docstr: Project a matrix to the general linear group.
  
  As GL(n) is dense in the space of matrices, this is not a projection
  per se, but a regularization if the matrix is not already invertible:
  :math:`X + \epsilon I_n` is returned where :math:`\epsilon=gs.atol`
  is returned for an input X.
  
  Parameters
  ----------
  point : array-like, shape=[..., dim_embedding]
      Point in embedding manifold.
  
  Returns
  -------
  projected : array-like, shape=[..., dim_embedding]
      Projected point.
docstr_tok: ["Project","a","matrix","to","the","general","linear","group",".","As","GL","(","n",")","is","dense","in","the","space","of","matrices",",","this","is","not","a","projection","per","se",",","but","a","regularization","if","the","matrix","is","not","already","invertible",":",":","math",":","`","X","+","\\epsilon","I_n","`","is","returned","where",":","math",":","`","\\epsilon=gs.atol","`","is","returned","for","an","input","X.","Parameters","--","--","--","--","--","point",":","array-like",",","shape=","[","...",",","dim_embedding","]","Point","in","embedding","manifold",".","Returns","--","--","--","-","projected",":","array-like",",","shape=","[","...",",","dim_embedding","]","Projected","point","."]
code: def projection(self, point):
      r"""Project a matrix to the general linear group.
  
      As GL(n) is dense in the space of matrices, this is not a projection
      per se, but a regularization if the matrix is not already invertible:
      :math:`X + \epsilon I_n` is returned where :math:`\epsilon=gs.atol`
      is returned for an input X.
  
      Parameters
      ----------
      point : array-like, shape=[..., dim_embedding]
          Point in embedding manifold.
  
      Returns
      -------
      projected : array-like, shape=[..., dim_embedding]
          Projected point.
      """
      belongs = self.belongs(point)
      regularization = gs.einsum(
          "...,ij->...ij",
          gs.where(~belongs, gs.atol, 0.0),
          self.identity,
      )
      projected = point + regularization
      if self.positive_det:
          det = gs.linalg.det(point)
          return utils.flip_determinant(projected, det)
      return projected
  
imports: import geomstats.algebra_utils
  import geomstats.backend
  from geomstats.geometry.base import VectorSpaceOpenSet
  from geomstats.geometry.lie_algebra import MatrixLieAlgebra
  from geomstats.geometry.lie_group import MatrixLieGroup
  from geomstats.geometry.matrices import Matrices, MatricesMetric
label_desc: Use image node_id 3 for calling the GeneralLinear obj's underlying member method code with example usage: obj.projection(point) and returns: projected, utils