27 _numberState(number_of_elements), _arrayState(0.0,
28 number_of_elements), _arrayInterpretation(0.0,
33 _numberState(static_cast<
Number>(array_state.size())), _arrayState(
34 toValarray<double>(array_state)), _arrayInterpretation(
35 std::valarray<double>(0.0, array_state.size())) {
39 const std::vector<double>& array_interpretation) :
40 _numberState(static_cast<
Number>(array_state.size())), _arrayState(
41 toValarray<double>(array_state)), _arrayInterpretation(
42 toValarray<double>(array_interpretation)) {
72 const std::vector<double>& vector)
const {
73 return std::valarray<Value>(&vector[0], vector.size());
78 Number number_to_be_copied)
const {
79 auto& array_test =
const_cast<std::valarray<Value>&
>(array);
80 auto p_begin = &array_test[0];
81 auto p_end = p_begin + number_to_be_copied;
83 std::vector<Value> vector_return(0);
84 std::copy(p_begin, p_end, back_inserter(vector_return));
114 auto& ref_state =
const_cast<std::valarray<double>&
>(
_arrayState);
115 const double* p_begin = &ref_state[0];
120 auto& ref_state =
const_cast<std::valarray<double>&
>(
_arrayState);
128 const double* p_begin = &ref_state[0];
const double * end_interpretation() const
std::valarray< double > _arrayState
const double * begin_interpretation() const
std::valarray< double > & getArrayInterpretation()
std::valarray< Value > toValarray(const std::vector< double > &vector) const
std::vector< double > toInterpretationVector() const
AlgorithmGrid & operator=(const AlgorithmGrid &rhs)
void resize(Number number_of_new_bins)
std::valarray< double > _arrayInterpretation
std::vector< double > toStateVector() const
const double * begin_state() const
allow iteration over internal values of the state
const double * end_state() const
std::valarray< double > & getArrayState()
std::vector< Value > toVector(const std::valarray< Value > &array, Number number_to_be_copied) const