HPCombi
High Performance Combinatorics in C++ using vector instructions v1.0.3
Loading...
Searching...
No Matches
HPCombi::power_helper::Monoid< T > Struct Template Reference

Algebraic monoid structure used by default for type T by the pow function and prod function. More...

#include <power.hpp>

Static Public Member Functions

static const T one ()
 The one of type T.
 
static const T prod (T a, T b)
 the product of two elements of type T
 

Detailed Description

template<typename T>
struct HPCombi::power_helper::Monoid< T >

Algebraic monoid structure used by default for type T by the pow function and prod function.

A Monoid structure is required to define two static members

  • T one() : the unit of the monoid
  • T prod(T, T) : the product of two elements in the monoid

By default for any type T, one is constructed from the literal 1 and prod calls the operator *. One can change these default by specializing the template for some specific type T.

Examples
stringmonoid.cpp.

Member Function Documentation

◆ one()

template<typename T>
static const T HPCombi::power_helper::Monoid< T >::one ( )
inlinestatic

The one of type T.

Examples
stringmonoid.cpp.

◆ prod()

template<typename T>
static const T HPCombi::power_helper::Monoid< T >::prod ( T a,
T b )
inlinestatic

the product of two elements of type T

Parameters
athe first element to be multiplied
bthe second element to be multiplied
Returns
the product a * b
Examples
stringmonoid.cpp.

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