当前位置: 首页>>代码示例>>C++>>正文


C++ Objective::invHessVec方法代码示例

本文整理汇总了C++中Objective::invHessVec方法的典型用法代码示例。如果您正苦于以下问题:C++ Objective::invHessVec方法的具体用法?C++ Objective::invHessVec怎么用?C++ Objective::invHessVec使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Objective的用法示例。


在下文中一共展示了Objective::invHessVec方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: compute

  void compute( Vector<Real> &s, const Vector<Real> &x,
                Objective<Real> &obj, BoundConstraint<Real> &bnd,
                AlgorithmState<Real> &algo_state ) {
    Teuchos::RCP<StepState<Real> > step_state = Step<Real>::getState();
    Real tol = std::sqrt(ROL_EPSILON<Real>()), one(1);

    // Compute unconstrained step
    obj.invHessVec(s,*(step_state->gradientVec),x,tol);
    s.scale(-one);
  }
开发者ID:agrippa,项目名称:Trilinos,代码行数:10,代码来源:ROL_NewtonStep.hpp

示例2: compute

  void compute( Vector<Real> &s, const Vector<Real> &x,
                Objective<Real> &obj, BoundConstraint<Real> &bnd,
                AlgorithmState<Real> &algo_state ) {
    Real tol = std::sqrt(ROL_EPSILON<Real>());
    Teuchos::RCP<StepState<Real> > step_state = Step<Real>::getState();

    // Compute projected Newton step
    // ---> Apply inactive-inactive block of inverse hessian to gradient
    gp_->set(*(step_state->gradientVec));
    bnd.pruneActive(*gp_,*(step_state->gradientVec),x,algo_state.gnorm);
    obj.invHessVec(s,*gp_,x,tol);
    bnd.pruneActive(s,*(step_state->gradientVec),x,algo_state.gnorm);
    // ---> Add in active gradient components
    gp_->set(*(step_state->gradientVec));
    bnd.pruneInactive(*d_,*(step_state->gradientVec),x,algo_state.gnorm);
    s.plus(gp_->dual());
    s.scale(-1.0);
  }
开发者ID:Russell-Jones-OxPhys,项目名称:Trilinos,代码行数:18,代码来源:ROL_ProjectedNewtonStep.hpp


注:本文中的Objective::invHessVec方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。