simple_function.cpp
Go to the documentation of this file.
1 
35 #include <acado_toolkit.hpp> // Include the ACADO toolkit
36 #include <acado/utils/matlab_acado_utils.hpp> // Include specific Matlab utils
37 
38 USING_NAMESPACE_ACADO // Open the namespace
39 
40 void mexFunction( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[] ) // Start the MEX function. Do NOT change the header of this function.
41  {
42  clearAllStaticCounters( ); // Clear software counters
43 
44 
45 
48  TIME t;
49  Function f;
50 
51  z = 0.5*x + 1.0 ;
52 
53  f << exp(x) + t ;
54  f << exp(z+exp(z)) ;
55 
56  printf("the dimension of f is %d \n", f.getDim() );
57  printf("f depends on %d states \n", f.getNX () );
58  printf("f depends on %d controls \n", f.getNU () );
59 
60  if( f.isConvex() == BT_TRUE )
61  printf("all components of function f are convex. \n");
62 
63 
64 
65  clearAllStaticCounters( ); // Clear software counters
66 }
67 
Allows to setup and evaluate a general function based on SymbolicExpressions.
Definition: function_.hpp:59
#define USING_NAMESPACE_ACADO
int getNU() const
Definition: function.cpp:222
USING_NAMESPACE_ACADO void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
int getDim() const
BooleanType isConvex()
Definition: function.cpp:378
returnValue clearAllStaticCounters()
#define BT_TRUE
Definition: acado_types.hpp:47
int getNX() const
Definition: function.cpp:207
IntermediateState exp(const Expression &arg)


acado
Author(s): Milan Vukov, Rien Quirynen
autogenerated on Mon Jun 10 2019 12:35:04