本文整理汇总了C++中ExportStatementBlock类的典型用法代码示例。如果您正苦于以下问题:C++ ExportStatementBlock类的具体用法?C++ ExportStatementBlock怎么用?C++ ExportStatementBlock使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ExportStatementBlock类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getCode
returnValue ThreeSweepsERKExport::getCode( ExportStatementBlock& code
)
{
int useOMP;
get(CG_USE_OPENMP, useOMP);
if ( useOMP )
{
getDataDeclarations( code, ACADO_LOCAL );
code << "#pragma omp threadprivate( "
<< getAuxVariable().getFullName() << ", "
<< rk_xxx.getFullName() << ", "
<< rk_ttt.getFullName() << ", "
<< rk_kkk.getFullName() << ", "
<< rk_forward_sweep.getFullName() << ", "
<< rk_backward_sweep.getFullName()
<< " )\n\n";
}
int sensGen;
get( DYNAMIC_SENSITIVITY,sensGen );
if( exportRhs ) {
code.addFunction( rhs );
code.addFunction( diffs_rhs );
code.addFunction( diffs_sweep3 );
}
double h = (grid.getLastTime() - grid.getFirstTime())/grid.getNumIntervals();
code.addComment(std::string("Fixed step size:") + toString(h));
code.addFunction( integrate );
return SUCCESSFUL_RETURN;
}
示例2: getCode
returnValue ExportCholeskySolver::getCode( ExportStatementBlock& code )
{
code.addFunction( chol );
code.addFunction( solve );
return SUCCESSFUL_RETURN;
}
示例3: getFunctionDeclarations
returnValue ExportCholeskySolver::getFunctionDeclarations( ExportStatementBlock& declarations
) const
{
declarations.addDeclaration( chol );
declarations.addDeclaration( solve );
return SUCCESSFUL_RETURN;
}
示例4: getFunctionDeclarations
returnValue ExplicitRungeKuttaExport::getFunctionDeclarations( ExportStatementBlock& declarations
) const
{
declarations.addDeclaration( integrate );
declarations.addDeclaration( rhs );
declarations.addDeclaration( diffs_rhs );
return SUCCESSFUL_RETURN;
}
示例5: getFunctionDeclarations
returnValue DiscreteTimeExport::getFunctionDeclarations( ExportStatementBlock& declarations
) const
{
declarations.addDeclaration( integrate );
if( NX2 != NX ) declarations.addDeclaration( fullRhs );
else declarations.addDeclaration( rhs );
return SUCCESSFUL_RETURN;
}
示例6: getFunctionDeclarations
returnValue ExportGaussElim::getFunctionDeclarations( ExportStatementBlock& declarations
) const
{
declarations.addDeclaration( solve );
declarations.addDeclaration( solveTriangular );
if( REUSE ) {
declarations.addDeclaration( solveReuse );
}
return SUCCESSFUL_RETURN;
}
示例7: getCode
returnValue ExportGaussNewtonBlockForces::getCode( ExportStatementBlock& code
)
{
setupQPInterface();
code.addStatement( *qpInterface );
code.addFunction( cleanup );
code.addFunction( shiftQpData );
code.addFunction( evaluateConstraints );
code.addFunction( evaluateAffineConstraints );
return ExportGaussNewtonCN2::getCode( code );
}
示例8: 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;
}
示例9: 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;
}
示例10: 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;
}
示例11:
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;
}
示例12: getCode
returnValue ExportCholeskyDecomposition::getCode( ExportStatementBlock& code
)
{
if (A.getDim() != 0)
return code.addFunction( fcn );
return SUCCESSFUL_RETURN;
}
示例13: getFunctionDeclarations
returnValue ExportCholeskyDecomposition::getFunctionDeclarations( ExportStatementBlock& declarations
) const
{
if (A.getDim() != 0)
return declarations.addFunction( fcn );
return SUCCESSFUL_RETURN;
}
示例14: 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;
}
示例15: 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;
}