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

Hessian preconditioner wrappers #410

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

smartalecH
Copy link

Closes #177

There's still an issue with the python wrappers. Seems to be passing the wrong number of arguments:

NotImplementedError: Wrong number or type of arguments for overloaded function 'opt_set_precond_min_objective'.
  Possible C/C++ prototypes are:
    nlopt::opt::set_precond_min_objective(nlopt::func,nlopt::pfunc,void *)
    nlopt::opt::set_precond_min_objective(nlopt::func,nlopt::pfunc,void *,nlopt_munge,nlopt_munge)

Any ideas what might be wrong?

d->o = this; d->f = f; d->f_data = f_data; d->mf = NULL; d->vf = NULL;
d->pf = pf;
d->munge_destroy = md; d->munge_copy = mc;
printf("ALEC\n");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this line is an artifact of some debugging?

static void pfunc_python(unsigned n, const double *x, const double *v, double *vpre, void *f)
{
npy_intp sz = npy_intp(n), sz0 = 0, stride1 = sizeof(double);
PyObject *xpy = PyArray_New(&PyArray_Type, 1, &sz, NPY_DOUBLE, &stride1,
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like these calls are equivalent to calling PyArray_SimpleNewFromData?

const_cast<double*>(v), // not NPY_WRITEABLE
0, NPY_ARRAY_C_CONTIGUOUS | NPY_ARRAY_ALIGNED, NULL);
PyObject *vprepy = vpre
? PyArray_SimpleNewFromData(1, &sz, NPY_DOUBLE, vpre)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't vpre always be non-NULL here?

@jschueller
Copy link
Collaborator

hello @smartalecH, any news on this ?

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

Successfully merging this pull request may close these issues.

Preconditioners not wrapped in C++ ...
4 participants