6 #include <boost/filesystem/path.hpp>
7 #include <boost/filesystem/operations.hpp>
26 for (
size_t j=0; j<size(); ++j) {
27 if ((*
this)[j].match(state, m, env))
34 const std::vector<double>& weights)
const
37 boost::filesystem::path dir(directory);
38 boost::filesystem::create_directory(dir);
41 std::string filename = directory +
"/" + group_name +
".txt";
42 std::ofstream os(filename.c_str());
43 for (
int i=range.first; i<range.second; ++i)
44 os << std::setprecision(8) << weights[i] <<
"\n";
48 std::vector<double>& weights)
const
50 std::string filename = directory +
"/" + group_name +
".txt";
51 FILE *fp = fopen(filename.c_str(),
"r");
54 for (
int i=range.first; i<range.second; ++i) {
55 if (fscanf(fp,
"%lf", &weights[i]) != 1)
63 const std::vector<double>& weights)
const
66 for (
size_t f=0; f<size(); ++f) {
67 os << std::setw(name_width)
69 <<
" " << 400*log10(weights[f+range.first]) <<
"\n";
75 const std::vector<double>& weights)
const
78 showMinMax(os, name_width, range, weights);
79 for (
size_t i=0; i<size(); ++i) {
80 os <<
" " << (*this)[i].name() <<
" " << 400*log10(weights[i+range.first]);
86 const std::vector<double>& weights)
const
90 for (
size_t i=0; i<size(); ++i) {
94 os << std::setw(name_width)
96 <<
" [" <<
min <<
" -- " <<
max <<
"] ";
101 const std::vector<double>& weights,
int n)
const
104 if ((
int)weights.size() <= n*2)
105 return showAll(os, name_width, range, weights);
106 showMinMax(os, name_width, range, weights);
107 std::vector<double> w;
109 for (
int i=range.first; i<range.second; ++i)
110 w.push_back(weights[i]);
111 std::sort(w.begin(), w.end());
112 for (
int i=0; i<n; ++i) {
113 double value = w[size()-1-i];
115 for (; j<range.second; ++j)
116 if (weights[j] == value)
118 os <<
" " << (*this)[j-range.first].name() <<
" " << 400*log10(value);
121 for (
int i=0; i<n; ++i) {
122 double value = w[n-1-i];
124 for (; j<range.second; ++j)
125 if (weights[j] == value)
127 os <<
" " << (*this)[j-range.first].name() <<
" " << 400*log10(value);
136 for (
int o=0; o<4; ++o) {
179 assert((*
this)[index].match(state, move, env));
185 push_back(
new Karanari(
false,
true));
186 push_back(
new Karanari(
false,
false));
187 push_back(
new Karanari(
true,
true));
188 push_back(
new Karanari(
true,
false));
199 :
Group(
"ImmediateAddSupport")
203 for (
int p=0; p<8; ++p)