本文整理汇总了C++中ExportVariable::getTranspose方法的典型用法代码示例。如果您正苦于以下问题:C++ ExportVariable::getTranspose方法的具体用法?C++ ExportVariable::getTranspose怎么用?C++ ExportVariable::getTranspose使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ExportVariable
的用法示例。
在下文中一共展示了ExportVariable::getTranspose方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setup
returnValue AuxiliaryFunctionsExport::setup( )
{
String fileName( "auxiliary_functions.c" );
int printLevel;
get( PRINTLEVEL,printLevel );
if ( (PrintLevel)printLevel >= HIGH )
acadoPrintf( "--> Preparing to export %s... ",fileName.getName() );
ExportVariable x ( "x", N+1,NX, REAL,ACADO_VARIABLES );
ExportVariable u ( "u", N,NU, REAL,ACADO_VARIABLES );
ExportVariable p ( "p", 1,NP, REAL,ACADO_VARIABLES );
ExportVariable xRef( "xRef", N+1,NX, REAL,ACADO_VARIABLES );
ExportVariable uRef( "uRef", N,NU, REAL,ACADO_VARIABLES );
getAcadoVariablesX.setup( "getAcadoVariablesX" );
getAcadoVariablesX.setReturnValue( x,BT_TRUE );
getAcadoVariablesU.setup( "getAcadoVariablesU" );
getAcadoVariablesU.setReturnValue( u,BT_TRUE );
getAcadoVariablesXRef.setup( "getAcadoVariablesXRef" );
getAcadoVariablesXRef.setReturnValue( xRef,BT_TRUE );
getAcadoVariablesURef.setup( "getAcadoVariablesURef" );
getAcadoVariablesURef.setReturnValue( uRef,BT_TRUE );
printStates.setup( "printStates" );
printStates.addStatement( ExportPrintf(x.getTranspose()) );
printControls.setup( "printControls" );
printControls.addStatement( ExportPrintf(u.getTranspose()) );
int operatingSystem;
get( OPERATING_SYSTEM,operatingSystem );
getTime.setup( "getTime" );
ExportVariable currentTime( "current_time",(Matrix)0.0 );
currentTime.callByValue();
if ( (OperatingSystem)operatingSystem == OS_WINDOWS )
{
getTime.addStatement( "LARGE_INTEGER counter, frequency;\n" );
getTime.addStatement( "QueryPerformanceFrequency(&frequency);\n" );
getTime.addStatement( "QueryPerformanceCounter(&counter);\n" );
getTime.addStatement( "current_time = ((real_t) counter.QuadPart) / ((real_t) frequency.QuadPart);\n" );
}
else
{
// OS_UNIX
getTime.addStatement( "struct timeval theclock;\n" );
getTime.addStatement( "gettimeofday( &theclock,0 );\n" );
getTime.addStatement( "current_time = 1.0*theclock.tv_sec + 1.0e-6*theclock.tv_usec;\n" );
}
getTime.setReturnValue( currentTime );
printHeader.setup( "printHeader" );
printHeader.addStatement( " printf(\"\\nACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization.\\nCopyright (C) 2008-2011 by Boris Houska and Hans Joachim Ferreau, K.U.Leuven.\\nDeveloped within the Optimization in Engineering Center (OPTEC) under\\nsupervision of Moritz Diehl. All rights reserved.\\n\\nACADO Toolkit is distributed under the terms of the GNU Lesser\\nGeneral Public License 3 in the hope that it will be useful,\\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\\nGNU Lesser General Public License for more details.\\n\\n\" );\n" );
if ( (PrintLevel)printLevel >= HIGH )
acadoPrintf( "done.\n" );
return SUCCESSFUL_RETURN;
}