Kyopro Library
 
読み取り中…
検索中…
一致する文字列を見つけられません
abel.hpp
[詳解]
1#pragma once
2#include"../../kyopro_library/template.hpp"
3
4/// @brief 可換群
5namespace Abel {
6 /// @brief 和
7 template<typename T>
8 struct Sum {
9 using Type=T;
10 static Type id() { return T(0); }
11 static Type op(const Type& a, const Type& b) { return a+b; }
12 static Type inv(const Type& x) { return -x; }
13 };
14
15 /// @brief XOR
16 template<typename T>
17 struct Xor {
18 using Type=T;
19 static Type id() { return T(0); }
20 static Type op(const Type& a, const Type& b) { return a^b; }
21 static Type inv(const Type& x) { return x; }
22 };
23}
可換群
Definition abel.hpp:5
Definition abel.hpp:8
static Type id()
Definition abel.hpp:10
static Type op(const Type &a, const Type &b)
Definition abel.hpp:11
static Type inv(const Type &x)
Definition abel.hpp:12
XOR
Definition abel.hpp:17
static Type inv(const Type &x)
Definition abel.hpp:21
static Type op(const Type &a, const Type &b)
Definition abel.hpp:20
static Type id()
Definition abel.hpp:19