本文整理汇总了C++中rol::Vector::clone方法的典型用法代码示例。如果您正苦于以下问题:C++ Vector::clone方法的具体用法?C++ Vector::clone怎么用?C++ Vector::clone使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类rol::Vector
的用法示例。
在下文中一共展示了Vector::clone方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: MoreauYosidaPenalty
MoreauYosidaPenalty(const Teuchos::RCP<Objective<Real> > &obj,
const Teuchos::RCP<BoundConstraint<Real> > &con,
const ROL::Vector<Real> &x, const Real mu = 1.0)
: obj_(obj), con_(con), mu_(mu),
fval_(0), isConEvaluated_(false), nfval_(0), ngval_(0) {
g_ = x.dual().clone();
l_ = x.clone();
l1_ = x.clone();
dl1_ = x.dual().clone();
u_ = x.clone();
u1_ = x.clone();
du1_ = x.dual().clone();
xlam_ = x.clone();
v_ = x.clone();
dv_ = x.dual().clone();
dv2_ = x.dual().clone();
lam_ = x.clone();
tmp_ = x.clone();
con_->setVectorToLowerBound(*l_);
con_->setVectorToUpperBound(*u_);
lam_->zero();
//lam_->set(*u_);
//lam_->plus(*l_);
//lam_->scale(0.5);
}
示例2: AugmentedLagrangian
AugmentedLagrangian(Objective<Real> &obj, EqualityConstraint<Real> &con,
const ROL::Vector<Real> &x, const ROL::Vector<Real> &c)
: mu_(0.0), fval_(0.0), isConEvaluated_(false), ncval_(0), nfval_(0), ngval_(0) {
obj_ = Teuchos::rcp(&obj, false);
con_ = Teuchos::rcp(&con, false);
c_ = c.clone();
dc1_ = x.dual().clone();
dc2_ = c.clone();
lam_ = c.dual().clone();
dlam_ = c.dual().clone();
flag_ = true;
HessianLevel_ = 1;
}
示例3: initialize
void initialize(const ROL::Vector<Real> &x, const ROL::Vector<Real> &s, const ROL::Vector<Real> &g,
Objective<Real> &obj, BoundConstraint<Real> &con) {
LineSearch<Real>::initialize(x,s,g,obj,con);
xnew_ = x.clone();
}