queso-0.57.1
|
A class representing a vector space. More...
#include <VectorSet.h>
Public Member Functions | |
template<> | |
GslVector * | newVector () const |
template<> | |
GslVector * | newVector (double value) const |
template<> | |
GslMatrix * | newMatrix () const |
template<> | |
GslMatrix * | newDiagMatrix (double diagValue) const |
template<> | |
TeuchosVector * | newVector () const |
template<> | |
TeuchosVector * | newVector (double value) const |
template<> | |
TeuchosMatrix * | newMatrix () const |
template<> | |
TeuchosMatrix * | newDiagMatrix (double diagValue) const |
Constructor/Destructor methods | |
VectorSpace (const BaseEnvironment &env, const char *prefix, unsigned int dimGlobalValue, const std::vector< std::string > *componentsNamesVec) | |
Shaped constructor. More... | |
~VectorSpace () | |
Destructor. More... | |
Attribute methods | |
const BaseEnvironment & | env () const |
Environment. More... | |
const Map & | map () const |
Map. More... | |
unsigned int | numOfProcsForStorage () const |
Returns total number of processes. More... | |
unsigned int | dimLocal () const |
unsigned int | dimGlobal () const |
unsigned int | globalIdOfFirstComponent () const |
Mathematical methods | |
const V & | zeroVector () const |
Returns a vector filled with zeros. More... | |
V * | newVector () const |
Creates an empty vector of size given by Map& map. See template specialization. More... | |
V * | newVector (double value) const |
Creates a vector of size given by Map& map and all values give by value . See template specialization. More... | |
V * | newVector (const V &v) const |
Creates vector as a copy of another. More... | |
M * | newMatrix () const |
Creates an empty matrix of size given by Map& map. See template specialization. More... | |
M * | newDiagMatrix (const V &v) const |
Creates a diagonal matrix with the elements and size of vector v . More... | |
M * | newDiagMatrix (double diagValue) const |
Creates a diagonal matrix with the elements diagValue and size given by Map& map. See template specialization. More... | |
M * | newProposalMatrix (const V *varVec, const V *auxVec) const |
Creates a diagonal matrix conditionally to values from vector varVec , guaranteeing that its values are neither 0, NAN nor INFINITY. More... | |
const VectorSpace< V, M > & | vectorSpace () const |
Accessor method to this . Vector space to which this vector set belongs to. More... | |
bool | contains (const V &vec) const |
Whether vector contains vector vec . More... | |
void | centroid (V &vec) const |
The (INFINITY/nonexistent) centroid of the space. More... | |
void | moments (M &vec) const |
The (INFINITY/nonexistent) matrix of second moments of the space. More... | |
const DistArray< std::string > * | componentsNamesArray () const |
Access to private attribute m_componentsNamesArray, which is an instance of DistArray. More... | |
const std::vector< std::string > * | componentsNamesVec () const |
Access to private attribute m_componentsNamesVec. More... | |
const std::string & | localComponentName (unsigned int localComponentId) const |
Returns the local component names. More... | |
I/O methods | |
void | printComponentsNames (std::ostream &os, bool printHorizontally) const |
Prints the local component names. More... | |
void | print (std::ostream &os) const |
Prints only a message. More... | |
Public Member Functions inherited from QUESO::VectorSet< V, M > | |
VectorSet (const BaseEnvironment &env, const char *prefix, double volume) | |
Shaped constructor. More... | |
virtual | ~VectorSet () |
Virtual destructor. More... | |
const BaseEnvironment & | env () const |
Environment. Access to private attribute m_env. More... | |
const std::string & | prefix () const |
Access to private attribute m_prefix. More... | |
double | volume () const |
Set volume; access to private attribute m_volume. More... | |
Protected Member Functions | |
Map * | newMap () |
Creates a new map. See template specialization. More... | |
template<> | |
Map * | newMap () |
template<> | |
Map * | newMap () |
Protected Attributes | |
unsigned int | m_dimGlobal |
Global dimension. More... | |
const Map * | m_map |
Map. More... | |
unsigned int | m_dimLocal |
Local dimension (number of elements owned by the calling processor.). More... | |
DistArray< std::string > * | m_componentsNamesArray |
Array of strings of the type DistArray to store the names of the components. More... | |
DistArray< std::string > * | m_componentsNamesVec |
Vector of strings of the type DistArray to store the names of the components. More... | |
std::string | m_emptyComponentName |
Empty string for the components names. More... | |
V * | m_zeroVector |
A vector of all elements equal to zero. More... | |
Protected Attributes inherited from QUESO::VectorSet< V, M > | |
const BaseEnvironment & | m_env |
std::string | m_prefix |
double | m_volume |
Private Member Functions | |
VectorSpace () | |
Default constructor. More... | |
VectorSpace (const VectorSpace< V, M > &aux) | |
Copy constructor. More... | |
A class representing a vector space.
Template classes V
and M
are to represent a vector class and a matrix class respectively. Currently (as of version 0.46.0) QUESO has matrix and vector classes implemented using either GSL or Trilinos-Teuchos libraries.
Definition at line 49 of file VectorSet.h.
QUESO::VectorSpace< V, M >::VectorSpace | ( | const BaseEnvironment & | env, |
const char * | prefix, | ||
unsigned int | dimGlobalValue, | ||
const std::vector< std::string > * | componentsNamesVec | ||
) |
Shaped constructor.
Construct a vector space with QUESO environment env
and of dimension dimGlobalValue
.
Definition at line 38 of file VectorSpace.C.
References QUESO::BaseEnvironment::displayVerbosity(), QUESO::VectorSpace< V, M >::globalIdOfFirstComponent(), QUESO::DistArray< T >::GlobalLength(), QUESO::VectorSpace< V, M >::m_componentsNamesArray, QUESO::VectorSpace< V, M >::m_dimGlobal, QUESO::VectorSpace< V, M >::m_dimLocal, QUESO::VectorSet< V, M >::m_env, QUESO::VectorSpace< V, M >::m_map, QUESO::VectorSet< V, M >::m_prefix, QUESO::VectorSpace< V, M >::m_zeroVector, QUESO::DistArray< T >::MyLength(), QUESO::Map::NumGlobalElements(), QUESO::queso_require_equal_to_msg, and QUESO::BaseEnvironment::subDisplayFile().
QUESO::VectorSpace< V, M >::~VectorSpace | ( | ) |
Destructor.
Definition at line 116 of file VectorSpace.C.
|
private |
Default constructor.
|
private |
Copy constructor.
Definition at line 102 of file VectorSpace.C.
|
virtual |
The (INFINITY/nonexistent) centroid of the space.
Implements QUESO::VectorSet< V, M >.
Definition at line 249 of file VectorSpace.C.
const DistArray< std::string > * QUESO::VectorSpace< V, M >::componentsNamesArray | ( | ) | const |
Access to private attribute m_componentsNamesArray, which is an instance of DistArray.
Definition at line 271 of file VectorSpace.C.
const std::vector<std::string>* QUESO::VectorSpace< V, M >::componentsNamesVec | ( | ) | const |
Access to private attribute m_componentsNamesVec.
|
virtual |
Whether vector contains vector vec
.
Implements QUESO::VectorSet< V, M >.
Definition at line 243 of file VectorSpace.C.
unsigned int QUESO::VectorSpace< V, M >::dimGlobal | ( | ) | const |
Definition at line 161 of file VectorSpace.C.
Referenced by QUESO::ComputeCovCorrMatricesBetweenVectorSequences(), QUESO::GPMSAFactory< V, M >::GPMSAFactory(), and QUESO::InstantiateIntersection().
unsigned int QUESO::VectorSpace< V, M >::dimLocal | ( | ) | const |
Definition at line 155 of file VectorSpace.C.
Referenced by QUESO::BoxSubset< V, M >::BoxSubset(), QUESO::ComputeCovCorrMatricesBetweenVectorSequences(), QUESO::ExponentialMatrixCovarianceFunction< P_V, P_M, Q_V, Q_M >::ExponentialMatrixCovarianceFunction(), QUESO::GPMSAEmulator< V, M >::GPMSAEmulator(), and QUESO::StatisticalInverseProblem< P_V, P_M >::StatisticalInverseProblem().
const BaseEnvironment & QUESO::VectorSpace< V, M >::env | ( | ) | const |
Environment.
Definition at line 136 of file VectorSpace.C.
Referenced by QUESO::InstantiateIntersection().
unsigned int QUESO::VectorSpace< V, M >::globalIdOfFirstComponent | ( | ) | const |
Definition at line 167 of file VectorSpace.C.
Referenced by QUESO::VectorSpace< V, M >::VectorSpace().
const std::string & QUESO::VectorSpace< V, M >::localComponentName | ( | unsigned int | localComponentId | ) | const |
Returns the local component names.
Definition at line 277 of file VectorSpace.C.
const Map & QUESO::VectorSpace< V, M >::map | ( | ) | const |
Map.
Definition at line 142 of file VectorSpace.C.
Referenced by QUESO::GPMSAFactory< V, M >::GPMSAFactory().
|
virtual |
The (INFINITY/nonexistent) matrix of second moments of the space.
Implements QUESO::VectorSet< V, M >.
Definition at line 259 of file VectorSpace.C.
GslMatrix * QUESO::VectorSpace< GslVector, GslMatrix >::newDiagMatrix | ( | double | diagValue | ) | const |
Definition at line 60 of file GslVectorSpace.C.
TeuchosMatrix * QUESO::VectorSpace< TeuchosVector, TeuchosMatrix >::newDiagMatrix | ( | double | diagValue | ) | const |
Definition at line 63 of file TeuchosVectorSpace.C.
M * QUESO::VectorSpace< V, M >::newDiagMatrix | ( | const V & | v | ) | const |
Creates a diagonal matrix with the elements and size of vector v
.
Definition at line 190 of file VectorSpace.C.
M* QUESO::VectorSpace< V, M >::newDiagMatrix | ( | double | diagValue | ) | const |
Creates a diagonal matrix with the elements diagValue
and size given by Map& map. See template specialization.
|
protected |
Definition at line 32 of file GslVectorSpace.C.
|
protected |
Definition at line 35 of file TeuchosVectorSpace.C.
|
protected |
Creates a new map. See template specialization.
GslMatrix * QUESO::VectorSpace< GslVector, GslMatrix >::newMatrix | ( | ) | const |
Definition at line 53 of file GslVectorSpace.C.
TeuchosMatrix * QUESO::VectorSpace< TeuchosVector, TeuchosMatrix >::newMatrix | ( | ) | const |
Definition at line 56 of file TeuchosVectorSpace.C.
M* QUESO::VectorSpace< V, M >::newMatrix | ( | ) | const |
Creates an empty matrix of size given by Map& map. See template specialization.
M * QUESO::VectorSpace< V, M >::newProposalMatrix | ( | const V * | varVec, |
const V * | auxVec | ||
) | const |
Creates a diagonal matrix conditionally to values from vector varVec
, guaranteeing that its values are neither 0, NAN nor INFINITY.
If varVec[i] is either 0, NAN or INFINITY, then this method tries to assign the value (*auxVec)[i])^2 to matrix(i,i). Case (*auxVec)[i])^2 is either NAN or INFINITY, then matrix(i,i)=1.
Definition at line 199 of file VectorSpace.C.
GslVector * QUESO::VectorSpace< GslVector, GslMatrix >::newVector | ( | ) | const |
Definition at line 39 of file GslVectorSpace.C.
TeuchosVector * QUESO::VectorSpace< TeuchosVector, TeuchosMatrix >::newVector | ( | ) | const |
Definition at line 42 of file TeuchosVectorSpace.C.
GslVector * QUESO::VectorSpace< GslVector, GslMatrix >::newVector | ( | double | value | ) | const |
Definition at line 46 of file GslVectorSpace.C.
TeuchosVector * QUESO::VectorSpace< TeuchosVector, TeuchosMatrix >::newVector | ( | double | value | ) | const |
Definition at line 49 of file TeuchosVectorSpace.C.
V* QUESO::VectorSpace< V, M >::newVector | ( | ) | const |
Creates an empty vector of size given by Map& map. See template specialization.
V* QUESO::VectorSpace< V, M >::newVector | ( | double | value | ) | const |
Creates a vector of size given by Map& map and all values give by value
. See template specialization.
V * QUESO::VectorSpace< V, M >::newVector | ( | const V & | v | ) | const |
Creates vector as a copy of another.
Definition at line 181 of file VectorSpace.C.
unsigned int QUESO::VectorSpace< V, M >::numOfProcsForStorage | ( | ) | const |
Returns total number of processes.
Definition at line 149 of file VectorSpace.C.
Referenced by QUESO::ComputeCovCorrMatricesBetweenVectorRvs(), and QUESO::ComputeCovCorrMatricesBetweenVectorSequences().
|
virtual |
Prints only a message.
Reimplemented from QUESO::VectorSet< V, M >.
Definition at line 309 of file VectorSpace.C.
void QUESO::VectorSpace< V, M >::printComponentsNames | ( | std::ostream & | os, |
bool | printHorizontally | ||
) | const |
Prints the local component names.
Definition at line 289 of file VectorSpace.C.
|
virtual |
Accessor method to this
. Vector space to which this
vector set belongs to.
It is virtual in the base class 'VectorSet'
Implements QUESO::VectorSet< V, M >.
Definition at line 237 of file VectorSpace.C.
const V & QUESO::VectorSpace< V, M >::zeroVector | ( | ) | const |
Returns a vector filled with zeros.
Definition at line 174 of file VectorSpace.C.
Referenced by QUESO::ComputeCovCorrMatricesBetweenVectorRvs(), and QUESO::ComputeCovCorrMatricesBetweenVectorSequences().
|
protected |
Array of strings of the type DistArray to store the names of the components.
Definition at line 159 of file VectorSpace.h.
Referenced by QUESO::VectorSpace< V, M >::VectorSpace().
|
protected |
Vector of strings of the type DistArray to store the names of the components.
Definition at line 162 of file VectorSpace.h.
|
protected |
Global dimension.
Definition at line 150 of file VectorSpace.h.
Referenced by QUESO::VectorSpace< V, M >::VectorSpace().
|
protected |
Local dimension (number of elements owned by the calling processor.).
Definition at line 156 of file VectorSpace.h.
Referenced by QUESO::VectorSpace< V, M >::VectorSpace().
|
protected |
Empty string for the components names.
Definition at line 165 of file VectorSpace.h.
|
protected |
Map.
Definition at line 153 of file VectorSpace.h.
Referenced by QUESO::VectorSpace< V, M >::VectorSpace().
|
protected |
A vector of all elements equal to zero.
Definition at line 168 of file VectorSpace.h.
Referenced by QUESO::VectorSpace< V, M >::VectorSpace().