OPAL (Object Oriented Parallel Accelerator Library) 2022.1
OPAL
Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes | List of all members
FromFile Struct Reference

#include <FromFile.h>

Inheritance diagram for FromFile:
Inheritance graph
[legend]
Collaboration diagram for FromFile:
Collaboration graph
[legend]

Public Member Functions

 FromFile (const std::string &filename, const std::string &dvarName, size_t modulo)
 
void create (boost::shared_ptr< SampleIndividual > &ind, size_t i)
 
void allocate (const CmdArguments_t &, const Comm::Bundle_t &)
 
double getNext (unsigned int id)
 
unsigned int getSize () const
 
 ~FromFile ()
 
Expressions::Result_t operator() (client::function::arguments_t args)
 
- Public Member Functions inherited from SamplingMethod
virtual ~SamplingMethod ()
 
virtual void create (boost::shared_ptr< SampleIndividual > &ind, size_t i)=0
 
virtual void allocate (const CmdArguments_t &, const Comm::Bundle_t &)
 

Static Public Attributes

static const std::string name
 

Private Member Functions

void readValues ()
 reads a simple list of double values More...
 

Private Attributes

std::vector< double > chain_m
 
size_t mod_m
 
std::string filename_m
 
std::string dvarName_m
 
unsigned int globalSize_m
 
std::vector< double > values_
 
std::string filename_
 

Detailed Description

Definition at line 38 of file FromFile.h.

Constructor & Destructor Documentation

◆ FromFile()

FromFile::FromFile ( const std::string &  filename,
const std::string &  dvarName,
size_t  modulo 
)
inline

Definition at line 43 of file FromFile.h.

References end(), filename_m, and globalSize_m.

Here is the call graph for this function:

◆ ~FromFile()

FromFile::~FromFile ( )
inline

Definition at line 134 of file FromFile.h.

Member Function Documentation

◆ allocate()

void FromFile::allocate ( const CmdArguments_t ,
const Comm::Bundle_t  
)
inlinevirtual

Allocate memory for sampling. Not every sampling method requires that.

This function is used to reduce memory since only the sampler ranks need these sampling methods.

Parameters
argssamler arguments
commsampler communicator

Reimplemented from SamplingMethod.

Definition at line 85 of file FromFile.h.

References chain_m, dvarName_m, filename_m, and globalSize_m.

◆ create()

void FromFile::create ( boost::shared_ptr< SampleIndividual > &  ind,
size_t  i 
)
inlinevirtual

Implements SamplingMethod.

Definition at line 81 of file FromFile.h.

References getNext().

Here is the call graph for this function:

◆ getNext()

double FromFile::getNext ( unsigned int  id)
inline

Definition at line 124 of file FromFile.h.

References chain_m, globalSize_m, and mod_m.

Referenced by create().

◆ getSize()

unsigned int FromFile::getSize ( ) const
inline

Definition at line 130 of file FromFile.h.

References globalSize_m.

◆ operator()()

Expressions::Result_t FromFile::operator() ( client::function::arguments_t  args)
inline

Definition at line 48 of file FromFile.h.

References Physics::e, filename_, readValues(), sum(), and values_.

Here is the call graph for this function:

◆ readValues()

void FromFile::readValues ( )
private

reads a simple list of double values

Definition at line 29 of file FromFile.cpp.

References filename_, and values_.

Referenced by operator()().

Member Data Documentation

◆ chain_m

std::vector<double> FromFile::chain_m
private

Definition at line 137 of file FromFile.h.

Referenced by allocate(), and getNext().

◆ dvarName_m

std::string FromFile::dvarName_m
private

Definition at line 140 of file FromFile.h.

Referenced by allocate().

◆ filename_

std::string FromFile::filename_
private

Definition at line 76 of file FromFile.h.

Referenced by operator()(), and readValues().

◆ filename_m

std::string FromFile::filename_m
private

Definition at line 139 of file FromFile.h.

Referenced by allocate(), and FromFile().

◆ globalSize_m

unsigned int FromFile::globalSize_m
private

Definition at line 142 of file FromFile.h.

Referenced by allocate(), FromFile(), getNext(), and getSize().

◆ mod_m

size_t FromFile::mod_m
private

Definition at line 138 of file FromFile.h.

Referenced by getNext().

◆ name

const std::string FromFile::name
static

Definition at line 46 of file FromFile.h.

◆ values_

std::vector<double> FromFile::values_
private

Definition at line 74 of file FromFile.h.

Referenced by operator()(), and readValues().


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