Heidelberg Educational Numerics Library Version 0.27 (from 15 March 2021)
|
#include <opcounter.hh>
Classes | |
struct | Counters |
Struct storing the number of operations. More... | |
Public Types | |
using | size_type = std::size_t |
using | value_type = F |
Public Member Functions | |
template<typename T > | |
OpCounter (const T &t, typename std::enable_if< std::is_same< T, int >::value and !std::is_same< F, int >::value >::type *=nullptr) | |
OpCounter (const F &f) | |
OpCounter (F &&f) | |
OpCounter (const char *s) | |
OpCounter & | operator= (const char *s) |
operator F () const | |
OpCounter & | operator= (const F &f) |
OpCounter & | operator= (F &&f) |
F * | data () |
const F * | data () const |
Static Public Member Functions | |
static void | additions (std::size_t n) |
static void | multiplications (std::size_t n) |
static void | divisions (std::size_t n) |
static void | reset () |
template<typename Stream > | |
static void | reportOperations (Stream &os, bool doReset=false) |
Report operations to stream object. | |
static size_type | totalOperationCount (bool doReset=false) |
Return total number of operations. | |
Public Attributes | |
F | _v |
Static Public Attributes | |
static Counters | counters |
Friends | |
std::ostream & | operator<< (std::ostream &os, const OpCounter &f) |
std::istringstream & | operator>> (std::istringstream &iss, OpCounter &f) |
Class counting operations
This is done by overloading operations and storing the numbers in a static class member.