queso-0.53.0
Public Member Functions | Private Attributes | Friends | List of all members
QUESO::ExperimentModel< S_V, S_M, D_V, D_M > Class Template Reference

#include <ExperimentModel.h>

Collaboration diagram for QUESO::ExperimentModel< S_V, S_M, D_V, D_M >:
Collaboration graph
[legend]

Public Member Functions

 ExperimentModel (const char *prefix, const EmOptionsValues *alternativeOptionsValues, const ExperimentStorage< S_V, S_M, D_V, D_M > &experimentStorage, const std::vector< D_M * > &Dmats, const std::vector< D_M * > &Kmats_interp)
 
 ~ExperimentModel ()
 
unsigned int numBasis () const
 
unsigned int numBasisGroups () const
 
const std::vector< unsigned int > & Gs () const
 
const D_M & Dmat (unsigned int basisId) const
 
const D_M & Dmat_BlockDiag () const
 
const std::vector< D_M * > & Kmats_interp () const
 
const ExperimentModelOptionsoptionsObj () const
 
void print (std::ostream &os) const
 

Private Attributes

const BaseEnvironmentm_env
 
const EmOptionsValuesm_optionsObj
 
ExperimentModelOptionsm_experimentModelOptions
 
unsigned int m_paper_p_x
 
unsigned int m_paper_n
 
unsigned int m_paper_p_delta
 
unsigned int m_paper_n_y
 
std::vector< D_M * > m_Dmats
 
std::vector< D_M * > m_Kmats_interp
 
VectorSpace< D_V, D_M > * m_n_y_space
 
D_M * m_Dmat_BlockDiag
 

Friends

std::ostream & operator<< (std::ostream &os, const ExperimentModel< S_V, S_M, D_V, D_M > &obj)
 

Detailed Description

template<class S_V = GslVector, class S_M = GslMatrix, class D_V = GslVector, class D_M = GslMatrix>
class QUESO::ExperimentModel< S_V, S_M, D_V, D_M >

Definition at line 39 of file ExperimentModel.h.

Constructor & Destructor Documentation

template<class S_V , class S_M , class D_V , class D_M >
QUESO::ExperimentModel< S_V, S_M, D_V, D_M >::ExperimentModel ( const char *  prefix,
const EmOptionsValues alternativeOptionsValues,
const ExperimentStorage< S_V, S_M, D_V, D_M > &  experimentStorage,
const std::vector< D_M * > &  Dmats,
const std::vector< D_M * > &  Kmats_interp 
)

Definition at line 32 of file ExperimentModel.C.

References QUESO::BaseEnvironment::displayVerbosity(), QUESO::ExperimentModel< S_V, S_M, D_V, D_M >::m_Dmat_BlockDiag, QUESO::ExperimentModel< S_V, S_M, D_V, D_M >::m_Dmats, QUESO::ExperimentModel< S_V, S_M, D_V, D_M >::m_env, QUESO::ExperimentModel< S_V, S_M, D_V, D_M >::m_experimentModelOptions, QUESO::EmOptionsValues::m_Gvalues, QUESO::ExperimentModel< S_V, S_M, D_V, D_M >::m_n_y_space, QUESO::ExperimentModel< S_V, S_M, D_V, D_M >::m_optionsObj, QUESO::ExperimentModel< S_V, S_M, D_V, D_M >::m_paper_n, QUESO::ExperimentModel< S_V, S_M, D_V, D_M >::m_paper_n_y, QUESO::ExperimentModel< S_V, S_M, D_V, D_M >::m_paper_p_delta, QUESO::ExperimentModel< S_V, S_M, D_V, D_M >::m_paper_p_x, QUESO::EmOptionsValues::m_prefix, QUESO::VectorSpace< V, M >::map(), QUESO::BaseEnvironment::optionsInputFileName(), queso_require_equal_to_msg, queso_require_greater_equal_msg, QUESO::BaseEnvironment::subDisplayFile(), and QUESO::ExperimentStorage< S_V, S_M, D_V, D_M >::xs_standard().

38  :
39  m_env (Dmats[0]->env()),
40  m_optionsObj (alternativeOptionsValues),
41  m_paper_p_x (experimentStorage.scenarioSpace().dimLocal()),
42  m_paper_n (Dmats.size()),
43  m_paper_p_delta (Dmats[0]->numCols()),
44  m_paper_n_y (0),
45  m_Dmats (Dmats),
47  m_n_y_space (NULL),
48  m_Dmat_BlockDiag (NULL)
49 {
50  if ((m_env.subDisplayFile()) && (m_env.displayVerbosity() >= 2)) {
51  *m_env.subDisplayFile() << "Entering ExperimentModel<S_V,S_M,D_V,D_M>::constructor()"
52  << ": prefix = " << prefix
53  << ", alternativeOptionsValues = " << alternativeOptionsValues
54  << ", m_env.optionsInputFileName() = " << m_env.optionsInputFileName()
55  << "\n m_paper_p_x = " << m_paper_p_x
56  << "\n m_paper_n = " << m_paper_n
57  << "\n m_paper_p_delta = " << m_paper_p_delta
58  << "\n m_paper_n_y = " << "to be set soon"
59  << std::endl;
60  }
61 
62  // If NULL, we create one
63  if (m_optionsObj == NULL) {
64  EmOptionsValues * tempOptions = new EmOptionsValues(&m_env, prefix);
65 
66  // We did this dance because scanOptionsValues is not a const method, but
67  // m_optionsObj is a pointer to const
68  m_optionsObj = tempOptions;
69  }
70 
71  // We'll need to remove this later
72  m_experimentModelOptions = new ExperimentModelOptions(m_env, prefix);
73 
74  queso_require_greater_equal_msg(m_optionsObj->m_Gvalues.size(), 1, "invalid m_Gs");
75 
76  queso_require_equal_to_msg(m_paper_n, experimentStorage.xs_standard().size(), "invalid m_paper_n");
77 
78  unsigned int sumGs = 0;
79  for (unsigned int i = 0; i < m_optionsObj->m_Gvalues.size(); ++i) {
80  sumGs += m_optionsObj->m_Gvalues[i];
81  }
82  queso_require_equal_to_msg(m_paper_p_delta, sumGs, "inconsistent input");
83 
84  //***********************************************************************
85  // Form 'Dmat_BlockDiag' matrix
86  //***********************************************************************
87  for (unsigned int i = 0; i < m_Dmats.size(); ++i) {
88  queso_require_equal_to_msg(m_Dmats[i]->numCols(), m_paper_p_delta, "inconsistent m_Dmats");
89  m_paper_n_y += m_Dmats[i]->numRowsLocal();
90  }
91  if ((m_env.subDisplayFile()) && (m_env.displayVerbosity() >= 3)) {
92  *m_env.subDisplayFile() << "In ExperimentModel<S_V,S_M,D_V,D_M>::constructor()"
93  << ": prefix = " << prefix
94  << "\n m_paper_n_y = " << m_paper_n_y
95  << std::endl;
96  }
97  m_n_y_space = new VectorSpace<D_V,D_M>(m_env, "n_y_", m_paper_n_y, NULL),
99  if ((m_env.subDisplayFile()) && (m_env.displayVerbosity() >= 2)) {
100  *m_env.subDisplayFile() << "In ExperimentModel<S_V,S_M,D_V,D_M>::constructor()"
101  << ": key-debug"
102  << ", m_Dmat_BlockDiag just created (not yet populated)"
103  << ", numRowsLocal = " << m_Dmat_BlockDiag->numRowsLocal()
104  << ", numCols = " << m_Dmat_BlockDiag->numCols()
105  << std::endl;
106  }
107  m_Dmat_BlockDiag->fillWithBlocksDiagonally(0,0,m_Dmats,true,true);
108 
109  std::set<unsigned int> tmpSet;
110  tmpSet.insert(m_env.subId());
111  if (false) { //gcmOptionsObj.m_dataOutputAllowedSet.find(m_env.subId()) != gcmOptionsObj.m_dataOutputAllowedSet.end()) {
112  m_Dmat_BlockDiag->subWriteContents("Dmat_BlockDiag",
113  "Dmat_BlockDiag",
114  "m",
115  tmpSet);
116  }
117 
118  if ((m_env.subDisplayFile()) && (m_env.displayVerbosity() >= 2)) {
119  *m_env.subDisplayFile() << "Leaving ExperimentModel<S_V,S_M,D_V,D_M>::constructor()"
120  << ": prefix = " << m_optionsObj->m_prefix
121  << std::endl;
122  }
123 }
unsigned int displayVerbosity() const
Definition: Environment.C:396
std::vector< D_M * > m_Dmats
const BaseEnvironment & m_env
unsigned int m_paper_p_delta
const Map & map() const
Map.
Definition: VectorSpace.C:157
const std::vector< D_M * > & Kmats_interp() const
ExperimentModelOptions * m_experimentModelOptions
const EmOptionsValues * m_optionsObj
#define queso_require_equal_to_msg(expr1, expr2, msg)
Definition: asserts.h:85
std::string optionsInputFileName() const
Access to the attribute m_optionsInputFileName, which stores the name of the input file passed by the...
Definition: Environment.C:307
std::ofstream * subDisplayFile() const
Access function for m_subDisplayFile (displays file on stream).
Definition: Environment.C:274
std::vector< D_M * > m_Kmats_interp
#define queso_require_greater_equal_msg(expr1, expr2, msg)
Definition: asserts.h:90
VectorSpace< D_V, D_M > * m_n_y_space
std::vector< unsigned int > m_Gvalues
template<class S_V , class S_M , class D_V , class D_M >
QUESO::ExperimentModel< S_V, S_M, D_V, D_M >::~ExperimentModel ( )

Definition at line 126 of file ExperimentModel.C.

127 {
128  if ((m_env.subDisplayFile()) && (m_env.displayVerbosity() >= 2)) {
129  *m_env.subDisplayFile() << "Entering ExperimentModel<S_V,S_M,P_V,P_M,Q_V,Q_M>::destructor()..."
130  << std::endl;
131  }
132 
133  if (m_Dmat_BlockDiag) delete m_Dmat_BlockDiag; // to be deleted on destructor
134  if (m_n_y_space ) delete m_n_y_space; // to be deleted on destructor
135  if (m_optionsObj ) delete m_optionsObj;
136 
137  if ((m_env.subDisplayFile()) && (m_env.displayVerbosity() >= 2)) {
138  *m_env.subDisplayFile() << "Leaving ExperimentModel<S_V,S_M,P_V,P_M,Q_V,Q_M>::destructor()"
139  << std::endl;
140  }
141 
144  }
145 }
unsigned int displayVerbosity() const
Definition: Environment.C:396
const BaseEnvironment & m_env
ExperimentModelOptions * m_experimentModelOptions
const EmOptionsValues * m_optionsObj
std::ofstream * subDisplayFile() const
Access function for m_subDisplayFile (displays file on stream).
Definition: Environment.C:274
VectorSpace< D_V, D_M > * m_n_y_space

Member Function Documentation

template<class S_V , class S_M , class D_V , class D_M >
const D_M & QUESO::ExperimentModel< S_V, S_M, D_V, D_M >::Dmat ( unsigned int  basisId) const

Definition at line 177 of file ExperimentModel.C.

178 {
179  return *(m_Dmats[basisId]);
180 }
std::vector< D_M * > m_Dmats
template<class S_V , class S_M , class D_V , class D_M >
const D_M & QUESO::ExperimentModel< S_V, S_M, D_V, D_M >::Dmat_BlockDiag ( ) const
template<class S_V , class S_M , class D_V , class D_M >
const std::vector< unsigned int > & QUESO::ExperimentModel< S_V, S_M, D_V, D_M >::Gs ( ) const

Definition at line 163 of file ExperimentModel.C.

164 {
165  return m_optionsObj->m_Gvalues;
166 }
const EmOptionsValues * m_optionsObj
std::vector< unsigned int > m_Gvalues
template<class S_V , class S_M , class D_V , class D_M >
const std::vector< D_M * > & QUESO::ExperimentModel< S_V, S_M, D_V, D_M >::Kmats_interp ( ) const

Definition at line 170 of file ExperimentModel.C.

171 {
172  return m_Kmats_interp;
173 }
std::vector< D_M * > m_Kmats_interp
template<class S_V , class S_M , class D_V , class D_M >
unsigned int QUESO::ExperimentModel< S_V, S_M, D_V, D_M >::numBasis ( ) const
template<class S_V , class S_M , class D_V , class D_M >
unsigned int QUESO::ExperimentModel< S_V, S_M, D_V, D_M >::numBasisGroups ( ) const

Definition at line 156 of file ExperimentModel.C.

157 {
158  return m_optionsObj->m_Gvalues.size();
159 }
const EmOptionsValues * m_optionsObj
std::vector< unsigned int > m_Gvalues
template<class S_V , class S_M , class D_V , class D_M >
const ExperimentModelOptions & QUESO::ExperimentModel< S_V, S_M, D_V, D_M >::optionsObj ( ) const

Definition at line 192 of file ExperimentModel.C.

References queso_deprecated.

193 {
194  // This methods returns the old ExperimentModelOptions object. We're using
195  // the new EmOptionsValues so this method is deprecated.
197  return *m_experimentModelOptions;
198 }
ExperimentModelOptions * m_experimentModelOptions
#define queso_deprecated()
Definition: Defines.h:120
template<class S_V , class S_M , class D_V , class D_M >
void QUESO::ExperimentModel< S_V, S_M, D_V, D_M >::print ( std::ostream &  os) const

Definition at line 202 of file ExperimentModel.C.

203 {
204  return;
205 }

Friends And Related Function Documentation

template<class S_V = GslVector, class S_M = GslMatrix, class D_V = GslVector, class D_M = GslMatrix>
std::ostream& operator<< ( std::ostream &  os,
const ExperimentModel< S_V, S_M, D_V, D_M > &  obj 
)
friend

Definition at line 59 of file ExperimentModel.h.

60  {
61  obj.print(os);
62  return os;
63  }

Member Data Documentation

template<class S_V = GslVector, class S_M = GslMatrix, class D_V = GslVector, class D_M = GslMatrix>
D_M* QUESO::ExperimentModel< S_V, S_M, D_V, D_M >::m_Dmat_BlockDiag
private
template<class S_V = GslVector, class S_M = GslMatrix, class D_V = GslVector, class D_M = GslMatrix>
std::vector<D_M* > QUESO::ExperimentModel< S_V, S_M, D_V, D_M >::m_Dmats
private
template<class S_V = GslVector, class S_M = GslMatrix, class D_V = GslVector, class D_M = GslMatrix>
const BaseEnvironment& QUESO::ExperimentModel< S_V, S_M, D_V, D_M >::m_env
private
template<class S_V = GslVector, class S_M = GslMatrix, class D_V = GslVector, class D_M = GslMatrix>
ExperimentModelOptions* QUESO::ExperimentModel< S_V, S_M, D_V, D_M >::m_experimentModelOptions
private
template<class S_V = GslVector, class S_M = GslMatrix, class D_V = GslVector, class D_M = GslMatrix>
std::vector<D_M* > QUESO::ExperimentModel< S_V, S_M, D_V, D_M >::m_Kmats_interp
private

Definition at line 77 of file ExperimentModel.h.

template<class S_V = GslVector, class S_M = GslMatrix, class D_V = GslVector, class D_M = GslMatrix>
VectorSpace<D_V,D_M>* QUESO::ExperimentModel< S_V, S_M, D_V, D_M >::m_n_y_space
private
template<class S_V = GslVector, class S_M = GslMatrix, class D_V = GslVector, class D_M = GslMatrix>
const EmOptionsValues* QUESO::ExperimentModel< S_V, S_M, D_V, D_M >::m_optionsObj
private
template<class S_V = GslVector, class S_M = GslMatrix, class D_V = GslVector, class D_M = GslMatrix>
unsigned int QUESO::ExperimentModel< S_V, S_M, D_V, D_M >::m_paper_n
private
template<class S_V = GslVector, class S_M = GslMatrix, class D_V = GslVector, class D_M = GslMatrix>
unsigned int QUESO::ExperimentModel< S_V, S_M, D_V, D_M >::m_paper_n_y
private
template<class S_V = GslVector, class S_M = GslMatrix, class D_V = GslVector, class D_M = GslMatrix>
unsigned int QUESO::ExperimentModel< S_V, S_M, D_V, D_M >::m_paper_p_delta
private
template<class S_V = GslVector, class S_M = GslMatrix, class D_V = GslVector, class D_M = GslMatrix>
unsigned int QUESO::ExperimentModel< S_V, S_M, D_V, D_M >::m_paper_p_x
private

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

Generated on Thu Jun 11 2015 13:52:34 for queso-0.53.0 by  doxygen 1.8.5