{"action":"created","issue":{"url":"https://api.github.com/repos/JuliaOpt/JuMP.jl/issues/897","repository_url":"https://api.github.com/repos/JuliaOpt/JuMP.jl","labels_url":"https://api.github.com/repos/JuliaOpt/JuMP.jl/issues/897/labels{/name}","comments_url":"https://api.github.com/repos/JuliaOpt/JuMP.jl/issues/897/comments","events_url":"https://api.github.com/repos/JuliaOpt/JuMP.jl/issues/897/events","html_url":"https://github.com/JuliaOpt/JuMP.jl/issues/897","id":191034936,"number":897,"title":"more user-friendly functions for macro calls","user":{"login":"ExpandingMan","id":11379353,"avatar_url":"https://avatars.githubusercontent.com/u/11379353?v=3","gravatar_id":"","url":"https://api.github.com/users/ExpandingMan","html_url":"https://github.com/ExpandingMan","followers_url":"https://api.github.com/users/ExpandingMan/followers","following_url":"https://api.github.com/users/ExpandingMan/following{/other_user}","gists_url":"https://api.github.com/users/ExpandingMan/gists{/gist_id}","starred_url":"https://api.github.com/users/ExpandingMan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ExpandingMan/subscriptions","organizations_url":"https://api.github.com/users/ExpandingMan/orgs","repos_url":"https://api.github.com/users/ExpandingMan/repos","events_url":"https://api.github.com/users/ExpandingMan/events{/privacy}","received_events_url":"https://api.github.com/users/ExpandingMan/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2016-11-22T15:17:41Z","updated_at":"2016-11-22T16:06:21Z","closed_at":null,"body":"Sometimes it is desirable to embed parts of JuMP in a larger code base for some reason.  For example, I frequently encounter large-scale linear and quadratic optimization problems which require JuMP variables to be embedded in sparse matrices.  As things are right now, it can be extremely difficult to write code for doing that in a generic way.  For example, it is very hard to have a generic way of specifying the shape of variable tensors created with the `@variable` macro.  Currently my workaround is to stick my code inside other `helper` macros, but really the right way to do this would be to just write a macro that calls the same methods that `@variable` does.  Obviously it's already possible to do this, but the expressions output by the macros in JuMP are quite obtuse, and it would take me quite a lot of work to figure out how to write my own.\r\n\r\nI realize that nobody is going to go in and change all the function calls required for macros, but I thought that it might be nice going forward, if any changes really are made to the internal workings of the macros, to consider that users might want to write their own.  Really sparse matrices are the only big pain point that I can think of in declaring variables and constraints at the moment.  As it sits right now, it requires an awful lot of boiler-plate code to specify sparse variables."},"comment":{"url":"https://api.github.com/repos/JuliaOpt/JuMP.jl/issues/comments/262282984","html_url":"https://github.com/JuliaOpt/JuMP.jl/issues/897#issuecomment-262282984","issue_url":"https://api.github.com/repos/JuliaOpt/JuMP.jl/issues/897","id":262282984,"user":{"login":"ExpandingMan","id":11379353,"avatar_url":"https://avatars.githubusercontent.com/u/11379353?v=3","gravatar_id":"","url":"https://api.github.com/users/ExpandingMan","html_url":"https://github.com/ExpandingMan","followers_url":"https://api.github.com/users/ExpandingMan/followers","following_url":"https://api.github.com/users/ExpandingMan/following{/other_user}","gists_url":"https://api.github.com/users/ExpandingMan/gists{/gist_id}","starred_url":"https://api.github.com/users/ExpandingMan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ExpandingMan/subscriptions","organizations_url":"https://api.github.com/users/ExpandingMan/orgs","repos_url":"https://api.github.com/users/ExpandingMan/repos","events_url":"https://api.github.com/users/ExpandingMan/events{/privacy}","received_events_url":"https://api.github.com/users/ExpandingMan/received_events","type":"User","site_admin":false},"created_at":"2016-11-22T16:06:21Z","updated_at":"2016-11-22T16:06:21Z","body":"It seems to go through a lot of code to parse its arguments (granted it mostly just goes through if constructs), so I wasn't sure, it'll have to be called millions of times, but I'll see how it works, thanks.\r\n\r\nIt still seems like a bit of an issue to me that the variable and constraint code isn't more generic.  It's hard to foresee every possible use case, and there are some surprising difficulties with passing function arguments to macros, though it might just be another case of my not being knowledgeable enough about it."}}
{"actor":{"display_login":"ExpandingMan"}}