Parallel Analog Ensemble
Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | Friends | List of all members
Array4DPointer Class Reference

Array4DPointer is an implementation of the abstract class Array4D. More...

#include <Array4DPointer.h>

Inheritance diagram for Array4DPointer:
Array4D ForecastsPointer

Public Member Functions

 Array4DPointer ()
 
 Array4DPointer (const Array4DPointer &orig)
 
 Array4DPointer (std::size_t, std::size_t, std::size_t, std::size_t)
 
virtual ~Array4DPointer ()
 
virtual const std::size_t * shape () const override
 
virtual std::size_t num_elements () const override
 
virtual const double * getValuesPtr () const override
 
virtual double * getValuesPtr () override
 
virtual void resize (std::size_t, std::size_t, std::size_t, std::size_t) override
 
virtual void resize (const Array4D &) override
 
virtual void initialize (double value) override
 
virtual double getValue (std::size_t, std::size_t, std::size_t, std::size_t) const override
 
virtual void setValue (double val, std::size_t, std::size_t, std::size_t, std::size_t) override
 
virtual void subset (const std::vector< std::size_t > &, const std::vector< std::size_t > &, const std::vector< std::size_t > &, const std::vector< std::size_t > &, Array4D &) const override
 
virtual void print (std::ostream &) const override
 
Array4DPointeroperator= (const Array4DPointer &)
 
bool operator== (const Array4DPointer &) const
 
- Public Member Functions inherited from Array4D
 Array4D ()=default
 
 Array4D (const Array4D &orig)=default
 
virtual ~Array4D ()=default
 

Static Public Attributes

static const double _DEFAULT_VALUE = NAN
 

Protected Member Functions

std::size_t toIndex_ (std::size_t, std::size_t, std::size_t, std::size_t) const
 
void allocateMemory_ ()
 

Protected Attributes

vector4 dims_
 
double * data_
 
bool allocated_
 

Friends

std::ostream & operator<< (std::ostream &, const Array4DPointer &)
 

Detailed Description

Array4DPointer is an implementation of the abstract class Array4D.

Constructor & Destructor Documentation

◆ Array4DPointer() [1/3]

Array4DPointer::Array4DPointer ( )

◆ Array4DPointer() [2/3]

Array4DPointer::Array4DPointer ( const Array4DPointer orig)

◆ Array4DPointer() [3/3]

Array4DPointer::Array4DPointer ( std::size_t  ,
std::size_t  ,
std::size_t  ,
std::size_t   
)

◆ ~Array4DPointer()

Array4DPointer::~Array4DPointer ( )
virtual

Member Function Documentation

◆ allocateMemory_()

void Array4DPointer::allocateMemory_ ( )
protected

◆ getValue()

double Array4DPointer::getValue ( std::size_t  ,
std::size_t  ,
std::size_t  ,
std::size_t   
) const
overridevirtual

Gets or sets a value using the array indices.

Parameters
parameter_indexParameter index.
station_indexStation index.
time_indexTime index.
flt_indexFLT index.
Returns
A value.

Implements Array4D.

◆ getValuesPtr() [1/2]

const double * Array4DPointer::getValuesPtr ( ) const
overridevirtual

Gets a double pointer to the start of the values.

Returns
A double pointer.

Implements Array4D.

◆ getValuesPtr() [2/2]

double * Array4DPointer::getValuesPtr ( )
overridevirtual

Implements Array4D.

◆ initialize()

void Array4DPointer::initialize ( double  )
overridevirtual

Initialize the values

Parameters
Thevalue for initialization

Implements Array4D.

◆ num_elements()

size_t Array4DPointer::num_elements ( ) const
overridevirtual

Returns the total number of data values.

Returns
A value.

Implements Array4D.

◆ operator=()

Array4DPointer & Array4DPointer::operator= ( const Array4DPointer rhs)

◆ operator==()

bool Array4DPointer::operator== ( const Array4DPointer rhs) const

◆ print()

void Array4DPointer::print ( std::ostream &  ) const
overridevirtual

Implements Array4D.

Reimplemented in ForecastsPointer.

◆ resize() [1/2]

void Array4DPointer::resize ( const Array4D arr)
overridevirtual

Implements Array4D.

◆ resize() [2/2]

virtual void Array4DPointer::resize ( std::size_t  ,
std::size_t  ,
std::size_t  ,
std::size_t   
)
overridevirtual

Resize the dimensions and allocate memory.

Parameters
Lengthof the first dimension
Lengthof the second dimension
Lengthof the third dimension
Lengthof the fourth dimension

Implements Array4D.

◆ setValue()

void Array4DPointer::setValue ( double  val,
std::size_t  ,
std::size_t  ,
std::size_t  ,
std::size_t   
)
overridevirtual

Implements Array4D.

◆ shape()

const size_t * Array4DPointer::shape ( ) const
overridevirtual

Implements Array4D.

◆ subset()

void Array4DPointer::subset ( const std::vector< std::size_t > &  ,
const std::vector< std::size_t > &  ,
const std::vector< std::size_t > &  ,
const std::vector< std::size_t > &  ,
Array4D  
) const
overridevirtual

Implements Array4D.

◆ toIndex_()

size_t Array4DPointer::toIndex_ ( std::size_t  ,
std::size_t  ,
std::size_t  ,
std::size_t   
) const
protected

Friends And Related Function Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream &  ,
const Array4DPointer  
)
friend

Member Data Documentation

◆ _DEFAULT_VALUE

const double Array4DPointer::_DEFAULT_VALUE = NAN
static

◆ allocated_

bool Array4DPointer::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* Array4DPointer::data_
protected

◆ dims_

vector4 Array4DPointer::dims_
protected

The documentation for this class was generated from the following files: