本文整理汇总了C++中ExportStatementBlock::addDeclaration方法的典型用法代码示例。如果您正苦于以下问题:C++ ExportStatementBlock::addDeclaration方法的具体用法?C++ ExportStatementBlock::addDeclaration怎么用?C++ ExportStatementBlock::addDeclaration使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ExportStatementBlock
的用法示例。
在下文中一共展示了ExportStatementBlock::addDeclaration方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getFunctionDeclarations
returnValue ExportCholeskySolver::getFunctionDeclarations( ExportStatementBlock& declarations
) const
{
declarations.addDeclaration( chol );
declarations.addDeclaration( solve );
return SUCCESSFUL_RETURN;
}
示例2: getFunctionDeclarations
returnValue ExplicitRungeKuttaExport::getFunctionDeclarations( ExportStatementBlock& declarations
) const
{
declarations.addDeclaration( integrate );
declarations.addDeclaration( rhs );
declarations.addDeclaration( diffs_rhs );
return SUCCESSFUL_RETURN;
}
示例3: getFunctionDeclarations
returnValue DiscreteTimeExport::getFunctionDeclarations( ExportStatementBlock& declarations
) const
{
declarations.addDeclaration( integrate );
if( NX2 != NX ) declarations.addDeclaration( fullRhs );
else declarations.addDeclaration( rhs );
return SUCCESSFUL_RETURN;
}
示例4: getFunctionDeclarations
returnValue ExportGaussElim::getFunctionDeclarations( ExportStatementBlock& declarations
) const
{
declarations.addDeclaration( solve );
declarations.addDeclaration( solveTriangular );
if( REUSE ) {
declarations.addDeclaration( solveReuse );
}
return SUCCESSFUL_RETURN;
}
示例5: getDataDeclarations
returnValue ExportGaussElim::getDataDeclarations( ExportStatementBlock& declarations,
ExportStruct dataStruct
) const
{
declarations.addDeclaration( rk_swap,dataStruct ); // needed for the row swaps
if( REUSE ) {
declarations.addDeclaration( rk_bPerm,dataStruct ); // reordered right-hand side
if( TRANSPOSE ) {
declarations.addDeclaration( rk_bPerm_trans,dataStruct );
}
}
return SUCCESSFUL_RETURN;
}
示例6: getDataDeclarations
returnValue ExplicitRungeKuttaExport::getDataDeclarations( ExportStatementBlock& declarations,
ExportStruct dataStruct
) const
{
if( exportRhs ) {
declarations.addDeclaration( getAuxVariable(),dataStruct );
}
declarations.addDeclaration( rk_ttt,dataStruct );
declarations.addDeclaration( rk_xxx,dataStruct );
declarations.addDeclaration( rk_kkk,dataStruct );
// declarations.addDeclaration( reset_int,dataStruct );
return SUCCESSFUL_RETURN;
}
示例7: getCode
returnValue DiscreteTimeExport::getCode( ExportStatementBlock& code
)
{
if( NX1 > 0 ) {
code.addFunction( lin_input );
code.addStatement( "\n\n" );
}
if( NX2 > 0 ) {
code.addFunction( rhs );
code.addStatement( "\n\n" );
code.addFunction( diffs_rhs );
code.addStatement( "\n\n" );
}
if( !equidistantControlGrid() ) {
ExportVariable numStepsV( "numSteps", numSteps, STATIC_CONST_INT );
code.addDeclaration( numStepsV );
code.addLinebreak( 2 );
}
double h = (grid.getLastTime() - grid.getFirstTime())/grid.getNumIntervals();
code.addComment(String("Fixed step size:") << String(h));
code.addFunction( integrate );
if( NX2 != NX ) {
prepareFullRhs();
code.addFunction( fullRhs );
}
return SUCCESSFUL_RETURN;
}
示例8: getDataDeclarations
returnValue ExportGaussNewtonForces::getDataDeclarations( ExportStatementBlock& declarations,
ExportStruct dataStruct
) const
{
returnValue status;
status = ExportNLPSolver::getDataDeclarations(declarations, dataStruct);
if (status != SUCCESSFUL_RETURN)
return status;
declarations.addDeclaration(x0, dataStruct);
declarations.addDeclaration(lbValues, dataStruct);
declarations.addDeclaration(ubValues, dataStruct);
return SUCCESSFUL_RETURN;
}
示例9: getDataDeclarations
returnValue DiscreteTimeExport::getDataDeclarations( ExportStatementBlock& declarations,
ExportStruct dataStruct
) const
{
ExportVariable max = getAuxVariable();
declarations.addDeclaration( max,dataStruct );
declarations.addDeclaration( rk_xxx,dataStruct );
declarations.addDeclaration( reset_int,dataStruct );
declarations.addDeclaration( rk_diffsPrev1,dataStruct );
declarations.addDeclaration( rk_diffsPrev2,dataStruct );
declarations.addDeclaration( rk_diffsNew1,dataStruct );
declarations.addDeclaration( rk_diffsNew2,dataStruct );
return SUCCESSFUL_RETURN;
}
示例10:
returnValue ExportIRK4StageSimplifiedNewton::getFunctionDeclarations( ExportStatementBlock& declarations
) const
{
ExportGaussElim::getFunctionDeclarations( declarations );
declarations.addDeclaration( solve_complex );
if( REUSE ) {
declarations.addDeclaration( solveReuse_complex );
}
declarations.addDeclaration( solve_full );
if( REUSE ) {
declarations.addDeclaration( solveReuse_full );
}
return SUCCESSFUL_RETURN;
}
示例11: getFunctionDeclarations
returnValue DiscreteTimeExport::getFunctionDeclarations( ExportStatementBlock& declarations
) const
{
declarations.addDeclaration( integrate );
if( NX2 != NX ) declarations.addDeclaration( fullRhs );
if( exportRhs ) {
if( NX1 > 0 ) {
declarations.addDeclaration( lin_input );
}
if( NX2 > 0 ) {
declarations.addDeclaration( rhs );
declarations.addDeclaration( diffs_rhs );
}
}
else {
Function tmpFun;
tmpFun << zeros(1,1);
ExportODEfunction tmpExport(tmpFun, getNameRHS());
declarations.addDeclaration( tmpExport );
tmpExport = ExportODEfunction(tmpFun, getNameDiffsRHS());
declarations.addDeclaration( tmpExport );
}
return SUCCESSFUL_RETURN;
}
示例12:
returnValue ExportExactHessianCN2::getFunctionDeclarations( ExportStatementBlock& declarations
) const
{
ExportGaussNewtonCN2::getFunctionDeclarations( declarations );
declarations.addDeclaration( regularization );
return SUCCESSFUL_RETURN;
}
示例13:
returnValue ExportGaussNewtonCN2::getFunctionDeclarations( ExportStatementBlock& declarations
) const
{
declarations.addDeclaration( preparation );
declarations.addDeclaration( feedback );
declarations.addDeclaration( initialize );
declarations.addDeclaration( initializeNodes );
declarations.addDeclaration( shiftStates );
declarations.addDeclaration( shiftControls );
declarations.addDeclaration( getKKT );
declarations.addDeclaration( getObjective );
declarations.addDeclaration( evaluateLSQ );
declarations.addDeclaration( evaluateLSQEndTerm );
return SUCCESSFUL_RETURN;
}
示例14: getDataDeclarations
returnValue ThreeSweepsERKExport::getDataDeclarations( ExportStatementBlock& declarations,
ExportStruct dataStruct
) const
{
AdjointERKExport::getDataDeclarations( declarations, dataStruct );
declarations.addDeclaration( rk_backward_sweep,dataStruct );
return SUCCESSFUL_RETURN;
}
示例15: getCode
returnValue ExportGaussNewtonForces::getCode( ExportStatementBlock& code
)
{
setupQPInterface();
code.addStatement( *qpInterface );
code.addLinebreak( 2 );
code.addStatement( "/******************************************************************************/\n" );
code.addStatement( "/* */\n" );
code.addStatement( "/* ACADO code generation */\n" );
code.addStatement( "/* */\n" );
code.addStatement( "/******************************************************************************/\n" );
code.addLinebreak( 2 );
int useOMP;
get(CG_USE_OPENMP, useOMP);
if ( useOMP )
{
code.addDeclaration( state );
}
code.addFunction( modelSimulation );
code.addFunction( evaluateStageCost );
code.addFunction( evaluateTerminalCost );
code.addFunction( setObjQ1Q2 );
code.addFunction( setObjR1R2 );
code.addFunction( setObjS1 );
code.addFunction( setObjQN1QN2 );
code.addFunction( setStageH );
code.addFunction( setStagef );
code.addFunction( evaluateObjective );
code.addFunction( conSetGxGu );
code.addFunction( conSetd );
code.addFunction( evaluateConstraints );
code.addFunction( acc );
code.addFunction( preparation );
code.addFunction( feedback );
code.addFunction( initialize );
code.addFunction( initializeNodes );
code.addFunction( shiftStates );
code.addFunction( shiftControls );
code.addFunction( getKKT );
code.addFunction( getObjective );
return SUCCESSFUL_RETURN;
}