ObservationsPointer is an implementation of the abstract class Observations. The underlying storage uses a pointer which is optimized for performance.
More...
#include <ObservationsPointer.h>
|
| ObservationsPointer () |
|
| ObservationsPointer (const ObservationsPointer &orig) |
|
| ObservationsPointer (const Parameters &, const Stations &, const Times &) |
|
virtual | ~ObservationsPointer () |
|
std::size_t | num_elements () const override |
|
const double * | getValuesPtr () const override |
|
double * | getValuesPtr () override |
|
virtual void | setDimensions (const Parameters ¶meters, const Stations &stations, const Times ×) override |
|
virtual void | initialize (double) override |
|
virtual double | getValue (std::size_t parameter_index, std::size_t station_index, std::size_t time_index) const override |
|
virtual void | setValue (double val, std::size_t parameter_index, std::size_t station_index, std::size_t time_index) override |
|
virtual void | subset (Observations &) const override |
|
virtual void | subset (const Parameters &, const Stations &, const Times &, Observations &) const override |
|
virtual void | print (std::ostream &) const override |
|
| Observations () |
|
| Observations (const Observations &orig) |
|
| Observations (const Parameters &, const Stations &, const Times &) |
|
virtual | ~Observations () |
|
| BasicData () |
|
| BasicData (const Parameters &, const Stations &, const Times &) |
|
| BasicData (const BasicData &orig) |
|
virtual | ~BasicData () |
|
void | setMembers (const Parameters &, const Stations &, const Times &) |
|
const Parameters & | getParameters () const |
|
const Stations & | getStations () const |
|
const Times & | getTimes () const |
|
Parameters & | getParameters () |
|
Stations & | getStations () |
|
Times & | getTimes () |
|
std::size_t | getTimeStamp (std::size_t index) const |
|
std::size_t | getTimeIndex (std::size_t timestamp) const |
|
std::size_t | getTimeIndex (const Time &) const |
|
BasicData & | operator= (const BasicData &) |
|
ObservationsPointer is an implementation of the abstract class Observations. The underlying storage uses a pointer which is optimized for performance.
◆ ObservationsPointer() [1/3]
ObservationsPointer::ObservationsPointer |
( |
| ) |
|
◆ ObservationsPointer() [2/3]
◆ ObservationsPointer() [3/3]
ObservationsPointer::ObservationsPointer |
( |
const Parameters & |
parameters, |
|
|
const Stations & |
stations, |
|
|
const Times & |
times |
|
) |
| |
◆ ~ObservationsPointer()
ObservationsPointer::~ObservationsPointer |
( |
| ) |
|
|
virtual |
◆ allocateMemory_()
void ObservationsPointer::allocateMemory_ |
( |
| ) |
|
|
protected |
◆ getValue()
double ObservationsPointer::getValue |
( |
std::size_t |
parameter_index, |
|
|
std::size_t |
station_index, |
|
|
std::size_t |
time_index |
|
) |
| const |
|
overridevirtual |
Gets or sets a value using the array indices.
- Parameters
-
- Returns
- a value.
Implements Observations.
◆ getValuesPtr() [1/2]
const double * ObservationsPointer::getValuesPtr |
( |
| ) |
const |
|
overridevirtual |
Gets a double pointer to the start of the values.
- Returns
- A double pointer.
Implements Observations.
◆ getValuesPtr() [2/2]
double * ObservationsPointer::getValuesPtr |
( |
| ) |
|
|
overridevirtual |
◆ initialize()
void ObservationsPointer::initialize |
( |
double |
value | ) |
|
|
overridevirtual |
◆ num_elements()
size_t ObservationsPointer::num_elements |
( |
| ) |
const |
|
overridevirtual |
Returns the total number of data values as one dimension.
- Returns
- A value.
Implements Observations.
◆ print()
void ObservationsPointer::print |
( |
std::ostream & |
os | ) |
const |
|
overridevirtual |
◆ setDimensions()
void ObservationsPointer::setDimensions |
( |
const Parameters & |
parameters, |
|
|
const Stations & |
stations, |
|
|
const Times & |
times |
|
) |
| |
|
overridevirtual |
Sets the dimensions of forecasts and allocates memory for data values.
- Parameters
-
Implements Observations.
◆ setValue()
void ObservationsPointer::setValue |
( |
double |
val, |
|
|
std::size_t |
parameter_index, |
|
|
std::size_t |
station_index, |
|
|
std::size_t |
time_index |
|
) |
| |
|
overridevirtual |
◆ subset() [1/2]
◆ subset() [2/2]
Subset Observations. Dimensions to be extracted are determined from the function input Observations. The input Observations should have already allocated enough memory by calling setDimensions prior to this function call.
Implements Observations.
◆ subset_data_() [1/2]
◆ subset_data_() [2/2]
void ObservationsPointer::subset_data_ |
( |
const std::vector< std::size_t > & |
, |
|
|
const std::vector< std::size_t > & |
, |
|
|
const std::vector< std::size_t > & |
, |
|
|
double * |
|
|
) |
| const |
|
protected |
◆ toIndex_()
size_t ObservationsPointer::toIndex_ |
( |
size_t |
dim0, |
|
|
size_t |
dim1, |
|
|
size_t |
dim2 |
|
) |
| const |
|
protected |
◆ operator<<
◆ _DIM_PARAMETER
const size_t ObservationsPointer::_DIM_PARAMETER = 0 |
|
static |
◆ _DIM_STATION
const size_t ObservationsPointer::_DIM_STATION = 1 |
|
static |
◆ _DIM_TIME
const size_t ObservationsPointer::_DIM_TIME = 2 |
|
static |
◆ allocated_
bool ObservationsPointer::allocated_ |
|
protected |
This variable is used to keep track of whether the data memory is allocated internally and whether the pointer should be deleted during the de-constructor.
◆ data_
double* ObservationsPointer::data_ |
|
protected |
◆ dims_
The documentation for this class was generated from the following files: