Skip to content

igl.spectra

Python API reference for igl.spectra.

eigs

eigs(A: scipy.sparse.csc_matrix[float], B: scipy.sparse.csc_matrix[float], k: int, type: EigsType) -> tuple[float64[m, n], float64[m]]

Compute the first/last k eigen pairs of the generalized eigenvalue problem:

A u = s B u

Solutions are approximate and sorted. Only EIGS_TYPE_SM (smallest magnitude) is well supported.

Parameters

  • A — #A by #A symmetric sparse matrix
  • B — #A by #A symmetric positive-definite sparse matrix
  • k — number of eigen pairs to compute
  • type — EigsType.EIGS_TYPE_SM or EigsType.EIGS_TYPE_LM
  • U — #A by k matrix of sorted eigenvectors (descending)
  • S — k vector of sorted eigenvalues (descending)

Returns

  • Tuple (U, S)
eigs(A: scipy.sparse.csc_matrix[float], B: scipy.sparse.csc_matrix[float], k: int, sigma: float) -> tuple[float64[m, n], float64[m]]

Compute k eigen pairs of A u = s B u with a shift: A ← A + sigma * B.

Parameters

  • A — #A by #A symmetric sparse matrix
  • B — #A by #A symmetric positive-definite sparse matrix
  • k — number of eigen pairs to compute
  • sigma — shift to apply to A
  • U — #A by k matrix of sorted eigenvectors (descending)
  • S — k vector of sorted eigenvalues (descending)

Returns

  • Tuple (U, S)

lscm

lscm(V: float64[m, n], F: int64[m, n]) -> float64[m, n]

Compute a free-boundary least-squares conformal map parametrization using spectral decomposition. Assumes the mesh is a single connected component topologically equivalent to a disk.

Implements "Spectral Conformal Parameterization" [Mullen et al. 2008].

Parameters

  • V — #V by 3 list of mesh vertex positions
  • F — #F by 3 list of mesh face indices (triangles)
  • UV — #V by 2 list of UV coordinates

Returns

  • UV coordinates

EigsType