44 #ifndef ROL_RANGE_SPACE_OPERATOR_H
45 #define ROL_RANGE_SPACE_OPERATOR_H
65 const Ptr<Constraint<Real>>
con_;
73 mutable Ptr<Vector<Real>>
v1_;
74 mutable Ptr<Vector<Real>>
v2_;
75 mutable Ptr<PartitionedVector<Real>>
vv_;
76 mutable Ptr<Vector<Real>>
b1_;
77 mutable Ptr<Vector<Real>>
b2_;
78 mutable Ptr<PartitionedVector<Real>>
bb_;
79 mutable Ptr<Vector<Real>>
w1_;
80 mutable Ptr<Vector<Real>>
w2_;
81 mutable Ptr<PartitionedVector<Real>>
ww_;
82 mutable Ptr<Vector<Real>>
mul_;
87 bool refine =
false)
const {
94 b.
axpy( static_cast<Real>(-1), *
vv_ );
99 krylov_->resetAbsoluteTolerance(tol);
123 Real atol =
static_cast<Real
>(1e-12);
124 Real rtol =
static_cast<Real
>(1e-2);
125 list.sublist(
"General").sublist(
"Krylov").set(
"Type",
"GMRES");
126 list.sublist(
"General").sublist(
"Krylov").set(
"Absolute Tolerance", atol);
127 list.sublist(
"General").sublist(
"Krylov").set(
"Relative Tolerance", rtol);
128 list.sublist(
"General").sublist(
"Krylov").set(
"Iteration Limit", 200);
129 krylov_ = KrylovFactory<Real>(list);
131 augsys_ = makePtr<AugmentedSystemOperator<Real>>(con,dom);
132 augsysprec_ = makePtr<AugmentedSystemPrecOperator<Real>>(con,dom);
134 v1_ = dom->dual().clone();
135 v2_ = ran->dual().clone();
136 vv_ = makePtr<PartitionedVector<Real>>(std::vector<Ptr<Vector<Real>>>({
v1_,
v2_}));
138 w1_ = dom->dual().clone();
139 w2_ = ran->dual().clone();
140 ww_ = makePtr<PartitionedVector<Real>>(std::vector<Ptr<Vector<Real>>>({
w1_,
w2_}));
142 b1_ = dom->dual().clone();
144 bb_ = makePtr<PartitionedVector<Real>>(std::vector<Ptr<Vector<Real>>>({
b1_,
b2_}));
146 mul_ = ran->dual().clone();
151 Ptr<PartitionedVector<Real>> sol = makePtr<PartitionedVector<Real>>(std::vector<Ptr<Vector<Real>>>({makePtrFromRef(Hv),
mul_}));
void applyAdjoint(Vector< Real > &Hv, const Vector< Real > &v, Real &tol) const
Apply adjoint of linear operator.
Ptr< LinearOperator< Real > > augsysprec_
virtual void plus(const Vector &x)=0
Compute , where .
virtual void axpy(const Real alpha, const Vector &x)
Compute where .
Projects on to the null space of a linear constraint.
Ptr< PartitionedVector< Real > > bb_
Ptr< Vector< Real > > b2_
Defines the linear algebra or vector space interface.
void applyInverse(Vector< Real > &Hv, const Vector< Real > &v, Real &tol) const
Apply inverse of linear operator.
void solveAugmentedSystem(Vector< Real > &v, Vector< Real > &b, Real &tol, bool refine=false) const
const Ptr< Constraint< Real > > con_
Ptr< Vector< Real > > w1_
virtual ~RangeSpaceOperator()
Ptr< Vector< Real > > v1_
Provides the interface to apply a linear operator.
Ptr< PartitionedVector< Real > > vv_
Ptr< LinearOperator< Real > > augsys_
Ptr< Vector< Real > > w2_
virtual void apply(Vector< Real > &Hv, const Vector< Real > &v, Real &tol) const
Apply linear operator.
virtual void set(const Vector &x)
Set where .
Ptr< Vector< Real > > b1_
Ptr< Krylov< Real > > krylov_
Ptr< PartitionedVector< Real > > ww_
void applyAdjointInverse(Vector< Real > &Hv, const Vector< Real > &v, Real &tol) const
Apply adjoint of the inverse linear operator.
Defines the general constraint operator interface.
Ptr< Vector< Real > > v2_
RangeSpaceOperator(const Ptr< Constraint< Real >> &con, const Ptr< Vector< Real >> &dom, const Ptr< Vector< Real >> &ran)
Ptr< Vector< Real > > mul_