#include <alpaqa/dl/dl-problem.hpp>
Class that loads an optimal control problem using dlopen
.
The shared library should export a C function with the name function_name
that accepts a void pointer with user data, and returns a struct of type alpaqa_control_problem_register_t that contains all data to represent the problem, as well as function pointers for all required operations.
Definition at line 200 of file dl-problem.hpp.
Public Types | |
using | Box = alpaqa::Box< config_t > |
using | instance_t = ExtraFuncs::instance_t |
Private Attributes | |
std::shared_ptr< void > | handle |
Handle to the shared module defining the problem. | |
std::shared_ptr< void > | instance |
Problem instance created by the registration function, including the deleter to destroy it. | |
control_problem_functions_t * | functions = nullptr |
Pointer to the struct of function pointers for evaluating the objective, constraints, their gradients, etc. | |
ExtraFuncs | extra_funcs |
Dictionary of extra functions that were registered by the problem. | |
using Box = alpaqa::Box<config_t> |
Definition at line 203 of file dl-problem.hpp.
using instance_t = ExtraFuncs::instance_t |
Definition at line 282 of file dl-problem.hpp.
DLControlProblem | ( | const std::filesystem::path & | so_filename, |
const std::string & | function_name = "register_alpaqa_control_problem" , |
||
void * | user_param = nullptr |
||
) |
Load a problem from a shared library.
so_filename | Filename of the shared library to load. |
function_name | Name of the problem registration function. Should have signature alpaqa_control_problem_register_t(void *) . |
user_param | Pointer to custom user data to pass to the registration function. |
Definition at line 314 of file dl-problem.cpp.
|
inline |
Definition at line 228 of file dl-problem.hpp.
|
inline |
Definition at line 229 of file dl-problem.hpp.
|
inline |
Definition at line 230 of file dl-problem.hpp.
|
inline |
Definition at line 231 of file dl-problem.hpp.
|
inline |
Definition at line 232 of file dl-problem.hpp.
|
inline |
Definition at line 233 of file dl-problem.hpp.
|
inline |
Definition at line 234 of file dl-problem.hpp.
|
inline |
Definition at line 236 of file dl-problem.hpp.
Definition at line 351 of file dl-problem.cpp.
Definition at line 352 of file dl-problem.cpp.
Definition at line 353 of file dl-problem.cpp.
Definition at line 354 of file dl-problem.cpp.
Definition at line 355 of file dl-problem.cpp.
Definition at line 356 of file dl-problem.cpp.
Definition at line 357 of file dl-problem.cpp.
Definition at line 358 of file dl-problem.cpp.
Definition at line 359 of file dl-problem.cpp.
Definition at line 360 of file dl-problem.cpp.
Definition at line 361 of file dl-problem.cpp.
Definition at line 362 of file dl-problem.cpp.
Definition at line 364 of file dl-problem.cpp.
auto eval_add_R_masked | ( | index_t | timestep, |
crvec | xu, | ||
crvec | h, | ||
crindexvec | mask, | ||
rmat | R, | ||
rvec | work | ||
) | const |
Definition at line 366 of file dl-problem.cpp.
auto eval_add_S_masked | ( | index_t | timestep, |
crvec | xu, | ||
crvec | h, | ||
crindexvec | mask, | ||
rmat | S, | ||
rvec | work | ||
) | const |
Definition at line 367 of file dl-problem.cpp.
auto eval_add_R_prod_masked | ( | index_t | timestep, |
crvec | xu, | ||
crvec | h, | ||
crindexvec | mask_J, | ||
crindexvec | mask_K, | ||
crvec | v, | ||
rvec | out, | ||
rvec | work | ||
) | const |
Definition at line 368 of file dl-problem.cpp.
auto eval_add_S_prod_masked | ( | index_t | timestep, |
crvec | xu, | ||
crvec | h, | ||
crindexvec | mask_K, | ||
crvec | v, | ||
rvec | out, | ||
rvec | work | ||
) | const |
Definition at line 369 of file dl-problem.cpp.
auto get_R_work_size | ( | ) | const |
Definition at line 370 of file dl-problem.cpp.
auto get_S_work_size | ( | ) | const |
Definition at line 371 of file dl-problem.cpp.
Definition at line 372 of file dl-problem.cpp.
Definition at line 373 of file dl-problem.cpp.
Definition at line 374 of file dl-problem.cpp.
Definition at line 375 of file dl-problem.cpp.
Definition at line 376 of file dl-problem.cpp.
Definition at line 377 of file dl-problem.cpp.
bool provides_get_D | ( | ) | const |
Definition at line 379 of file dl-problem.cpp.
bool provides_get_D_N | ( | ) | const |
Definition at line 380 of file dl-problem.cpp.
bool provides_eval_add_Q_N | ( | ) | const |
Definition at line 381 of file dl-problem.cpp.
bool provides_eval_add_R_prod_masked | ( | ) | const |
Definition at line 382 of file dl-problem.cpp.
bool provides_eval_add_S_prod_masked | ( | ) | const |
Definition at line 383 of file dl-problem.cpp.
bool provides_get_R_work_size | ( | ) | const |
Definition at line 384 of file dl-problem.cpp.
bool provides_get_S_work_size | ( | ) | const |
Definition at line 385 of file dl-problem.cpp.
bool provides_eval_constr | ( | ) | const |
Definition at line 386 of file dl-problem.cpp.
bool provides_eval_constr_N | ( | ) | const |
Definition at line 387 of file dl-problem.cpp.
bool provides_eval_grad_constr_prod | ( | ) | const |
Definition at line 388 of file dl-problem.cpp.
bool provides_eval_grad_constr_prod_N | ( | ) | const |
Definition at line 389 of file dl-problem.cpp.
bool provides_eval_add_gn_hess_constr | ( | ) | const |
Definition at line 390 of file dl-problem.cpp.
bool provides_eval_add_gn_hess_constr_N | ( | ) | const |
Definition at line 391 of file dl-problem.cpp.
|
private |
Handle to the shared module defining the problem.
Definition at line 217 of file dl-problem.hpp.
|
private |
Problem instance created by the registration function, including the deleter to destroy it.
Definition at line 220 of file dl-problem.hpp.
|
private |
Pointer to the struct of function pointers for evaluating the objective, constraints, their gradients, etc.
Definition at line 223 of file dl-problem.hpp.
|
private |
Dictionary of extra functions that were registered by the problem.
Definition at line 225 of file dl-problem.hpp.