39 const std::string& _commonHeaderName
62 LOG(
LVL_DEBUG ) <<
"Solver: setup initialization... " << endl;
66 LOG(
LVL_DEBUG ) <<
"Solver: setup variables... " << endl;
72 LOG(
LVL_DEBUG ) <<
"Solver: setup multiplication routines... " << endl;
76 LOG(
LVL_DEBUG ) <<
"Solver: setup model simulation... " << endl;
80 LOG(
LVL_DEBUG ) <<
"Solver: setup objective evaluation... " << endl;
84 LOG(
LVL_DEBUG ) <<
"Solver: setup condensing... " << endl;
88 LOG(
LVL_DEBUG ) <<
"Solver: setup constraints... " << endl;
92 LOG(
LVL_DEBUG ) <<
"Solver: setup evaluation... " << endl;
96 LOG(
LVL_DEBUG ) <<
"Solver: setup auxiliary functions... " << endl;
155 int hardcodeConstraintValues;
184 unsigned numStateBounds = 0;
189 lbXValues.
append( lbXInf );
191 lbXValues.
append( lbTmp );
195 ubXValues.
append( ubXInf );
197 ubXValues.
append( ubTmp );
207 lbXAValues(numStateBounds) = lbTmp(
xBoundsIdx[index]-offset);
208 ubXAValues(numStateBounds) = ubTmp(
xBoundsIdx[index]-offset);
218 lbXValues.
append( lbXInf );
220 lbXValues.
append( lbTmp );
224 ubXValues.
append( ubXInf );
226 ubXValues.
append( ubTmp );
232 if( hardcodeConstraintValues ==
YES ) {
254 if( hardcodeConstraintValues ==
YES ) {
262 if( hardcodeConstraintValues ==
YES ) {
272 for (
unsigned i = 0; i < j; ++i) {
298 for (
unsigned i = 0; i <
N; ++i)
302 lbUValues.
append( lbUInf );
304 lbUValues.
append( lbTmp );
308 ubUValues.
append( ubUInf );
310 ubUValues.
append( ubTmp );
320 if( hardcodeConstraintValues ==
YES ) {
333 for(
uint j = 0; j <
NX; j++ ) {
342 for(
uint j = 0; j <
NX; j++ ) {
351 if( hardcodeConstraintValues ==
YES ) {
366 ExportIndex uInd(
"uInd" ), offset1(
"offset1" ), offset2(
"offset2" );
374 if( hardcodeConstraintValues ==
YES ) {
397 if( hardcodeConstraintValues ==
YES ) {
423 if( hardcodeConstraintValues ==
YES ) {
477 LOG(
LVL_DEBUG ) <<
"Setup condensing: H00, H10 and C" << endl;
555 LOG(
LVL_DEBUG ) <<
"Setup condensing: H11 and E" << endl;
653 S1Call,
E.
getAddress((offset + row - col - 1) * NX),
722 S1Call,
E.
getAddress((offset + row - col - 1) * NX),
758 for(
unsigned jj = 0; jj < ii; ++jj)
803 LOG(
LVL_DEBUG ) <<
"Setup condensing: create Dx0, Dy and DyN" << endl;
941 unsigned offset2 = i * (2 *
getBlockSize() - i + 1) / 2;
969 LOG(
LVL_DEBUG ) <<
"Setup condensing: create expand routine" << endl;
1005 int hessianApproximation;
1014 for (
uint j = 0; j <
NX; j++ ) {
1026 for (
int i =
N - 1; i >= 1; i--) {
1027 for (
uint j = 0; j <
NX; j++ ) {
1112 unsigned numStateBoundsBlock = 0;
1117 numStateBoundsBlock += 1;
1122 return numStateBoundsBlock;
virtual returnValue setupCondensing()
virtual returnValue setupMultiplicationRoutines()
uint getBlockSize() const
#define LOG(level)
Just define a handy macro for getting the logger.
Lowest level, the debug level.
virtual unsigned getNumStateBoundsPerBlock() const
virtual returnValue setupMultiplicationRoutines()
virtual returnValue setupEvaluation()=0
ExportVariable getRow(const ExportIndex &idx) const
ExportFunction condensePrep
uint getNumBlockVariables() const
ExportVariable getTranspose() const
virtual returnValue setupObjectiveEvaluation(void)
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
Allows to pass back messages to the calling function.
DVector getUpperBounds(uint pointIdx) const
ExportGaussNewtonBlockCN2(UserInteraction *_userInteraction=0, const std::string &_commonHeaderName="")
returnValue addComment(const std::string &_comment)
BEGIN_NAMESPACE_ACADO typedef unsigned int uint
virtual returnValue getDataDeclarations(ExportStatementBlock &declarations, ExportStruct dataStruct=ACADO_ANY) const
virtual returnValue setupVariables()
const DMatrix & getGivenMatrix() const
Allows to export code of a for-loop.
string toString(T const &value)
std::vector< unsigned > qpConDim
ExportVariable getElement(const ExportIndex &rowIdx, const ExportIndex &colIdx) const
#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.
virtual returnValue setupConstraintsEvaluation(void)
Defines a matrix-valued variable that can be passed as argument to exported functions.
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)
virtual returnValue setupInitialization()
ExportFunction macATw1QDy
ExportFunction expansionStep2
ExportVariable getCols(const ExportIndex &idx1, const ExportIndex &idx2) const
double levenbergMarquardt
bool performsSingleShooting() const
virtual returnValue setupSimulation(void)
Encapsulates all user interaction for setting options, logging data and plotting results.
ExportFunction shiftQpData
An OCP solver based on the N^2 condensing algorithm.
returnValue addStatement(const ExportStatement &_statement)
returnValue addLinebreak(uint num=1)
ExportFunction expansionStep
GenericVector & append(const GenericVector &_arg)
bool performFullCondensing() const
virtual ExportFunction & acquire(ExportIndex &obj)
ExportFunction & addVariable(const ExportVariable &_var)
void setAll(const T &_value)
virtual returnValue getFunctionDeclarations(ExportStatementBlock &declarations) const
ExportVariable getRows(const ExportIndex &idx1, const ExportIndex &idx2) const
returnValue addDeclaration(const ExportVariable &_data, ExportStruct _dataStruct=ACADO_ANY)
returnValue setupAuxiliaryFunctions()
uint getNumberOfBlocks() const
virtual ExportFunction & release(const ExportIndex &obj)
unsigned getNumComplexConstraints(void)
DVector getLowerBounds(uint pointIdx) const
#define BEGIN_NAMESPACE_ACADO
ExportFunction macQSbarW2
virtual returnValue setup()
virtual returnValue setupVariables()
ExportFunction macS1TSbar
std::vector< unsigned > xBoundsIdx
virtual returnValue getFunctionDeclarations(ExportStatementBlock &declarations) const
Allows to export code for a block of statements.
ExportFunction initialize
ExportFunction mult_BT_T1
ExportFunction evaluateConstraints
ExportArgument getAddress(const ExportIndex &_rowIdx, const ExportIndex &_colIdx=emptyConstExportIndex) const
ExportFunction macBTW1_R1
ExportVariable getCol(const ExportIndex &idx) const
unsigned getNumQPvars() const
ExportFunction & addIndex(const ExportIndex &_index)
#define ACADOERROR(retval)
Defines a matrix-valued variable to be used for exporting code.
virtual returnValue getDataDeclarations(ExportStatementBlock &declarations, ExportStruct dataStruct=ACADO_ANY) const
#define ACADOERRORTEXT(retval, text)
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