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

Merge Oracle and Function #1774

Closed
jaeandersson opened this issue Apr 27, 2016 · 0 comments
Closed

Merge Oracle and Function #1774

jaeandersson opened this issue Apr 27, 2016 · 0 comments
Assignees
Milestone

Comments

@jaeandersson
Copy link
Member

jaeandersson commented Apr 27, 2016

The Oracle class provides a useful abstraction for a "Function factory". There is no reason though why this functionality could not be moved into the Function class. This would improve maintainability and make the functionality of the now internal Oracle class available to the end user:

from casadi import *
# Create a function
x = SX.sym('x')
y = SX.sym('y')
f = Function('fcn', [x, y], [y*sin(x), x*cos(y)], ['x', 'y'], ['r', 'q'])
# Create a function for calculating r only
r = f.factory('rfcn', ['x', 'y'], ['r'])
# Create a function for calculating the Jacobian of q wrt y
dqdy = f.factory('dqdy', ['x', 'y'], ['jac_q_y'])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant