1 #ifndef SAMPLINGSTATE_H_
2 #define SAMPLINGSTATE_H_
5 #include <unordered_map>
10 #include <boost/any.hpp>
16 #include <cereal/types/string.hpp>
17 #include <cereal/types/unordered_map.hpp>
18 #include <cereal/types/vector.hpp>
22 namespace SamplingAlgorithms {
48 std::vector<Eigen::VectorXd>
state;
54 bool HasMeta(std::string
const& metaKey);
63 Eigen::VectorXd
ToVector(
int blockInd=-1)
const;
68 double StateValue(
unsigned int totalInd)
const;
72 std::unordered_map<std::string, boost::any>
meta;
81 template<
class Archive>
Each state is one sample generated by a sampling algorithm.
int TotalDim() const
The total number of parameters in the state, i.e., the sum of state[i].size()
std::unordered_map< std::string, boost::any > meta
A map containing extra information like the target density, run time, forward model output,...
double weight
The weight of this state.
void serialize(Archive &archive)
Serialization function for use with Cereal.
std::vector< Eigen::VectorXd > state
The state variables.
double StateValue(unsigned int totalInd) const
bool HasMeta(std::string const &metaKey)
Checks to see if the meta map contains a particular key.
Eigen::VectorXd ToVector(int blockInd=-1) const
virtual ~SamplingState()=default