26 #ifndef CASADI_FAST_NEWTON_HPP
27 #define CASADI_FAST_NEWTON_HPP
29 #include "casadi/core/rootfinder_impl.hpp"
30 #include <casadi/solvers/casadi_rootfinder_fast_newton_export.h>
45 struct FastNewtonMemory
46 :
public RootfinderMemory {
63 class FastNewton :
public Rootfinder {
66 explicit FastNewton(
const std::string& name,
const Function& f);
69 ~FastNewton()
override;
72 const char* plugin_name()
const override {
return "fast_newton";}
75 std::string class_name()
const override {
return "FastNewton";}
78 static Rootfinder* creator(
const std::string& name,
const Function& f) {
79 return new FastNewton(name, f);
84 static const Options options_;
85 const Options& get_options()
const override {
return options_;}
89 Dict get_stats(
void* mem)
const override;
92 void init(
const Dict& opts)
override;
95 void* alloc_mem()
const override {
return new FastNewtonMemory();}
98 int init_mem(
void* mem)
const override;
101 void free_mem(
void *mem)
const override {
delete static_cast<FastNewtonMemory*
>(mem);}
104 void set_work(
void* mem,
const double**& arg,
double**& res,
105 casadi_int*& iw,
double*& w)
const override;
108 int solve(
void* mem)
const override;
111 static const std::string meta_doc;
114 void codegen_body(CodeGenerator& g)
const override;
117 void codegen_declarations(CodeGenerator& g)
const override;
120 void serialize_body(SerializingStream &s)
const override;
123 static ProtoFunction* deserialize(DeserializingStream& s) {
return new FastNewton(s); }
127 explicit FastNewton(DeserializingStream& s);
130 casadi_int max_iter_;
144 std::vector<casadi_int> prinv_;
145 std::vector<casadi_int> pc_;
GenericType::Dict Dict
C++ equivalent of Python's dict or MATLAB's struct.