10 #ifndef ROL_ALMOST_SURE_CONSTRAINT_H
11 #define ROL_ALMOST_SURE_CONSTRAINT_H
24 const Ptr<Constraint<Real>>
con_;
38 con_->update(x,flag,iter);
41 con_->update(x,type,iter);
50 std::vector<Real> param;
51 for (
int i = 0; i <
sampler_->numMySamples(); ++i) {
53 con_->setParameter(param);
55 con_->value(*(pc.
get(i)), x, tol);
66 std::vector<Real> param;
67 for (
int i = 0; i <
sampler_->numMySamples(); ++i) {
69 con_->setParameter(param);
71 con_->applyJacobian(*(pjv.
get(i)), v, x, tol);
87 std::vector<Real> param;
89 for (
int i = 0; i <
sampler_->numMySamples(); ++i) {
91 con_->setParameter(param);
112 std::vector<Real> param;
114 for (
int i = 0; i <
sampler_->numMySamples(); ++i) {
116 con_->setParameter(param);
133 std::vector<Real> param;
135 for (
int i = 0; i <
sampler_->numMySamples(); ++i) {
137 con_->setParameter(param);
139 con_->applyPreconditioner(*(ppv.
get(i)), *(pv.
get(i)), x, g, tol);
void applyAdjointJacobian(Vector< Real > &ajv, const Vector< Real > &v, const Vector< Real > &x, Real &tol)
Apply the adjoint of the the constraint Jacobian at , , to vector .
virtual ROL::Ptr< Vector > clone() const =0
Clone to make a new (uninitialized) vector.
Ptr< Vector< Real > > scratch2_
void applyAdjointHessian(Vector< Real > &ahuv, const Vector< Real > &u, const Vector< Real > &v, const Vector< Real > &x, Real &tol)
Apply the derivative of the adjoint of the constraint Jacobian at to vector in direction ...
virtual void zero()
Set to zero vector.
Defines the linear algebra or vector space interface.
Defines the linear algebra of a vector space on a generic partitioned vector where the individual vec...
ROL::Ptr< const Vector< Real > > get(size_type i) const
void value(Vector< Real > &c, const Vector< Real > &x, Real &tol)
Evaluate the constraint operator at .
const Ptr< SampleGenerator< Real > > sampler_
Ptr< Vector< Real > > scratch1_
virtual ~AlmostSureConstraint()
const Ptr< Constraint< Real > > con_
void applyJacobian(Vector< Real > &jv, const Vector< Real > &v, const Vector< Real > &x, Real &tol)
Apply the constraint Jacobian at , , to vector .
void applyPreconditioner(Vector< Real > &Pv, const Vector< Real > &v, const Vector< Real > &x, const Vector< Real > &g, Real &tol)
Apply a constraint preconditioner at , , to vector . Ideally, this preconditioner satisfies the follo...
void update(const Vector< Real > &x, UpdateType type, int iter=-1)
Update constraint function.
void update(const Vector< Real > &x, bool flag=true, int iter=-1)
Update constraint functions. x is the optimization variable, flag = true if optimization variable is ...
AlmostSureConstraint(const Ptr< SampleGenerator< Real >> &sampler, const Ptr< Constraint< Real >> &con)
Defines the general constraint operator interface.