44 #ifndef ROL_ALMOST_SURE_CONSTRAINT_H
45 #define ROL_ALMOST_SURE_CONSTRAINT_H
57 const ROL::Ptr<SampleGenerator<Real> >
sampler_;
58 const ROL::Ptr<Constraint<Real> >
con_;
79 std::vector<Real> param;
80 for (
int i = 0; i <
sampler_->numMySamples(); ++i) {
82 con_->setParameter(param);
84 con_->value(*(pc.
get(i)), x, tol);
95 std::vector<Real> param;
96 for (
int i = 0; i <
sampler_->numMySamples(); ++i) {
98 con_->setParameter(param);
100 con_->applyJacobian(*(pjv.
get(i)), v, x, tol);
116 std::vector<Real> param;
118 for (
int i = 0; i <
sampler_->numMySamples(); ++i) {
120 con_->setParameter(param);
141 std::vector<Real> param;
143 for (
int i = 0; i <
sampler_->numMySamples(); ++i) {
145 con_->setParameter(param);
162 std::vector<Real> param;
164 for (
int i = 0; i <
sampler_->numMySamples(); ++i) {
166 con_->setParameter(param);
168 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.
const ROL::Ptr< SampleGenerator< Real > > sampler_
ROL::Ptr< Vector< Real > > scratch1_
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 ...
ROL::Ptr< Vector< Real > > scratch2_
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 .
AlmostSureConstraint(const ROL::Ptr< SampleGenerator< Real > > &sampler, const ROL::Ptr< Constraint< Real > > &con)
virtual ~AlmostSureConstraint()
void applyJacobian(Vector< Real > &jv, const Vector< Real > &v, const Vector< Real > &x, Real &tol)
Apply the constraint Jacobian at , , to vector .
const ROL::Ptr< Constraint< Real > > con_
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, bool flag=true, int iter=-1)
Update constraint functions. x is the optimization variable, flag = true if optimization variable is ...
Defines the general constraint operator interface.