本文整理汇总了C++中BoundConstraint::isFeasible方法的典型用法代码示例。如果您正苦于以下问题:C++ BoundConstraint::isFeasible方法的具体用法?C++ BoundConstraint::isFeasible怎么用?C++ BoundConstraint::isFeasible使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BoundConstraint
的用法示例。
在下文中一共展示了BoundConstraint::isFeasible方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: update
/** \brief Update step, if successful.
This function returns \f$x_{k+1} = x_k + s_k\f$.
It also updates secant information if being used.
@param[in] x is the new iterate
@param[out] s is the step computed via PDAS
@param[in] obj is the objective function
@param[in] con are the bound constraints
@param[in] algo_state is the current state of the algorithm
*/
void update( Vector<Real> &x, const Vector<Real> &s, Objective<Real> &obj, BoundConstraint<Real> &con,
AlgorithmState<Real> &algo_state ) {
Teuchos::RCP<StepState<Real> > step_state = Step<Real>::getState();
x.plus(s);
feasible_ = con.isFeasible(x);
algo_state.snorm = s.norm();
algo_state.iter++;
Real tol = std::sqrt(ROL_EPSILON);
obj.update(x,true,algo_state.iter);
algo_state.value = obj.value(x,tol);
algo_state.nfval++;
if ( secant_ != Teuchos::null ) {
gtmp_->set(*(step_state->gradientVec));
}
algo_state.gnorm = computeCriticalityMeasure(x,obj,con,tol);
algo_state.ngrad++;
if ( secant_ != Teuchos::null ) {
secant_->update(*(step_state->gradientVec),*gtmp_,s,algo_state.snorm,algo_state.iter+1);
}
(algo_state.iterateVec)->set(x);
}