44 #ifndef ROL_ALMOST_SURE_CONSTRAINT_H
45 #define ROL_ALMOST_SURE_CONSTRAINT_H
58 const Ptr<Constraint<Real>>
con_;
72 con_->update(x,flag,iter);
75 con_->update(x,type,iter);
84 std::vector<Real> param;
85 for (
int i = 0; i <
sampler_->numMySamples(); ++i) {
87 con_->setParameter(param);
89 con_->value(*(pc.
get(i)), x, tol);
100 std::vector<Real> param;
101 for (
int i = 0; i <
sampler_->numMySamples(); ++i) {
103 con_->setParameter(param);
105 con_->applyJacobian(*(pjv.
get(i)), v, x, tol);
121 std::vector<Real> param;
123 for (
int i = 0; i <
sampler_->numMySamples(); ++i) {
125 con_->setParameter(param);
146 std::vector<Real> param;
148 for (
int i = 0; i <
sampler_->numMySamples(); ++i) {
150 con_->setParameter(param);
167 std::vector<Real> param;
169 for (
int i = 0; i <
sampler_->numMySamples(); ++i) {
171 con_->setParameter(param);
173 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.