FV3 Bundle
oops/qg/model/ObsBiasIncrement.h
Go to the documentation of this file.
1 /*
2  * (C) Copyright 2009-2016 ECMWF.
3  *
4  * This software is licensed under the terms of the Apache Licence Version 2.0
5  * which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
6  * In applying this licence, ECMWF does not waive the privileges and immunities
7  * granted to it by virtue of its status as an intergovernmental organisation nor
8  * does it submit to any jurisdiction.
9  */
10 
11 #ifndef QG_MODEL_OBSBIASINCREMENT_H_
12 #define QG_MODEL_OBSBIASINCREMENT_H_
13 
14 #include <iostream>
15 #include <vector>
16 
17 #include "oops/util/Printable.h"
18 
19 namespace eckit {
20  class Configuration;
21 }
22 
23 namespace qg {
24  class ObsBias;
25 
26 // -----------------------------------------------------------------------------
27 
28 class ObsBiasIncrement : public util::Printable {
29  public:
30 /// Constructor, destructor
32  explicit ObsBiasIncrement(const eckit::Configuration &);
33  ObsBiasIncrement(const ObsBiasIncrement &, const bool copy = true);
34  ObsBiasIncrement(const ObsBiasIncrement &, const eckit::Configuration &);
36 
37 /// Linear algebra operators
38  void diff(const ObsBias &, const ObsBias &);
39  void zero();
43  ObsBiasIncrement & operator*=(const double);
44  void axpy(const double, const ObsBiasIncrement &);
45  double dot_product_with(const ObsBiasIncrement &) const;
46 
47 /// I/O and diagnostics
48  void read(const eckit::Configuration &) {}
49  void write(const eckit::Configuration &) const {}
50  double norm() const;
51 
52  double & operator[](const unsigned int ii) {return bias_[ii];}
53  const double & operator[](const unsigned int ii) const {return bias_[ii];}
54 
55  double & stream() {return bias_[0];}
56  double & wind() {return bias_[1];}
57  double & wspd() {return bias_[3];}
58  const double & stream() const {return bias_[0];}
59  const double & wind() const {return bias_[1];}
60  const double & wspd() const {return bias_[3];}
61 
62  private:
63  void print(std::ostream &) const;
64  void makePassive();
65 
66  std::vector<double> bias_;
67  std::vector<bool> active_;
68 };
69 
70 // -----------------------------------------------------------------------------
71 
72 } // namespace qg
73 
74 #endif // QG_MODEL_OBSBIASINCREMENT_H_
void write(const eckit::Configuration &) const
ObsBiasIncrement & operator=(const ObsBiasIncrement &)
void diff(const ObsBias &, const ObsBias &)
Linear algebra operators.
double & operator[](const unsigned int ii)
const double & operator[](const unsigned int ii) const
subroutine, public copy(self, rhs)
void axpy(const double, const ObsBiasIncrement &)
void print(std::ostream &) const
ObsBiasIncrement & operator+=(const ObsBiasIncrement &)
ObsBiasIncrement & operator*=(const double)
Class to handle observation bias parameters.
double dot_product_with(const ObsBiasIncrement &) const
void read(const eckit::Configuration &)
I/O and diagnostics.
ObsBiasIncrement()
Constructor, destructor.
ObsBiasIncrement & operator-=(const ObsBiasIncrement &)
The namespace for the qg model.