queso-0.51.1
Protected Attributes | List of all members
QUESO::DiscreteSubset< V, M > Class Template Reference

A templated class representing the discrete vector subsets. More...

#include <DiscreteSubset.h>

Inheritance diagram for QUESO::DiscreteSubset< V, M >:
Inheritance graph
[legend]
Collaboration diagram for QUESO::DiscreteSubset< V, M >:
Collaboration graph
[legend]

Public Member Functions

Constructor/Destructor methods.
 DiscreteSubset (const char *prefix, const VectorSpace< V, M > &vectorSpace, const std::vector< V * > &elements)
 Default Constructor. More...
 
 ~DiscreteSubset ()
 Destructor. More...
 
Mathematical methods.
bool contains (const V &vec) const
 Checks whether this discrete subset contains vector vec. TODO: incomplete code. More...
 
I/O methods.
void print (std::ostream &os) const
 Prints nothing. More...
 
- Public Member Functions inherited from QUESO::VectorSubset< V, M >
 VectorSubset ()
 Default Constructor. More...
 
 VectorSubset (const char *prefix, const VectorSpace< V, M > &vectorSpace, double volume)
 Shaped constructor (with volume). More...
 
virtual ~VectorSubset ()
 Destructor. More...
 
const VectorSpace< V, M > & vectorSpace () const
 Vector space to which this set belongs to. See template specialization. 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 BaseEnvironmentenv () 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 Attributes

std::vector< V * > m_elements
 Number of elements in the discrete vector subset. More...
 
- Protected Attributes inherited from QUESO::VectorSubset< V, M >
const VectorSpace< V, M > * m_vectorSpace
 
- Protected Attributes inherited from QUESO::VectorSet< V, M >
const BaseEnvironmentm_env
 
std::string m_prefix
 
double m_volume
 

Detailed Description

template<class V, class M>
class QUESO::DiscreteSubset< V, M >

A templated class representing the discrete vector subsets.

This class is used to represent the a discrete vector subset. Here the notion of volume does not apply, instead there is the total number of elements (vectors) that belongs to the subset.

Definition at line 42 of file DiscreteSubset.h.

Constructor & Destructor Documentation

template<class V , class M >
QUESO::DiscreteSubset< V, M >::DiscreteSubset ( const char *  prefix,
const VectorSpace< V, M > &  vectorSpace,
const std::vector< V * > &  elements 
)

Default Constructor.

It constructs a class object given the prefix, vector space to which it belongs and its number of elements.

Definition at line 32 of file DiscreteSubset.C.

References QUESO::VectorSet< V, M >::m_env, QUESO::VectorSet< V, M >::m_volume, UQ_FATAL_TEST_MACRO, and QUESO::BaseEnvironment::worldRank().

35  : VectorSubset<V,M>(prefix, vectorSpace, 0.),
36  m_elements(elements.size(),NULL)
37 {
38  m_volume = 0.;
40  m_env.worldRank(),
41  "DiscreteSubset<V,M>::contains()",
42  "incomplete code");
43 }
const std::string & prefix() const
Access to private attribute m_prefix.
Definition: VectorSet.C:88
int worldRank() const
Returns the process world rank.
Definition: Environment.C:235
const VectorSpace< V, M > & vectorSpace() const
Vector space to which this set belongs to. See template specialization.
Definition: VectorSubset.C:80
const BaseEnvironment & m_env
Definition: VectorSet.h:99
std::vector< V * > m_elements
Number of elements in the discrete vector subset.
#define UQ_FATAL_TEST_MACRO(test, givenRank, where, what)
Definition: Defines.h:223
template<class V , class M >
QUESO::DiscreteSubset< V, M >::~DiscreteSubset ( )

Destructor.

Definition at line 47 of file DiscreteSubset.C.

48 {
49 }

Member Function Documentation

template<class V , class M >
bool QUESO::DiscreteSubset< V, M >::contains ( const V &  vec) const
virtual

Checks whether this discrete subset contains vector vec. TODO: incomplete code.

Implements QUESO::VectorSubset< V, M >.

Definition at line 53 of file DiscreteSubset.C.

References UQ_FATAL_TEST_MACRO.

54 {
56  m_env.worldRank(),
57  "DiscreteSubset<V,M>::contains()",
58  "incomplete code");
59 
60  return false;
61 }
int worldRank() const
Returns the process world rank.
Definition: Environment.C:235
const BaseEnvironment & m_env
Definition: VectorSet.h:99
#define UQ_FATAL_TEST_MACRO(test, givenRank, where, what)
Definition: Defines.h:223
template<class V , class M >
void QUESO::DiscreteSubset< V, M >::print ( std::ostream &  os) const
virtual

Prints nothing.

Reimplemented from QUESO::VectorSubset< V, M >.

Definition at line 65 of file DiscreteSubset.C.

66 {
67  os << "In DiscreteSubset<V,M>::print()"
68  << ": nothing to print"
69  << std::endl;
70 
71  return;
72 }

Member Data Documentation

template<class V , class M >
std::vector<V*> QUESO::DiscreteSubset< V, M >::m_elements
protected

Number of elements in the discrete vector subset.

Definition at line 74 of file DiscreteSubset.h.


The documentation for this class was generated from the following files:

Generated on Thu Apr 23 2015 19:26:17 for queso-0.51.1 by  doxygen 1.8.5