Module compat

Module compat 

Source
Expand description

SciPy-compatible API wrappers for scirs2-linalg

This module provides function signatures that match SciPy’s linalg module to ease migration and compatibility. The functions delegate to the main scirs2-linalg implementations while providing the same parameter interface as SciPy.

§Supported Functions

§Basic Matrix Operations

  • det() - Matrix determinant
  • inv() - Matrix inverse
  • pinv() - Moore-Penrose pseudoinverse
  • norm() - Matrix and vector norms
  • cond() - Condition number
  • matrix_rank() - Matrix rank

§Matrix Decompositions

  • lu() - LU decomposition
  • qr() - QR decomposition
  • svd() - Singular value decomposition
  • cholesky() - Cholesky decomposition
  • schur() - Schur decomposition
  • polar() - Polar decomposition
  • rq() - RQ decomposition

§Eigenvalue Problems

  • eig() - General eigenvalue problem
  • eigh() - Symmetric/Hermitian eigenvalue problem
  • eigvals() - Eigenvalues only
  • eigvalsh() - Eigenvalues of symmetric/Hermitian matrix

§Linear System Solvers

  • solve() - General linear system solver
  • lstsq() - Least squares solver
  • solve_triangular() - Triangular system solver
  • solve_banded() - Banded matrix solver

§Matrix Functions

  • expm() - Matrix exponential
  • logm() - Matrix logarithm
  • sqrtm() - Matrix square root
  • funm() - General matrix function
  • cosm(), sinm(), tanm() - Trigonometric matrix functions

§Utilities

  • block_diag() - Block diagonal matrix construction

Re-exports§

pub use crate::eigen::eigvals;
pub use crate::eigen::eigvalsh;
pub use crate::eigen_specialized::banded_eigh as eig_banded;
pub use crate::eigen_specialized::banded_eigvalsh as eigvals_banded;
pub use crate::eigen_specialized::tridiagonal_eigh as eigh_tridiagonal;
pub use crate::eigen_specialized::tridiagonal_eigvalsh as eigvalsh_tridiagonal;
pub use crate::matrix_functions::expm;
pub use crate::matrix_functions::logm;

Functions§

block_diag
Create block diagonal matrix (SciPy-compatible interface)
cholesky
Cholesky decomposition (SciPy-compatible interface)
compat_solve
Solve a linear system (SciPy-compatible interface)
cond
Compute condition number (SciPy-compatible interface)
cosm
Matrix cosine (SciPy-compatible interface)
det
Compute the determinant of a matrix (SciPy-compatible interface)
eig
Compute eigenvalues and eigenvectors (SciPy-compatible interface)
eigh
Compute eigenvalues and eigenvectors of symmetric/Hermitian matrix (SciPy-compatible interface)
fractionalmatrix_power
Raise a square matrix to the given power.
funm
General matrix function (SciPy-compatible interface)
inv
Compute the inverse of a matrix (SciPy-compatible interface)
lstsq
Solve linear least squares problem (SciPy-compatible interface)
lu
LU decomposition (SciPy-compatible interface)
matrix_rank
Compute matrix rank (SciPy-compatible interface)
norm
Compute matrix or vector norm (SciPy-compatible interface)
pinv
Compute Moore-Penrose pseudoinverse (SciPy-compatible interface)
polar
Polar decomposition (SciPy-compatible interface)
qr
QR decomposition (SciPy-compatible interface)
rq
RQ decomposition (SciPy-compatible interface)
schur
Schur decomposition (SciPy-compatible interface)
sinm
Matrix sine (SciPy-compatible interface)
solve_banded
Solve banded linear system (SciPy-compatible interface)
solve_triangular
Solve triangular system (SciPy-compatible interface)
sqrtm
Matrix square root (SciPy-compatible interface)
svd
SVD decomposition (SciPy-compatible interface)
tanm
Matrix tangent (SciPy-compatible interface)
vector_norm
Compute vector norm (SciPy-compatible interface)

Type Aliases§

LstsqResult
Type alias for least squares solver result
SvdResult
Type alias for SVD decomposition result