feat(linalg): matrix infix ops and # matrix methods

Dispatch +/−/* to the linalg plugin for matrix values, retag for EN/ZH
method chains, and expand # matrix with T/simplify/ascii-style methods.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
cflmyandCursor committed 2026-09-07 15:13:47 +08:00
1 parent c0fbe9b182
commit 51bb8767e3
16 files changed
+459 -57

No files matched your search

+2 -2
View File
@@ -6,7 +6,7 @@ import la:ext/linalg/linalg.mq.md
# SVD from a runnable document
A diagonal matrix has singular values on the diagonal. `factorize kind=svd` returns `U`, `S`, `Vt`; `draw kind=svd` writes a teaching structure SVG for `view`.
A diagonal matrix has singular values on the diagonal. Prefer matrix values and methods; `factorize` / `draw` stay explicit for teaching SVGs.
# main
@@ -18,7 +18,7 @@ $$
*`M` = > la.from_formula formula=`M`*
*`f` = > la.factorize matrix=`M` kind="svd"*
*`S` = f[^S]*
*`_` = > la.draw factor=`f` kind="svd" path="svd-structure.svg"*
*`_` = > la.draw factor=`f` kind="svd" theme="light" path="svd-structure.svg"*
*`hm` = > la.draw factor=`M` kind="hinton" path="svd-hinton.svg"*
> print text=`S`