本文整理汇总了C++中Objective::getNumMayerTerms方法的典型用法代码示例。如果您正苦于以下问题:C++ Objective::getNumMayerTerms方法的具体用法?C++ Objective::getNumMayerTerms怎么用?C++ Objective::getNumMayerTerms使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Objective
的用法示例。
在下文中一共展示了Objective::getNumMayerTerms方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: checkConsistency
returnValue OCPexport::checkConsistency( ) const
{
//
// Consistency checks:
//
Objective objective;
ocp.getObjective( objective );
int hessianApproximation;
get( HESSIAN_APPROXIMATION, hessianApproximation );
if ( ocp.hasObjective( ) == true && !((HessianApproximationMode)hessianApproximation == EXACT_HESSIAN &&
(objective.getNumMayerTerms() == 1 || objective.getNumLagrangeTerms() == 1)) ) { // for Exact Hessian RTI
return ACADOERROR( RET_INVALID_OBJECTIVE_FOR_CODE_EXPORT );
}
int sensitivityProp;
get(DYNAMIC_SENSITIVITY, sensitivityProp);
// if( (HessianApproximationMode)hessianApproximation == EXACT_HESSIAN && (ExportSensitivityType) sensitivityProp != THREE_SWEEPS ) {
// return ACADOERROR( RET_INVALID_OPTION );
// }
DifferentialEquation f;
ocp.getModel( f );
// if ( f.isDiscretized( ) == BT_TRUE )
// return ACADOERROR( RET_NO_DISCRETE_ODE_FOR_CODE_EXPORT );
if ( f.getNUI( ) > 0 )
return ACADOERROR( RET_INVALID_ARGUMENTS );
if ( f.getNP( ) > 0 )
return ACADOERRORTEXT(RET_INVALID_ARGUMENTS,
"Free parameters are not supported. For the old functionality use OnlineData class.");
if ( (HessianApproximationMode)hessianApproximation != GAUSS_NEWTON && (HessianApproximationMode)hessianApproximation != EXACT_HESSIAN )
return ACADOERROR( RET_INVALID_OPTION );
int discretizationType;
get( DISCRETIZATION_TYPE,discretizationType );
if ( ( (StateDiscretizationType)discretizationType != SINGLE_SHOOTING ) &&
( (StateDiscretizationType)discretizationType != MULTIPLE_SHOOTING ) )
return ACADOERROR( RET_INVALID_OPTION );
return SUCCESSFUL_RETURN;
}