HQP  1.9.6
Prg_SFunction Class Reference

Basic functionality for formulating an optimization problem for a model given as MEX S-function. More...

#include <Prg_SFunction.h>

Inheritance diagram for Prg_SFunction:
[legend]

Public Member Functions

 Prg_SFunction ()
 constructor
 
 ~Prg_SFunction ()
 destructor
 
Member access methods (no If prefix)
const char * mdl_name () const
 S-function name.
 
void set_mdl_name (const char *str)
 set S-function name
 
const char * mdl_path () const
 S-function path, including name, used for dynamic loading. More...
 
void set_mdl_path (const char *str)
 set S-function path
 
const char * mdl_args () const
 String representation of S-function arguments.
 
void set_mdl_args (const char *str)
 set S-function arguments
 
const VECP mdl_p () const
 parameters
 
void set_mdl_p (const VECP value)
 set parameters
 
const VECP mdl_x0 () const
 initial states
 
void set_mdl_x0 (const VECP value)
 set initial states
 
- Public Member Functions inherited from Omu_Program
 Omu_Program ()
 constructor
 
virtual ~Omu_Program ()
 destructor
 
virtual void setup_stages (IVECP ks, VECP ts)
 Setup stages and time sampling. More...
 
virtual void setup (int k, Omu_VariableVec &x, Omu_VariableVec &u, Omu_VariableVec &c)=0
 Allocate states x, control parameters u, and constraints c for stage k. More...
 
virtual void init_simulation (int k, Omu_VariableVec &x, Omu_VariableVec &u)
 Initialize problem variables using simulation. More...
 
virtual void update (int kk, const adoublev &x, const adoublev &u, adoublev &f, adouble &f0, adoublev &c)
 High-level update for the optimization criterion, constraints, and discrete state equations.
 
virtual void consistic (int kk, double t, const adoublev &x, const adoublev &u, adoublev &xt)
 High-level consistic (consistent initial conditions) routine for the initialization of continuous-time states from optimization variables x and u. More...
 

Protected Member Functions

virtual void setup_model ()
 load S-function
 
Helper methods for reading and writing S-function arguments.
void read_mx_args (VECP p)
 read _mx_args into vector p
 
void write_mx_args (VECP p)
 write vector p to _mx_args
 
Helper methods for treatment of sample times
bool setContinuousTask (bool val)
 enable continuous sample time; return true if a continuous sample time exists and has been enabled
 
bool setSampleHit (bool val)
 enable hit for all discrete sample times; return true if a discrete sample time exists and has been enabled
 

Protected Attributes

char * _mdl_name
 S-function name.
 
char * _mdl_path
 full S-function path
 
char * _mdl_args
 S-function parameters.
 
SimStruct * _SS
 pointer to SimStruct
 
mxArray ** _mx_args
 S-function parameters after parsing.
 
int _mdl_nargs
 number of S-function arguments
 
double _t0_setup_model
 time used for initialization of model
 
int _mdl_np
 number of model parameters
 
int _mdl_nd
 number of discrete-time states
 
int _mdl_nx
 number of model states (incl. discrete)
 
int _mdl_nu
 number of model inputs
 
int _mdl_ny
 number of model outputs
 
VECP _mdl_p
 parameters
 
VECP _mdl_x0
 initial states
 
bool _mdl_needs_setup
 indicate that setup_model needs to be called as _mdl_name, _mdl_path, or _mdl_args changed
 

Detailed Description

Basic functionality for formulating an optimization problem for a model given as MEX S-function.

Member Function Documentation

const char* Prg_SFunction::mdl_path ( ) const
inline

S-function path, including name, used for dynamic loading.

References _mdl_path.


The documentation for this class was generated from the following file: