25 #ifndef UQ_TEUCHOS_VECTOR_H
26 #define UQ_TEUCHOS_VECTOR_H
28 #ifdef QUESO_HAS_TRILINOS
29 #include <Teuchos_SerialDenseVector.hpp>
30 #include <Teuchos_SerialDenseMatrix.hpp>
31 #include <Teuchos_LAPACK.hpp>
34 #include <queso/Defines.h>
35 #include <queso/Vector.h>
38 #ifdef QUESO_HAS_TRILINOS
115 const double&
operator[](
unsigned int i)
const;
154 double norm2 ()
const;
157 double norm1 ()
const;
183 void cwSet(
double value);
257 void matlabDiff (
unsigned int firstPositionToStoreDiff,
double valueForRemainderPosition,
TeuchosVector& outputVec)
const;
263 void print (std::ostream& os)
const;
266 const std::string& fileType,
267 const std::set<unsigned int>& allowedSubEnvIds);
269 const std::string& fileName,
270 const std::string& fileType,
271 const std::set<unsigned int>& allowedSubEnvIds)
const;
284 Teuchos::SerialDenseVector<int,double>
m_vec;
304 #endif // ifdef QUESO_HAS_TRILINOS
306 #endif //UQ_TEUCHOS_VECTOR_H
void cwSetGaussian(double mean, double stdDev)
This function sets component-wise Gaussian random variates, with mean mean and standard deviation std...
TeuchosVector & operator-=(const TeuchosVector &rhs)
Stores in this vector the coordinate-wise subtraction of this and rhs.
TeuchosVector & operator/=(double a)
Stores in this vector the coordinate-wise division of this by a.
void matlabDiff(unsigned int firstPositionToStoreDiff, double valueForRemainderPosition, TeuchosVector &outputVec) const
void copy_from_std_vector(const std::vector< double > vec)
Copies the values of std::vector structure to this vector (a TeuchosVector).
void mpiAllQuantile(double probability, const MpiComm &opComm, TeuchosVector &resultVec) const
Gathers values from a group of processes and returns all quantiles.
int getMaxValueIndex() const
This function returns the index of the maximum value in the vector this.
double norm2Sq() const
Returns the norm of the vector, as the square root of 2-norm of this vector.
A class for partitioning vectors and matrices.
double sumOfComponents() const
Returns the sum of the components of the vector.
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.
bool atLeastOneComponentBiggerOrEqualThan(const TeuchosVector &rhs) const
This function returns true if at least one component of this is bigger than or equal to the respectiv...
unsigned int sizeLocal() const
Returns the length of this vector.
This (virtual) class sets up the environment underlying the use of the QUESO library by an executable...
void matlabLinearInterpExtrap(const TeuchosVector &xVec, const TeuchosVector &yVec, const TeuchosVector &xiVec)
Reproduces MATLAB linear inter/extra-polation.
void cwSetBeta(const TeuchosVector &alpha, const TeuchosVector &beta)
This function sets component-wise random variates from the Beta distribution, with vector parameters ...
void getMinValueAndIndex(double &value, int &index)
This function returns minimum value in the vector this and its the index.
void cwSetUniform(const TeuchosVector &lowerBoundVec, const TeuchosVector &upperBoundVec)
This function sets component-wise a number uniformly distributed in the range of elements of [lowerBo...
std::ostream & operator<<(std::ostream &os, const SequenceStatisticalOptions &obj)
bool atLeastOneComponentSmallerOrEqualThan(const TeuchosVector &rhs) const
This function returns true if at least one component of this is smaller than or equal to the respecti...
bool atLeastOneComponentSmallerThan(const TeuchosVector &rhs) const
This function returns true if at least one component of this is smaller than the respective component...
double getMaxValue() const
Returns the maximum value in the this vector.
void cwSetConcatenated(const TeuchosVector &v1, const TeuchosVector &v2)
This function concatenates vectors v1 and v2 into this vector.
GslMatrix operator-(const GslMatrix &m1, const GslMatrix &m2)
double & operator[](unsigned int i)
Element access method (non-const).
double getMinValue() const
Returns the minimum value in the this vector.
void cwSqrt()
Component-wise sets the square-root of this.
TeuchosVector()
Default Constructor.
double scalarProduct(const GslVector &x, const GslVector &y)
bool operator==(const GslVector &lhs, const GslVector &rhs)
TeuchosVector abs() const
This function returns absolute value of all elements in this.
Class for vector operations (virtual).
TeuchosVector & operator*=(double a)
Stores in this vector the coordinate-wise multiplication of this and a.
void sort()
This function sorts the elements of the vector this in ascending numerical order. ...
unsigned int sizeGlobal() const
Returns the global length of this vector.
Teuchos::SerialDenseVector< int, double > m_vec
Teuchos vector.
void cwInvert()
This function inverts component-wise the element values of this.
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.
GslMatrix operator*(double a, const GslMatrix &mat)
void subReadContents(const std::string &fileName, const std::string &fileType, const std::set< unsigned int > &allowedSubEnvIds)
void copy(const TeuchosVector &src)
This function copies the elements of the vector src into this.
~TeuchosVector()
Destructor.
Class for vector operations using Teuchos (Trilinos).
const BaseEnvironment & env() const
void subWriteContents(const std::string &varNamePrefix, const std::string &fileName, const std::string &fileType, const std::set< unsigned int > &allowedSubEnvIds) const
TeuchosVector & operator+=(const TeuchosVector &rhs)
Stores in this vector the coordinate-wise addition of this and rhs.
TeuchosVector & operator=(double a)
Set all values in the vector to a constant value.
GslVector operator/(double a, const GslVector &x)
void cwSet(double value)
Component-wise sets all values to this with value.
double norm2() const
Returns the 2-norm (Euclidean norm) of the vector.
void cwExtract(unsigned int initialPos, TeuchosVector &vec) const
Component-wise extracts all values of this with vector vec, starting at position initialPos.
int getMinValueIndex() const
This function returns the index of the minimum value in the vector this.
The QUESO MPI Communicator Class.
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.
void getMaxValueAndIndex(double &value, int &index)
This function returns maximum value in the vector this and its the index.
void mpiBcast(int srcRank, const MpiComm &bcastComm)
Broadcasts a message from the process with srcRank root to all other processes of the group...
void copy_to_std_vector(std::vector< double > &vec)
Copies the values of this vector (a TeuchosVector) to a std::vector structure.
double norm1() const
Returns the 1-norm of the vector.
bool atLeastOneComponentBiggerThan(const TeuchosVector &rhs) const
This function returns true if at least one component of this is bigger than the respective component ...
double normInf() const
Returns the infinity-norm (maximum norm) of the vector.
GslMatrix operator+(const GslMatrix &m1, const GslMatrix &m2)
void print(std::ostream &os) const
Print method. Defines the behavior of the std::ostream << operator inherited from the Object class...