queso-0.53.0
|
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 (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 (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 |
Private Member Functions | |
VectorSpace () | |
Default 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_require_equal_to_msg, and QUESO::BaseEnvironment::subDisplayFile().
QUESO::VectorSpace< V, M >::VectorSpace | ( | const VectorSpace< V, M > & | aux | ) |
Copy constructor.
Definition at line 102 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 131 of file VectorSpace.C.
|
private |
Default constructor.
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 265 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 258 of file VectorSpace.C.
unsigned int QUESO::VectorSpace< V, M >::dimGlobal | ( | ) | const |
Definition at line 176 of file VectorSpace.C.
Referenced by QUESO::ComputeCovCorrMatricesBetweenVectorSequences(), QUESO::GcmJointTildeInfo< S_V, S_M, D_V, D_M, P_V, P_M, Q_V, Q_M >::GcmJointTildeInfo(), and QUESO::InstantiateIntersection().
unsigned int QUESO::VectorSpace< V, M >::dimLocal | ( | ) | const |
Definition at line 170 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::GcmExperimentInfo< S_V, S_M, D_V, D_M, P_V, P_M >::GcmExperimentInfo(), QUESO::GcmJointInfo< S_V, S_M, D_V, D_M, P_V, P_M, Q_V, Q_M >::GcmJointInfo(), QUESO::GcmSimulationInfo< S_V, S_M, P_V, P_M, Q_V, Q_M >::GcmSimulationInfo(), QUESO::GcmZInfo< S_V, S_M, D_V, D_M, P_V, P_M, Q_V, Q_M >::GcmZInfo(), QUESO::GpmsaComputerModel< S_V, S_M, D_V, D_M, P_V, P_M, Q_V, Q_M >::GpmsaComputerModel(), QUESO::SimulationModel< S_V, S_M, P_V, P_M, Q_V, Q_M >::SimulationModel(), and QUESO::StatisticalInverseProblem< P_V, P_M >::StatisticalInverseProblem().
const BaseEnvironment & QUESO::VectorSpace< V, M >::env | ( | ) | const |
Environment.
Definition at line 151 of file VectorSpace.C.
Referenced by QUESO::InstantiateIntersection().
unsigned int QUESO::VectorSpace< V, M >::globalIdOfFirstComponent | ( | ) | const |
Definition at line 182 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 271 of file VectorSpace.C.
References queso_require_less_equal_msg.
const Map & QUESO::VectorSpace< V, M >::map | ( | ) | const |
Map.
Definition at line 157 of file VectorSpace.C.
References queso_require_msg.
Referenced by QUESO::ExperimentModel< S_V, S_M, D_V, D_M >::ExperimentModel(), QUESO::GcmExperimentInfo< S_V, S_M, D_V, D_M, P_V, P_M >::GcmExperimentInfo(), QUESO::GcmJointInfo< S_V, S_M, D_V, D_M, P_V, P_M, Q_V, Q_M >::GcmJointInfo(), QUESO::GcmJointTildeInfo< S_V, S_M, D_V, D_M, P_V, P_M, Q_V, Q_M >::GcmJointTildeInfo(), QUESO::GcmSimulationInfo< S_V, S_M, P_V, P_M, Q_V, Q_M >::GcmSimulationInfo(), QUESO::GcmSimulationTildeInfo< S_V, S_M, P_V, P_M, Q_V, Q_M >::GcmSimulationTildeInfo(), QUESO::GcmZInfo< S_V, S_M, D_V, D_M, P_V, P_M, Q_V, Q_M >::GcmZInfo(), and QUESO::SimulationModel< S_V, S_M, P_V, P_M, Q_V, Q_M >::SimulationModel().
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 205 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 214 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 196 of file VectorSpace.C.
unsigned int QUESO::VectorSpace< V, M >::numOfProcsForStorage | ( | ) | const |
Returns total number of processes.
Definition at line 164 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 303 of file VectorSpace.C.
void QUESO::VectorSpace< V, M >::printComponentsNames | ( | std::ostream & | os, |
bool | printHorizontally | ||
) | const |
Prints the local component names.
Definition at line 283 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 252 of file VectorSpace.C.
const V & QUESO::VectorSpace< V, M >::zeroVector | ( | ) | const |
Returns a vector filled with zeros.
Definition at line 189 of file VectorSpace.C.
References queso_require_msg.
Referenced by QUESO::ComputeCovCorrMatricesBetweenVectorRvs(), QUESO::ComputeCovCorrMatricesBetweenVectorSequences(), QUESO::GcmExperimentInfo< S_V, S_M, D_V, D_M, P_V, P_M >::GcmExperimentInfo(), QUESO::GcmJointInfo< S_V, S_M, D_V, D_M, P_V, P_M, Q_V, Q_M >::GcmJointInfo(), QUESO::GcmJointTildeInfo< S_V, S_M, D_V, D_M, P_V, P_M, Q_V, Q_M >::GcmJointTildeInfo(), QUESO::GcmSimulationInfo< S_V, S_M, P_V, P_M, Q_V, Q_M >::GcmSimulationInfo(), QUESO::GcmSimulationTildeInfo< S_V, S_M, P_V, P_M, Q_V, Q_M >::GcmSimulationTildeInfo(), QUESO::GcmZTildeInfo< S_V, S_M, D_V, D_M, P_V, P_M, Q_V, Q_M >::GcmZTildeInfo(), and QUESO::SimulationModel< S_V, S_M, P_V, P_M, Q_V, Q_M >::SimulationModel().
|
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().