39 const std::string& _commonHeaderName
71 int hardcodeConstraintValues;
105 if (hardcodeConstraintValues ==
NO) {
142 code.
addStatement(
"/******************************************************************************/\n" );
146 code.
addStatement(
"/******************************************************************************/\n" );
200 return (
N + 1) *
NX +
N *
NU;
272 unsigned indexX =
getNY();
350 tmpFxCall, tmpFuCall, objSCall,
417 qq ==
Q2 *
Dy.
getRows(index * NY, (index + 1) * NY)
429 rr ==
R2 *
Dy.
getRows(index * NY, (index + 1) * NY)
440 for (
unsigned blk = 0; blk <
N; ++blk)
451 for (
unsigned blk = 0; blk <
N; ++blk)
465 for (
unsigned blk = 0; blk <
N; ++blk)
496 int hardcodeConstraintValues;
520 for (
unsigned node = 0; node <
N; ++node)
524 lbValues.
append( lbUInf );
530 ubValues.
append( ubUInf );
538 for (
unsigned node = 1; node < N + 1; ++node)
542 lbValues.
append( lbXInf );
548 ubValues.
append( ubXInf );
556 if( hardcodeConstraintValues ==
YES ) {
592 for (
unsigned i = 0; i <
N; ++i)
595 for (
unsigned i = 0; i <
N; ++i)
636 for (
unsigned i = 0; i <
N; ++i)
649 if( hardcodeConstraintValues ==
YES ||
qpDimHtot == 0 ) {
695 derOffset = derOffset + dimPacH *
NX;
715 for (
unsigned i = 0, intRowOffset = 0, dim = 0; i < N + 1; ++i)
721 string(
"Evaluating constraint on node: #" ) +
toString( i )
774 setStagePac.
setup(
"setStagePac", offsetPac, indPac, tLbAValues, tUbAValues);
777 << (
qpLbA.
getRows(offsetPac, offsetPac + dimPacH) == tLbAValues -
pacEvH.
getRows(indPac * dimPacH, indPac * dimPacH + dimPacH))
778 << (
qpUbA.
getRows(offsetPac, offsetPac + dimPacH) == tUbAValues -
pacEvH.
getRows(indPac * dimPacH, indPac * dimPacH + dimPacH));
785 unsigned offsetEval = 0;
786 unsigned offsetPoc = 0;
787 for (
unsigned i = 0; i <
N; ++i)
807 << (tPocA.getSubMatrix(0, dim, 0, NX) ==
pocEvHx.
getSubMatrix(offsetPoc, offsetPoc + dim, 0, NX))
808 << (tPocA.getSubMatrix(0, dim, NX, NX + NU) ==
pocEvHu.
getSubMatrix(offsetPoc, offsetPoc + dim, 0, NU))
839 x0.
setDoc(
"Current state feedback vector." );
868 retSim.
setDoc(
"Status of the integration module. =0: OK, otherwise the error code.");
883 returnValueFeedbackPhase.
setDoc(
"Status code of the QP solver." );
885 feedback.
doc(
"Feedback/estimation step of the RTI scheme." );
917 for (
unsigned i = 0; i <
N; ++i)
940 feedback << returnValueFeedbackPhase.
getFullName() <<
" = " << moduleName <<
"_solve( );\n";
963 getKKT.
doc(
"Get the KKT tolerance of the current iterate." );
964 kkt.
setDoc(
"The KKT tolerance value." );
991 ubLoop << kkt.
getFullName() <<
"+= fabs( " <<
qpUb.
get(index, 0) <<
" * " <<
qpMu.
get(index + N * NU + N * NX, 0) <<
");\n";
virtual returnValue setupVariables()
ExportVariable conValueOut
ExportVariable getRow(const ExportIndex &idx) const
virtual returnValue getDataDeclarations(ExportStatementBlock &declarations, ExportStruct dataStruct=ACADO_ANY) const
ExportFunction preparation
ExportFunction shiftStates
virtual returnValue setupObjectiveEvaluation(void)
ExportFunction evaluateObjective
ExportVariable getTranspose() const
bool initialStateFixed() const
ExportVariable & setup(const std::string &_name, uint _nRows=1, uint _nCols=1, ExportType _type=REAL, ExportStruct _dataStruct=ACADO_LOCAL, bool _callItByValue=false, const std::string &_prefix=std::string())
bool isGiven(const ExportIndex &rowIdx, const ExportIndex &colIdx) const
virtual returnValue setupEvaluation()
Allows to pass back messages to the calling function.
ExportVariable conValueIn
DVector getUpperBounds(uint pointIdx) const
std::vector< DVector > pocLbStack
returnValue addComment(const std::string &_comment)
virtual returnValue getCode(ExportStatementBlock &code)
ExportVariable objEvFxEnd
ExportFunction setObjQN1QN2
const DMatrix & getGivenMatrix() const
Allows to export code of a for-loop.
string toString(T const &value)
#define CLOSE_NAMESPACE_ACADO
ExportVariable getSubMatrix(const ExportIndex &rowIdx1, const ExportIndex &rowIdx2, const ExportIndex &colIdx1, const ExportIndex &colIdx2) const
Defines a scalar-valued index variable to be used for exporting code.
Base class for export of NLP/OCP solvers.
std::vector< unsigned > qpConDim
ExportAcadoFunction evaluateStageCost
Defines a matrix-valued variable that can be passed as argument to exported functions.
ExportAcadoFunction evaluateTerminalCost
ExportFunction & setup(const std::string &_name="defaultFunctionName", const ExportArgument &_argument1=emptyConstExportArgument, const ExportArgument &_argument2=emptyConstExportArgument, const ExportArgument &_argument3=emptyConstExportArgument, const ExportArgument &_argument4=emptyConstExportArgument, const ExportArgument &_argument5=emptyConstExportArgument, const ExportArgument &_argument6=emptyConstExportArgument, const ExportArgument &_argument7=emptyConstExportArgument, const ExportArgument &_argument8=emptyConstExportArgument, const ExportArgument &_argument9=emptyConstExportArgument)
virtual returnValue setDoc(const std::string &_doc)
ExportFunction evaluateConstraints
virtual returnValue setupInitialization()
ExportVariable evLbAValues
ExportFunction modelSimulation
virtual ExportFunction & doc(const std::string &_doc)
ExportVariable getCols(const ExportIndex &idx1, const ExportIndex &idx2) const
ExportFunction getObjective
ExportVariable evUbValues
ExportVariable makeRowVector() const
ExportVariable objValueIn
ExportFunction initializeNodes
double levenbergMarquardt
virtual returnValue setup()
const std::string get(const ExportIndex &rowIdx, const ExportIndex &colIdx) const
virtual returnValue setupSimulation(void)
std::vector< std::shared_ptr< ExportAcadoFunction > > evaluatePointConstraints
ExportVariable evLbValues
ExportVariable evUbAValues
Encapsulates all user interaction for setting options, logging data and plotting results.
virtual uint getDim() const
ExportFunction shiftControls
returnValue addStatement(const ExportStatement &_statement)
virtual bool isGiven() const
std::string getFullName() const
returnValue addLinebreak(uint num=1)
ExportAcadoFunction evaluatePathConstraints
ExportFunction setObjQ1Q2
GenericVector & append(const GenericVector &_arg)
ExportFunction & setReturnValue(const ExportVariable &_functionReturnValue, bool _returnAsPointer=false)
virtual ExportFunction & acquire(ExportIndex &obj)
ExportFunction & addVariable(const ExportVariable &_var)
ExportFunction setObjR1R2
void setAll(const T &_value)
unsigned getNumQPvars() const
ExportVariable objSEndTerm
std::string getName() const
ExportVariable getRows(const ExportIndex &idx1, const ExportIndex &idx2) const
returnValue addDeclaration(const ExportVariable &_data, ExportStruct _dataStruct=ACADO_ANY)
returnValue setupAuxiliaryFunctions()
virtual ExportFunction & release(const ExportIndex &obj)
DVector getLowerBounds(uint pointIdx) const
#define BEGIN_NAMESPACE_ACADO
returnValue addFunction(const ExportFunction &_function)
std::vector< DVector > pocUbStack
virtual returnValue setupMultiplicationRoutines()
virtual returnValue getDataDeclarations(ExportStatementBlock &declarations, ExportStruct dataStruct=ACADO_ANY) const
ExportFunction setStagePac
Allows to export code for a block of statements.
ExportFunction initialize
ExportArgument getAddress(const ExportIndex &_rowIdx, const ExportIndex &_colIdx=emptyConstExportIndex) const
ExportVariable objValueOut
ExportGaussNewtonGeneric(UserInteraction *_userInteraction=0, const std::string &_commonHeaderName="")
ExportFunction & addIndex(const ExportIndex &_index)
virtual returnValue getFunctionDeclarations(ExportStatementBlock &declarations) const
Defines a matrix-valued variable to be used for exporting code.
returnValue addFunctionCall(const std::string &_fName, const ExportArgument &_argument1=emptyConstExportArgument, const ExportArgument &_argument2=emptyConstExportArgument, const ExportArgument &_argument3=emptyConstExportArgument, const ExportArgument &_argument4=emptyConstExportArgument, const ExportArgument &_argument5=emptyConstExportArgument, const ExportArgument &_argument6=emptyConstExportArgument, const ExportArgument &_argument7=emptyConstExportArgument, const ExportArgument &_argument8=emptyConstExportArgument, const ExportArgument &_argument9=emptyConstExportArgument)
ExportVariable makeColVector() const
virtual returnValue setupConstraintsEvaluation(void)