10 #ifndef ROL_BLOCKOPERATOR2DIAGONAL_H
11 #define ROL_BLOCKOPERATOR2DIAGONAL_H
44 void apply(
V &Hv,
const V &v, Real &tol )
const {
47 PV &Hv_pv =
dynamic_cast<PV&
>(Hv);
48 const PV &v_pv =
dynamic_cast<const PV&
>(v);
50 ROL::Ptr<V> Hv1 = Hv_pv.get(0);
51 ROL::Ptr<V> Hv2 = Hv_pv.get(1);
52 ROL::Ptr<const V> v1 = v_pv.get(0);
53 ROL::Ptr<const V> v2 = v_pv.get(1);
55 A_->apply(*Hv1,*v1,tol);
56 D_->apply(*Hv2,*v2,tol);
64 PV &Hv_pv =
dynamic_cast<PV&
>(Hv);
65 const PV &v_pv =
dynamic_cast<const PV&
>(v);
67 ROL::Ptr<V> Hv1 = Hv_pv.get(0);
68 ROL::Ptr<V> Hv2 = Hv_pv.get(1);
69 ROL::Ptr<const V> v1 = v_pv.get(0);
70 ROL::Ptr<const V> v2 = v_pv.get(1);
72 A_->applyInverse(*Hv1,*v1,tol);
73 D_->applyInverse(*Hv2,*v2,tol);
77 ROL::Ptr<LinearOperator<Real> >
getOperator(
int row,
int col )
const {
78 if( row == 0 && col == 0 ) {
81 else if( row == 1 && col == 1 ) {
85 ROL_TEST_FOR_EXCEPTION(
true, std::invalid_argument,
86 ">>> ERROR (ROL_BlockOperator2Diagonal, getOperator): "
87 "invalid block indices.");
97 #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)