23 #pragma GCC diagnostic push 24 #pragma GCC diagnostic ignored "-Wunused-parameter" 25 #include <boost/math/distributions/normal.hpp> 27 #pragma GCC diagnostic pop 49 auto bb = _bc.
block(p);
53 for (
auto const& tr: r[1])
57 dist[tx.gasPrice()] += gu;
69 m_octiles[0] = dist.begin()->first;
73 for (
auto const& i: dist)
74 mean += i.first * i.second;
79 for (
auto const& i: dist)
80 sdSquared += i.second * (i.first - mean) * (i.first - mean);
85 long double sd = sqrt(sdSquared.convert_to<
long double>());
86 long double normalizedSd = sd / mean.convert_to<
long double>();
89 boost::math::normal gauss(1.0, (normalizedSd > 0.01) ? normalizedSd : 0.01);
90 for (
size_t i = 1; i < 8; i++)
91 m_octiles[i] =
u256(mean.convert_to<
long double>() * boost::math::quantile(gauss, i / 8.0));
92 m_octiles[8] = dist.rbegin()->first;
96 for (
size_t i = 0; i < 9; i++)
97 m_octiles[i] = (i + 1) * mean / 5;
Adapted from code found on http://stackoverflow.com/questions/180947/base64-decode-snippet-in-c Origi...
BlockHeader info(h256 const &_hash) const
Get the partial-header of a block (or the most recent mined if none given). Thread-safe.
Implements the blockchain database.
BlockReceipts receipts(h256 const &_hash) const
Get the transactions' receipts of a block (or the most recent mined if none given).
TransactionReceipts receipts
std::hash for asio::adress
h256 currentHash() const
Get a given block (RLP format). Thread-safe.
boost::multiprecision::number< boost::multiprecision::cpp_int_backend< 256, 256, boost::multiprecision::unsigned_magnitude, boost::multiprecision::unchecked, void >> u256
Encodes a transaction, ready to be exported to or freshly imported from RLP.
bytes block(h256 const &_hash) const
Get a block (RLP format) for the given hash (or the most recent mined if none given). Thread-safe.
Class for interpreting Recursive Linear-Prefix Data.