Skip to content

Pass data to fitfunction #217

@Optiuse

Description

@Optiuse

Hi, is it possible to pass own data (by reference) from scope of upper_function directly to the FitFunc?
(directly from function to FitFunc, without use of global variables)

FitFunc fsphere = [](const double *x, const int N)
{
   // use Data from scope of upper_function() ?
}
void upper_function()
{
   // data. for example a struct/class/int/double/etc
   //...
   CMASolutions cmasols = cmaes<>(fsphere,cmaparams);
   //...
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions