0

I have following code in python:

from scipy import optimize
def f(x):
  return .5*(1 - x[0])**2 + (x[1] - x[0]**2)**2
print optimize.fmin_cg(f, [2, 2])

Is there any way to call optimize.fmin_cg() from C++ (or C).

I need to use above function from my C++ code.

1 Answer 1

2

Check boost.python library. Calling Python Functions and Methods

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.