Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow creating a Contractor from a function #128

Closed
dpsanders opened this issue Mar 29, 2019 · 0 comments
Closed

Allow creating a Contractor from a function #128

dpsanders opened this issue Mar 29, 2019 · 0 comments

Comments

@dpsanders
Copy link
Member

dpsanders commented Mar 29, 2019

julia> g(x, y) = x + y
g (generic function with 1 method)

julia> vars = @variables x y
(x, y)

julia> Contractor(vars, g(vars...))
Contractor in 2 dimensions:
  - forward pass contracts to 1 dimensions
  - variables: Symbol[:x, :y]
  - expression: x + y

julia> Contractor(vars, g)
ERROR: MethodError: no method matching Contractor(::Tuple{Variable,Variable}, ::typeof(g))

We should allow this last syntax.

cc @Yashcodes

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

No branches or pull requests

1 participant