11 #ifndef OOPS_INTERFACE_OBSVECTOR_H_ 12 #define OOPS_INTERFACE_OBSVECTOR_H_ 18 #include <boost/scoped_ptr.hpp> 21 #include "oops/util/Logger.h" 22 #include "oops/util/ObjectCounter.h" 23 #include "oops/util/Printable.h" 24 #include "oops/util/Timer.h" 38 template <
typename MODEL>
39 class ObsVector :
public util::Printable,
40 private util::ObjectCounter<ObsVector<MODEL> > {
44 static const std::string
classname() {
return "oops::ObsVector";}
72 void read(
const std::string &);
73 void save(
const std::string &)
const;
76 void print(std::ostream &)
const;
77 boost::scoped_ptr<ObsVector_>
data_;
81 template <
typename MODEL>
83 Log::trace() <<
"ObsVector<MODEL>::ObsVector starting" << std::endl;
84 util::Timer timer(
classname(),
"ObsVector");
88 Log::trace() <<
"ObsVector<MODEL>::ObsVector done" << std::endl;
91 template <
typename MODEL>
93 Log::trace() <<
"ObsVector<MODEL>::ObsVector starting" << std::endl;
94 util::Timer timer(
classname(),
"ObsVector");
98 Log::trace() <<
"ObsVector<MODEL>::ObsVector done" << std::endl;
101 template <
typename MODEL>
103 Log::trace() <<
"ObsVector<MODEL>::ObsVector done" << std::endl;
106 template <
typename MODEL>
108 Log::trace() <<
"ObsVector<MODEL>::~ObsVector starting" << std::endl;
109 util::Timer timer(classname(),
"~ObsVector");
113 Log::trace() <<
"ObsVector<MODEL>::~ObsVector done" << std::endl;
116 template <
typename MODEL>
118 Log::trace() <<
"ObsVector<MODEL>::operator= starting" << std::endl;
119 util::Timer timer(classname(),
"operator=");
123 Log::trace() <<
"ObsVector<MODEL>::operator= done" << std::endl;
127 template <
typename MODEL>
129 Log::trace() <<
"ObsVector<MODEL>::operator*= starting" << std::endl;
130 util::Timer timer(classname(),
"operator*=");
134 Log::trace() <<
"ObsVector<MODEL>::operator*= done" << std::endl;
138 template <
typename MODEL>
140 Log::trace() <<
"ObsVector<MODEL>::operator+= starting" << std::endl;
141 util::Timer timer(classname(),
"operator+=");
143 *data_ += *rhs.data_;
145 Log::trace() <<
"ObsVector<MODEL>::operator+= done" << std::endl;
149 template <
typename MODEL>
151 Log::trace() <<
"ObsVector<MODEL>::operator-= starting" << std::endl;
152 util::Timer timer(classname(),
"operator-=");
154 *data_ -= *rhs.data_;
156 Log::trace() <<
"ObsVector<MODEL>::operator-= done" << std::endl;
160 template <
typename MODEL>
162 Log::trace() <<
"ObsVector<MODEL>::operator*= starting" << std::endl;
163 util::Timer timer(classname(),
"operator*=");
165 *data_ *= *rhs.data_;
167 Log::trace() <<
"ObsVector<MODEL>::operator*= done" << std::endl;
171 template <
typename MODEL>
173 Log::trace() <<
"ObsVector<MODEL>::operator/= starting" << std::endl;
174 util::Timer timer(classname(),
"operator/=");
176 *data_ /= *rhs.data_;
178 Log::trace() <<
"ObsVector<MODEL>::operator/= done" << std::endl;
182 template <
typename MODEL>
184 Log::trace() <<
"ObsVector<MODEL>::zero starting" << std::endl;
185 util::Timer timer(classname(),
"zero");
189 Log::trace() <<
"ObsVector<MODEL>::zero done" << std::endl;
192 template <
typename MODEL>
194 Log::trace() <<
"ObsVector<MODEL>::axpy starting" << std::endl;
195 util::Timer timer(classname(),
"axpy");
197 data_->axpy(zz, *rhs.data_);
199 Log::trace() <<
"ObsVector<MODEL>::axpy done" << std::endl;
202 template <
typename MODEL>
204 Log::trace() <<
"ObsVector<MODEL>::invert starting" << std::endl;
205 util::Timer timer(classname(),
"invert");
209 Log::trace() <<
"ObsVector<MODEL>::invert done" << std::endl;
212 template <
typename MODEL>
214 Log::trace() <<
"ObsVector<MODEL>::random starting" << std::endl;
215 util::Timer timer(classname(),
"random");
219 Log::trace() <<
"ObsVector<MODEL>::random done" << std::endl;
222 template <
typename MODEL>
224 Log::trace() <<
"ObsVector<MODEL>::dot_product starting" << std::endl;
225 util::Timer timer(classname(),
"dot_product");
227 const double zz = data_->dot_product_with(*other.data_);
229 Log::trace() <<
"ObsVector<MODEL>::dot_product done" << std::endl;
233 template <
typename MODEL>
235 Log::trace() <<
"ObsVector<MODEL>::rms starting" << std::endl;
236 util::Timer timer(classname(),
"rms");
238 const double zz = data_->rms();
240 Log::trace() <<
"ObsVector<MODEL>::rms done" << std::endl;
244 template <
typename MODEL>
246 Log::trace() <<
"ObsVector<MODEL>::print starting" << std::endl;
247 util::Timer timer(classname(),
"print");
251 Log::trace() <<
"ObsVector<MODEL>::print done" << std::endl;
254 template <
typename MODEL>
256 Log::trace() <<
"ObsVector<MODEL>::read starting" << std::endl;
257 util::Timer timer(classname(),
"read");
261 Log::trace() <<
"ObsVector<MODEL>::read done" << std::endl;
264 template <
typename MODEL>
266 Log::trace() <<
"ObsVector<MODEL>::save starting";
267 util::Timer timer(classname(),
"save");
271 Log::trace() <<
"ObsVector<MODEL>::save done" << std::endl;
277 #endif // OOPS_INTERFACE_OBSVECTOR_H_
void axpy(const double &, const ObsVector &)
ObsVector & operator=(const ObsVector &)
subroutine, public copy(self, rhs)
ObsVector(const ObservationSpace< MODEL > &)
const ObsVector_ & obsvector() const
void read(const std::string &)
The namespace for the main oops code.
unsigned int size() const
ObsVector & operator*=(const double &)
void print(std::ostream &) const
ObsVector_ & obsvector()
Interfacing.
boost::scoped_ptr< ObsVector_ > data_
void save(const std::string &) const
ObsVector & operator-=(const ObsVector &)
ObsVector & operator/=(const ObsVector &)
ObsSpace_ & observationspace() const
Interfacing.
double dot_product_with(const ObsVector &) const
ObsVector & operator+=(const ObsVector &)
MODEL::ObsVector ObsVector_
static const std::string classname()