Teuchos Package Browser (Single Doxygen Collection) Version of the Day
|
This class creates and provides basic support for dense vectors of templated type as a specialization of Teuchos::SerialDenseMatrix. Additional methods for the SerialDenseVector class, like mathematical methods, can be found documented in SerialDenseMatrix. More...
#include <Teuchos_SerialDenseVector.hpp>
Constructor/Destructor methods. | |
SerialDenseVector () | |
Default Constructor. | |
SerialDenseVector (OrdinalType length, bool zeroOut=true) | |
Shaped Constructor. | |
SerialDenseVector (DataAccess CV, ScalarType *values, OrdinalType length) | |
Shaped Constructor with Values. | |
SerialDenseVector (const SerialDenseVector< OrdinalType, ScalarType > &Source) | |
Copy Constructor. | |
SerialDenseVector (DataAccess CV, const SerialDenseVector< OrdinalType, ScalarType > &Source) | |
Copy Constructor. | |
virtual | ~SerialDenseVector () |
Destructor. | |
Sizing methods. | |
int | size (OrdinalType length_in) |
Size method for changing the size of a SerialDenseVector, initializing entries to zero. | |
int | sizeUninitialized (OrdinalType length_in) |
Same as size() except leaves values uninitialized. | |
int | resize (OrdinalType length_in) |
Resizing method for changing the size of a SerialDenseVector, keeping the entries. | |
Set methods. | |
SerialDenseVector< OrdinalType, ScalarType > & | operator= (const ScalarType value) |
Set all values in the matrix to a constant value. | |
SerialDenseVector< OrdinalType, ScalarType > & | operator= (const SerialDenseVector< OrdinalType, ScalarType > &Source) |
Copies values from one vector to another. | |
Comparison methods. | |
bool | operator== (const SerialDenseVector< OrdinalType, ScalarType > &Operand) const |
Equality of two matrices. | |
bool | operator!= (const SerialDenseVector< OrdinalType, ScalarType > &Operand) const |
Inequality of two matrices. | |
Accessor methods. | |
ScalarType & | operator() (OrdinalType index) |
Element access method (non-const). | |
const ScalarType & | operator() (OrdinalType index) const |
Element access method (const). | |
ScalarType & | operator[] (OrdinalType index) |
Element access method (non-const). | |
const ScalarType & | operator[] (OrdinalType index) const |
Element access method (const). | |
Mathematical methods. | |
ScalarType | dot (const SerialDenseVector< OrdinalType, ScalarType > &x) const |
Compute the dot product of this vector and x . | |
Attribute methods. | |
OrdinalType | length () const |
Returns the length of this vector. | |
I/O methods. | |
std::ostream & | print (std::ostream &os) const |
Print method. Define the behavior of the std::ostream << operator inherited from the Object class. | |
This class creates and provides basic support for dense vectors of templated type as a specialization of Teuchos::SerialDenseMatrix. Additional methods for the SerialDenseVector class, like mathematical methods, can be found documented in SerialDenseMatrix.
Definition at line 60 of file Teuchos_SerialDenseVector.hpp.
Teuchos::SerialDenseVector< OrdinalType, ScalarType >::SerialDenseVector | ( | ) |
Default Constructor.
Creates an empty vector of no length. The Sizing methods should be used to size this matrix. Values of this matrix should be set using the [] or the () operators.
Definition at line 218 of file Teuchos_SerialDenseVector.hpp.
Teuchos::SerialDenseVector< OrdinalType, ScalarType >::SerialDenseVector | ( | OrdinalType | length, |
bool | zeroOut = true ) |
Shaped Constructor.
length | - Number of elements in this vector. |
zeroOut | - Initializes values to 0 if true (default) |
Creates a shaped vector of length length
. All values are initialized to 0 when zeroOut
is true. Values of this matrix should be set using the [] or the () operators.
Definition at line 221 of file Teuchos_SerialDenseVector.hpp.
Teuchos::SerialDenseVector< OrdinalType, ScalarType >::SerialDenseVector | ( | DataAccess | CV, |
ScalarType * | values, | ||
OrdinalType | length ) |
Shaped Constructor with Values.
CV | - Enumerated type set to Teuchos::Copy or Teuchos::View. |
values | - Pointer to an array of ScalarType of the given length . |
length | - Length of vector to be constructed. |
Definition at line 224 of file Teuchos_SerialDenseVector.hpp.
Teuchos::SerialDenseVector< OrdinalType, ScalarType >::SerialDenseVector | ( | const SerialDenseVector< OrdinalType, ScalarType > & | Source | ) |
Copy Constructor.
Definition at line 228 of file Teuchos_SerialDenseVector.hpp.
Teuchos::SerialDenseVector< OrdinalType, ScalarType >::SerialDenseVector | ( | DataAccess | CV, |
const SerialDenseVector< OrdinalType, ScalarType > & | Source ) |
Copy Constructor.
Source
is made with this copy constructor. Definition at line 232 of file Teuchos_SerialDenseVector.hpp.
|
virtual |
Destructor.
Definition at line 236 of file Teuchos_SerialDenseVector.hpp.
|
inline |
Size method for changing the size of a SerialDenseVector, initializing entries to zero.
length | - The length of the new vector. |
This allows the user to define the length of a SerialDenseVector at any point. This method can be called at any point after construction. Any values previously in this object will be destroyed and the resized vector starts with all zero values.
Definition at line 112 of file Teuchos_SerialDenseVector.hpp.
|
inline |
Same as size()
except leaves values uninitialized.
Definition at line 116 of file Teuchos_SerialDenseVector.hpp.
|
inline |
Resizing method for changing the size of a SerialDenseVector, keeping the entries.
length | - The length of the new vector. This allows the user to redefine the length of a SerialDenseVector at any point. This method can be called at any point after construction. Any values previously in this object will be copied to the resized vector. |
Definition at line 126 of file Teuchos_SerialDenseVector.hpp.
|
inline |
Set all values in the matrix to a constant value.
value | - Value to use; |
Definition at line 137 of file Teuchos_SerialDenseVector.hpp.
bool Teuchos::SerialDenseVector< OrdinalType, ScalarType >::operator== | ( | const SerialDenseVector< OrdinalType, ScalarType > & | Operand | ) | const |
Equality of two matrices.
Operand
are of the same length and have the same entries, else False will be returned. Definition at line 246 of file Teuchos_SerialDenseVector.hpp.
bool Teuchos::SerialDenseVector< OrdinalType, ScalarType >::operator!= | ( | const SerialDenseVector< OrdinalType, ScalarType > & | Operand | ) | const |
Inequality of two matrices.
Operand
are not of the same length or do not have the same entries, else False will be returned. Definition at line 267 of file Teuchos_SerialDenseVector.hpp.
SerialDenseVector< OrdinalType, ScalarType > & Teuchos::SerialDenseVector< OrdinalType, ScalarType >::operator= | ( | const SerialDenseVector< OrdinalType, ScalarType > & | Source | ) |
Copies values from one vector to another.
The operator= copies the values from one existing SerialDenseVector to another. If Source
is a view (i.e. CV = Teuchos::View), then this method will return a view. Otherwise, it will return a copy of Source
. this will be resized if it is not large enough to copy Source
into.
Definition at line 239 of file Teuchos_SerialDenseVector.hpp.
|
inline |
Element access method (non-const).
Returns the ith element if x(i) is specified, the expression x[i] will return the same element.
index
will only be checked if Teuchos is configured with –enable-teuchos-abc. Definition at line 308 of file Teuchos_SerialDenseVector.hpp.
|
inline |
Element access method (const).
Returns the ith element if x(i) is specified, the expression x[i] will return the same element.
index
will only be checked if Teuchos is configured with –enable-teuchos-abc. Definition at line 317 of file Teuchos_SerialDenseVector.hpp.
|
inline |
Element access method (non-const).
Returns the ith element if x[i] is specified, the expression x(i) will return the same element.
index
will only be checked if Teuchos is configured with –enable-teuchos-abc. Definition at line 335 of file Teuchos_SerialDenseVector.hpp.
|
inline |
Element access method (const).
Returns the ith element if x[i] is specified, the expression x(i) will return the same element.
index
will only be checked if Teuchos is configured with –enable-teuchos-abc. Definition at line 326 of file Teuchos_SerialDenseVector.hpp.
ScalarType Teuchos::SerialDenseVector< OrdinalType, ScalarType >::dot | ( | const SerialDenseVector< OrdinalType, ScalarType > & | x | ) | const |
Compute the dot product of this
vector and x
.
Definition at line 273 of file Teuchos_SerialDenseVector.hpp.
|
inline |
Returns the length of this vector.
Definition at line 207 of file Teuchos_SerialDenseVector.hpp.
|
virtual |
Print method. Define the behavior of the std::ostream << operator inherited from the Object class.
Reimplemented from Teuchos::SerialDenseMatrix< OrdinalType, ScalarType >.
Definition at line 284 of file Teuchos_SerialDenseVector.hpp.