mirror of
https://github.com/aicodix/code.git
synced 2026-04-27 22:35:44 +00:00
output debug messages to stderr
This commit is contained in:
parent
e2b160385e
commit
537390db43
3 changed files with 31 additions and 31 deletions
|
|
@ -52,10 +52,10 @@ public:
|
||||||
assert(!tmp);
|
assert(!tmp);
|
||||||
root *= pe;
|
root *= pe;
|
||||||
}
|
}
|
||||||
std::cout << "generator =";
|
std::cerr << "generator =";
|
||||||
for (int i = 0; i <= NP; ++i)
|
for (int i = 0; i <= NP; ++i)
|
||||||
std::cout << " " << (int)generator[i];
|
std::cerr << " " << (int)generator[i];
|
||||||
std::cout << std::endl;
|
std::cerr << std::endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
void operator()(ValueType *code)
|
void operator()(ValueType *code)
|
||||||
|
|
|
||||||
|
|
@ -32,18 +32,18 @@ public:
|
||||||
}
|
}
|
||||||
tmp[NR] = ValueType(1);
|
tmp[NR] = ValueType(1);
|
||||||
if (0) {
|
if (0) {
|
||||||
std::cout << "generator = ";
|
std::cerr << "generator = ";
|
||||||
for (int i = NR; i > 0; --i) {
|
for (int i = NR; i > 0; --i) {
|
||||||
if (!tmp[i])
|
if (!tmp[i])
|
||||||
continue;
|
continue;
|
||||||
if (tmp[i] != ValueType(1))
|
if (tmp[i] != ValueType(1))
|
||||||
std::cout << (int)tmp[i] << "*";
|
std::cerr << (int)tmp[i] << "*";
|
||||||
std::cout << "x";
|
std::cerr << "x";
|
||||||
if (i != 1)
|
if (i != 1)
|
||||||
std::cout << "^" << i;
|
std::cerr << "^" << i;
|
||||||
std::cout << " + ";
|
std::cerr << " + ";
|
||||||
}
|
}
|
||||||
std::cout << (int)tmp[0] << std::endl;
|
std::cerr << (int)tmp[0] << std::endl;
|
||||||
}
|
}
|
||||||
for (int i = 0; i <= NR; ++i)
|
for (int i = 0; i <= NR; ++i)
|
||||||
generator[i] = index(tmp[i]);
|
generator[i] = index(tmp[i]);
|
||||||
|
|
|
||||||
|
|
@ -212,45 +212,45 @@ struct ReedSolomonErrorCorrection
|
||||||
static bool once;
|
static bool once;
|
||||||
if (!once) {
|
if (!once) {
|
||||||
once = true;
|
once = true;
|
||||||
std::cout << "syndromes =";
|
std::cerr << "syndromes =";
|
||||||
for (int i = 0; i < NR; ++i)
|
for (int i = 0; i < NR; ++i)
|
||||||
std::cout << " " << (int)syndromes[i];
|
std::cerr << " " << (int)syndromes[i];
|
||||||
std::cout << std::endl;
|
std::cerr << std::endl;
|
||||||
std::cout << "locator = ";
|
std::cerr << "locator = ";
|
||||||
for (int i = NR; i > 0; --i) {
|
for (int i = NR; i > 0; --i) {
|
||||||
if (!locator[i])
|
if (!locator[i])
|
||||||
continue;
|
continue;
|
||||||
if (locator[i] != ValueType(1))
|
if (locator[i] != ValueType(1))
|
||||||
std::cout << (int)locator[i] << "*";
|
std::cerr << (int)locator[i] << "*";
|
||||||
std::cout << "x";
|
std::cerr << "x";
|
||||||
if (i != 1)
|
if (i != 1)
|
||||||
std::cout << "^" << i;
|
std::cerr << "^" << i;
|
||||||
std::cout << " + ";
|
std::cerr << " + ";
|
||||||
}
|
}
|
||||||
std::cout << (int)locator[0] << std::endl;
|
std::cerr << (int)locator[0] << std::endl;
|
||||||
std::cout << "locations =";
|
std::cerr << "locations =";
|
||||||
for (int i = 0; i < count; ++i)
|
for (int i = 0; i < count; ++i)
|
||||||
std::cout << " " << (int)locations[i];
|
std::cerr << " " << (int)locations[i];
|
||||||
std::cout << std::endl;
|
std::cerr << std::endl;
|
||||||
std::cout << "evaluator = ";
|
std::cerr << "evaluator = ";
|
||||||
for (int i = evaluator_degree; i > 0; --i) {
|
for (int i = evaluator_degree; i > 0; --i) {
|
||||||
if (!evaluator[i])
|
if (!evaluator[i])
|
||||||
continue;
|
continue;
|
||||||
if (evaluator[i] != ValueType(1))
|
if (evaluator[i] != ValueType(1))
|
||||||
std::cout << (int)evaluator[i] << "*";
|
std::cerr << (int)evaluator[i] << "*";
|
||||||
std::cout << "x";
|
std::cerr << "x";
|
||||||
if (i != 1)
|
if (i != 1)
|
||||||
std::cout << "^" << i;
|
std::cerr << "^" << i;
|
||||||
if (i != 1 || evaluator[0])
|
if (i != 1 || evaluator[0])
|
||||||
std::cout << " + ";
|
std::cerr << " + ";
|
||||||
}
|
}
|
||||||
if (evaluator[0])
|
if (evaluator[0])
|
||||||
std::cout << (int)evaluator[0];
|
std::cerr << (int)evaluator[0];
|
||||||
std::cout << std::endl;
|
std::cerr << std::endl;
|
||||||
std::cout << "magnitudes =";
|
std::cerr << "magnitudes =";
|
||||||
for (int i = 0; i < count; ++i)
|
for (int i = 0; i < count; ++i)
|
||||||
std::cout << " " << (int)magnitudes[i];
|
std::cerr << " " << (int)magnitudes[i];
|
||||||
std::cout << std::endl;
|
std::cerr << std::endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return count;
|
return count;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue