class_docstr: Class for skew-symmetric matrices.
  
  Parameters
  ----------
  n : int
      Number of rows and columns.
class_docstr_tok: ["Class","for","skew-symmetric","matrices",".","Parameters","--","--","--","--","--","n",":","int","Number","of","rows","and","columns","."]
docstr: Calculate the coefficients of given matrix in the basis.
  
  Compute a 1d-array that corresponds to the input matrix in the basis
  representation.
  
  Parameters
  ----------
  matrix_representation : array-like, shape=[..., n, n]
      Matrix.
  
  Returns
  -------
  basis_representation : array-like, shape=[..., dim]
      Representation in the basis.
docstr_tok: ["Calculate","the","coefficients","of","given","matrix","in","the","basis",".","Compute","a","1d-array","that","corresponds","to","the","input","matrix","in","the","basis","representation",".","Parameters","--","--","--","--","--","matrix_representation",":","array-like",",","shape=","[","...",",","n",",","n","]","Matrix",".","Returns","--","--","--","-","basis_representation",":","array-like",",","shape=","[","...",",","dim","]","Representation","in","the","basis","."]
code: def basis_representation(self, matrix_representation):
      """Calculate the coefficients of given matrix in the basis.
  
      Compute a 1d-array that corresponds to the input matrix in the basis
      representation.
  
      Parameters
      ----------
      matrix_representation : array-like, shape=[..., n, n]
          Matrix.
  
      Returns
      -------
      basis_representation : array-like, shape=[..., dim]
          Representation in the basis.
      """
      if self.n == 2:
          return matrix_representation[..., 1, 0][..., None]
      if self.n == 3:
          vec = gs.stack(
              [
                  matrix_representation[..., 2, 1],
                  matrix_representation[..., 0, 2],
                  matrix_representation[..., 1, 0],
              ]
          )
          return gs.transpose(vec)
  
      return gs.triu_to_vec(matrix_representation, k=1)
  
file_path: geomstats/geomstats/geometry/skew_symmetric_matrices.py
imports: import geomstats.backend
  from geomstats.geometry.lie_algebra import MatrixLieAlgebra
  from geomstats.geometry.matrices import Matrices, MatricesMetric
label_desc: Use image node_id 7 for calling the SkewSymmetricMatrices obj's underlying member method code with example usage: obj.basis_representation(matrix_representation) and returns: gs, matrix_representation, gs