Heidelberg Educational Numerics Library Version 0.27 (from 15 March 2021)
Classes | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Friends | List of all members
hdnum::oc::OpCounter< F > Class Template Reference

#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)
 
OpCounteroperator= (const char *s)
 
 operator F () const
 
OpCounteroperator= (const F &f)
 
OpCounteroperator= (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

_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)
 

Detailed Description

template<typename F>
class hdnum::oc::OpCounter< F >

Class counting operations

This is done by overloading operations and storing the numbers in a static class member.


The documentation for this class was generated from the following file: