mirror of
https://github.com/triqs/dft_tools
synced 2025-01-12 14:08:24 +01:00
Added constructor of observable on binned_series
This commit is contained in:
parent
14067abb34
commit
0e23db7f92
@ -64,6 +64,10 @@ namespace statistics {
|
|||||||
value_type operator[](int i) const { return binned[i]; }
|
value_type operator[](int i) const { return binned[i]; }
|
||||||
int size() const { return binned.size(); }
|
int size() const { return binned.size(); }
|
||||||
|
|
||||||
|
std::vector<value_type> const & data() const & { return binned;}
|
||||||
|
std::vector<value_type> const & data() & { return binned;}
|
||||||
|
std::vector<value_type> data() && { return std::move(binned);}
|
||||||
|
|
||||||
using const_iterator = typename std::vector<ValueType>::const_iterator;
|
using const_iterator = typename std::vector<ValueType>::const_iterator;
|
||||||
const_iterator begin() const { return binned.begin(); }
|
const_iterator begin() const { return binned.begin(); }
|
||||||
const_iterator end() const { return binned.end(); }
|
const_iterator end() const { return binned.end(); }
|
||||||
@ -171,6 +175,8 @@ namespace statistics {
|
|||||||
public:
|
public:
|
||||||
observable() { _series.reserve(1000); }
|
observable() { _series.reserve(1000); }
|
||||||
|
|
||||||
|
observable(binned_series<T> && s):_series(std::move(s).data()){}
|
||||||
|
|
||||||
observable& operator<<(T x) { // copy and move : check speed ... or overload const &, &&
|
observable& operator<<(T x) { // copy and move : check speed ... or overload const &, &&
|
||||||
_series.push_back(std::move(x));
|
_series.push_back(std::move(x));
|
||||||
return *this;
|
return *this;
|
||||||
|
Loading…
Reference in New Issue
Block a user