OPAL (Object Oriented Parallel Accelerator Library)  2.2.0
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 &args, const Comm::Bundle_t &comm)
 
double getNext ()
 
unsigned int getSize () const
 
Expressions::Result_t operator() (client::function::arguments_t args)
 
- Public Member Functions inherited from SamplingMethod
virtual ~SamplingMethod ()
 

Static Public Attributes

static const std::string name
 

Private Member Functions

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

Private Attributes

std::vector< double > chain_m
 
unsigned int n_m
 
size_t counter_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

Parse file that contains design variable values. Each column belongs to a design variable. The first line is considered as header and consists of the design variable name. The name has to agree with the string in the input file.

Simple functor that reads vector data from a file. If the file contains more than one value the sum is returned.

\[ result = \sum_{i=0}^n value_i \]

Definition at line 21 of file FromFile.h.

Constructor & Destructor Documentation

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

Definition at line 26 of file FromFile.h.

References filename_m, and globalSize_m.

Member Function Documentation

void FromFile::allocate ( const CmdArguments_t args,
const Comm::Bundle_t comm 
)
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 70 of file FromFile.h.

References chain_m, dvarName_m, filename_m, Comm::Bundle_t::island_id, and max().

Here is the call graph for this function:

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

Implements SamplingMethod.

Definition at line 66 of file FromFile.h.

References getNext().

Here is the call graph for this function:

double FromFile::getNext ( )
inline

Definition at line 135 of file FromFile.h.

References chain_m, incrementCounter(), and n_m.

Referenced by create().

Here is the call graph for this function:

unsigned int FromFile::getSize ( ) const
inline

Definition at line 142 of file FromFile.h.

References globalSize_m.

void FromFile::incrementCounter ( )
inlineprivate

Definition at line 156 of file FromFile.h.

References chain_m, counter_m, mod_m, and n_m.

Referenced by getNext().

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

Definition at line 31 of file FromFile.h.

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

Here is the call graph for this function:

void FromFile::readValues ( )
private

reads a simple list of double values

Definition at line 4 of file FromFile.cpp.

References filename_, and values_.

Referenced by operator()().

Member Data Documentation

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

Definition at line 147 of file FromFile.h.

Referenced by allocate(), getNext(), and incrementCounter().

size_t FromFile::counter_m
private

Definition at line 149 of file FromFile.h.

Referenced by incrementCounter().

std::string FromFile::dvarName_m
private

Definition at line 152 of file FromFile.h.

Referenced by allocate().

std::string FromFile::filename_
private

Definition at line 59 of file FromFile.h.

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

std::string FromFile::filename_m
private

Definition at line 151 of file FromFile.h.

Referenced by allocate(), and FromFile().

unsigned int FromFile::globalSize_m
private

Definition at line 154 of file FromFile.h.

Referenced by FromFile(), and getSize().

size_t FromFile::mod_m
private

Definition at line 150 of file FromFile.h.

Referenced by incrementCounter().

unsigned int FromFile::n_m
private

Definition at line 148 of file FromFile.h.

Referenced by getNext(), and incrementCounter().

const std::string FromFile::name
static

Definition at line 29 of file FromFile.h.

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

Definition at line 57 of file FromFile.h.

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


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