|
queso-0.51.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 |
Constructor/Destructor methods | |
| VectorSpace () | |
| Default constructor. More... | |
| VectorSpace (const BaseEnvironment &env, const char *prefix, unsigned int dimGlobalValue, const std::vector< std::string > *componentsNamesVec) | |
| Shaped constructor. More... | |
| VectorSpace (const VectorSpace< V, M > &aux) | |
| Copy 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... | |
| 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 () | |
| Default Constructor. More... | |
| 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 () |
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 |
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 46 of file VectorSet.h.
| QUESO::VectorSpace< V, M >::VectorSpace | ( | ) |
Default constructor.
Definition at line 38 of file VectorSpace.C.
References QUESO::VectorSet< V, M >::m_env, UQ_FATAL_TEST_MACRO, and QUESO::BaseEnvironment::worldRank().
| 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 49 of file VectorSpace.C.
References QUESO::BaseEnvironment::displayVerbosity(), QUESO::VectorSpace< V, M >::globalIdOfFirstComponent(), 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::Map::NumGlobalElements(), QUESO::BaseEnvironment::subDisplayFile(), UQ_FATAL_TEST_MACRO, and QUESO::BaseEnvironment::worldRank().
| QUESO::VectorSpace< V, M >::VectorSpace | ( | const VectorSpace< V, M > & | aux | ) |
Copy constructor.
Definition at line 128 of file VectorSpace.C.
References QUESO::BaseEnvironment::displayVerbosity(), QUESO::VectorSpace< V, M >::m_componentsNamesArray, QUESO::VectorSpace< V, M >::m_componentsNamesVec, QUESO::VectorSet< V, M >::m_env, and QUESO::BaseEnvironment::subDisplayFile().
| QUESO::VectorSpace< V, M >::~VectorSpace | ( | ) |
Destructor.
Definition at line 157 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 297 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 290 of file VectorSpace.C.
| unsigned int QUESO::VectorSpace< V, M >::dimGlobal | ( | ) | const |
Definition at line 205 of file VectorSpace.C.
Referenced by QUESO::ComputeCovCorrMatricesBetweenVectorSequences(), and QUESO::InstantiateIntersection().
| unsigned int QUESO::VectorSpace< V, M >::dimLocal | ( | ) | const |
Definition at line 199 of file VectorSpace.C.
Referenced by QUESO::BoxSubset< V, M >::BoxSubset(), QUESO::ComputeCovCorrMatricesBetweenVectorSequences(), QUESO::ExponentialMatrixCovarianceFunction< P_V, P_M, Q_V, Q_M >::ExponentialMatrixCovarianceFunction(), and QUESO::StatisticalInverseProblem< P_V, P_M >::StatisticalInverseProblem().
| const BaseEnvironment & QUESO::VectorSpace< V, M >::env | ( | ) | const |
Environment.
Definition at line 177 of file VectorSpace.C.
Referenced by QUESO::InstantiateIntersection().
| unsigned int QUESO::VectorSpace< V, M >::globalIdOfFirstComponent | ( | ) | const |
Definition at line 211 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 303 of file VectorSpace.C.
References UQ_FATAL_TEST_MACRO.
| const Map & QUESO::VectorSpace< V, M >::map | ( | ) | const |
Map.
Definition at line 183 of file VectorSpace.C.
References UQ_FATAL_TEST_MACRO.
| GslMatrix * QUESO::VectorSpace< GslVector, GslMatrix >::newDiagMatrix | ( | double | diagValue | ) | const |
Definition at line 60 of file GslVectorSpace.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 237 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 |
Creates a new map. See template specialization.
| GslMatrix * QUESO::VectorSpace< GslVector, GslMatrix >::newMatrix | ( | ) | const |
Definition at line 53 of file GslVectorSpace.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 246 of file VectorSpace.C.
| GslVector * QUESO::VectorSpace< GslVector, GslMatrix >::newVector | ( | ) | const |
Definition at line 39 of file GslVectorSpace.C.
| GslVector * QUESO::VectorSpace< GslVector, GslMatrix >::newVector | ( | double | value | ) | const |
Definition at line 46 of file GslVectorSpace.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 228 of file VectorSpace.C.
| unsigned int QUESO::VectorSpace< V, M >::numOfProcsForStorage | ( | ) | const |
Returns total number of processes.
Definition at line 193 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 338 of file VectorSpace.C.
| void QUESO::VectorSpace< V, M >::printComponentsNames | ( | std::ostream & | os, |
| bool | printHorizontally | ||
| ) | const |
Prints the local component names.
Definition at line 318 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 284 of file VectorSpace.C.
| const V & QUESO::VectorSpace< V, M >::zeroVector | ( | ) | const |
Returns a vector filled with zeros.
Definition at line 218 of file VectorSpace.C.
References UQ_FATAL_TEST_MACRO.
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 156 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 159 of file VectorSpace.h.
Referenced by QUESO::VectorSpace< V, M >::VectorSpace().
|
protected |
Global dimension.
Definition at line 147 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 153 of file VectorSpace.h.
Referenced by QUESO::VectorSpace< V, M >::VectorSpace().
|
protected |
Empty string for the components names.
Definition at line 162 of file VectorSpace.h.
|
protected |
Map.
Definition at line 150 of file VectorSpace.h.
Referenced by QUESO::VectorSpace< V, M >::VectorSpace().
|
protected |
A vector of all elements equal to zero.
Definition at line 165 of file VectorSpace.h.
Referenced by QUESO::VectorSpace< V, M >::VectorSpace().