Miind
|
#include <libs/MPILib/include/AlgorithmGrid.hpp>
Public Member Functions | |
AlgorithmGrid (Number) | |
AlgorithmGrid (const std::vector< double > &array_state) | |
AlgorithmGrid (const std::vector< double > &array_state, const std::vector< double > &array_interpretation) | |
AlgorithmGrid & | operator= (const AlgorithmGrid &rhs) |
std::vector< double > | toInterpretationVector () const |
std::vector< double > | toStateVector () const |
Private Member Functions | |
const double * | begin_interpretation () const |
const double * | begin_state () const |
const double * | end_interpretation () const |
const double * | end_state () const |
std::valarray< double > & | getArrayInterpretation () |
std::valarray< double > & | getArrayState () |
Number & | getStateSize () |
Number | getStateSize () const |
void | resize (Number number_of_new_bins) |
template<class Value > | |
std::valarray< Value > | toValarray (const std::vector< double > &vector) const |
template<class Value > | |
std::vector< Value > | toVector (const std::valarray< Value > &array, Number number_to_be_copied) const |
Private Attributes | |
std::valarray< double > | _arrayInterpretation |
std::valarray< double > | _arrayState |
Number | _numberState |
Friends | |
template<class WeightValue > | |
class | AlgorithmInterface |
Stored the internal state of an algorithm
Definition at line 33 of file AlgorithmGrid.hpp.
AlgorithmGrid::AlgorithmGrid | ( | Number | number_of_elements | ) |
Create the state for a AlgorithmGrid with a maximum number of elements
Definition at line 26 of file AlgorithmGrid.cpp.
AlgorithmGrid::AlgorithmGrid | ( | const std::vector< double > & | array_state | ) |
Create an AlgorithmGrid with just a state (usually a single number)
array_state | The State of the algorithm |
Definition at line 32 of file AlgorithmGrid.cpp.
AlgorithmGrid::AlgorithmGrid | ( | const std::vector< double > & | array_state, |
const std::vector< double > & | array_interpretation | ||
) |
Construct an AlgorithmGrid from
array_state | a state |
array_interpretation | an interpretation |
Definition at line 38 of file AlgorithmGrid.cpp.
References _arrayInterpretation, and _arrayState.
|
private |
Definition at line 125 of file AlgorithmGrid.cpp.
References _arrayInterpretation.
|
private |
allow iteration over internal values of the state
Definition at line 112 of file AlgorithmGrid.cpp.
References _arrayState.
|
private |
Definition at line 132 of file AlgorithmGrid.cpp.
References _arrayInterpretation, and _numberState.
|
private |
Definition at line 119 of file AlgorithmGrid.cpp.
References _arrayState, and _numberState.
|
private |
Getter for the array interpretation
Definition at line 93 of file AlgorithmGrid.cpp.
References _arrayInterpretation.
Referenced by MPILib::AlgorithmInterface< Weight >::getArrayInterpretation().
|
private |
Getter for the state array
Definition at line 89 of file AlgorithmGrid.cpp.
References _arrayState.
Referenced by MPILib::AlgorithmInterface< Weight >::getArrayState().
|
private |
Getter for the number of states stored
Definition at line 97 of file AlgorithmGrid.cpp.
References _numberState.
Referenced by MPILib::AlgorithmInterface< Weight >::getStateSize().
|
private |
const getter for the number of states stored
Definition at line 101 of file AlgorithmGrid.cpp.
References _numberState.
AlgorithmGrid & AlgorithmGrid::operator= | ( | const AlgorithmGrid & | rhs | ) |
Assignment operator
rhs | The assigned AlgorithmGrid |
Definition at line 46 of file AlgorithmGrid.cpp.
References _arrayInterpretation, _arrayState, and _numberState.
|
private |
Resize the arrays of elements
number_of_new_bins | The new size of the arrays |
Definition at line 106 of file AlgorithmGrid.cpp.
References _arrayInterpretation, and _arrayState.
std::vector< double > AlgorithmGrid::toInterpretationVector | ( | ) | const |
Getter for the interpretation vector
Definition at line 66 of file AlgorithmGrid.cpp.
References _arrayInterpretation, _numberState, and toVector().
std::vector< double > AlgorithmGrid::toStateVector | ( | ) | const |
Getter for the state vector
Definition at line 61 of file AlgorithmGrid.cpp.
References _arrayState, _numberState, and toVector().
|
private |
Helper function to convert vector to valarray
vector | to be converted |
Definition at line 71 of file AlgorithmGrid.cpp.
|
private |
Helper function to convert valarray to vector
array | the valarray to be converted |
number_to_be_copied | The number of elements copied |
Definition at line 77 of file AlgorithmGrid.cpp.
Referenced by toInterpretationVector(), and toStateVector().
|
friend |
Definition at line 75 of file AlgorithmGrid.hpp.
|
private |
Definition at line 132 of file AlgorithmGrid.hpp.
Referenced by AlgorithmGrid(), begin_interpretation(), end_interpretation(), getArrayInterpretation(), operator=(), resize(), and toInterpretationVector().
|
private |
Definition at line 131 of file AlgorithmGrid.hpp.
Referenced by AlgorithmGrid(), begin_state(), end_state(), getArrayState(), operator=(), resize(), and toStateVector().
|
private |
Definition at line 130 of file AlgorithmGrid.hpp.
Referenced by end_interpretation(), end_state(), getStateSize(), operator=(), toInterpretationVector(), and toStateVector().