Skip to content

Add element-wise evalf for dense matrices - #541

Merged
isuruf merged 1 commit into
symengine:mainfrom
yqia03:matrix-evalf
Dec 3, 2026
Merged

isuruf merged 1 commit into
symengine:mainfrom
yqia03:matrix-evalf

Conversation

@yqia03

@yqia03 yqia03 commented Nov 30, 2026

Copy link
Copy Markdown
Contributor

Fixes #491.

Add DenseMatrix.evalf(prec=53, real=None), which calls the existing scalar evalf on each entry. It keeps the shape and returns the same mutable or immutable matrix type. The test differentiates an exact symbolic matrix, substitutes a real value, and checks the numerical result without modifying the exact input.

The regression failed on the original wrapper because it had no matrix evalf method. With the patch, the matrix and evaluation modules passed 67 tests with four skips on macOS arm64, Python 3.13, and the pinned SymEngine core. Six additional direct comparisons matched the corresponding scalar calls at default and higher precision and in real and complex modes.

OpenAI Codex prepared the patch, tests, and this description. No human pre-submission review was performed.

Generated-by: OpenAI Codex
@isuruf

isuruf commented Dec 3, 2026

Copy link
Copy Markdown
Member

Thanks

@isuruf
isuruf merged commit 47f994d into symengine:main Dec 3, 2026
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

.evalf() for matrices

2 participants