{"action":"created","issue":{"url":"https://api.github.com/repos/sympy/symengine/issues/603","labels_url":"https://api.github.com/repos/sympy/symengine/issues/603/labels{/name}","comments_url":"https://api.github.com/repos/sympy/symengine/issues/603/comments","events_url":"https://api.github.com/repos/sympy/symengine/issues/603/events","html_url":"https://github.com/sympy/symengine/pull/603","id":110025660,"number":603,"title":"Lambdify - fast numerical evaluation into Python buffers","user":{"login":"bjodah","id":485936,"avatar_url":"https://avatars.githubusercontent.com/u/485936?v=3","gravatar_id":"","url":"https://api.github.com/users/bjodah","html_url":"https://github.com/bjodah","followers_url":"https://api.github.com/users/bjodah/followers","following_url":"https://api.github.com/users/bjodah/following{/other_user}","gists_url":"https://api.github.com/users/bjodah/gists{/gist_id}","starred_url":"https://api.github.com/users/bjodah/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bjodah/subscriptions","organizations_url":"https://api.github.com/users/bjodah/orgs","repos_url":"https://api.github.com/users/bjodah/repos","events_url":"https://api.github.com/users/bjodah/events{/privacy}","received_events_url":"https://api.github.com/users/bjodah/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":17,"created_at":"2015-10-06T14:52:48Z","updated_at":"2015-10-11T18:39:44Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/sympy/symengine/pulls/603","html_url":"https://github.com/sympy/symengine/pull/603","diff_url":"https://github.com/sympy/symengine/pull/603.diff","patch_url":"https://github.com/sympy/symengine/pull/603.patch"},"body":"This is a suggestion for lambdify functionality.\r\n\r\n- [x] handle numpy dependency (~~currently just assumed, any ideas?~~) - made optional\r\n- [x] add numpy to CI(?)\r\n- [x] support symengine.DenseMatrix (needs testing)\r\n- [x] extended testing for different input shapes and orders (C and Fortran)\r\n- [x] complex data type (what about taking two kwargs: `complex_in=False, complex_out=False` in `__call__`.\r\n- [x] support for broadcasting (input is always converted to be C-contiguous, inp.shape[:-1] are the broadcasted dimensions).\r\n- [x] Common subexpression elimination convenience (`LambdifyCSE`)\r\n- [x] add benchmarks for Lambdify\r\n- [ ] optimize the implementation (see `benchmarks/Lambdify.py`)\r\n\r\nI am rather new to CMake etc so please let me know if there are things I've missed."},"comment":{"url":"https://api.github.com/repos/sympy/symengine/issues/comments/147234031","html_url":"https://github.com/sympy/symengine/pull/603#issuecomment-147234031","issue_url":"https://api.github.com/repos/sympy/symengine/issues/603","id":147234031,"user":{"login":"certik","id":20568,"avatar_url":"https://avatars.githubusercontent.com/u/20568?v=3","gravatar_id":"","url":"https://api.github.com/users/certik","html_url":"https://github.com/certik","followers_url":"https://api.github.com/users/certik/followers","following_url":"https://api.github.com/users/certik/following{/other_user}","gists_url":"https://api.github.com/users/certik/gists{/gist_id}","starred_url":"https://api.github.com/users/certik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/certik/subscriptions","organizations_url":"https://api.github.com/users/certik/orgs","repos_url":"https://api.github.com/users/certik/repos","events_url":"https://api.github.com/users/certik/events{/privacy}","received_events_url":"https://api.github.com/users/certik/received_events","type":"User","site_admin":false},"created_at":"2015-10-11T18:39:44Z","updated_at":"2015-10-11T18:39:44Z","body":"@bjodah is the benchmark that you have a vector of expressions (of many variables), then you substitute for those variables and want to get the vector of numbers back? So in SymPy, this gets converted to calling numpy directly? I am still confused how it can be fast in SymPy. What I know is that if you have an expression, let's say (x+y+sin(z)) and then you want to evaluate it for vector of numbers like x=[1, 2, 3, 4], y=[2, 3, 4, 5], z=[5, 6, 7, 8], then this can be very fast. Even here though we should be able to beat it with C++.\r\n\r\nFernando's latest work should make symengine much faster than anything you can do with numpy."}}