ROL
ROL::ROL::Vector< Real > Class Template Referenceabstract

#include <ROL_Constraint_SerialSimOpt.hpp>

Inheritance diagram for ROL::ROL::Vector< Real >:

Public Member Functions

virtual ~Vector ()
virtual void plus (const Vector &x)=0
 Compute \(y \leftarrow y + x\), where \(y = \mathtt{*this}\).
virtual void scale (const Real alpha)=0
 Compute \(y \leftarrow \alpha y\) where \(y = \mathtt{*this}\).
virtual Real dot (const Vector &x) const =0
 Compute \( \langle y,x \rangle \) where \(y = \mathtt{*this}\).
virtual Real norm () const =0
 Returns \( \| y \| \) where \(y = \mathtt{*this}\).
virtual ROL::Ptr< Vectorclone () const =0
 Clone to make a new (uninitialized) vector.
virtual void axpy (const Real alpha, const Vector &x)
 Compute \(y \leftarrow \alpha x + y\) where \(y = \mathtt{*this}\).
virtual void zero ()
 Set to zero vector.
virtual ROL::Ptr< Vectorbasis (const int i) const
 Return i-th basis vector.
virtual int dimension () const
 Return dimension of the vector space.
virtual void set (const Vector &x)
 Set \(y \leftarrow x\) where \(y = \mathtt{*this}\).
virtual const Vectordual () const
 Return dual representation of \(\mathtt{*this}\), for example, the result of applying a Riesz map, or change of basis, or change of memory layout.
virtual Real apply (const Vector< Real > &x) const
 Apply \(\mathtt{*this}\) to a dual vector. This is equivalent to the call \(\mathtt{this->dot(x.dual())}\).
virtual void applyUnary (const Elementwise::UnaryFunction< Real > &f)
virtual void applyBinary (const Elementwise::BinaryFunction< Real > &f, const Vector &x)
virtual Real reduce (const Elementwise::ReductionOp< Real > &r) const
virtual void print (std::ostream &outStream) const
virtual void setScalar (const Real C)
 Set \(y \leftarrow C\) where \(C\in\mathbb{R}\).
virtual void randomize (const Real l=0.0, const Real u=1.0)
 Set vector to be uniform random between [l,u].
virtual std::vector< Real > checkVector (const Vector< Real > &x, const Vector< Real > &y, const bool printToStream=true, std::ostream &outStream=std::cout) const
 Verify vector-space methods.

Detailed Description

template<class Real>
class ROL::ROL::Vector< Real >

Definition at line 46 of file ROL_Constraint_SerialSimOpt.hpp.

Constructor & Destructor Documentation

◆ ~Vector()

template<class Real>
virtual ROL::ROL::Vector< Real >::~Vector ( )
inlinevirtual

Definition at line 53 of file ROL_Constraint_SerialSimOpt.hpp.

Member Function Documentation

◆ plus()

template<class Real>
virtual void ROL::ROL::Vector< Real >::plus ( const Vector< Real > & x)
pure virtual

Compute \(y \leftarrow y + x\), where \(y = \mathtt{*this}\).

  @param[in]      x  is the vector to be added to \f$\mathtt{*this}\f$.

  On return \f$\mathtt{*this} = \mathtt{*this} + x\f$.

  ---

Implemented in ROL::ROL::PartitionedVector< Real >, and ROL::ROL::Vector_SimOpt< Real >.

Referenced by ROL::ROL::NonlinearLeastSquaresObjective< Real >::hessVec(), and ROL::ROL::LinearConstraint< Real >::value().

◆ scale()

◆ dot()

template<class Real>
virtual Real ROL::ROL::Vector< Real >::dot ( const Vector< Real > & x) const
pure virtual

Compute \( \langle y,x \rangle \) where \(y = \mathtt{*this}\).

  @param[in]      x  is the vector that forms the dot product with \f$\mathtt{*this}\f$.
  @return         The number equal to \f$\langle \mathtt{*this}, x \rangle\f$.

  ---

Implemented in ROL::ROL::PartitionedVector< Real >, and ROL::ROL::Vector_SimOpt< Real >.

Referenced by ROL::DyadicOperator< Real >::apply(), ROL::ROL::Objective< Real >::gradient(), ROL::ROL::Constraint< Real >::solveAugmentedSystem(), and ROL::ROL::Objective_FSsolver< Real >::value().

◆ norm()

template<class Real>
virtual Real ROL::ROL::Vector< Real >::norm ( ) const
pure virtual

Returns \( \| y \| \) where \(y = \mathtt{*this}\).

  @return         A nonnegative number equal to the norm of \f$\mathtt{*this}\f$.

  ---

Implemented in H1VectorDual< Real >, H1VectorDual< Real >, H1VectorDual< Real >, H1VectorDual< RealT >, H1VectorDual< RealT >, H1VectorDual< RealT >, H1VectorPrimal< Real >, H1VectorPrimal< Real >, H1VectorPrimal< Real >, H1VectorPrimal< RealT >, H1VectorPrimal< RealT >, H1VectorPrimal< RealT >, L2VectorDual< Real >, L2VectorDual< Real >, L2VectorDual< Real >, L2VectorDual< RealT >, L2VectorDual< RealT >, L2VectorDual< RealT >, L2VectorPrimal< Real >, L2VectorPrimal< Real >, L2VectorPrimal< Real >, L2VectorPrimal< RealT >, L2VectorPrimal< RealT >, L2VectorPrimal< RealT >, ROL::ElementwiseVector< Real >, ROL::PartitionedVector< Real >, ROL::ProfiledVector< Ordinal, Real >, ROL::RiskVector< Real >, ROL::ROL::PartitionedVector< Real >, ROL::ROL::Vector_SimOpt< Real >, ROL::SimulatedVector< Real >, ROL::SingletonVector< Real >, ROL::size_type< Real >, ROL::SROMVector< Real >, ROL::StdArray< Real, array_size, pool_size >, ROL::StdVector< Real, Element >, and ROL::Vector_SimOpt< Real >.

Referenced by ROL::ROL::Constraint< Real >::applyAdjointHessian(), ROL::ROL::Constraint< Real >::applyAdjointJacobian(), ROL::ROL::Constraint< Real >::applyJacobian(), ROL::Constraint_TimeSimOpt< Real >::checkInverseAdjointJacobian_1_new(), ROL::Constraint_TimeSimOpt< Real >::checkInverseJacobian_1_new(), ROL::ROL::Objective< Real >::hessVec(), and ROL::ROL::Objective< Real >::proxJacVec().

◆ clone()

template<class Real>
virtual ROL::Ptr< Vector > ROL::ROL::Vector< Real >::clone ( ) const
pure virtual

Clone to make a new (uninitialized) vector.

  @return         A reference-counted pointer to the cloned vector.

  Provides the means of allocating temporary memory in ROL.

  ---             

Implemented in H1VectorDual< Real >, H1VectorDual< Real >, H1VectorDual< Real >, H1VectorDual< Real >, H1VectorDual< Real >, H1VectorDual< RealT >, H1VectorDual< RealT >, H1VectorDual< RealT >, H1VectorDual< RealT >, H1VectorDual< RealT >, H1VectorPrimal< Real >, H1VectorPrimal< Real >, H1VectorPrimal< Real >, H1VectorPrimal< Real >, H1VectorPrimal< Real >, H1VectorPrimal< RealT >, H1VectorPrimal< RealT >, H1VectorPrimal< RealT >, H1VectorPrimal< RealT >, H1VectorPrimal< RealT >, L2VectorDual< Real >, L2VectorDual< Real >, L2VectorDual< Real >, L2VectorDual< Real >, L2VectorDual< Real >, L2VectorDual< RealT >, L2VectorDual< RealT >, L2VectorDual< RealT >, L2VectorDual< RealT >, L2VectorDual< RealT >, L2VectorPrimal< Real >, L2VectorPrimal< Real >, L2VectorPrimal< Real >, L2VectorPrimal< Real >, L2VectorPrimal< Real >, L2VectorPrimal< RealT >, L2VectorPrimal< RealT >, L2VectorPrimal< RealT >, L2VectorPrimal< RealT >, L2VectorPrimal< RealT >, ROL::BatchStdVector< Real >, ROL::DualAtomVector< Real >, ROL::DualProbabilityVector< Real >, ROL::DualScaledStdVector< Real, Element >, ROL::DualScaledStdVector< Real >, ROL::DualSimulatedVector< Real >, ROL::PartitionedVector< Real >, ROL::PrimalAtomVector< Real >, ROL::PrimalProbabilityVector< Real >, ROL::PrimalScaledStdVector< Real, Element >, ROL::PrimalScaledStdVector< Real >, ROL::PrimalSimulatedVector< Real >, ROL::ProbabilityVector< Real >, ROL::ProfiledVector< Ordinal, Real >, ROL::RieszDualVector< Real >, ROL::RieszPrimalVector< Real >, ROL::RiskVector< Real >, ROL::ROL::PartitionedVector< Real >, ROL::ROL::Vector_SimOpt< Real >, ROL::SimulatedVector< Real >, ROL::SingletonVector< Real >, ROL::size_type< Real >, ROL::SROMVector< Real >, ROL::StdArray< Real, array_size, pool_size >, ROL::StdVector< Real, Element >, and ROL::Vector_SimOpt< Real >.

Referenced by ROL::ROL::AffineTransformConstraint< Real >::AffineTransformConstraint(), ROL::ROL::AffineTransformObjective< Real >::AffineTransformObjective(), ROL::ROL::VectorController< Real, Key >::allocate(), ROL::ROL::Constraint< Real >::applyAdjointHessian(), ROL::ROL::Constraint< Real >::applyAdjointJacobian(), ROL::ConstraintFromObjective< Real >::applyJacobian(), ROL::ROL::Constraint< Real >::applyJacobian(), ROL::ROL::Constraint< Real >::checkAdjointConsistencyJacobian(), ROL::ROL::Constraint< Real >::checkApplyAdjointHessian(), ROL::ROL::Constraint< Real >::checkApplyAdjointJacobian(), ROL::ROL::Constraint< Real >::checkApplyJacobian(), ROL::ROL::Objective< Real >::checkGradient(), ROL::ROL::Objective< Real >::checkHessSym(), ROL::ROL::Objective< Real >::checkHessVec(), ROL::ROL::Objective< Real >::checkProxJacVec(), ROL::details::VectorWorkspace< Real >::VectorStack::clone(), ROL::computeDenseHessian(), ROL::computeScaledDenseHessian(), ROL::ROL::Objective< Real >::dirDeriv(), ROL::ElementwiseVector< Real >::dot(), ROL::ROL::VectorController< Real, Key >::get(), ROL::ROL::Objective< Real >::gradient(), ROL::ROL::Objective< Real >::hessVec(), ROL::CompositeObjective< Real >::initialize(), ROL::IterationScaling< Real >::initialize(), ROL::MoreauYosidaPenalty< Real >::initialize(), ROL::ROL::NonlinearLeastSquaresObjective< Real >::NonlinearLeastSquaresObjective(), ROL::ROL::Objective< Real >::proxJacVec(), ROL::ROL::VectorController< Real, Key >::set(), and ROL::ROL::Constraint< Real >::solveAugmentedSystem().

◆ axpy()

template<class Real>
virtual void ROL::ROL::Vector< Real >::axpy ( const Real alpha,
const Vector< Real > & x )
inlinevirtual

Compute \(y \leftarrow \alpha x + y\) where \(y = \mathtt{*this}\).

  @param[in]      alpha is the scaling of @b x.
  @param[in]      x     is a vector.

  On return \f$\mathtt{*this} = \mathtt{*this} + \alpha x \f$.
  Uses #clone, #set, #scale and #plus for the computation.
  Please overload if a more efficient implementation is needed.

  ---

Reimplemented in ROL::ROL::PartitionedVector< Real >, and ROL::ROL::Vector_SimOpt< Real >.

Definition at line 119 of file ROL_Constraint_SerialSimOpt.hpp.

Referenced by ROL::ROL::Constraint< Real >::applyAdjointHessian(), ROL::ROL::Constraint< Real >::applyAdjointJacobian(), ROL::ROL::Constraint< Real >::applyJacobian(), ROL::ROL::Objective< Real >::gradient(), ROL::ROL::Objective< Real >::hessVec(), and ROL::ROL::Objective< Real >::proxJacVec().

◆ zero()

◆ basis()

template<class Real>
virtual ROL::Ptr< Vector > ROL::ROL::Vector< Real >::basis ( const int i) const
inlinevirtual

◆ dimension()

◆ set()

template<class Real>
virtual void ROL::ROL::Vector< Real >::set ( const Vector< Real > & x)
inlinevirtual

Set \(y \leftarrow x\) where \(y = \mathtt{*this}\).

  @param[in]      x     is a vector.

  On return \f$\mathtt{*this} = x\f$.
  Uses #zero and #plus methods for the computation.
  Please overload if a more efficient implementation is needed.

  ---

Reimplemented in ROL::ROL::PartitionedVector< Real >.

Definition at line 175 of file ROL_Constraint_SerialSimOpt.hpp.

Referenced by ROL::DyadicOperator< Real >::apply(), ROL::Constraint_SimOpt< Real >::applyPreconditioner(), ROL::ROL::VectorController< Real, Key >::get(), ROL::ROL::Objective_FSsolver< Real >::gradient(), ROL::ROL::Objective_FSsolver< Real >::hessVec(), and ROL::ROL::Constraint< Real >::solveAugmentedSystem().

◆ dual()

template<class Real>
virtual const Vector & ROL::ROL::Vector< Real >::dual ( void ) const
inlinevirtual

Return dual representation of \(\mathtt{*this}\), for example, the result of applying a Riesz map, or change of basis, or change of memory layout.

Returns
A const reference to dual representation.

By default, returns the current object. Please overload if you need a dual representation.


Reimplemented in H1VectorDual< Real >, H1VectorDual< Real >, H1VectorDual< Real >, H1VectorDual< Real >, H1VectorDual< Real >, H1VectorDual< RealT >, H1VectorDual< RealT >, H1VectorDual< RealT >, H1VectorDual< RealT >, H1VectorDual< RealT >, H1VectorPrimal< Real >, H1VectorPrimal< Real >, H1VectorPrimal< Real >, H1VectorPrimal< Real >, H1VectorPrimal< Real >, H1VectorPrimal< RealT >, H1VectorPrimal< RealT >, H1VectorPrimal< RealT >, H1VectorPrimal< RealT >, H1VectorPrimal< RealT >, L2VectorDual< Real >, L2VectorDual< Real >, L2VectorDual< Real >, L2VectorDual< Real >, L2VectorDual< Real >, L2VectorDual< RealT >, L2VectorDual< RealT >, L2VectorDual< RealT >, L2VectorDual< RealT >, L2VectorDual< RealT >, L2VectorPrimal< Real >, L2VectorPrimal< Real >, L2VectorPrimal< Real >, L2VectorPrimal< Real >, L2VectorPrimal< Real >, L2VectorPrimal< RealT >, L2VectorPrimal< RealT >, L2VectorPrimal< RealT >, L2VectorPrimal< RealT >, L2VectorPrimal< RealT >, ROL::DualAtomVector< Real >, ROL::DualProbabilityVector< Real >, ROL::DualScaledStdVector< Real, Element >, ROL::DualScaledStdVector< Real >, ROL::DualSimulatedVector< Real >, ROL::PartitionedVector< Real >, ROL::PrimalAtomVector< Real >, ROL::PrimalProbabilityVector< Real >, ROL::PrimalScaledStdVector< Real, Element >, ROL::PrimalScaledStdVector< Real >, ROL::PrimalSimulatedVector< Real >, ROL::ProfiledVector< Ordinal, Real >, ROL::RieszDualVector< Real >, ROL::RieszPrimalVector< Real >, ROL::RiskVector< Real >, ROL::ROL::PartitionedVector< Real >, ROL::ROL::Vector_SimOpt< Real >, ROL::SimulatedVector< Real >, ROL::size_type< Real >, ROL::SROMVector< Real >, and ROL::Vector_SimOpt< Real >.

Definition at line 192 of file ROL_Constraint_SerialSimOpt.hpp.

Referenced by ROL::ROL::AffineTransformConstraint< Real >::AffineTransformConstraint(), ROL::ROL::AffineTransformObjective< Real >::AffineTransformObjective(), ROL::ROL::Constraint< Real >::applyAdjointJacobian(), ROL::ROL::Objective< Real >::dirDeriv(), ROL::ROL::Objective_FSsolver< Real >::gradient(), ROL::ROL::Objective_FSsolver< Real >::hessVec(), ROL::MoreauYosidaPenalty< Real >::initialize(), main(), ROL::ROL::NonlinearLeastSquaresObjective< Real >::NonlinearLeastSquaresObjective(), and ROL::ROL::NonlinearLeastSquaresObjective< Real >::precond().

◆ apply()

template<class Real>
virtual Real ROL::ROL::Vector< Real >::apply ( const Vector< Real > & x) const
inlinevirtual

Apply \(\mathtt{*this}\) to a dual vector. This is equivalent to the call \(\mathtt{this->dot(x.dual())}\).

Parameters
[in]xis a vector
Returns
The number equal to \(\langle \mathtt{*this}, x \rangle\).

Reimplemented in ROL::ROL::PartitionedVector< Real >, and ROL::ROL::Vector_SimOpt< Real >.

Definition at line 204 of file ROL_Constraint_SerialSimOpt.hpp.

Referenced by ROL::ROL::Constraint< Real >::checkAdjointConsistencyJacobian(), ROL::ROL::Objective< Real >::checkGradient(), ROL::ROL::Objective< Real >::checkHessSym(), and ROL::ROL::Objective< Real >::dirDeriv().

◆ applyUnary()

◆ applyBinary()

template<class Real>
virtual void ROL::ROL::Vector< Real >::applyBinary ( const Elementwise::BinaryFunction< Real > & f,
const Vector< Real > & x )
inlinevirtual

◆ reduce()

◆ print()

◆ setScalar()

template<class Real>
virtual void ROL::ROL::Vector< Real >::setScalar ( const Real C)
inlinevirtual

Set \(y \leftarrow C\) where \(C\in\mathbb{R}\).

  @param[in]      C     is a scalar.

  On return \f$\mathtt{*this} = C\f$.
  Uses #applyUnary methods for the computation.
  Please overload if a more efficient implementation is needed.

  ---

Reimplemented in ROL::PartitionedVector< Real >, ROL::ProfiledVector< Ordinal, Real >, ROL::RieszDualVector< Real >, ROL::RieszPrimalVector< Real >, ROL::RiskVector< Real >, ROL::ROL::PartitionedVector< Real >, ROL::ROL::Vector_SimOpt< Real >, ROL::SimulatedVector< Real >, ROL::SingletonVector< Real >, ROL::size_type< Real >, ROL::StdArray< Real, array_size, pool_size >, ROL::StdVector< Real, Element >, and ROL::Vector_SimOpt< Real >.

Definition at line 241 of file ROL_Constraint_SerialSimOpt.hpp.

◆ randomize()

template<class Real>
virtual void ROL::ROL::Vector< Real >::randomize ( const Real l = 0.0,
const Real u = 1.0 )
inlinevirtual

Set vector to be uniform random between [l,u].

  @param[in]      l     is a the lower bound.
  @param[in]      u     is a the upper bound.

  On return the components of \f$\mathtt{*this}\f$ are uniform
  random numbers on the interval \f$[l,u]\f$.
        The default implementation uses #applyUnary methods for the
        computation. Please overload if a more efficient implementation is
  needed.

  ---

Reimplemented in ROL::PartitionedVector< Real >, ROL::ProfiledVector< Ordinal, Real >, ROL::RieszDualVector< Real >, ROL::RieszPrimalVector< Real >, ROL::RiskVector< Real >, ROL::ROL::PartitionedVector< Real >, ROL::ROL::Vector_SimOpt< Real >, ROL::SimulatedVector< Real >, ROL::SingletonVector< Real >, ROL::size_type< Real >, ROL::StdArray< Real, array_size, pool_size >, ROL::StdVector< Real, Element >, and ROL::Vector_SimOpt< Real >.

Definition at line 258 of file ROL_Constraint_SerialSimOpt.hpp.

◆ checkVector()

template<class Real>
virtual std::vector< Real > ROL::ROL::Vector< Real >::checkVector ( const Vector< Real > & x,
const Vector< Real > & y,
const bool printToStream = true,
std::ostream & outStream = std::cout ) const
inlinevirtual

Verify vector-space methods.

  @param[in]      x     is a vector.
  @param[in]      y     is a vector.

  Returns a vector of Reals, all of which should be close to zero.
  They represent consistency errors in the vector space properties,
  as follows:

  - Commutativity of addition: \f$\mathtt{*this} + x = x + \mathtt{*this}\f$.
  - Associativity of addition: \f$\mathtt{*this} + (x + y) = (\mathtt{*this} + x) + y\f$.
  - Identity element of addition: \f$0 + x = x\f$.
  - Inverse elements of addition: \f$\mathtt{*this} + (- \mathtt{*this}) = 0\f$.
  - Identity element of scalar multiplication: \f$ 1 \cdot \mathtt{*this} = \mathtt{*this} \f$.
  - Consistency of scalar multiplication with field multiplication: \f$a (b \cdot \mathtt{*this}) = (a b) \cdot \mathtt{*this}\f$.
  - Distributivity of scalar multiplication with respect to field addition: \f$(a+b) \cdot \mathtt{*this} = a \cdot \mathtt{*this} + b \cdot \mathtt{*this}\f$.
  - Distributivity of scalar multiplication with respect to vector addition: \f$a \cdot (\mathtt{*this} + x) = a \cdot \mathtt{*this} + a \cdot x\f$.
  - Commutativity of dot (inner) product over the field of reals: \f$(\mathtt{*this}, x)  = (x, \mathtt{*this})\f$.
  - Additivity of dot (inner) product: \f$(\mathtt{*this}, x+y)  = (\mathtt{*this}, x) + (\mathtt{*this}, y)\f$.
  - Consistency of scalar multiplication and norm: \f$\|{\mathtt{*this}} / {\|\mathtt{*this}\|} \| = 1\f$.
  - Reflexivity: \f$\mbox{dual}(\mbox{dual}(\mathtt{*this})) = \mathtt{*this}\f$ .
  - Consistency of apply and dual: \f$\langle \mathtt{*this}, x\rangle = (\mbox{dual}(\mathtt{*this}),x) = (\mathtt{*this},\mbox{dual}(x))\f$.

  The consistency errors are defined as the norms or absolute values of the differences between the left-hand
  side and the right-hand side terms in the above equalities.

  ---

Definition at line 291 of file ROL_Constraint_SerialSimOpt.hpp.

Referenced by main().


The documentation for this class was generated from the following file: