This documentation is automatically generated by online-judge-tools/verification-helper
#include "Src/Algebra/Group/AdditiveGroup.hpp"
本ライブラリの群を要求するデータ構造で加法を扱いたい時に使用します。
実装の詳細は本ライブラリでの群の実装についてを確認してください。
テンプレート引数に入れる型、クラスが以下の条件を満たす必要があります。
+
が定義されている。-
のoperator
が定義されていて、加法の逆元を返すものになっている。#pragma once
namespace zawa {
template <class T>
class AdditiveGroup {
public:
using Element = T;
static constexpr T identity() noexcept {
return T{};
}
static constexpr T operation(const T& l, const T& r) noexcept {
return l + r;
}
static constexpr T inverse(const T& v) noexcept {
return -v;
}
};
} // namespace zawa
#line 2 "Src/Algebra/Group/AdditiveGroup.hpp"
namespace zawa {
template <class T>
class AdditiveGroup {
public:
using Element = T;
static constexpr T identity() noexcept {
return T{};
}
static constexpr T operation(const T& l, const T& r) noexcept {
return l + r;
}
static constexpr T inverse(const T& v) noexcept {
return -v;
}
};
} // namespace zawa