Commit cce6c92
committed
Dispatch numpy ufuncs for expr functions
Replace per-function PyNumber_Check lambdas with a unified _dispatch_ufunc helper that vectorizes conversion of Python numbers to Constant via _to_const and np.frompyfunc. Removed the direct cimport of PyNumber_Check and updated exp/log/sqrt/sin/cos to call _dispatch_ufunc. _dispatch_ufunc also coerces ndarray results to MatrixExpr, centralizing numpy ufunc handling and improving array support for expression construction.1 parent 590859d commit cce6c92
1 file changed
Lines changed: 15 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
51 | | - | |
52 | 51 | | |
53 | 52 | | |
54 | 53 | | |
| |||
857 | 856 | | |
858 | 857 | | |
859 | 858 | | |
860 | | - | |
861 | | - | |
862 | | - | |
863 | | - | |
864 | | - | |
| 859 | + | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
| 867 | + | |
| 868 | + | |
| 869 | + | |
| 870 | + | |
| 871 | + | |
| 872 | + | |
| 873 | + | |
865 | 874 | | |
866 | 875 | | |
867 | 876 | | |
| |||
0 commit comments