ROL
ROL_LinearConstraint_Def.hpp
Go to the documentation of this file.
1 // @HEADER
2 // *****************************************************************************
3 // Rapid Optimization Library (ROL) Package
4 //
5 // Copyright 2014 NTESS and the ROL contributors.
6 // SPDX-License-Identifier: BSD-3-Clause
7 // *****************************************************************************
8 // @HEADER
9 
10 #ifndef ROL_LINEARCONSTRAINT_DEF_H
11 #define ROL_LINEARCONSTRAINT_DEF_H
12 
13 namespace ROL {
14 
15 template<typename Real>
17  const Ptr<const Vector<Real>> &b) : A_(A), b_(b) {}
18 
19 template<typename Real>
20 void LinearConstraint<Real>::update( const Vector<Real> &x, UpdateType type, int iter ) {}
21 
22 template<typename Real>
23 void LinearConstraint<Real>::update( const Vector<Real> &x, bool flag, int iter ) {}
24 
25 template<typename Real>
27  A_->apply(c,x,tol);
28  c.plus(*b_);
29 }
30 
31 template<typename Real>
33  A_->apply(jv,v,tol);
34 }
35 
36 template<typename Real>
38  A_->applyAdjoint(ajv,v,tol);
39 }
40 
41 template<typename Real>
42 void LinearConstraint<Real>::applyAdjointJacobian(Vector<Real> &ajv, const Vector<Real> &v, const Vector<Real> &x, const Vector<Real> &dualv, Real &tol) {
43  A_->applyAdjoint(ajv,v,tol);
44 }
45 
46 template<typename Real>
48  ahuv.zero();
49 }
50 
51 template<typename Real>
52 Ptr<Vector<Real>> LinearConstraint<Real>::createRangeSpaceVector(void) const {
53  return b_->clone();
54 }
55 
56 } // namespace ROL
57 
58 #endif
LinearConstraint(const Ptr< const LinearOperator< Real >> &A, const Ptr< const Vector< Real >> &b)
virtual void plus(const Vector &x)=0
Compute , where .
void applyAdjointHessian(Vector< Real > &ahuv, const Vector< Real > &u, const Vector< Real > &v, const Vector< Real > &x, Real &tol) override
Apply the derivative of the adjoint of the constraint Jacobian at to vector in direction ...
void value(Vector< Real > &c, const Vector< Real > &x, Real &tol) override
Evaluate the constraint operator at .
virtual void zero()
Set to zero vector.
Definition: ROL_Vector.hpp:133
Defines the linear algebra or vector space interface.
Definition: ROL_Vector.hpp:46
ROL::Ptr< OP > A_
void update(const Vector< Real > &x, UpdateType type, int iter=-1) override
Update constraint function.
void applyAdjointJacobian(Vector< Real > &ajv, const Vector< Real > &v, const Vector< Real > &x, Real &tol) override
Apply the adjoint of the the constraint Jacobian at , , to vector .
Provides the interface to apply a linear operator.
void applyJacobian(Vector< Real > &jv, const Vector< Real > &v, const Vector< Real > &x, Real &tol) override
Apply the constraint Jacobian at , , to vector .
Ptr< Vector< Real > > createRangeSpaceVector(void) const