queso-0.51.1
|
Class for vector operations (virtual). More...
#include <Vector.h>
Public Member Functions | |
Constructor/Destructor methods | |
Vector () | |
Default Constructor. More... | |
Vector (const BaseEnvironment &env, const Map &map) | |
Shaped Constructor. More... | |
Vector (const Vector &rhs) | |
Copy Constructor. More... | |
virtual | ~Vector () |
Virtual Destructor. More... | |
Set methods | |
Vector & | operator= (const Vector &rhs) |
Operator for copying a vector. More... | |
Vector & | operator*= (double a) |
Operator for multiplication of the vector by a scalar. More... | |
Vector & | operator/= (double a) |
Operator for division of the vector by a scalar. More... | |
Vector & | operator+= (const Vector &rhs) |
Operator for addition (element-wise) of two vectors. More... | |
Vector & | operator-= (const Vector &rhs) |
Operator for subtraction (element-wise) of two vectors. More... | |
Environment and Map methods | |
const BaseEnvironment & | env () const |
const Map & | map () 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 | copy (const Vector &src) |
Copies vector src to this matrix. More... | |
Protected Attributes | |
const BaseEnvironment & | m_env |
Environment variable. More... | |
const Map & | m_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... | |
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).
QUESO::Vector::Vector | ( | ) |
Default Constructor.
Definition at line 32 of file Vector.C.
References m_env, UQ_FATAL_TEST_MACRO, and QUESO::BaseEnvironment::worldRank().
QUESO::Vector::Vector | ( | const BaseEnvironment & | env, |
const Map & | map | ||
) |
Shaped Constructor.
Definition at line 44 of file Vector.C.
QUESO::Vector::Vector | ( | const Vector & | rhs | ) |
Copy Constructor.
Definition at line 61 of file Vector.C.
References m_env, UQ_FATAL_TEST_MACRO, QUESO::UQ_INVALID_INTERNAL_STATE_RC, and QUESO::BaseEnvironment::worldRank().
|
virtual |
|
protectedvirtual |
Copies vector src
to this
matrix.
Definition at line 183 of file Vector.C.
References m_printHorizontally, and m_printScientific.
Referenced by QUESO::GslVector::copy().
|
pure virtual |
Component-wise invert the values of the vector.
Implemented in QUESO::GslVector.
|
pure virtual |
Component-wise set the values of the vector to value
.
Implemented in QUESO::GslVector.
|
pure virtual |
Component-wise set the values of the vector to a random number from a Gaussian distribution.
Implemented in QUESO::GslVector.
const BaseEnvironment & QUESO::Vector::env | ( | ) | const |
Definition at line 136 of file Vector.C.
References m_env.
Referenced by QUESO::matrixProduct(), QUESO::operator==(), and QUESO::scalarProduct().
bool QUESO::Vector::getPrintHorizontally | ( | ) | const |
Checks if vector is printed horizontally.
Definition at line 164 of file Vector.C.
References m_printHorizontally.
Referenced by QUESO::GslVector::subWriteContents().
bool QUESO::Vector::getPrintScientific | ( | ) | const |
Checks if the vector should be printed in Scientific Notation.
Definition at line 177 of file Vector.C.
References m_printScientific.
Referenced by QUESO::GslVector::subWriteContents().
const Map & QUESO::Vector::map | ( | ) | const |
Definition at line 143 of file Vector.C.
References m_map.
Referenced by QUESO::GslVector::GslVector(), and QUESO::matrixProduct().
unsigned int QUESO::Vector::numOfProcsForStorage | ( | ) | const |
Definition at line 150 of file Vector.C.
References QUESO::Map::Comm(), m_map, and QUESO::MpiComm::NumProc().
Referenced by QUESO::GslVector::subReadContents(), and QUESO::GslVector::subWriteContents().
Vector & QUESO::Vector::operator*= | ( | double | a | ) |
Operator for multiplication of the vector by a scalar.
Definition at line 90 of file Vector.C.
References m_env, UQ_FATAL_TEST_MACRO, QUESO::UQ_INVALID_INTERNAL_STATE_RC, and QUESO::BaseEnvironment::worldRank().
Operator for addition (element-wise) of two vectors.
Definition at line 114 of file Vector.C.
References m_env, UQ_FATAL_TEST_MACRO, QUESO::UQ_INVALID_INTERNAL_STATE_RC, and QUESO::BaseEnvironment::worldRank().
Operator for subtraction (element-wise) of two vectors.
Definition at line 125 of file Vector.C.
References m_env, UQ_FATAL_TEST_MACRO, QUESO::UQ_INVALID_INTERNAL_STATE_RC, and QUESO::BaseEnvironment::worldRank().
Vector & QUESO::Vector::operator/= | ( | double | a | ) |
Operator for division of the vector by a scalar.
Definition at line 102 of file Vector.C.
References m_env, UQ_FATAL_TEST_MACRO, QUESO::UQ_INVALID_INTERNAL_STATE_RC, and QUESO::BaseEnvironment::worldRank().
Operator for copying a vector.
Definition at line 79 of file Vector.C.
References m_env, UQ_FATAL_TEST_MACRO, QUESO::UQ_INVALID_INTERNAL_STATE_RC, and QUESO::BaseEnvironment::worldRank().
|
pure virtual |
Print this vector.
Implemented in QUESO::GslVector.
void QUESO::Vector::setPrintHorizontally | ( | bool | value | ) | const |
Determines whether vector should be printed horizontally.
Definition at line 157 of file Vector.C.
References m_printHorizontally.
Referenced by QUESO::GslVector::subWriteContents().
void QUESO::Vector::setPrintScientific | ( | bool | value | ) | const |
Determines whether vector should be printed in Scientific Notation.
Definition at line 170 of file Vector.C.
References m_printScientific.
Referenced by QUESO::GslVector::subWriteContents().
|
pure virtual |
Returns the global size of the vector.
Implemented in QUESO::GslVector.
|
pure virtual |
Returns the local size of the vector.
Implemented in QUESO::GslVector.
|
pure virtual |
Sort the elements.
Implemented in QUESO::GslVector.
|
protected |
Environment variable.
Definition at line 142 of file Vector.h.
Referenced by QUESO::GslVector::atLeastOneComponentBiggerOrEqualThan(), QUESO::GslVector::atLeastOneComponentBiggerThan(), QUESO::GslVector::atLeastOneComponentSmallerOrEqualThan(), QUESO::GslVector::atLeastOneComponentSmallerThan(), QUESO::GslVector::copy(), QUESO::GslVector::cwExtract(), QUESO::GslVector::cwSet(), QUESO::GslVector::cwSetBeta(), QUESO::GslVector::cwSetConcatenated(), QUESO::GslVector::cwSetGamma(), QUESO::GslVector::cwSetGaussian(), QUESO::GslVector::cwSetInverseGamma(), QUESO::GslVector::cwSetUniform(), env(), QUESO::GslVector::GslVector(), QUESO::GslVector::matlabDiff(), QUESO::GslVector::matlabLinearInterpExtrap(), QUESO::GslVector::mpiAllQuantile(), QUESO::GslVector::mpiAllReduce(), QUESO::GslVector::mpiBcast(), operator*=(), QUESO::GslVector::operator*=(), operator+=(), QUESO::GslVector::operator+=(), operator-=(), QUESO::GslVector::operator-=(), operator/=(), QUESO::GslVector::operator/=(), operator=(), QUESO::GslVector::operator=(), QUESO::GslVector::sizeGlobal(), QUESO::GslVector::sizeLocal(), QUESO::GslVector::subReadContents(), QUESO::GslVector::subWriteContents(), and Vector().
|
protected |
Mapping variable.
Definition at line 151 of file Vector.h.
Referenced by QUESO::GslVector::GslVector(), map(), numOfProcsForStorage(), QUESO::GslVector::sizeGlobal(), and QUESO::GslVector::sizeLocal().
|
mutableprotected |
Flag for either or not print this matrix horizontally.
Definition at line 155 of file Vector.h.
Referenced by copy(), getPrintHorizontally(), QUESO::GslVector::print(), and setPrintHorizontally().
|
mutableprotected |
Flag for either or not print this matrix in scientific notation.
Definition at line 158 of file Vector.h.
Referenced by copy(), getPrintScientific(), QUESO::GslVector::print(), and setPrintScientific().