1 #include <alpaqa/panoc-alm.hpp>
2 #include <alpaqa/problem/box-constr-problem.hpp>
3 #include <alpaqa/problem/problem-with-counters.hpp>
5 #include <casadi/interfaces/alpaqa/casadi_nlpsol_alpaqa_export.h>
6 #include "casadi/core/nlpsol_impl.hpp"
7 #include "casadi/core/timing.hpp"
8 #include "alpaqa_problem.hpp"
10 using Direction = alpaqa::LBFGSDirection<alpaqa::DefaultConfig>;
11 using InnerSolver = alpaqa::PANOCSolver<Direction>;
12 using OuterSolver = alpaqa::ALMSolver<InnerSolver>;
16 class AlpaqaInterface;
20 alpaqa::ALMSolver<InnerSolver>*
solver;
41 std::string
class_name()
const override {
return "AlpaqaInterface";}
46 const Options&
get_options()
const override {
return options_;}
65 void set_work(
void* mem,
const double**& arg,
double**& res,
66 casadi_int*& iw,
double*& w)
const override;
69 int solve(
void* mem)
const override;
~AlpaqaInterface() override
AlpaqaInterface(const std::string &name, const Function &nlp)
int solve(void *mem) const override
static ProtoFunction * deserialize(DeserializingStream &s)
Deserialize into MX.
void serialize_body(SerializingStream &s) const override
Serialize an object without type information.
Dict get_stats(void *mem) const override
Get all statistics.
std::string class_name() const override
AlpaqaInterface(DeserializingStream &s)
Deserializing constructor.
Dict opts_
All Alpaqa options.
static const Options options_
void free_mem(void *mem) const override
Free memory block.
int init_mem(void *mem) const override
Initalize memory block.
void init(const Dict &opts) override
const char * plugin_name() const override
const Options & get_options() const override
void set_work(void *mem, const double **&arg, double **&res, casadi_int *&iw, double *&w) const override
Set the (persistent) work vectors.
static Nlpsol * creator(const std::string &name, const Function &nlp)
static const std::string meta_doc
void * alloc_mem() const override
Create memory block.
Helper class for Serialization.
Helper class for Serialization.
GenericType::Dict Dict
C++ equivalent of Python's dict or MATLAB's struct.
const AlpaqaInterface * interface
alpaqa::ALMSolver< InnerSolver > * solver