IODA
|
ObsVector class to handle vectors in observation space for IODA. More...
#include <ObsVector.h>
Public Member Functions | |
ObsVector (ObsSpace &, const std::string &name="") | |
ObsVector (const ObsVector &) | |
~ObsVector () | |
ObsVector & | operator= (const ObsVector &) |
ObsVector & | operator*= (const double &) |
ObsVector & | operator+= (const ObsVector &) |
ObsVector & | operator-= (const ObsVector &) |
ObsVector & | operator*= (const ObsVector &) |
ObsVector & | operator/= (const ObsVector &) |
ObsVector & | operator= (const ObsDataVector< float > &) |
void | zero () |
void | ones () |
set all elements to one (used in tests) More... | |
void | axpy (const double &beta, const ObsVector &y) |
adds beta * y to the current vector More... | |
void | axpy (const std::vector< double > &beta, const ObsVector &y) |
void | invert () |
void | random () |
double | dot_product_with (const ObsVector &other) const |
global (across all MPI tasks) dot product of this with other More... | |
std::vector< double > | multivar_dot_product_with (const ObsVector &other) const |
double | rms () const |
std::size_t | size () const |
const double & | operator[] (const std::size_t ii) const |
double & | operator[] (const std::size_t ii) |
unsigned int | nobs () const |
Number of active observations (missing values not included) across all MPI tasks. More... | |
Eigen::VectorXd | packEigen (const ObsVector &mask) const |
size_t | packEigenSize (const ObsVector &mask) const |
const double & | toFortran () const |
double & | toFortran () |
ObsSpace & | space () |
const ObsSpace & | space () const |
const std::string & | obstype () const |
const oops::Variables & | varnames () const |
std::size_t | nvars () const |
std::size_t | nlocs () const |
void | mask (const ObsDataVector< int > &mask) |
Set this ObsVector values to missing where mask is non-zero. More... | |
void | mask (const ObsVector &mask) |
Set this ObsVector values to missing where mask has missing values. More... | |
bool | has (const std::string &var) const |
int64_t | getSeed () const |
void | save (const std::string &) const |
void | read (const std::string &) |
Static Public Member Functions | |
static const std::string | classname () |
Private Member Functions | |
void | print (std::ostream &) const |
Private Attributes | |
ObsSpace & | obsdb_ |
Associate ObsSpace object. More... | |
oops::Variables | obsvars_ |
Variables. More... | |
std::size_t | nvars_ |
Number of variables. More... | |
std::size_t | nlocs_ |
std::vector< double > | values_ |
Vector data. More... | |
const double | missing_ |
Missing data mark. More... | |
ObsVector class to handle vectors in observation space for IODA.
This class holds observation vector data. Examples of an obs vector are the y vector and the H(x) vector. The methods of this class that implement vector operations (e.g., bitwise add, bitwise subtract, dot product) are capable of handling missing values in the obs data.
Definition at line 33 of file src/ObsVector.h.
|
explicit |
ioda::ObsVector::ObsVector | ( | const ObsVector & | other | ) |
Definition at line 35 of file ObsVector.cc.
ioda::ObsVector::~ObsVector | ( | ) |
Definition at line 42 of file ObsVector.cc.
void ioda::ObsVector::axpy | ( | const double & | beta, |
const ObsVector & | y | ||
) |
adds beta
* y
to the current vector
Definition at line 121 of file ObsVector.cc.
void ioda::ObsVector::axpy | ( | const std::vector< double > & | beta, |
const ObsVector & | y | ||
) |
adds beta
[ivar] * y
[ivar] for each variable in the current vector. beta
has to be size of variables
Definition at line 133 of file ObsVector.cc.
|
inlinestatic |
Definition at line 36 of file src/ObsVector.h.
double ioda::ObsVector::dot_product_with | ( | const ObsVector & | other | ) | const |
global (across all MPI tasks) dot product of this with other
Definition at line 164 of file ObsVector.cc.
|
inline |
Definition at line 103 of file src/ObsVector.h.
|
inline |
Definition at line 101 of file src/ObsVector.h.
void ioda::ObsVector::invert | ( | ) |
Definition at line 149 of file ObsVector.cc.
void ioda::ObsVector::mask | ( | const ObsDataVector< int > & | mask | ) |
Set this ObsVector values to missing where mask
is non-zero.
Definition at line 281 of file ObsVector.cc.
void ioda::ObsVector::mask | ( | const ObsVector & | mask | ) |
Set this ObsVector values to missing where mask
has missing values.
Definition at line 293 of file ObsVector.cc.
std::vector< double > ioda::ObsVector::multivar_dot_product_with | ( | const ObsVector & | other | ) | const |
global (across all MPI tasks) dot product of this with other
, variable by variable. Returns vectors size of nvars_
Definition at line 169 of file ObsVector.cc.
|
inline |
unsigned int ioda::ObsVector::nobs | ( | ) | const |
Number of active observations (missing values not included) across all MPI tasks.
Definition at line 301 of file ObsVector.cc.
|
inline |
Definition at line 93 of file src/ObsVector.h.
|
inline |
Definition at line 91 of file src/ObsVector.h.
void ioda::ObsVector::ones | ( | ) |
set all elements to one (used in tests)
Definition at line 117 of file ObsVector.cc.
ObsVector & ioda::ObsVector::operator*= | ( | const double & | zz | ) |
Definition at line 50 of file ObsVector.cc.
Definition at line 85 of file ObsVector.cc.
Definition at line 59 of file ObsVector.cc.
Definition at line 72 of file ObsVector.cc.
Definition at line 98 of file ObsVector.cc.
ObsVector & ioda::ObsVector::operator= | ( | const ObsDataVector< float > & | rhs | ) |
Definition at line 45 of file ObsVector.cc.
|
inline |
Definition at line 73 of file src/ObsVector.h.
|
inline |
Definition at line 72 of file src/ObsVector.h.
Eigen::VectorXd ioda::ObsVector::packEigen | ( | const ObsVector & | mask | ) | const |
Pack observations local to this MPI task into an Eigen vector (excluding vector elements that are missing values, or where mask is equal to missing values
Definition at line 245 of file ObsVector.cc.
size_t ioda::ObsVector::packEigenSize | ( | const ObsVector & | mask | ) | const |
Number of non-masked out observations local to this MPI task (size of an Eigen vector returned by packEigen
)
Definition at line 235 of file ObsVector.cc.
|
private |
void ioda::ObsVector::random | ( | ) |
void ioda::ObsVector::read | ( | const std::string & | name | ) |
Definition at line 194 of file ObsVector.cc.
double ioda::ObsVector::rms | ( | ) | const |
Definition at line 186 of file ObsVector.cc.
void ioda::ObsVector::save | ( | const std::string & | name | ) | const |
|
inline |
Definition at line 71 of file src/ObsVector.h.
|
inline |
Definition at line 89 of file src/ObsVector.h.
|
inline |
Definition at line 90 of file src/ObsVector.h.
double & ioda::ObsVector::toFortran | ( | ) |
Definition at line 311 of file ObsVector.cc.
const double & ioda::ObsVector::toFortran | ( | ) | const |
Definition at line 307 of file ObsVector.cc.
|
inline |
Definition at line 92 of file src/ObsVector.h.
void ioda::ObsVector::zero | ( | ) |
Definition at line 111 of file ObsVector.cc.
|
private |
Missing data mark.
Definition at line 126 of file src/ObsVector.h.
|
private |
Definition at line 120 of file src/ObsVector.h.
|
private |
Number of variables.
Definition at line 119 of file src/ObsVector.h.
|
private |
Associate ObsSpace object.
Definition at line 113 of file src/ObsVector.h.
|
private |
Variables.
Definition at line 116 of file src/ObsVector.h.
|
private |
Vector data.
Definition at line 123 of file src/ObsVector.h.