44 #ifndef ROL_VECTOR_SIMOPT_HPP 45 #define ROL_VECTOR_SIMOPT_HPP 59 Teuchos::RCP<Vector<Real> >
vec1_;
60 Teuchos::RCP<Vector<Real> >
vec2_;
63 mutable Teuchos::RCP<Vector_SimOpt<Real> >
dual_vec_;
79 void scale(
const Real alpha ) {
98 Real norm1 =
vec1_->norm();
99 Real norm2 =
vec2_->norm();
100 return sqrt( norm1*norm1 + norm2*norm2 );
103 Teuchos::RCP<Vector<Real> >
clone()
const {
114 Teuchos::RCP<Vector<Real> >
basis(
const int i )
const {
117 Teuchos::RCP<Vector<Real> > e1 = (
vec1_)->
basis(i);
118 Teuchos::RCP<Vector<Real> > e2 = (
vec2_)->
clone(); e2->zero();
123 Teuchos::RCP<Vector<Real> > e1 = (
vec1_)->
clone(); e1->zero();
124 Teuchos::RCP<Vector<Real> > e2 = (
vec2_)->
basis(i-n1);
130 void applyUnary(
const Elementwise::UnaryFunction<Real> &f ) {
132 vec1_->applyUnary(f);
133 vec2_->applyUnary(f);
145 Real
reduce(
const Elementwise::ReductionOp<Real> &r )
const {
147 Real result = r.initialValue();
148 r.reduce(
vec1_->reduce(r),result);
149 r.reduce(
vec2_->reduce(r),result);
158 Teuchos::RCP<const Vector<Real> >
get_1()
const {
162 Teuchos::RCP<const Vector<Real> >
get_2()
const {
166 Teuchos::RCP<Vector<Real> >
get_1() {
170 Teuchos::RCP<Vector<Real> >
get_2() {
Teuchos::RCP< Vector< Real > > clone() const
Clone to make a new (uninitialized) vector.
Defines the linear algebra or vector space interface for simulation-based optimization.
Teuchos::RCP< const Vector< Real > > get_2() const
void set_1(const Vector< Real > &vec)
Teuchos::RCP< Vector< Real > > vec2_
void applyBinary(const Elementwise::BinaryFunction< Real > &f, const Vector< Real > &x)
int dimension() const
Return dimension of the vector space.
Defines the linear algebra or vector space interface.
Teuchos::RCP< Vector< Real > > dual_vec2_
void applyUnary(const Elementwise::UnaryFunction< Real > &f)
Real dot(const Vector< Real > &x) const
Compute where .
Real reduce(const Elementwise::ReductionOp< Real > &r) const
void scale(const Real alpha)
Compute where .
Teuchos::RCP< Vector< Real > > vec1_
Teuchos::RCP< const Vector< Real > > get_1() const
Teuchos::RCP< Vector< Real > > get_1()
const Vector< Real > & dual(void) const
Return dual representation of , for example, the result of applying a Riesz map, or change of basis...
Real norm() const
Returns where .
Teuchos::RCP< Vector< Real > > get_2()
Teuchos::RCP< Vector< Real > > basis(const int i) const
Return i-th basis vector.
Vector_SimOpt(const Teuchos::RCP< Vector< Real > > &vec1, const Teuchos::RCP< Vector< Real > > &vec2)
void axpy(const Real alpha, const Vector< Real > &x)
Compute where .
void plus(const Vector< Real > &x)
Compute , where .
Teuchos::RCP< Vector< Real > > dual_vec1_
Teuchos::RCP< Vector_SimOpt< Real > > dual_vec_
void set_2(const Vector< Real > &vec)