5 #include <initializer_list> 20 UnbinnedDataSet(
const std::vector<Observable> &vars, std::string n =
"");
22 UnbinnedDataSet(std::initializer_list<Observable> vars, std::string n =
"");
47 "The wrong number of rows, expected {}, but matrix had {}",
observables.size(), input.rows());
49 for(
int i = 0; i < input.cols(); i++) {
50 for(
int j = 0; j < input.rows(); j++) {
56 observables.at(input.rows()).setValue(optional_index++);
67 size_t rows = data.size();
68 size_t cols = data.at(0).size();
70 for(
int i = 0; i < rows; i++) {
71 for(
int j = 0; j < cols; j++)
72 mat(i, j) = data[i].at(j);
78 std::vector<std::vector<fptype>> data;
Thrown when a general error is encountered.
size_t getNumEvents() const
void from_matrix(const M &input, bool filter=false)
Input an eigen matrix.
void fillWithGrid()
Replace the current dataset with a grid.
std::vector< Observable > observables
UnbinnedDataSet(const Observable &var, std::string n="")
Special class for observables. Used in DataSets.
fptype getValue(const Observable &var, size_t idx) const
Get the value at a specific variable and event number.
~UnbinnedDataSet() override=default
void setValueForAllEvents(const Observable &var)
Set all entries to a constant value (note: this is kind of ugly)
virtual void addEvent()=0
void loadEvent(size_t idx)
Set all the variables to the current event values.
M to_matrix() const
Produce an eigen Matrix.