id()
return (1, 0)
op(a, b)
#pragma once #include <utility> namespace haar_lib { template <typename T> struct affine_monoid { using value_type = std::pair<T, T>; value_type operator()() const { return std::make_pair(1, 0); } value_type operator()(const value_type &a, const value_type &b) const { return std::make_pair(a.first * b.first, a.first * b.second + a.second); } }; } // namespace haar_lib
#line 2 "Mylib/AlgebraicStructure/Monoid/affine.cpp" #include <utility> namespace haar_lib { template <typename T> struct affine_monoid { using value_type = std::pair<T, T>; value_type operator()() const { return std::make_pair(1, 0); } value_type operator()(const value_type &a, const value_type &b) const { return std::make_pair(a.first * b.first, a.first * b.second + a.second); } }; } // namespace haar_lib