Skip to content

Add element-wise evalf for dense matrices - #541

Open
yqia03 wants to merge 1 commit into
symengine:mainfrom
yqia03:matrix-evalf
Open

yqia03 wants to merge 1 commit into
symengine:mainfrom
yqia03:matrix-evalf

Conversation

@yqia03

@yqia03 yqia03 commented Nov 30, 2026

Copy link
Copy Markdown

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

This branch has not been deployed

No deployments
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

1 participant