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:
1 parent
c0fbe9b182
commit
51bb8767e3
16 files changed
+459
-57
No files matched your search
@@ -47,7 +47,8 @@ pub fn to_dense_value(m: &Mat) -> Result<Value, String> {
|
||||
let (rows, cols) = shape(m)?;
|
||||
check_elems(rows, cols)?;
|
||||
Ok(json!({
|
||||
"_type": "linalg_dense",
|
||||
"_type": "matrix",
|
||||
"kind": "dense",
|
||||
"rows": rows,
|
||||
"cols": cols,
|
||||
"data": m,
|
||||
@@ -108,7 +109,7 @@ pub fn from_value(v: &Value) -> Result<Mat, String> {
|
||||
if v.is_array() {
|
||||
return parse_data(v);
|
||||
}
|
||||
Err("expected linalg_dense, dense expr, or nested list".into())
|
||||
Err("expected matrix dense, dense expr, or nested list".into())
|
||||
}
|
||||
|
||||
fn parse_data(v: &Value) -> Result<Mat, String> {
|
||||
|
||||
Reference in new issue
Block a user