From fc6d57ffb8d5ddb5820fcc00b5491a585c259ebc Mon Sep 17 00:00:00 2001 From: Yuren Hao Date: Thu, 4 Sep 2025 22:16:22 -0500 Subject: Initial commit --- Qwen2.5-Eval/evaluation/latex2sympy/tests/linalg_test.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100755 Qwen2.5-Eval/evaluation/latex2sympy/tests/linalg_test.py (limited to 'Qwen2.5-Eval/evaluation/latex2sympy/tests/linalg_test.py') diff --git a/Qwen2.5-Eval/evaluation/latex2sympy/tests/linalg_test.py b/Qwen2.5-Eval/evaluation/latex2sympy/tests/linalg_test.py new file mode 100755 index 0000000..d6dea56 --- /dev/null +++ b/Qwen2.5-Eval/evaluation/latex2sympy/tests/linalg_test.py @@ -0,0 +1,15 @@ +from .context import assert_equal +import pytest +from sympy import MatMul, Matrix + + +def test_linalg_placeholder(): + assert_equal("\\begin{pmatrix}1&2\\\\3&4\\end{pmatrix}\\cdot\\variable{v}", MatMul(Matrix([[1, 2], [3, 4]]), Matrix([1, 2])), {'v': Matrix([1, 2])}) + + +def test_linalg_placeholder_multiple(): + assert_equal("\\variable{M}\\cdot\\variable{v}", MatMul(Matrix([[1, 2], [3, 4]]), Matrix([1, 2])), {'M': Matrix([[1, 2], [3, 4]]), 'v': Matrix([1, 2])}) + + +def test_linalg_placeholder_multiple_mul(): + assert_equal("\\begin{pmatrix}3&-1\\end{pmatrix}\\cdot\\variable{M}\\cdot\\variable{v}", MatMul(Matrix([[3, -1]]), Matrix([[1, 2], [3, 4]]), Matrix([1, 2])), {'M': Matrix([[1, 2], [3, 4]]), 'v': Matrix([1, 2])}) -- cgit v1.2.3