本文整理汇总了C++中DVector::isEmpty方法的典型用法代码示例。如果您正苦于以下问题:C++ DVector::isEmpty方法的具体用法?C++ DVector::isEmpty怎么用?C++ DVector::isEmpty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DVector
的用法示例。
在下文中一共展示了DVector::isEmpty方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: init
returnValue Actuator::init( double _startTime,
const DVector& _startValueU,
const DVector& _startValueP
)
{
DVector tmp;
if ( _startValueU.isEmpty( ) == BT_FALSE )
tmp.append( _startValueU );
if ( _startValueP.isEmpty( ) == BT_FALSE )
tmp.append( _startValueP );
if ( TransferDevice::init( _startTime,tmp ) != SUCCESSFUL_RETURN )
return ACADOERROR( RET_ACTUATOR_INIT_FAILED );
return SUCCESSFUL_RETURN;
}
示例2: initializeButcherTableau
returnValue RungeKuttaExport::initializeButcherTableau( const DMatrix& _AA, const DVector& _bb, const DVector& _cc ) {
if( _cc.isEmpty() || !_AA.isSquare() || _AA.getNumRows() != _bb.getDim() || _bb.getDim() != _cc.getDim() ) return RET_INVALID_OPTION;
numStages = _cc.getDim();
is_symmetric = checkSymmetry( _cc );
// std::cout << "Symmetry of the chosen method: " << is_symmetric << "\n";
AA = _AA;
bb = _bb;
cc = _cc;
return SUCCESSFUL_RETURN;
}
示例3: hasEquidistantGrid
BooleanType OCP::hasEquidistantGrid( ) const{
DVector numSteps;
modelData.getNumSteps(numSteps);
return numSteps.isEmpty();
}
示例4: exportAcadoHeader
returnValue SIMexport::exportAcadoHeader( const std::string& _dirName,
const std::string& _fileName,
const std::string& _realString,
const std::string& _intString,
int _precision
) const
{
string moduleName;
get(CG_MODULE_NAME, moduleName);
int qpSolver;
get(QP_SOLVER, qpSolver);
int useSinglePrecision;
get(USE_SINGLE_PRECISION, useSinglePrecision);
string fileName;
fileName = _dirName + "/" + _fileName;
map<string, pair<string, string> > options;
DVector nMeasV = getNumMeas();
DVector nOutV = getDimOutputs();
options[ "ACADO_N" ] = make_pair(toString( getN() ), "Number of control/estimation intervals.");
options[ "ACADO_NX" ] = make_pair(toString( getNX() ), "Number of differential variables.");
options[ "ACADO_NXD" ] = make_pair(toString( getNDX() ), "Number of differential derivative variables.");
options[ "ACADO_NXA" ] = make_pair(toString( getNXA() ), "Number of algebraic variables.");
options[ "ACADO_NU" ] = make_pair(toString( getNU() ), "Number of control variables.");
options[ "ACADO_NOD" ] = make_pair(toString( getNOD() ), "Number of online data values.");
options[ "ACADO_NUMOUT" ] = make_pair(toString( nOutV.getDim() ), "Number of output functions.");
if( !nMeasV.isEmpty() && !nOutV.isEmpty() ) {
std::ostringstream acado_nout;
ExportVariable( "ACADO_NOUT",nOutV,STATIC_CONST_INT ).exportDataDeclaration(acado_nout);
std::ostringstream acado_nmeas;
ExportVariable( "ACADO_NMEAS",nMeasV,STATIC_CONST_INT ).exportDataDeclaration(acado_nmeas);
options[ "ACADO_OUTPUTS_DEFINED" ] = make_pair("\n" + acado_nout.str() + acado_nmeas.str(), "Dimension and measurements of the output functions per shooting interval.");
}
//
// ACADO variables and workspace
//
ExportStatementBlock variablesBlock;
stringstream variables;
if (collectDataDeclarations(variablesBlock, ACADO_VARIABLES) != SUCCESSFUL_RETURN)
return ACADOERROR( RET_UNABLE_TO_EXPORT_CODE );
variablesBlock.exportCode(variables, _realString, _intString, _precision);
ExportStatementBlock workspaceBlock;
stringstream workspace;
if (collectDataDeclarations(workspaceBlock, ACADO_WORKSPACE) != SUCCESSFUL_RETURN)
return ACADOERROR( RET_UNABLE_TO_EXPORT_CODE );
workspaceBlock.exportCode(workspace, _realString, _intString, _precision);
ExportStatementBlock functionsBlock;
stringstream functions;
if (collectFunctionDeclarations( functionsBlock ) != SUCCESSFUL_RETURN)
return ACADOERROR( RET_UNABLE_TO_EXPORT_CODE );
functionsBlock.exportCode(functions, _realString);
ExportCommonHeader ech(fileName, "", _realString, _intString, _precision);
ech.configure( moduleName, useSinglePrecision, false, (QPSolverName)qpSolver,
options, variables.str(), workspace.str(), functions.str());
return ech.exportCode();
}