38 #ifndef ROL_CARRAY_VECTOR_H 39 #define ROL_CARRAY_VECTOR_H 42 #include "Teuchos_ArrayRCP.hpp" 55 template <
class Real,
class Element=Real>
86 Teuchos::ArrayRCP<Element> xp(ex.
getVector());
87 for(
unsigned int i=0; i<
dim_; ++i) {
95 Teuchos::ArrayRCP<Element> xp(ex.
getVector());
97 for(
unsigned int i=0; i<
dim_; ++i){
98 val += (
array_)[i]*(xp)[i];
105 val = std::sqrt(
dot(*
this) );
110 for(
unsigned int i=0; i<
dim_; ++i) {
119 Teuchos::RCP<Vector<Real> >
clone()
const {
120 return Teuchos::rcp(
new CArrayVector( Teuchos::ArrayRCP<Element>(
dim_) ) );
123 Teuchos::RCP<Vector<Real> >
basis (
const int i )
const {
124 Teuchos::RCP<CArrayVector> e =
126 (e->getVector())[i] = 1.0;
Real dot(const Vector< Real > &x) const
Compute where .
Real norm() const
Returns where .
CArrayVector(unsigned int dim)
Defines the linear algebra or vector space interface.
Teuchos::RCP< Vector< Real > > clone() const
Clone to make a new (uninitialized) vector.
CArrayVector(Element *array, unsigned int dim)
Teuchos::ArrayRCP< Element > getVector()
int dimension() const
Return dimension of the vector space.
Teuchos::ArrayRCP< Element > array_
void scale(const Real alpha)
Compute where .
Teuchos::ArrayRCP< Element > getVector() const
Provides the C array implementation of the ROL::Vector interface for use with NumPy->C Array passing ...
CArrayVector(const Teuchos::ArrayRCP< Element > array)
Teuchos::RCP< Vector< Real > > basis(const int i) const
Return i-th basis vector.
void plus(const Vector< Real > &x)
Compute , where .