kyopro-lib

This documentation is automatically generated by online-judge-tools/verification-helper

View on GitHub

:x: Dual monoid
(Mylib/AlgebraicStructure/Monoid/dual.cpp)

Operations

Requirements

Notes

Problems

References

Verified with

Code

#pragma once

namespace haar_lib {
  template <typename Monoid>
  struct dual_monoid {
    using value_type = typename Monoid::value_type;
    const static Monoid M;
    value_type operator()() const { return M(); }
    value_type operator()(const value_type &a, const value_type &b) const { return M(b, a); }
  };
}  // namespace haar_lib
#line 2 "Mylib/AlgebraicStructure/Monoid/dual.cpp"

namespace haar_lib {
  template <typename Monoid>
  struct dual_monoid {
    using value_type = typename Monoid::value_type;
    const static Monoid M;
    value_type operator()() const { return M(); }
    value_type operator()(const value_type &a, const value_type &b) const { return M(b, a); }
  };
}  // namespace haar_lib
Back to top page