queso-0.57.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
QUESO::Vector Class Referenceabstract

Class for vector operations (virtual). More...

#include <Vector.h>

Inheritance diagram for QUESO::Vector:
QUESO::GslVector QUESO::TeuchosVector

Public Member Functions

Constructor/Destructor methods
 Vector (const BaseEnvironment &env, const Map &map)
 Shaped Constructor. More...
 
virtual ~Vector ()
 Virtual Destructor. More...
 
Environment and Map methods
const BaseEnvironmentenv () const
 
const Mapmap () const
 
unsigned int numOfProcsForStorage () const
 
Attribute methods
virtual unsigned int sizeLocal () const =0
 Returns the local size of the vector. More...
 
virtual unsigned int sizeGlobal () const =0
 Returns the global size of the vector. More...
 
Get/Set methods
virtual void cwSet (double value)=0
 Component-wise set the values of the vector to value. More...
 
virtual void cwSetGaussian (double mean, double stdDev)=0
 Component-wise set the values of the vector to a random number from a Gaussian distribution. More...
 
virtual void cwInvert ()=0
 Component-wise invert the values of the vector. More...
 
I/O and Miscellaneous methods
virtual void sort ()=0
 Sort the elements. More...
 
virtual void print (std::ostream &os) const =0
 Print this vector. More...
 
void setPrintHorizontally (bool value) const
 Determines whether vector should be printed horizontally. More...
 
bool getPrintHorizontally () const
 Checks if vector is printed horizontally. More...
 
void setPrintScientific (bool value) const
 Determines whether vector should be printed in Scientific Notation. More...
 
bool getPrintScientific () const
 Checks if the vector should be printed in Scientific Notation. More...
 

Protected Member Functions

virtual void base_copy (const Vector &src)
 Copies base data from vector src to this vector. More...
 

Protected Attributes

const BaseEnvironmentm_env
 Environment variable. More...
 
const Map m_map
 Mapping variable. More...
 
const Mapm_map
 Mapping variable. More...
 
bool m_printHorizontally
 Flag for either or not print this matrix horizontally. More...
 
bool m_printScientific
 Flag for either or not print this matrix in scientific notation. More...
 

Private Member Functions

 Vector ()
 Default Constructor. More...
 

Detailed Description

Class for vector operations (virtual).

Base vector class. The vector class is an abstract class designed to be used as a base class for different vector implementations (all actual vector classes in QUESO).

Definition at line 47 of file Vector.h.

Constructor & Destructor Documentation

QUESO::Vector::Vector ( const BaseEnvironment env,
const Map map 
)

Shaped Constructor.

Definition at line 31 of file Vector.C.

32  :
33  m_env (env),
34  m_map (map),
35  m_printHorizontally(true),
36  m_printScientific (false) // for compatibility with previous regression tests
37 {
38  //std::cout << "Entering Vector::constructor(env,map)" << std::endl;
39 
40  //std::cout << "In Vector::constructor(env,map)" // mox
41  // << ", m_map.NumMyElements() = " << m_map.NumMyElements()
42  // << std::endl;
43 
44  //std::cout << "Leaving Vector::constructor(env,map)" << std::endl;
45 }
bool m_printHorizontally
Flag for either or not print this matrix horizontally.
Definition: Vector.h:130
const BaseEnvironment & m_env
Environment variable.
Definition: Vector.h:117
bool m_printScientific
Flag for either or not print this matrix in scientific notation.
Definition: Vector.h:133
const Map m_map
Mapping variable.
Definition: Vector.h:122
const BaseEnvironment & env() const
Definition: Vector.C:54
const Map & map() const
Definition: Vector.C:61
QUESO::Vector::~Vector ( )
virtual

Virtual Destructor.

Definition at line 48 of file Vector.C.

49 {
50 }
QUESO::Vector::Vector ( )
private

Default Constructor.

Member Function Documentation

void QUESO::Vector::base_copy ( const Vector src)
protectedvirtual

Copies base data from vector src to this vector.

Definition at line 101 of file Vector.C.

References m_printHorizontally, and m_printScientific.

Referenced by QUESO::GslVector::copy(), and QUESO::TeuchosVector::copy().

102 {
103  //m_env = src.env;
104  //m_map = src.map; // prudenci 2010-06-17
105  m_printHorizontally = src.m_printHorizontally;
106  m_printScientific = src.m_printScientific;
107 
108  return;
109 }
bool m_printHorizontally
Flag for either or not print this matrix horizontally.
Definition: Vector.h:130
bool m_printScientific
Flag for either or not print this matrix in scientific notation.
Definition: Vector.h:133
virtual void QUESO::Vector::cwInvert ( )
pure virtual

Component-wise invert the values of the vector.

Implemented in QUESO::TeuchosVector, and QUESO::GslVector.

virtual void QUESO::Vector::cwSet ( double  value)
pure virtual

Component-wise set the values of the vector to value.

Implemented in QUESO::TeuchosVector, and QUESO::GslVector.

virtual void QUESO::Vector::cwSetGaussian ( double  mean,
double  stdDev 
)
pure virtual

Component-wise set the values of the vector to a random number from a Gaussian distribution.

Implemented in QUESO::TeuchosVector, and QUESO::GslVector.

const BaseEnvironment & QUESO::Vector::env ( ) const

Definition at line 54 of file Vector.C.

References m_env.

Referenced by QUESO::matrixProduct().

55 {
56  return m_env;
57 }
const BaseEnvironment & m_env
Environment variable.
Definition: Vector.h:117
bool QUESO::Vector::getPrintHorizontally ( ) const

Checks if vector is printed horizontally.

Definition at line 82 of file Vector.C.

References m_printHorizontally.

Referenced by QUESO::GslVector::subWriteContents(), and QUESO::TeuchosVector::subWriteContents().

83 {
84  return m_printHorizontally;
85 }
bool m_printHorizontally
Flag for either or not print this matrix horizontally.
Definition: Vector.h:130
bool QUESO::Vector::getPrintScientific ( ) const

Checks if the vector should be printed in Scientific Notation.

Definition at line 95 of file Vector.C.

References m_printScientific.

Referenced by QUESO::GslVector::subWriteContents(), and QUESO::TeuchosVector::subWriteContents().

96 {
97  return m_printScientific;
98 }
bool m_printScientific
Flag for either or not print this matrix in scientific notation.
Definition: Vector.h:133
const Map & QUESO::Vector::map ( ) const

Definition at line 61 of file Vector.C.

References m_map.

Referenced by QUESO::GslVector::GslVector(), QUESO::matrixProduct(), and QUESO::TeuchosVector::TeuchosVector().

62 {
63  return m_map;
64 }
const Map m_map
Mapping variable.
Definition: Vector.h:122
unsigned int QUESO::Vector::numOfProcsForStorage ( ) const

Definition at line 68 of file Vector.C.

References QUESO::Map::Comm(), m_map, and QUESO::MpiComm::NumProc().

Referenced by QUESO::GslVector::subReadContents(), QUESO::TeuchosVector::subReadContents(), QUESO::GslVector::subWriteContents(), and QUESO::TeuchosVector::subWriteContents().

69 {
70  return m_map.Comm().NumProc();
71 }
const Map m_map
Mapping variable.
Definition: Vector.h:122
int NumProc() const
Returns total number of processes.
Definition: MpiComm.C:133
const MpiComm & Comm() const
Access function for MpiComm communicator.
Definition: Map.C:131
virtual void QUESO::Vector::print ( std::ostream &  os) const
pure virtual

Print this vector.

Implemented in QUESO::TeuchosVector, and QUESO::GslVector.

void QUESO::Vector::setPrintHorizontally ( bool  value) const

Determines whether vector should be printed horizontally.

Definition at line 75 of file Vector.C.

References m_printHorizontally.

Referenced by QUESO::GslVector::subWriteContents(), and QUESO::TeuchosVector::subWriteContents().

76 {
77  m_printHorizontally = value;
78  return;
79 }
bool m_printHorizontally
Flag for either or not print this matrix horizontally.
Definition: Vector.h:130
void QUESO::Vector::setPrintScientific ( bool  value) const

Determines whether vector should be printed in Scientific Notation.

Definition at line 88 of file Vector.C.

References m_printScientific.

Referenced by QUESO::GslVector::subWriteContents(), and QUESO::TeuchosVector::subWriteContents().

89 {
90  m_printScientific = value;
91  return;
92 }
bool m_printScientific
Flag for either or not print this matrix in scientific notation.
Definition: Vector.h:133
virtual unsigned int QUESO::Vector::sizeGlobal ( ) const
pure virtual

Returns the global size of the vector.

Implemented in QUESO::TeuchosVector, and QUESO::GslVector.

virtual unsigned int QUESO::Vector::sizeLocal ( ) const
pure virtual

Returns the local size of the vector.

Implemented in QUESO::TeuchosVector, and QUESO::GslVector.

virtual void QUESO::Vector::sort ( )
pure virtual

Sort the elements.

Implemented in QUESO::TeuchosVector, and QUESO::GslVector.

Member Data Documentation

const Map& QUESO::Vector::m_map
protected

Mapping variable.

Definition at line 126 of file Vector.h.

bool QUESO::Vector::m_printHorizontally
mutableprotected

Flag for either or not print this matrix horizontally.

Definition at line 130 of file Vector.h.

Referenced by base_copy(), getPrintHorizontally(), QUESO::GslVector::print(), QUESO::TeuchosVector::print(), and setPrintHorizontally().

bool QUESO::Vector::m_printScientific
mutableprotected

Flag for either or not print this matrix in scientific notation.

Definition at line 133 of file Vector.h.

Referenced by base_copy(), getPrintScientific(), QUESO::GslVector::print(), QUESO::TeuchosVector::print(), and setPrintScientific().


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

Generated on Tue Jun 5 2018 19:49:14 for queso-0.57.1 by  doxygen 1.8.5