1 #ifndef MTTOOLBOX_ALGORITHM_REDUCIBLE_RT_HPP
2 #define MTTOOLBOX_ALGORITHM_REDUCIBLE_RT_HPP
75 template<
typename U,
typename G>
129 bool verbose =
false,
130 std::ostream& os = std::cout,
131 bool no_lsb =
false) {
136 int veq[bit_size<U>()];
139 int mexp = rg.bitSize();
141 for (
int i = 0;; i++) {
142 if (search.start(1000 * mexp)) {
147 *out <<
"not found in " << (i + 1) * 10000 << endl;
154 time_t t = time(NULL);
155 *out <<
"irreducible parameter is found at " << ctime(&t);
158 *out <<
"count = " << search.getCount() << endl;
159 *out << rg.getParamString() << endl;
161 poly = search.getIrreducibleFactor();
163 weight = NTL::weight(poly);
166 NTL::GF2X quotient = lcm / poly;
171 print_kv(veq, mexp, bit_size<U>());
172 *out <<
"delta = " << dec << delta << endl;
178 rg.setReverseOutput();
182 rg.resetReverseOutput();
183 time_t t = time(NULL);
184 *out <<
"lsb tempering parameters are found at "
185 << ctime(&t) << endl;
186 print_kv(veq, mexp, bit_size<U>());
187 *out <<
"lsb delta = " << dec << delta << endl;
194 time_t t = time(NULL);
195 *out <<
"tempering parameters are found at " << ctime(&t)
197 *out << rg.getParamString() << endl;
198 print_kv(veq, mexp, bit_size<U>());
199 *out <<
"delta = " << dec << delta << endl;
235 bool verbose =
false,
236 std::ostream& os = std::cout) {
237 return search(rg, st, st, verbose, os,
true);
297 void print_kv(
int veq[],
int mexp,
int size) {
299 for (
int i = 0; i < size; i++) {
300 *out << dec << i + 1 <<
":" << veq[i]
301 <<
"(" << mexp / (i + 1) - veq[i] <<
")"
308 #endif //MTTOOLBOX_ALGORITHM_Reducible_RT_HPP
可約ジェネレータの状態遷移関数のパラメータを探索する。
可約ジェネレータのパリティチェックベクトルを求める。
テンパリングパラメータ探索アルゴリズムのための抽象クラス
可約ジェネレータのテンパリングパラメータ探索用の抽象クラス