queso-0.57.1
|
Class for vector operations using Teuchos (Trilinos). More...
#include <TeuchosVector.h>
Public Member Functions | |
Constructor/Destructor methods. | |
TeuchosVector (const BaseEnvironment &env, const Map &map) | |
Shaped constructor: creates an empty vector of size given by Map& map. More... | |
TeuchosVector (const BaseEnvironment &env, const Map &map, double value) | |
Shaped constructor: creates an vector of values value and of size given by Map& map. More... | |
TeuchosVector (const BaseEnvironment &env, double d1, double d2, const Map &map) | |
Shaped constructor: creates an vector of size given by Map& map and of values given by an average involving d1 , d2 and the vector size. More... | |
TeuchosVector (const TeuchosVector &v, double d1, double d2) | |
Shaped constructor: creates an vector of size given by vector v and of values given by an average involving d1 , d2 and vector size. More... | |
TeuchosVector (const TeuchosVector &y) | |
Copy constructor. More... | |
~TeuchosVector () | |
Destructor. More... | |
Set methods. | |
TeuchosVector & | operator= (double a) |
Set all values in the vector to a constant value. More... | |
TeuchosVector & | operator= (const TeuchosVector &rhs) |
Copies values from one vector to another. More... | |
TeuchosVector & | operator*= (double a) |
Stores in this vector the coordinate-wise multiplication of this and a. More... | |
TeuchosVector & | operator/= (double a) |
Stores in this vector the coordinate-wise division of this by a. More... | |
TeuchosVector & | operator*= (const TeuchosVector &rhs) |
Stores in this vector the coordinate-wise multiplication of this with rhs. More... | |
TeuchosVector & | operator/= (const TeuchosVector &rhs) |
Stores in this vector the coordinate-wise division of this by rhs. More... | |
TeuchosVector & | operator+= (const TeuchosVector &rhs) |
Stores in this vector the coordinate-wise addition of this and rhs. More... | |
TeuchosVector & | operator-= (const TeuchosVector &rhs) |
Stores in this vector the coordinate-wise subtraction of this and rhs . More... | |
void | cwSet (double value) |
Component-wise sets all values to this with value. More... | |
void | cwSet (unsigned int initialPos, const TeuchosVector &vec) |
Component-wise sets all values of this with vector vec , starting at position initialPos . More... | |
void | cwExtract (unsigned int initialPos, TeuchosVector &vec) const |
Component-wise extracts all values of this with vector vec , starting at position initialPos . More... | |
void | cwInvert () |
This function inverts component-wise the element values of this . More... | |
void | cwSqrt () |
Component-wise sets the square-root of this . More... | |
void | cwSetConcatenated (const TeuchosVector &v1, const TeuchosVector &v2) |
This function concatenates vectors v1 and v2 into this vector. More... | |
void | cwSetGaussian (double mean, double stdDev) |
This function sets component-wise Gaussian random variates, with mean mean and standard deviation stdDev . More... | |
void | cwSetGaussian (const TeuchosVector &meanVec, const TeuchosVector &stdDevVec) |
This function sets component-wise Gaussian random variates, with vectors for mean and standard deviation. More... | |
void | cwSetUniform (const TeuchosVector &lowerBoundVec, const TeuchosVector &upperBoundVec) |
This function sets component-wise a number uniformly distributed in the range of elements of [lowerBoundVec,upperBoundVec]. More... | |
void | cwSetBeta (const TeuchosVector &alpha, const TeuchosVector &beta) |
This function sets component-wise random variates from the Beta distribution, with vector parameters alpha and beta. More... | |
void | cwSetGamma (const TeuchosVector &a, const TeuchosVector &b) |
This function sets component-wise random variates from the Inverse Gamma distribution, with parameters given by vectors a and b . More... | |
void | cwSetInverseGamma (const TeuchosVector &a, const TeuchosVector &b) |
This function sets component-wise random variates from the Inverse Gamma distribution, with parameters given by vectors a and b . More... | |
Accessor methods. | |
double & | operator[] (unsigned int i) |
Element access method (non-const). More... | |
const double & | operator[] (unsigned int i) const |
Element access method (const). More... | |
Attribute methods. | |
unsigned int | sizeLocal () const |
Returns the length of this vector. More... | |
unsigned int | sizeGlobal () const |
Returns the global length of this vector. More... | |
double * | values () |
double | getMaxValue () const |
Returns the maximum value in the this vector. More... | |
double | getMinValue () const |
Returns the minimum value in the this vector. More... | |
int | getMaxValueIndex () const |
This function returns the index of the maximum value in the vector this . More... | |
int | getMinValueIndex () const |
This function returns the index of the minimum value in the vector this . More... | |
void | getMaxValueAndIndex (double &value, int &index) |
This function returns maximum value in the vector this and its the index. More... | |
void | getMinValueAndIndex (double &value, int &index) |
This function returns minimum value in the vector this and its the index. More... | |
Norm methods | |
double | norm2Sq () const |
Returns the norm of the vector, as the square root of 2-norm of this vector. More... | |
double | norm2 () const |
Returns the 2-norm (Euclidean norm) of the vector. More... | |
double | norm1 () const |
Returns the 1-norm of the vector. More... | |
double | normInf () const |
Returns the infinity-norm (maximum norm) of the vector. More... | |
Comparison methods. | |
bool | atLeastOneComponentSmallerThan (const TeuchosVector &rhs) const |
This function returns true if at least one component of this is smaller than the respective component of rhs. More... | |
bool | atLeastOneComponentBiggerThan (const TeuchosVector &rhs) const |
This function returns true if at least one component of this is bigger than the respective component of rhs. More... | |
bool | atLeastOneComponentSmallerOrEqualThan (const TeuchosVector &rhs) const |
This function returns true if at least one component of this is smaller than or equal to the respective component of rhs. More... | |
bool | atLeastOneComponentBiggerOrEqualThan (const TeuchosVector &rhs) const |
This function returns true if at least one component of this is bigger than or equal to the respective component of rhs. More... | |
Miscellaneous methods. | |
TeuchosVector | abs () const |
This function returns absolute value of all elements in this . More... | |
void | copy_to_std_vector (std::vector< double > &vec) |
Copies the values of this vector (a TeuchosVector) to a std::vector structure. More... | |
void | copy_from_std_vector (const std::vector< double > vec) |
Copies the values of std::vector structure to this vector (a TeuchosVector). More... | |
void | sort () |
This function sorts the elements of the vector this in ascending numerical order. More... | |
double | sumOfComponents () const |
Returns the sum of the components of the vector. More... | |
void | mpiBcast (int srcRank, const MpiComm &bcastComm) |
Broadcasts a message from the process with srcRank root to all other processes of the group. More... | |
void | mpiAllReduce (RawType_MPI_Op mpiOperation, const MpiComm &opComm, TeuchosVector &resultVec) const |
Combines values from all processes and distributes the result back to all processes. More... | |
void | mpiAllQuantile (double probability, const MpiComm &opComm, TeuchosVector &resultVec) const |
Gathers values from a group of processes and returns all quantiles. More... | |
void | matlabLinearInterpExtrap (const TeuchosVector &xVec, const TeuchosVector &yVec, const TeuchosVector &xiVec) |
Reproduces MATLAB linear inter/extra-polation. More... | |
void | matlabDiff (unsigned int firstPositionToStoreDiff, double valueForRemainderPosition, TeuchosVector &outputVec) const |
I/O methods. | |
void | print (std::ostream &os) const |
Print method. Defines the behavior of the std::ostream << operator inherited from the Object class. More... | |
void | subReadContents (const std::string &fileName, const std::string &fileType, const std::set< unsigned int > &allowedSubEnvIds) |
void | subWriteContents (const std::string &varNamePrefix, const std::string &fileName, const std::string &fileType, const std::set< unsigned int > &allowedSubEnvIds) const |
Public Member Functions inherited from QUESO::Vector | |
Vector (const BaseEnvironment &env, const Map &map) | |
Shaped Constructor. More... | |
virtual | ~Vector () |
Virtual Destructor. More... | |
const BaseEnvironment & | env () const |
const Map & | map () const |
unsigned int | numOfProcsForStorage () const |
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... | |
Private Member Functions | |
TeuchosVector () | |
Default Constructor. More... | |
void | copy (const TeuchosVector &src) |
This function copies the elements of the vector src into this . More... | |
Private Attributes | |
Teuchos::SerialDenseVector < int, double > | m_vec |
Teuchos vector. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from QUESO::Vector | |
virtual void | base_copy (const Vector &src) |
Copies base data from vector src to this vector. More... | |
Protected Attributes inherited from QUESO::Vector | |
const BaseEnvironment & | m_env |
Environment variable. More... | |
const Map | m_map |
Mapping 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 using Teuchos (Trilinos).
This class creates and provides basic support for vectors of templated type as a specialization of Vector using Teuchos vectors (from Trilinos), which are defined by an encapsulated Teuchos::SerialDenseVector structure.
Definition at line 55 of file TeuchosVector.h.
QUESO::TeuchosVector::TeuchosVector | ( | const BaseEnvironment & | env, |
const Map & | map | ||
) |
Shaped constructor: creates an empty vector of size given by Map& map.
Definition at line 38 of file TeuchosVector.C.
References QUESO::Vector::m_map, m_vec, QUESO::Map::NumGlobalElements(), QUESO::Map::NumMyElements(), and QUESO::queso_require_equal_to_msg.
QUESO::TeuchosVector::TeuchosVector | ( | const BaseEnvironment & | env, |
const Map & | map, | ||
double | value | ||
) |
Shaped constructor: creates an vector of values value
and of size given by Map& map.
Definition at line 58 of file TeuchosVector.C.
References QUESO::Vector::m_map, m_vec, QUESO::Map::NumGlobalElements(), QUESO::Map::NumMyElements(), and QUESO::queso_require_equal_to_msg.
QUESO::TeuchosVector::TeuchosVector | ( | const BaseEnvironment & | env, |
double | d1, | ||
double | d2, | ||
const Map & | map | ||
) |
Shaped constructor: creates an vector of size given by Map& map and of values given by an average involving d1
, d2
and the vector size.
Definition at line 73 of file TeuchosVector.C.
References QUESO::Vector::m_map, m_vec, QUESO::Map::NumGlobalElements(), QUESO::Map::NumMyElements(), and QUESO::queso_require_equal_to_msg.
QUESO::TeuchosVector::TeuchosVector | ( | const TeuchosVector & | v, |
double | d1, | ||
double | d2 | ||
) |
Shaped constructor: creates an vector of size given by vector v
and of values given by an average involving d1
, d2
and vector size.
Definition at line 92 of file TeuchosVector.C.
References QUESO::Vector::m_map, m_vec, QUESO::Vector::map(), QUESO::Map::NumGlobalElements(), QUESO::Map::NumMyElements(), QUESO::queso_require_equal_to_msg, and sizeLocal().
QUESO::TeuchosVector::TeuchosVector | ( | const TeuchosVector & | y | ) |
Copy constructor.
Definition at line 111 of file TeuchosVector.C.
References copy(), QUESO::Vector::m_map, m_vec, QUESO::Vector::map(), QUESO::Map::NumGlobalElements(), QUESO::Map::NumMyElements(), QUESO::queso_require_equal_to_msg, and sizeLocal().
QUESO::TeuchosVector::~TeuchosVector | ( | ) |
|
private |
Default Constructor.
Creates an empty vector of no length.
TeuchosVector QUESO::TeuchosVector::abs | ( | ) | const |
This function returns absolute value of all elements in this
.
Definition at line 650 of file TeuchosVector.C.
References QUESO::size, and sizeLocal().
bool QUESO::TeuchosVector::atLeastOneComponentBiggerOrEqualThan | ( | const TeuchosVector & | rhs | ) | const |
This function returns true if at least one component of this
is bigger than or equal to the respective component of rhs.
Definition at line 454 of file TeuchosVector.C.
References QUESO::queso_require_equal_to_msg, QUESO::size, and sizeLocal().
bool QUESO::TeuchosVector::atLeastOneComponentBiggerThan | ( | const TeuchosVector & | rhs | ) | const |
This function returns true if at least one component of this
is bigger than the respective component of rhs.
Definition at line 420 of file TeuchosVector.C.
References QUESO::queso_require_equal_to_msg, QUESO::size, and sizeLocal().
bool QUESO::TeuchosVector::atLeastOneComponentSmallerOrEqualThan | ( | const TeuchosVector & | rhs | ) | const |
This function returns true if at least one component of this
is smaller than or equal to the respective component of rhs.
Definition at line 437 of file TeuchosVector.C.
References QUESO::queso_require_equal_to_msg, QUESO::size, and sizeLocal().
bool QUESO::TeuchosVector::atLeastOneComponentSmallerThan | ( | const TeuchosVector & | rhs | ) | const |
This function returns true if at least one component of this
is smaller than the respective component of rhs.
Definition at line 403 of file TeuchosVector.C.
References QUESO::queso_require_equal_to_msg, QUESO::size, and sizeLocal().
|
private |
This function copies the elements of the vector src
into this
.
Definition at line 1149 of file TeuchosVector.C.
References QUESO::Vector::base_copy(), m_vec, and sizeLocal().
Referenced by TeuchosVector().
void QUESO::TeuchosVector::copy_from_std_vector | ( | const std::vector< double > | vec | ) |
Copies the values of std::vector structure to this
vector (a TeuchosVector).
With this method, after a std::vector is sorted, it may be copied to a TeuchosVector.
Definition at line 680 of file TeuchosVector.C.
References m_vec, QUESO::queso_require_equal_to_msg, and sizeLocal().
void QUESO::TeuchosVector::copy_to_std_vector | ( | std::vector< double > & | vec | ) |
Copies the values of this
vector (a TeuchosVector) to a std::vector structure.
With this method, the std::vector copy of the TeuchosVector may be sorted using std::sort.
Definition at line 667 of file TeuchosVector.C.
References m_vec, QUESO::size, and sizeLocal().
void QUESO::TeuchosVector::cwExtract | ( | unsigned int | initialPos, |
TeuchosVector & | vec | ||
) | const |
Component-wise extracts all values of this
with vector vec
, starting at position initialPos
.
Definition at line 496 of file TeuchosVector.C.
References sizeLocal().
|
virtual |
This function inverts component-wise the element values of this
.
Implements QUESO::Vector.
Definition at line 510 of file TeuchosVector.C.
References QUESO::size, and sizeLocal().
Referenced by QUESO::operator/().
|
virtual |
Component-wise sets all values to this
with value.
Implements QUESO::Vector.
Definition at line 472 of file TeuchosVector.C.
Referenced by QUESO::TeuchosMatrix::inverse().
void QUESO::TeuchosVector::cwSet | ( | unsigned int | initialPos, |
const TeuchosVector & | vec | ||
) |
Component-wise sets all values of this
with vector vec
, starting at position initialPos
.
Definition at line 480 of file TeuchosVector.C.
References sizeLocal().
void QUESO::TeuchosVector::cwSetBeta | ( | const TeuchosVector & | alpha, |
const TeuchosVector & | beta | ||
) |
This function sets component-wise random variates from the Beta distribution, with vector parameters alpha and beta.
Definition at line 591 of file TeuchosVector.C.
References QUESO::RngBase::betaSample(), QUESO::BaseEnvironment::displayVerbosity(), QUESO::BaseEnvironment::fullRank(), QUESO::Vector::m_env, QUESO::queso_require_equal_to_msg, QUESO::BaseEnvironment::rngObject(), sizeLocal(), and QUESO::BaseEnvironment::subDisplayFile().
void QUESO::TeuchosVector::cwSetConcatenated | ( | const TeuchosVector & | v1, |
const TeuchosVector & | v2 | ||
) |
This function concatenates vectors v1
and v2
into this
vector.
Definition at line 533 of file TeuchosVector.C.
References QUESO::queso_require_equal_to_msg, and sizeLocal().
void QUESO::TeuchosVector::cwSetGamma | ( | const TeuchosVector & | a, |
const TeuchosVector & | b | ||
) |
This function sets component-wise random variates from the Inverse Gamma distribution, with parameters given by vectors a
and b
.
Definition at line 617 of file TeuchosVector.C.
References QUESO::RngBase::gammaSample(), QUESO::Vector::m_env, QUESO::queso_require_equal_to_msg, QUESO::BaseEnvironment::rngObject(), and sizeLocal().
|
virtual |
This function sets component-wise Gaussian random variates, with mean mean
and standard deviation stdDev
.
Implements QUESO::Vector.
Definition at line 558 of file TeuchosVector.C.
References QUESO::RngBase::gaussianSample(), QUESO::Vector::m_env, QUESO::BaseEnvironment::rngObject(), and sizeLocal().
void QUESO::TeuchosVector::cwSetGaussian | ( | const TeuchosVector & | meanVec, |
const TeuchosVector & | stdDevVec | ||
) |
This function sets component-wise Gaussian random variates, with vectors for mean and standard deviation.
Definition at line 568 of file TeuchosVector.C.
References QUESO::RngBase::gaussianSample(), QUESO::Vector::m_env, QUESO::BaseEnvironment::rngObject(), and sizeLocal().
void QUESO::TeuchosVector::cwSetInverseGamma | ( | const TeuchosVector & | a, |
const TeuchosVector & | b | ||
) |
This function sets component-wise random variates from the Inverse Gamma distribution, with parameters given by vectors a
and b
.
Definition at line 633 of file TeuchosVector.C.
References QUESO::RngBase::gammaSample(), QUESO::Vector::m_env, QUESO::queso_require_equal_to_msg, QUESO::BaseEnvironment::rngObject(), and sizeLocal().
void QUESO::TeuchosVector::cwSetUniform | ( | const TeuchosVector & | lowerBoundVec, |
const TeuchosVector & | upperBoundVec | ||
) |
This function sets component-wise a number uniformly distributed in the range of elements of [lowerBoundVec,upperBoundVec].
Definition at line 580 of file TeuchosVector.C.
References QUESO::Vector::m_env, QUESO::BaseEnvironment::rngObject(), sizeLocal(), and QUESO::RngBase::uniformSample().
void QUESO::TeuchosVector::cwSqrt | ( | ) |
Component-wise sets the square-root of this
.
Definition at line 521 of file TeuchosVector.C.
References QUESO::size, and sizeLocal().
double QUESO::TeuchosVector::getMaxValue | ( | ) | const |
Returns the maximum value in the this
vector.
Definition at line 273 of file TeuchosVector.C.
References QUESO::size, and sizeLocal().
void QUESO::TeuchosVector::getMaxValueAndIndex | ( | double & | value, |
int & | index | ||
) |
This function returns maximum value in the vector this
and its the index.
Definition at line 326 of file TeuchosVector.C.
References QUESO::size, and sizeLocal().
int QUESO::TeuchosVector::getMaxValueIndex | ( | ) | const |
This function returns the index of the maximum value in the vector this
.
Definition at line 300 of file TeuchosVector.C.
References QUESO::size, and sizeLocal().
double QUESO::TeuchosVector::getMinValue | ( | ) | const |
Returns the minimum value in the this
vector.
Definition at line 286 of file TeuchosVector.C.
References QUESO::size, and sizeLocal().
void QUESO::TeuchosVector::getMinValueAndIndex | ( | double & | value, |
int & | index | ||
) |
This function returns minimum value in the vector this
and its the index.
Definition at line 343 of file TeuchosVector.C.
References QUESO::size, and sizeLocal().
int QUESO::TeuchosVector::getMinValueIndex | ( | ) | const |
This function returns the index of the minimum value in the vector this
.
Definition at line 313 of file TeuchosVector.C.
References QUESO::size, and sizeLocal().
void QUESO::TeuchosVector::matlabDiff | ( | unsigned int | firstPositionToStoreDiff, |
double | valueForRemainderPosition, | ||
TeuchosVector & | outputVec | ||
) | const |
Definition at line 903 of file TeuchosVector.C.
References QUESO::queso_require_equal_to_msg, QUESO::size, and sizeLocal().
void QUESO::TeuchosVector::matlabLinearInterpExtrap | ( | const TeuchosVector & | xVec, |
const TeuchosVector & | yVec, | ||
const TeuchosVector & | xiVec | ||
) |
Reproduces MATLAB linear inter/extra-polation.
yiVec.matlabLinearInterpExtrap(xVec,yVec,xiVec) interpolates/extrapolates to find yiVec, the values of the underlying function yVec at the points in the vector xiVec. Thus, yVec and xVec must have the same size; and yiVec and xiVec must have the same size.
Definition at line 834 of file TeuchosVector.C.
References QUESO::queso_require_equal_to_msg, and sizeLocal().
Referenced by QUESO::TeuchosMatrix::matlabLinearInterpExtrap().
void QUESO::TeuchosVector::mpiAllQuantile | ( | double | probability, |
const MpiComm & | opComm, | ||
TeuchosVector & | resultVec | ||
) | const |
Gathers values from a group of processes and returns all quantiles.
Definition at line 800 of file TeuchosVector.C.
References QUESO::MpiComm::Bcast(), QUESO::MpiComm::Gather(), QUESO::MpiComm::MyPID(), QUESO::MpiComm::NumProc(), QUESO::queso_require_equal_to_msg, QUESO::size, and sizeLocal().
void QUESO::TeuchosVector::mpiAllReduce | ( | RawType_MPI_Op | mpiOperation, |
const MpiComm & | opComm, | ||
TeuchosVector & | resultVec | ||
) | const |
Combines values from all processes and distributes the result back to all processes.
Definition at line 777 of file TeuchosVector.C.
References QUESO::MpiComm::Allreduce(), QUESO::MpiComm::MyPID(), QUESO::queso_require_equal_to_msg, QUESO::size, and sizeLocal().
void QUESO::TeuchosVector::mpiBcast | ( | int | srcRank, |
const MpiComm & | bcastComm | ||
) |
Broadcasts a message from the process with srcRank
root to all other processes of the group.
Definition at line 720 of file TeuchosVector.C.
References QUESO::MpiComm::Allreduce(), QUESO::MpiComm::Barrier(), QUESO::MpiComm::Bcast(), QUESO::MpiComm::MyPID(), QUESO::MpiComm::NumProc(), QUESO::queso_require_equal_to_msg, and sizeLocal().
double QUESO::TeuchosVector::norm1 | ( | ) | const |
Returns the 1-norm of the vector.
Definition at line 373 of file TeuchosVector.C.
References QUESO::size, and sizeLocal().
double QUESO::TeuchosVector::norm2 | ( | ) | const |
Returns the 2-norm (Euclidean norm) of the vector.
Definition at line 367 of file TeuchosVector.C.
References norm2Sq().
Referenced by QUESO::TeuchosMatrix::invertMultiply().
double QUESO::TeuchosVector::norm2Sq | ( | ) | const |
Returns the norm of the vector, as the square root of 2-norm of this vector.
Definition at line 361 of file TeuchosVector.C.
References m_vec.
Referenced by norm2().
double QUESO::TeuchosVector::normInf | ( | ) | const |
Returns the infinity-norm (maximum norm) of the vector.
Definition at line 386 of file TeuchosVector.C.
References QUESO::size, and sizeLocal().
TeuchosVector & QUESO::TeuchosVector::operator*= | ( | double | a | ) |
Stores in this
vector the coordinate-wise multiplication of this
and a.
Definition at line 158 of file TeuchosVector.C.
References m_vec.
TeuchosVector & QUESO::TeuchosVector::operator*= | ( | const TeuchosVector & | rhs | ) |
Stores in this
vector the coordinate-wise multiplication of this
with rhs.
Definition at line 172 of file TeuchosVector.C.
References QUESO::queso_require_equal_to_msg, and sizeLocal().
TeuchosVector & QUESO::TeuchosVector::operator+= | ( | const TeuchosVector & | rhs | ) |
Stores in this
vector the coordinate-wise addition of this
and rhs.
Definition at line 201 of file TeuchosVector.C.
References QUESO::queso_require_equal_to_msg, and sizeLocal().
TeuchosVector & QUESO::TeuchosVector::operator-= | ( | const TeuchosVector & | rhs | ) |
Stores in this
vector the coordinate-wise subtraction of this
and rhs
.
Definition at line 217 of file TeuchosVector.C.
References QUESO::queso_require_equal_to_msg, and sizeLocal().
TeuchosVector & QUESO::TeuchosVector::operator/= | ( | double | a | ) |
Stores in this
vector the coordinate-wise division of this
by a.
Definition at line 165 of file TeuchosVector.C.
TeuchosVector & QUESO::TeuchosVector::operator/= | ( | const TeuchosVector & | rhs | ) |
Stores in this
vector the coordinate-wise division of this
by rhs.
Definition at line 186 of file TeuchosVector.C.
References QUESO::queso_require_equal_to_msg, and sizeLocal().
TeuchosVector & QUESO::TeuchosVector::operator= | ( | double | a | ) |
Set all values in the vector to a constant value.
Definition at line 134 of file TeuchosVector.C.
References m_vec.
TeuchosVector & QUESO::TeuchosVector::operator= | ( | const TeuchosVector & | rhs | ) |
Copies values from one vector to another.
Definition at line 141 of file TeuchosVector.C.
References m_vec, QUESO::queso_require_equal_to_msg, and sizeLocal().
double & QUESO::TeuchosVector::operator[] | ( | unsigned int | i | ) |
Element access method (non-const).
Definition at line 236 of file TeuchosVector.C.
References m_vec.
const double & QUESO::TeuchosVector::operator[] | ( | unsigned int | i | ) | const |
Element access method (const).
Definition at line 242 of file TeuchosVector.C.
References m_vec.
|
virtual |
Print method. Defines the behavior of the std::ostream << operator inherited from the Object class.
Implements QUESO::Vector.
Definition at line 930 of file TeuchosVector.C.
References QUESO::Vector::m_printHorizontally, QUESO::Vector::m_printScientific, QUESO::size, and sizeLocal().
Referenced by QUESO::operator<<().
|
virtual |
Returns the global length of this vector.
Implements QUESO::Vector.
Definition at line 257 of file TeuchosVector.C.
References QUESO::Vector::m_map, m_vec, QUESO::Map::NumGlobalElements(), and QUESO::queso_require_equal_to_msg.
|
virtual |
Returns the length of this vector.
Implements QUESO::Vector.
Definition at line 249 of file TeuchosVector.C.
References QUESO::Vector::m_map, m_vec, QUESO::Map::NumMyElements(), and QUESO::queso_require_equal_to_msg.
Referenced by abs(), atLeastOneComponentBiggerOrEqualThan(), atLeastOneComponentBiggerThan(), atLeastOneComponentSmallerOrEqualThan(), atLeastOneComponentSmallerThan(), copy(), copy_from_std_vector(), copy_to_std_vector(), cwExtract(), cwInvert(), cwSet(), cwSetBeta(), cwSetConcatenated(), cwSetGamma(), cwSetGaussian(), cwSetInverseGamma(), cwSetUniform(), cwSqrt(), QUESO::TeuchosMatrix::eigen(), QUESO::TeuchosMatrix::fillWithTensorProduct(), QUESO::TeuchosMatrix::getColumn(), getMaxValue(), getMaxValueAndIndex(), getMaxValueIndex(), getMinValue(), getMinValueAndIndex(), getMinValueIndex(), QUESO::TeuchosMatrix::getRow(), QUESO::TeuchosMatrix::invertMultiply(), QUESO::TeuchosMatrix::invertMultiplyForceLU(), QUESO::TeuchosMatrix::largestEigen(), QUESO::leftDiagScaling(), matlabDiff(), matlabLinearInterpExtrap(), QUESO::TeuchosMatrix::matlabLinearInterpExtrap(), QUESO::matrixProduct(), mpiAllQuantile(), mpiAllReduce(), mpiBcast(), QUESO::TeuchosMatrix::multiply(), norm1(), normInf(), operator*=(), operator+=(), operator-=(), operator/=(), operator=(), QUESO::operator==(), print(), QUESO::TeuchosMatrix::rank(), QUESO::rightDiagScaling(), QUESO::scalarProduct(), QUESO::TeuchosMatrix::setColumn(), QUESO::TeuchosMatrix::setRow(), QUESO::TeuchosMatrix::smallestEigen(), subReadContents(), subWriteContents(), sumOfComponents(), QUESO::TeuchosMatrix::svd(), QUESO::TeuchosMatrix::svdSolve(), QUESO::TeuchosMatrix::TeuchosMatrix(), and TeuchosVector().
|
virtual |
This function sorts the elements of the vector this
in ascending numerical order.
It copies this
vector to a std::vector and uses the std::sort functionality to sort it.
Implements QUESO::Vector.
Definition at line 693 of file TeuchosVector.C.
void QUESO::TeuchosVector::subReadContents | ( | const std::string & | fileName, |
const std::string & | fileType, | ||
const std::set< unsigned int > & | allowedSubEnvIds | ||
) |
Definition at line 976 of file TeuchosVector.C.
References QUESO::BaseEnvironment::closeFile(), QUESO::BaseEnvironment::fullRank(), QUESO::FilePtrSetStruct::ifsVar, QUESO::Vector::m_env, QUESO::Vector::numOfProcsForStorage(), QUESO::BaseEnvironment::openInputFile(), QUESO::queso_require_equal_to_msg, sizeLocal(), QUESO::BaseEnvironment::subDisplayFile(), and QUESO::BaseEnvironment::subRank().
void QUESO::TeuchosVector::subWriteContents | ( | const std::string & | varNamePrefix, |
const std::string & | fileName, | ||
const std::string & | fileType, | ||
const std::set< unsigned int > & | allowedSubEnvIds | ||
) | const |
Definition at line 1104 of file TeuchosVector.C.
References QUESO::BaseEnvironment::closeFile(), QUESO::Vector::getPrintHorizontally(), QUESO::Vector::getPrintScientific(), QUESO::Vector::m_env, QUESO::Vector::numOfProcsForStorage(), QUESO::FilePtrSetStruct::ofsVar, QUESO::BaseEnvironment::openOutputFile(), QUESO::Vector::setPrintHorizontally(), QUESO::Vector::setPrintScientific(), sizeLocal(), QUESO::BaseEnvironment::subIdString(), and QUESO::BaseEnvironment::subRank().
double QUESO::TeuchosVector::sumOfComponents | ( | ) | const |
Returns the sum of the components of the vector.
Definition at line 706 of file TeuchosVector.C.
References QUESO::size, and sizeLocal().
double * QUESO::TeuchosVector::values | ( | ) |
Definition at line 266 of file TeuchosVector.C.
References m_vec.
Referenced by QUESO::TeuchosMatrix::internalSvd(), and QUESO::TeuchosMatrix::svdSolve().
|
private |
Teuchos vector.
Definition at line 284 of file TeuchosVector.h.
Referenced by copy(), copy_from_std_vector(), copy_to_std_vector(), norm2Sq(), operator*=(), operator=(), operator[](), sizeGlobal(), sizeLocal(), TeuchosVector(), and values().