ReFRACtor
problem_state.h
Go to the documentation of this file.
1 #ifndef PROBLEM_STATE_H
2 #define PROBLEM_STATE_H
3 #include <printable.h>
4 #include <blitz/array.h>
5 
6 namespace FullPhysics {
7 
8 //-----------------------------------------------------------------------
49 //-----------------------------------------------------------------------
50 
51 class ProblemState :
52  public Printable<ProblemState> {
53 
54 public:
55 
56 
57 //-----------------------------------------------------------------------
59 //-----------------------------------------------------------------------
60 
62 
63 
64 //-----------------------------------------------------------------------
69 //-----------------------------------------------------------------------
70 
72  { set(s); }
73 
74 
75  virtual ~ProblemState() {}
76 
77 
78 //-----------------------------------------------------------------------
86 //-----------------------------------------------------------------------
87 
88  virtual void set(const ProblemState& s)
89  { X.reference(s.X.copy()); }
90 
91 
92 //-----------------------------------------------------------------------
98 //-----------------------------------------------------------------------
99 
100  virtual void clear()
101  { X.free(); }
102 
103 
104 //-----------------------------------------------------------------------
126 //-----------------------------------------------------------------------
127 
128  virtual bool parameters_different(const blitz::Array<double, 1>& x) const;
129 
130 
131 //-----------------------------------------------------------------------
142 //-----------------------------------------------------------------------
143 
144  virtual void parameters(const blitz::Array<double, 1>& x);
145 
146 
147 //-----------------------------------------------------------------------
151 //-----------------------------------------------------------------------
152 
153  virtual blitz::Array<double, 1> parameters() const
154  { return X.copy(); }
155 
156 
157 //-----------------------------------------------------------------------
161 //-----------------------------------------------------------------------
162 
163  virtual int parameter_size() const
164  { return X.rows(); }
165 
166 
167 //-----------------------------------------------------------------------
183 //-----------------------------------------------------------------------
184 
185  virtual int expected_parameter_size() const
186  { return -1; }
187 
188 
189 //-----------------------------------------------------------------------
195 //-----------------------------------------------------------------------
196 
197  virtual void assert_parameter_set_correctly() const
199 
200 
201 //-----------------------------------------------------------------------
207 //-----------------------------------------------------------------------
208 
209  virtual void assert_parameter_correct(const blitz::Array<double, 1>& x) const;
210 
211 
212 //-----------------------------------------------------------------------
214 //-----------------------------------------------------------------------
215 
216  virtual void print(std::ostream& Os) const
217  { Os << "ProblemState"; }
218 
219 
220 protected:
221 
222  blitz::Array<double, 1> X;
223 
224 };
225 }
226 #endif
const Unit s("s", 1.0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0)
virtual void assert_parameter_set_correctly() const
Checks that the parameters are set correctly.
blitz::Array< double, 1 > X
virtual blitz::Array< double, 1 > parameters() const
Returns the current parameters.
ProblemState(const ProblemState &s)
Copy constructor.
Definition: problem_state.h:71
ProblemState()
Default constructor.
Definition: problem_state.h:61
virtual int parameter_size() const
Returns the size of the parameters.
virtual void assert_parameter_correct(const blitz::Array< double, 1 > &x) const
Checks that the new input parameters are correct.
This is a Mixin for classes that can be printed.
Definition: printable.h:24
virtual void clear()
Deletes data contents.
Contains classes to abstract away details in various Spurr Radiative Transfer software.
Definition: doxygen_python.h:1
The base class for all problem states.
Definition: problem_state.h:51
virtual void print(std::ostream &Os) const
Prints description of object.
virtual bool parameters_different(const blitz::Array< double, 1 > &x) const
Checks whether or not new input parameters are different from the current ones.
Definition: problem_state.cc:9
virtual int expected_parameter_size() const
Returns the expected size of the parameters.

Copyright © 2017, California Institute of Technology.
ALL RIGHTS RESERVED.
U.S. Government Sponsorship acknowledged.
Generated Fri Aug 24 2018 15:44:10