renamed Storage::bin_type to element_type; added Storage::const_reference; renamed histogram::bin_iterator to const_iterator; added bin(unsigned) method to histogram::const_iterator, which returns the current bin_type for that dimension

This commit is contained in:
Hans Dembinski
2018-03-13 00:26:41 +01:00
parent bb41363d6d
commit ce93a88986
12 changed files with 191 additions and 117 deletions

View File

@@ -334,21 +334,21 @@ std::string histogram_repr(const pyhistogram &h) {
return os.str();
}
double bin_type_value(const pyhistogram::bin_type& b) {
double element_value(const pyhistogram::element_type& b) {
return b.value();
}
double bin_type_variance(const pyhistogram::bin_type& b) {
double element_variance(const pyhistogram::element_type& b) {
return b.variance();
}
void register_histogram() {
bp::docstring_options dopt(true, true, false);
bp::class_<pyhistogram::bin_type>(
"bin_type", "Holds value and variance of bin count.", bp::no_init)
.add_property("value", bin_type_value)
.add_property("variance", bin_type_variance);
bp::class_<pyhistogram::element_type>(
"element", "Holds value and variance of bin count.", bp::no_init)
.add_property("value", element_value)
.add_property("variance", element_variance);
bp::class_<pyhistogram, boost::shared_ptr<pyhistogram>>(
"histogram", "N-dimensional histogram for real-valued data.", bp::no_init)