# Thyra::Vector< Scalar > Class Template Reference [Development of linear Abstract Numerical Algorithms (ANAs)]

Read-write handle class for wrapping `Thyra::VectorBase` objects and allowing for operator-overloading linear algebra. More...

`#include <Thyra_VectorDecl.hpp>`

Inheritance diagram for Thyra::Vector< Scalar >:

[legend]
List of all members.

## Product std::vector operations

void setBlock (int i, const ConstVector< Scalar > &v)
set block
void setBlock (int i, const Vector< Scalar > &v)
set block
Vector< Scalar > getBlock (int i)
get modifiable block

## Public Member Functions

Vector (const VectorSpace< Scalar > &space)
Construct from a std::vector space .
template<class Node1, class Node2>
Vector (const Thyra::LC2< Scalar, Node1, Node2 > &x)
Construct a std::vector from a 2-term LC.
template<class Node>
Vector (const Thyra::OpTimesLC< Scalar, Node > &x)
Construct a std::vector from an operator times a linear combination.
template<class Node1, class Node2>
Vectoroperator= (const Thyra::LC2< Scalar, Node1, Node2 > &x)
Assign a linear combination of vectors to this std::vector.
template<class Node1, class Node2>
Vectoroperator+= (const Thyra::LC2< Scalar, Node1, Node2 > &x)
Add and assign a linear combination of vectors to this std::vector.
template<class Node>
Vectoroperator= (const Thyra::OpTimesLC< Scalar, Node > &x)
Assign a scaled linear combination to this std::vector.
template<class Node>
Vectoroperator+= (const Thyra::OpTimesLC< Scalar, Node > &x)
Add and assign a scaled linear combination to this std::vector.
Vector< Scalar > & acceptCopyOf (const ConstVector< Scalar > &x)
Scalar operator[] (Index globalIndex) const

IndexObject operator[] (Index globalIndex)
Index operator that allows changes to the element.

## Related Functions

(Note that these are not member functions.)

OpTimesLC< Scalar, Thyra::ConstVector<
Scalar > >
operator * (const Scalar &alpha, const Thyra::ConstVector< Scalar > &x)
Overloaded multiplication operator for scalar times std::vector.
OpTimesLC< Scalar, Thyra::ConstVector<
Scalar > >
operator * (const Thyra::ConstVector< Scalar > &x, const Scalar &alpha)
Overloaded multiplication operator for scalar times std::vector.
Thyra::Vector< Scalar > formVector (const Thyra::Vector< Scalar > &x)
Form a Vector from this object.
Vector< Scalar > dotStar (const Converter< Scalar, ConstVector< Scalar > > &x, const Converter< Scalar, ConstVector< Scalar > > &y)
return[i] = x[i] * y[i].
Vector< Scalar > dotSlash (const Converter< Scalar, ConstVector< Scalar > > &x, const Converter< Scalar, ConstVector< Scalar > > &y)
return[i] = x[i] / y[i].
Scalar maxloc (const Converter< Scalar, ConstVector< Scalar > > &x, Index &index)
Return the max of a vector and its location.
Scalar minloc (const Converter< Scalar, ConstVector< Scalar > > &x, Index &index)
Return the min of a vector and its location.
Scalar minloc (const Converter< Scalar, ConstVector< Scalar > > &x, const Scalar &bound, Index &index)
Return the minimum element and its location (lowest index).
Scalar maxloc (const Converter< Scalar, ConstVector< Scalar > > &x, const Scalar &bound, Index &index)
Return the maxium element and its location (lowest index).
void scaleInto (const Converter< Scalar, ConstVector< Scalar > > &x, const Scalar &alpha, Vector< Scalar > &result)
result = alpha*x.
void scale (Vector< Scalar > &x, const Scalar &alpha)
x = alpha*x.
void axpy (const Scalar &alpha, const Converter< Scalar, ConstVector< Scalar > > &x, Vector< Scalar > &y)
y = alpha*x + y.

## Classes

class  IndexObject
Allows an element to be changed using `operator=()`. More...

## Detailed Description

### template<class Scalar> class Thyra::Vector< Scalar >

Read-write handle class for wrapping `Thyra::VectorBase` objects and allowing for operator-overloading linear algebra.
Examples:

Definition at line 201 of file Thyra_VectorDecl.hpp.

## Constructor & Destructor Documentation

template<class Scalar>
 Thyra::Vector< Scalar >::Vector ( const VectorSpace< Scalar > & space ) ` [inline]`

Construct from a std::vector space .

Definition at line 85 of file Thyra_VectorImpl.hpp.

template<class Scalar>
template<class Node1, class Node2>
 Thyra::Vector< Scalar >::Vector ( const Thyra::LC2< Scalar, Node1, Node2 > & x ) ` [inline]`

Construct a std::vector from a 2-term LC.

Definition at line 595 of file Thyra_LinearCombinationImpl.hpp.

template<class Scalar>
template<class Node>
 Thyra::Vector< Scalar >::Vector ( const Thyra::OpTimesLC< Scalar, Node > & x ) ` [inline]`

Construct a std::vector from an operator times a linear combination.

Definition at line 604 of file Thyra_LinearCombinationImpl.hpp.

## Member Function Documentation

template<class Scalar>
template<class Node1, class Node2>
 Thyra::Vector< Scalar > & Thyra::Vector< Scalar >::operator= ( const Thyra::LC2< Scalar, Node1, Node2 > & x ) ` [inline]`

Assign a linear combination of vectors to this std::vector.

Definition at line 547 of file Thyra_LinearCombinationImpl.hpp.

template<class Scalar>
template<class Node1, class Node2>
 Thyra::Vector< Scalar > & Thyra::Vector< Scalar >::operator+= ( const Thyra::LC2< Scalar, Node1, Node2 > & x ) ` [inline]`

Add and assign a linear combination of vectors to this std::vector.

Definition at line 568 of file Thyra_LinearCombinationImpl.hpp.

template<class Scalar>
template<class Node>
 Thyra::Vector< Scalar > & Thyra::Vector< Scalar >::operator= ( const Thyra::OpTimesLC< Scalar, Node > & x ) ` [inline]`

Assign a scaled linear combination to this std::vector.

Definition at line 517 of file Thyra_LinearCombinationImpl.hpp.

template<class Scalar>
template<class Node>
 Thyra::Vector< Scalar > & Thyra::Vector< Scalar >::operator+= ( const Thyra::OpTimesLC< Scalar, Node > & x ) ` [inline]`

Add and assign a scaled linear combination to this std::vector.

Definition at line 538 of file Thyra_LinearCombinationImpl.hpp.

template<class Scalar>
 Vector< Scalar > & Thyra::Vector< Scalar >::acceptCopyOf ( const ConstVector< Scalar > & x ) ` [inline]`

Write the contents of another std::vector into this std::vector

Definition at line 91 of file Thyra_VectorImpl.hpp.

template<class Scalar>
 Scalar Thyra::Vector< Scalar >::operator[] ( Index globalIndex ) const` [inline, virtual]`

Reimplemented from Thyra::ConstVector< Scalar >.

Definition at line 287 of file Thyra_VectorDecl.hpp.

template<class Scalar>
 IndexObject Thyra::Vector< Scalar >::operator[] ( Index globalIndex ) ` [inline]`

Index operator that allows changes to the element.

Note: The object returned is of type `IndexObject` which allows for the customary operations to be performed.

Definition at line 297 of file Thyra_VectorDecl.hpp.

template<class Scalar>
 void Thyra::Vector< Scalar >::setBlock ( int i, const ConstVector< Scalar > & v ) ` [inline]`

set block

Definition at line 170 of file Thyra_VectorImpl.hpp.

template<class Scalar>
 void Thyra::Vector< Scalar >::setBlock ( int i, const Vector< Scalar > & v ) ` [inline]`

set block

Definition at line 182 of file Thyra_VectorImpl.hpp.

template<class Scalar>
 Vector< Scalar > Thyra::Vector< Scalar >::getBlock ( int i ) ` [inline]`

get modifiable block

Definition at line 153 of file Thyra_VectorImpl.hpp.

## Friends And Related Function Documentation

template<class Scalar>
 OpTimesLC< Scalar, Thyra::ConstVector< Scalar > > operator * ( const Scalar & alpha, const Thyra::ConstVector< Scalar > & x ) ` [related]`

Overloaded multiplication operator for scalar times std::vector.

Definition at line 172 of file Thyra_LinearCombinationImpl.hpp.

template<class Scalar>
 OpTimesLC< Scalar, Thyra::ConstVector< Scalar > > operator * ( const Thyra::ConstVector< Scalar > & x, const Scalar & alpha ) ` [related]`

Overloaded multiplication operator for scalar times std::vector.

Definition at line 184 of file Thyra_LinearCombinationImpl.hpp.

template<class Scalar>
 Thyra::Vector< Scalar > formVector ( const Thyra::Vector< Scalar > & x ) ` [related]`

Form a Vector from this object.

For Vector, the operation is simply a pass-through.

Definition at line 326 of file Thyra_VectorDecl.hpp.

template<class Scalar>
 Vector< Scalar > dotStar ( const Converter< Scalar, ConstVector< Scalar > > & x, const Converter< Scalar, ConstVector< Scalar > > & y ) ` [related]`

return[i] = x[i] * y[i].

Definition at line 124 of file Thyra_VectorHandleOpsImpl.hpp.

template<class Scalar>
 Vector< Scalar > dotSlash ( const Converter< Scalar, ConstVector< Scalar > > & x, const Converter< Scalar, ConstVector< Scalar > > & y ) ` [related]`

return[i] = x[i] / y[i].

Definition at line 145 of file Thyra_VectorHandleOpsImpl.hpp.

template<class Scalar>
 Scalar maxloc ( const Converter< Scalar, ConstVector< Scalar > > & x, Index & index ) ` [related]`

Return the max of a vector and its location.

Definition at line 71 of file Thyra_VectorHandleOpsImpl.hpp.

template<class Scalar>
 Scalar minloc ( const Converter< Scalar, ConstVector< Scalar > > & x, Index & index ) ` [related]`

Return the min of a vector and its location.

Definition at line 81 of file Thyra_VectorHandleOpsImpl.hpp.

template<class Scalar>
 Scalar minloc ( const Converter< Scalar, ConstVector< Scalar > > & x, const Scalar & bound, Index & index ) ` [related]`

Return the minimum element and its location (lowest index).

<Scalar>

Definition at line 91 of file Thyra_VectorHandleOpsImpl.hpp.

template<class Scalar>
 Scalar maxloc ( const Converter< Scalar, ConstVector< Scalar > > & x, const Scalar & bound, Index & index ) ` [related]`

Return the maxium element and its location (lowest index).

Definition at line 102 of file Thyra_VectorHandleOpsImpl.hpp.

template<class Scalar>
 void scaleInto ( const Converter< Scalar, ConstVector< Scalar > > & x, const Scalar & alpha, Vector< Scalar > & result ) ` [related]`

result = alpha*x.

Definition at line 174 of file Thyra_VectorHandleOpsImpl.hpp.

template<class Scalar>
 void scale ( Vector< Scalar > & x, const Scalar & alpha ) ` [related]`

x = alpha*x.

Definition at line 166 of file Thyra_VectorHandleOpsImpl.hpp.

template<class Scalar>
 void axpy ( const Scalar & alpha, const Converter< Scalar, ConstVector< Scalar > > & x, Vector< Scalar > & y ) ` [related]`

y = alpha*x + y.

Definition at line 155 of file Thyra_VectorHandleOpsImpl.hpp.

The documentation for this class was generated from the following files:
Generated on Wed May 12 21:42:34 2010 for Thyra Operator/Vector Support by  1.4.7