Skip to content

v0.2.0

Choose a tag to compare

@TYEclipse TYEclipse released this 02 Oct 21:52
· 1 commit to main since this release

dsh-linalg v0.2.0

Two user-visible additions on top of v0.1.3 — no breaking changes.

New tool: matrix_eigen

Eigen-decomposition of a real symmetric matrix (cyclic Jacobi method, full double precision):

  • all eigenvalues in descending order + a matching unit eigenvector per eigenvalue
  • deterministic sign convention: the leading non-zero component of each eigenvector is positive
  • maxResidual — the largest |A·v − λ·v| entry actually measured, reported so accuracy is visible instead of assumed
  • traceSum — sum of the eigenvalues, equal to the trace (self-check in every reply)
  • non-square / non-symmetric input and non-convergence are errors, never a guessed spectrum

matrix_compute gains two operations

  • rank — rank via reduced row echelon form (rectangular input allowed)
  • power — integer matrix power by binary exponentiation; exponent takes −64…64, negative exponents invert first (clean failure on singular input), 0 gives the identity

Quality

  • every numeric expectation in the tests is produced by the independent oracle test/oracle/anchors.py (exact fractions arithmetic for det/inverse/rref/rank/power, closed-form spectra — 2 − 2·cos(kπ/5), 1 ± 2√2, and an integer matrix with the exact spectrum 8, 4, 0, −8 — cross-checked against an independent pure-Python Jacobi implementation). python3 test/oracle/anchors.py --check self-verifies.
  • tests 97 → 128, coverage 92.91% → 94.48% (baseline ratcheted up)

安装(两者等价):dsh plugin --profile <profile> add github:TYEclipse/dsh-linalg


dsh-linalg v0.2.0(中文)

在 v0.1.3 基础上新增两项用户可见能力,无破坏性变更。

新工具 matrix_eigen:实对称矩阵特征分解(循环 Jacobi 旋转,全双精度)——特征值降序 + 每个特征值对应的单位特征向量;符号约定为首个非零分量为正;回复里带 maxResidual(实测的 max|A·v − λ·v|,精度可见而非假设)与 traceSum(特征值之和 = 迹,自检)。非方阵 / 非对称 / 不收敛一律报错,不给猜测的谱。

matrix_compute 新增两个操作:rank(行最简形求秩,允许长方形输入)、power(二进制快速幂,exponent 取 −64…64,负指数先求逆、奇异矩阵明确报错,0 得单位阵)。

质量:测试里的每一个数值断言都由独立 oracle test/oracle/anchors.py 产出(det/inverse/rref/rank/power 走 fractions 精确算术;特征值走闭式解 2 − 2·cos(kπ/5)、1 ± 2√2,以及一个谱恰为 8, 4, 0, −8 的整数矩阵,并与独立的纯 Python Jacobi 实现交叉核对)。测试 97 → 128 条,覆盖率 92.91% → 94.48%(基线棘轮上调)。