44 #ifndef ROL_BLOCKOPERATOR2DIAGONAL_H
45 #define ROL_BLOCKOPERATOR2DIAGONAL_H
78 void apply(
V &Hv,
const V &v, Real &tol )
const {
81 PV &Hv_pv =
dynamic_cast<PV&
>(Hv);
82 const PV &v_pv =
dynamic_cast<const PV&
>(v);
84 ROL::Ptr<V> Hv1 = Hv_pv.get(0);
85 ROL::Ptr<V> Hv2 = Hv_pv.get(1);
86 ROL::Ptr<const V> v1 = v_pv.get(0);
87 ROL::Ptr<const V> v2 = v_pv.get(1);
89 A_->apply(*Hv1,*v1,tol);
90 D_->apply(*Hv2,*v2,tol);
98 PV &Hv_pv =
dynamic_cast<PV&
>(Hv);
99 const PV &v_pv =
dynamic_cast<const PV&
>(v);
101 ROL::Ptr<V> Hv1 = Hv_pv.get(0);
102 ROL::Ptr<V> Hv2 = Hv_pv.get(1);
103 ROL::Ptr<const V> v1 = v_pv.get(0);
104 ROL::Ptr<const V> v2 = v_pv.get(1);
106 A_->applyInverse(*Hv1,*v1,tol);
107 D_->applyInverse(*Hv2,*v2,tol);
111 ROL::Ptr<LinearOperator<Real> >
getOperator(
int row,
int col )
const {
112 if( row == 0 && col == 0 ) {
115 else if( row == 1 && col == 1 ) {
119 ROL_TEST_FOR_EXCEPTION(
true, std::invalid_argument,
120 ">>> ERROR (ROL_BlockOperator2Diagonal, getOperator): "
121 "invalid block indices.");
131 #endif // ROL_BLOCKOPERATOR2DIAGONAL_H
Provides the interface to apply a 2x2 block diagonal operator to a partitioned vector.
PartitionedVector< Real > PV
ROL::Ptr< LinearOperator< Real > > getOperator(int row, int col) const
void applyInverse(V &Hv, const V &v Real &tol) const
Defines the linear algebra of vector space on a generic partitioned vector.
LinearOperator< Real > OP
Defines the linear algebra or vector space interface.
PartitionedVector< Real > PV
Provides the interface to apply a linear operator.
Provides the interface to apply a 2x2 block operator to a partitioned vector.
ROL::DiagonalOperator apply
BlockOperator2Diagonal(ROL::Ptr< OP > &A, ROL::Ptr< OP > &D)