timemory 3.3.0
Modular C++ Toolkit for Performance Analysis and Logging. Profiling API and Tools for C, C++, CUDA, Fortran, and Python. The C++ template API is essentially a framework to creating tools: it is designed to provide a unifying interface for recording various performance measurements alongside data logging and interfaces to other tools.
tim::math::compute< Tp, Up > Struct Template Reference

Struct for performing math operations on complex data structures without using globally overload operators (e.g. lhs += rhs) and generic functions (lhs = abs(rhs)) More...

#include "timemory/math/compute.hpp"

+ Collaboration diagram for tim::math::compute< Tp, Up >:

Public Types

using this_type = compute< Tp, Up >
 
using type = Tp
 
using value_type = Up
 

Static Public Member Functions

static decltype(auto) abs (const type &_v)
 
static decltype(auto) sqr (const type &_v)
 
static decltype(auto) sqrt (const type &_v)
 
template<typename V >
static decltype(auto) min (const type &_l, const V &_r)
 
template<typename V >
static decltype(auto) max (const type &_l, const V &_r)
 
template<typename V >
static decltype(auto) percent_diff (const type &_l, const V &_r)
 
template<typename V >
static decltype(auto) plus (type &_l, const V &_r)
 
template<typename V >
static decltype(auto) minus (type &_l, const V &_r)
 
template<typename V >
static decltype(auto) multiply (type &_l, const V &_r)
 
template<typename V >
static decltype(auto) divide (type &_l, const V &_r)
 
template<typename V >
static auto plus (const type &_l, const V &_r)
 
template<typename V >
static auto minus (const type &_l, const V &_r)
 
template<typename V >
static auto multiply (const type &_l, const V &_r)
 
template<typename V >
static auto divide (const type &_l, const V &_r)
 

Detailed Description

template<typename Tp, typename Up = Tp>
struct tim::math::compute< Tp, Up >

Struct for performing math operations on complex data structures without using globally overload operators (e.g. lhs += rhs) and generic functions (lhs = abs(rhs))

Definition at line 52 of file compute.hpp.

Member Typedef Documentation

◆ this_type

template<typename Tp , typename Up = Tp>
using tim::math::compute< Tp, Up >::this_type = compute<Tp, Up>

Definition at line 54 of file compute.hpp.

◆ type

template<typename Tp , typename Up = Tp>
using tim::math::compute< Tp, Up >::type = Tp

Definition at line 55 of file compute.hpp.

◆ value_type

template<typename Tp , typename Up = Tp>
using tim::math::compute< Tp, Up >::value_type = Up

Definition at line 56 of file compute.hpp.

Member Function Documentation

◆ abs()

template<typename Tp , typename Up = Tp>
static decltype(auto) tim::math::compute< Tp, Up >::abs ( const type _v)
inlinestatic

Definition at line 58 of file compute.hpp.

59 {
60 return this_type::abs(_v, 0);
61 }
static decltype(auto) abs(const type &_v)
Definition: compute.hpp:58

References tim::math::compute< Tp, Up >::abs().

Referenced by tim::math::compute< Tp, Up >::abs(), and tim::statistics< Tp >::get_stddev().

◆ divide() [1/2]

template<typename Tp , typename Up = Tp>
template<typename V >
static auto tim::math::compute< Tp, Up >::divide ( const type _l,
const V &  _r 
)
inlinestatic

Definition at line 139 of file compute.hpp.

140 {
141 type _t{ _l };
142 return this_type::divide(_t, _r, 0);
143 }
static decltype(auto) divide(type &_l, const V &_r)
Definition: compute.hpp:111

References tim::math::compute< Tp, Up >::divide().

◆ divide() [2/2]

template<typename Tp , typename Up = Tp>
template<typename V >
static decltype(auto) tim::math::compute< Tp, Up >::divide ( type _l,
const V &  _r 
)
inlinestatic

◆ max()

template<typename Tp , typename Up = Tp>
template<typename V >
static decltype(auto) tim::math::compute< Tp, Up >::max ( const type _l,
const V &  _r 
)
inlinestatic

Definition at line 80 of file compute.hpp.

81 {
82 return this_type::max(_l, _r, 0);
83 }
static decltype(auto) max(const type &_l, const V &_r)
Definition: compute.hpp:80

References tim::math::compute< Tp, Up >::max().

Referenced by tim::math::compute< Tp, Up >::max(), tim::statistics< Tp >::operator+=(), and tim::statistics< Tp >::operator-=().

◆ min()

template<typename Tp , typename Up = Tp>
template<typename V >
static decltype(auto) tim::math::compute< Tp, Up >::min ( const type _l,
const V &  _r 
)
inlinestatic

Definition at line 74 of file compute.hpp.

75 {
76 return this_type::min(_l, _r, 0);
77 }
static decltype(auto) min(const type &_l, const V &_r)
Definition: compute.hpp:74

References tim::math::compute< Tp, Up >::min().

Referenced by tim::math::compute< Tp, Up >::min(), tim::statistics< Tp >::operator+=(), and tim::statistics< Tp >::operator-=().

◆ minus() [1/2]

template<typename Tp , typename Up = Tp>
template<typename V >
static auto tim::math::compute< Tp, Up >::minus ( const type _l,
const V &  _r 
)
inlinestatic

Definition at line 125 of file compute.hpp.

126 {
127 type _t{ _l };
128 return this_type::minus(_t, _r, 0);
129 }
static decltype(auto) minus(type &_l, const V &_r)
Definition: compute.hpp:99

References tim::math::compute< Tp, Up >::minus().

◆ minus() [2/2]

◆ multiply() [1/2]

template<typename Tp , typename Up = Tp>
template<typename V >
static auto tim::math::compute< Tp, Up >::multiply ( const type _l,
const V &  _r 
)
inlinestatic

Definition at line 132 of file compute.hpp.

133 {
134 type _t{ _l };
135 return this_type::multiply(_t, _r, 0);
136 }
static decltype(auto) multiply(type &_l, const V &_r)
Definition: compute.hpp:105

References tim::math::compute< Tp, Up >::multiply().

◆ multiply() [2/2]

◆ percent_diff()

template<typename Tp , typename Up = Tp>
template<typename V >
static decltype(auto) tim::math::compute< Tp, Up >::percent_diff ( const type _l,
const V &  _r 
)
inlinestatic

Definition at line 86 of file compute.hpp.

87 {
88 return this_type::percent_diff(_l, _r, 0);
89 }
static decltype(auto) percent_diff(const type &_l, const V &_r)
Definition: compute.hpp:86

References tim::math::compute< Tp, Up >::percent_diff().

Referenced by tim::math::compute< Tp, Up >::percent_diff().

◆ plus() [1/2]

template<typename Tp , typename Up = Tp>
template<typename V >
static auto tim::math::compute< Tp, Up >::plus ( const type _l,
const V &  _r 
)
inlinestatic

Definition at line 118 of file compute.hpp.

119 {
120 type _t{ _l };
121 return this_type::plus(_t, _r, 0);
122 }
static decltype(auto) plus(type &_l, const V &_r)
Definition: compute.hpp:93

References tim::math::compute< Tp, Up >::plus().

◆ plus() [2/2]

template<typename Tp , typename Up = Tp>
template<typename V >
static decltype(auto) tim::math::compute< Tp, Up >::plus ( type _l,
const V &  _r 
)
inlinestatic

◆ sqr()

template<typename Tp , typename Up = Tp>
static decltype(auto) tim::math::compute< Tp, Up >::sqr ( const type _v)
inlinestatic

◆ sqrt()

template<typename Tp , typename Up = Tp>
static decltype(auto) tim::math::compute< Tp, Up >::sqrt ( const type _v)
inlinestatic

Definition at line 68 of file compute.hpp.

69 {
70 return this_type::sqrt(_v, 0);
71 }
static decltype(auto) sqrt(const type &_v)
Definition: compute.hpp:68

References tim::math::compute< Tp, Up >::sqrt().

Referenced by tim::statistics< Tp >::get_stddev(), and tim::math::compute< Tp, Up >::sqrt().


The documentation for this struct was generated from the following files: