本文整理汇总了C++中ExportVariable::getDim方法的典型用法代码示例。如果您正苦于以下问题:C++ ExportVariable::getDim方法的具体用法?C++ ExportVariable::getDim怎么用?C++ ExportVariable::getDim使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ExportVariable
的用法示例。
在下文中一共展示了ExportVariable::getDim方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getAuxVariable
ExportVariable DiscreteTimeExport::getAuxVariable() const
{
ExportVariable max;
if( NX1 > 0 ) {
max = lin_input.getGlobalExportVariable();
}
if( NX2 > 0 ) {
if( rhs.getGlobalExportVariable().getDim() >= max.getDim() ) {
max = rhs.getGlobalExportVariable();
}
if( diffs_rhs.getGlobalExportVariable().getDim() >= max.getDim() ) {
max = diffs_rhs.getGlobalExportVariable();
}
}
if( NX3 > 0 ) {
if( rhs3.getGlobalExportVariable().getDim() >= max.getDim() ) {
max = rhs3.getGlobalExportVariable();
}
if( diffs_rhs3.getGlobalExportVariable().getDim() >= max.getDim() ) {
max = diffs_rhs3.getGlobalExportVariable();
}
}
return max;
}
示例2: getAuxVariable
ExportVariable LiftedERKExport::getAuxVariable() const
{
ExportVariable max;
max = rhs.getGlobalExportVariable();
if( diffs_rhs.getGlobalExportVariable().getDim() > max.getDim() ) {
max = diffs_rhs.getGlobalExportVariable();
}
if( alg_rhs.getGlobalExportVariable().getDim() > max.getDim() ) {
max = alg_rhs.getGlobalExportVariable();
}
return max;
}
示例3: getAuxVariable
ExportVariable ThreeSweepsERKExport::getAuxVariable() const
{
ExportVariable max;
max = rhs.getGlobalExportVariable();
if( diffs_rhs.getGlobalExportVariable().getDim() > max.getDim() ) {
max = diffs_rhs.getGlobalExportVariable();
}
if( diffs_sweep3.getGlobalExportVariable().getDim() > max.getDim() ) {
max = diffs_sweep3.getGlobalExportVariable();
}
return max;
}
示例4: getAuxVariable
ExportVariable ExplicitRungeKuttaExport::getAuxVariable() const
{
ExportVariable max;
max = rhs.getGlobalExportVariable();
if( diffs_rhs.getGlobalExportVariable().getDim() > max.getDim() ) {
max = diffs_rhs.getGlobalExportVariable();
}
return max;
}
示例5: setConstraints
returnValue ExportNLPSolver::setConstraints(const OCP& _ocp)
{
////////////////////////////////////////////////////////////////////////////
//
// Extract box constraints
//
////////////////////////////////////////////////////////////////////////////
Grid grid;
Constraint constraints;
_ocp.getGrid( grid );
_ocp.getConstraint( constraints );
VariablesGrid ugrid(NU, grid);
VariablesGrid xgrid(NX, grid);
OCPiterate tmp;
tmp.init(&xgrid, 0, 0, &ugrid, 0);
constraints.getBounds( tmp );
BooleanType isFinite = BT_FALSE;
Vector lbTmp;
Vector ubTmp;
//
// Extract box constraints on inputs
//
for (unsigned i = 0; i < tmp.u->getNumPoints(); ++i)
{
lbTmp = tmp.u->getLowerBounds( i );
ubTmp = tmp.u->getUpperBounds( i );
if ( (ubTmp - lbTmp).isPositive() == BT_FALSE )
return ACADOERRORTEXT(RET_INVALID_ARGUMENTS, "Some lower bounds are bigger than upper bounds?");
if ( (lbTmp.isFinite( ) == BT_TRUE) || (ubTmp.isFinite( ) == BT_TRUE) )
isFinite = BT_TRUE;
}
if (isFinite == BT_TRUE)
uBounds = *(tmp.u);
else
uBounds.init();
//
// Extract box constraints on states
//
isFinite = BT_FALSE;
xBoundsIdx.clear();
for (unsigned i = 0; i < tmp.x->getNumPoints(); ++i)
{
lbTmp = tmp.x->getLowerBounds( i );
ubTmp = tmp.x->getUpperBounds( i );
if ( (ubTmp - lbTmp).isPositive() == BT_FALSE )
return ACADOERRORTEXT(RET_INVALID_ARGUMENTS, "Some lower bounds are bigger than upper bounds?");
if ( (lbTmp.isFinite( ) == BT_TRUE) || (ubTmp.isFinite( ) == BT_TRUE) )
isFinite = BT_TRUE;
// This is maybe not necessary
if (isFinite == BT_FALSE || i == 0)
continue;
for (unsigned j = 0; j < lbTmp.getDim(); ++j)
{
if ( ( acadoIsFinite( ubTmp( j ) ) == BT_TRUE ) || ( acadoIsFinite( lbTmp( j ) ) == BT_TRUE ) )
{
xBoundsIdx.push_back(i * lbTmp.getDim() + j);
}
}
}
if ( isFinite == BT_TRUE )
xBounds = *(tmp.x);
else
xBounds.init();
////////////////////////////////////////////////////////////////////////////
//
// Intermezzo - reset static counters
//
////////////////////////////////////////////////////////////////////////////
DifferentialState dummy0;
Control dummy1;
dummy0.clearStaticCounters();
dummy1.clearStaticCounters();
DifferentialState vX( NX );
Control vU( NU );
////////////////////////////////////////////////////////////////////////////
//
// Extract path constraints; pac prefix
//
////////////////////////////////////////////////////////////////////////////
//.........这里部分代码省略.........