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

AnEnIS is an implementation of the class AnEn for the independent search algorithm. More...

#include <AnEnIS.h>

Inheritance diagram for AnEnIS:
AnEn AnEnISMPI AnEnSSE testAnEnIS AnEnSSEMS testAnEnSSEMS

Public Member Functions

 AnEnIS ()
 
 AnEnIS (const AnEnIS &orig)
 
 AnEnIS (const Config &)
 
virtual ~AnEnIS ()
 
virtual void compute (const Forecasts &forecasts, const Observations &observations, const Times &test_times, const Times &search_times) override
 
virtual void compute (const Forecasts &forecasts, const Observations &observations, std::vector< std::size_t > &fcsts_test_index, std::vector< std::size_t > &fcsts_search_index) override
 
virtual void print (std::ostream &) const override
 
AnEnISoperator= (const AnEnIS &rhs)
 
std::size_t num_analogs () const
 
std::size_t num_sims () const
 
std::size_t obs_var_index () const
 
std::size_t max_par_nan () const
 
std::size_t max_flt_nan () const
 
std::size_t flt_radius () const
 
bool save_analogs () const
 
bool save_analogs_time_index () const
 
bool save_sims () const
 
bool save_sims_time_index () const
 
bool operation () const
 
bool quick_sort () const
 
bool prevent_search_future () const
 
bool no_norm () const
 
const std::vector< double > & weights () const
 
const Array4DPointersds () const
 
const Array4DPointersims_metric () const
 
const Array4DPointersims_time_index () const
 
const Array4DPointeranalogs_value () const
 
const Array4DPointeranalogs_time_index () const
 
const Functions::Matrixobs_time_index_table () const
 
- Public Member Functions inherited from AnEn
 AnEn ()
 
 AnEn (const AnEn &orig)
 
 AnEn (const Config &)
 
virtual ~AnEn ()
 
virtual const ProfilergetProfile () const
 
AnEnoperator= (const AnEn &rhs)
 

Static Public Attributes

static const std::size_t _SIM_VALUE_INDEX = 0
 
static const std::size_t _SIM_FCST_TIME_INDEX = 1
 
static const std::size_t _SIM_OBS_TIME_INDEX = 2
 
static const std::array< double, 3 > _INIT_ARR_VALUE = {NAN, NAN, NAN}
 

Protected Member Functions

virtual void preprocess_ (const Forecasts &forecasts, const Observations &observations, std::vector< std::size_t > &fcsts_test_index, std::vector< std::size_t > &fcsts_search_index)
 
virtual void allocateMemory_ (const Forecasts &forecasts, const std::vector< std::size_t > &fcsts_test_index, const std::vector< std::size_t > &fcsts_search_index)
 
virtual void setMembers_ (const Config &) override
 
virtual void setSdsTimeMap_ (const std::vector< std::size_t > &times_accum_index)
 
virtual double computeSimMetric_ (const Forecasts &forecasts, std::size_t sta_test_i, std::size_t sta_search_i, std::size_t flt_i, std::size_t time_test_i, std::size_t time_search_i, const std::vector< bool > &circulars)
 
virtual void allocateSds_ (const Forecasts &forecasts, const std::vector< std::size_t > &times_fixed_index, const std::vector< std::size_t > &times_accum_index={})
 
virtual void computeSds_ (const Forecasts &forecasts, const std::vector< std::size_t > &times_fixed_index, const std::vector< std::size_t > &times_accum_index={})
 
virtual void checkIndexRange_ (const Forecasts &forecasts, const std::vector< std::size_t > &fcsts_test_index, const std::vector< std::size_t > &fcsts_search_index) const
 
virtual void checkConsistency_ (const Forecasts &forecasts, const Observations &observations) const
 
virtual void checkSave_ () const
 
virtual void checkNumberOfMembers_ (std::size_t num_search_times_index)
 
template<std::size_t len>
void saveAnalogs_ (const SimsVec< len > &sims_arr, const Observations &observations, std::size_t station_i, std::size_t test_time_i, std::size_t flt_i)
 
template<std::size_t len>
void saveAnalogsTimeIndex_ (const SimsVec< len > &sims_arr, std::size_t station_i, std::size_t test_time_i, std::size_t flt_i)
 
template<std::size_t len>
void saveSims_ (const SimsVec< len > &sims_arr, std::size_t station_i, std::size_t test_time_i, std::size_t flt_i)
 
template<std::size_t len>
void saveSimsTimeIndex_ (const SimsVec< len > &sims_arr, std::size_t station_i, std::size_t test_time_i, std::size_t flt_i)
 

Static Protected Member Functions

static bool _simsSort_ (const std::array< double, 3 > &, const std::array< double, 3 > &)
 

Protected Attributes

std::size_t num_analogs_
 
std::size_t num_sims_
 
std::size_t obs_var_index_
 
std::size_t max_par_nan_
 
std::size_t max_flt_nan_
 
std::size_t flt_radius_
 
bool save_analogs_
 
bool save_analogs_time_index_
 
bool save_sims_
 
bool save_sims_time_index_
 
bool operation_
 
bool quick_sort_
 
bool prevent_search_future_
 
bool no_norm_
 
std::vector< double > weights_
 
Array4DPointer sds_
 
std::unordered_map< std::size_t, std::size_t > sds_time_index_map_
 
Array4DPointer sims_metric_
 
Array4DPointer sims_time_index_
 
Array4DPointer analogs_value_
 
Array4DPointer analogs_time_index_
 
Functions::Matrix obs_time_index_table_
 
bool use_AI_
 
- Protected Attributes inherited from AnEn
Verbose verbose_
 
Profiler profiler_
 

Friends

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

Detailed Description

AnEnIS is an implementation of the class AnEn for the independent search algorithm.

Constructor & Destructor Documentation

◆ AnEnIS() [1/3]

AnEnIS::AnEnIS ( )

◆ AnEnIS() [2/3]

AnEnIS::AnEnIS ( const AnEnIS orig)

◆ AnEnIS() [3/3]

AnEnIS::AnEnIS ( const Config config)

◆ ~AnEnIS()

AnEnIS::~AnEnIS ( )
virtual

Member Function Documentation

◆ _simsSort_()

bool AnEnIS::_simsSort_ ( const std::array< double, 3 > &  ,
const std::array< double, 3 > &   
)
staticprotected

This is the function to sort the similarity vector based on the similarity metric from the array of length 3.

This function is static because it is called by the sorting algorithm

◆ allocateMemory_()

void AnEnIS::allocateMemory_ ( const Forecasts forecasts,
const std::vector< std::size_t > &  fcsts_test_index,
const std::vector< std::size_t > &  fcsts_search_index 
)
protectedvirtual

Reimplemented in AnEnSSE, and AnEnSSEMS.

◆ allocateSds_()

void AnEnIS::allocateSds_ ( const Forecasts forecasts,
const std::vector< std::size_t > &  times_fixed_index,
const std::vector< std::size_t > &  times_accum_index = {} 
)
protectedvirtual

◆ analogs_time_index()

const Array4DPointer & AnEnIS::analogs_time_index ( ) const

◆ analogs_value()

const Array4DPointer & AnEnIS::analogs_value ( ) const

◆ checkConsistency_()

void AnEnIS::checkConsistency_ ( const Forecasts forecasts,
const Observations observations 
) const
protectedvirtual

Reimplemented in AnEnSSEMS.

◆ checkIndexRange_()

void AnEnIS::checkIndexRange_ ( const Forecasts forecasts,
const std::vector< std::size_t > &  fcsts_test_index,
const std::vector< std::size_t > &  fcsts_search_index 
) const
protectedvirtual

◆ checkNumberOfMembers_()

void AnEnIS::checkNumberOfMembers_ ( std::size_t  num_search_times_index)
protectedvirtual

Reimplemented in AnEnSSE.

◆ checkSave_()

void AnEnIS::checkSave_ ( ) const
protectedvirtual

Reimplemented in AnEnSSE.

◆ compute() [1/2]

void AnEnIS::compute ( const Forecasts forecasts,
const Observations observations,
const Times test_times,
const Times search_times 
)
overridevirtual

Computes the analog ensembles.

Parameters
forecastsForecasts
observationsObservations
test_timesTimes for test
search_timesTimes for search

Implements AnEn.

Reimplemented in AnEnSSE, AnEnSSEMS, and AnEnISMPI.

◆ compute() [2/2]

virtual void AnEnIS::compute ( const Forecasts forecasts,
const Observations observations,
std::vector< std::size_t > &  fcsts_test_index,
std::vector< std::size_t > &  fcsts_search_index 
)
overridevirtual

Computes the analog ensembles.

Parameters
fcsts_test_indexA vector of forecast test indices
fcsts_search_indexA vector of forecast search indices

Implements AnEn.

Reimplemented in AnEnSSE, AnEnSSE, AnEnSSEMS, AnEnSSEMS, AnEnSSEMS, AnEnISMPI, and AnEnISMPI.

◆ computeSds_()

void AnEnIS::computeSds_ ( const Forecasts forecasts,
const std::vector< std::size_t > &  times_fixed_index,
const std::vector< std::size_t > &  times_accum_index = {} 
)
protectedvirtual

Reimplemented in AnEnISMPI.

◆ computeSimMetric_()

double AnEnIS::computeSimMetric_ ( const Forecasts forecasts,
std::size_t  sta_test_i,
std::size_t  sta_search_i,
std::size_t  flt_i,
std::size_t  time_test_i,
std::size_t  time_search_i,
const std::vector< bool > &  circulars 
)
protectedvirtual

◆ flt_radius()

size_t AnEnIS::flt_radius ( ) const

◆ max_flt_nan()

size_t AnEnIS::max_flt_nan ( ) const

◆ max_par_nan()

size_t AnEnIS::max_par_nan ( ) const

◆ no_norm()

bool AnEnIS::no_norm ( ) const

◆ num_analogs()

size_t AnEnIS::num_analogs ( ) const

◆ num_sims()

size_t AnEnIS::num_sims ( ) const

◆ obs_time_index_table()

const Functions::Matrix & AnEnIS::obs_time_index_table ( ) const

◆ obs_var_index()

size_t AnEnIS::obs_var_index ( ) const

◆ operation()

bool AnEnIS::operation ( ) const

◆ operator=()

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

◆ preprocess_()

void AnEnIS::preprocess_ ( const Forecasts forecasts,
const Observations observations,
std::vector< std::size_t > &  fcsts_test_index,
std::vector< std::size_t > &  fcsts_search_index 
)
protectedvirtual

Reimplemented in AnEnSSE.

◆ prevent_search_future()

bool AnEnIS::prevent_search_future ( ) const

◆ print()

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

Reimplemented from AnEn.

Reimplemented in AnEnSSE.

◆ quick_sort()

bool AnEnIS::quick_sort ( ) const

◆ save_analogs()

bool AnEnIS::save_analogs ( ) const

◆ save_analogs_time_index()

bool AnEnIS::save_analogs_time_index ( ) const

◆ save_sims()

bool AnEnIS::save_sims ( ) const

◆ save_sims_time_index()

bool AnEnIS::save_sims_time_index ( ) const

◆ saveAnalogs_()

template<std::size_t len>
void AnEnIS::saveAnalogs_ ( const SimsVec< len > &  sims_arr,
const Observations observations,
std::size_t  station_i,
std::size_t  test_time_i,
std::size_t  flt_i 
)
protected

◆ saveAnalogsTimeIndex_()

template<std::size_t len>
void AnEnIS::saveAnalogsTimeIndex_ ( const SimsVec< len > &  sims_arr,
std::size_t  station_i,
std::size_t  test_time_i,
std::size_t  flt_i 
)
protected

◆ saveSims_()

template<std::size_t len>
void AnEnIS::saveSims_ ( const SimsVec< len > &  sims_arr,
std::size_t  station_i,
std::size_t  test_time_i,
std::size_t  flt_i 
)
protected

◆ saveSimsTimeIndex_()

template<std::size_t len>
void AnEnIS::saveSimsTimeIndex_ ( const SimsVec< len > &  sims_arr,
std::size_t  station_i,
std::size_t  test_time_i,
std::size_t  flt_i 
)
protected

◆ sds()

const Array4DPointer & AnEnIS::sds ( ) const

◆ setMembers_()

void AnEnIS::setMembers_ ( const Config config)
overrideprotectedvirtual

Reimplemented from AnEn.

Reimplemented in AnEnSSE.

◆ setSdsTimeMap_()

void AnEnIS::setSdsTimeMap_ ( const std::vector< std::size_t > &  times_accum_index)
protectedvirtual

◆ sims_metric()

const Array4DPointer & AnEnIS::sims_metric ( ) const

◆ sims_time_index()

const Array4DPointer & AnEnIS::sims_time_index ( ) const

◆ weights()

const vector< double > & AnEnIS::weights ( ) const

Friends And Related Function Documentation

◆ operator<<

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

Member Data Documentation

◆ _INIT_ARR_VALUE

const array< double, 3 > AnEnIS::_INIT_ARR_VALUE = {NAN, NAN, NAN}
static

This is the default value for similarity array

◆ _SIM_FCST_TIME_INDEX

const size_t AnEnIS::_SIM_FCST_TIME_INDEX = 1
static

◆ _SIM_OBS_TIME_INDEX

const size_t AnEnIS::_SIM_OBS_TIME_INDEX = 2
static

◆ _SIM_VALUE_INDEX

const size_t AnEnIS::_SIM_VALUE_INDEX = 0
static

These variables define what the value is on different positions in the similarity array.

◆ analogs_time_index_

Array4DPointer AnEnIS::analogs_time_index_
protected

◆ analogs_value_

Array4DPointer AnEnIS::analogs_value_
protected

Arrays for storing analog information

◆ flt_radius_

std::size_t AnEnIS::flt_radius_
protected

◆ max_flt_nan_

std::size_t AnEnIS::max_flt_nan_
protected

◆ max_par_nan_

std::size_t AnEnIS::max_par_nan_
protected

◆ no_norm_

bool AnEnIS::no_norm_
protected

◆ num_analogs_

std::size_t AnEnIS::num_analogs_
protected

◆ num_sims_

std::size_t AnEnIS::num_sims_
protected

◆ obs_time_index_table_

Functions::Matrix AnEnIS::obs_time_index_table_
protected

Matrix for the time index table from forecasts to observations

◆ obs_var_index_

std::size_t AnEnIS::obs_var_index_
protected

◆ operation_

bool AnEnIS::operation_
protected

◆ prevent_search_future_

bool AnEnIS::prevent_search_future_
protected

◆ quick_sort_

bool AnEnIS::quick_sort_
protected

◆ save_analogs_

bool AnEnIS::save_analogs_
protected

◆ save_analogs_time_index_

bool AnEnIS::save_analogs_time_index_
protected

◆ save_sims_

bool AnEnIS::save_sims_
protected

◆ save_sims_time_index_

bool AnEnIS::save_sims_time_index_
protected

◆ sds_

Array4DPointer AnEnIS::sds_
protected

The standard deviation array has the following dimensions

[Parameters][Stations][FLTs][Times]

◆ sds_time_index_map_

std::unordered_map<std::size_t, std::size_t> AnEnIS::sds_time_index_map_
protected

The time index map is used in operational mode. The key is the test time and the the value is the corresponding index of the time dimension in the standard deviation array.

◆ sims_metric_

Array4DPointer AnEnIS::sims_metric_
protected

Arrays for storing similarity information

◆ sims_time_index_

Array4DPointer AnEnIS::sims_time_index_
protected

◆ use_AI_

bool AnEnIS::use_AI_
protected

◆ weights_

std::vector<double> AnEnIS::weights_
protected

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