Commit f34d23a6 authored by Adam P. Goucher's avatar Adam P. Goucher

To stderr is human; to /dev/null, divine

parent 16e33ef6
Pipeline #55746408 passed with stages
in 7 minutes and 36 seconds
......@@ -8,31 +8,25 @@
}
void assemble_lut18() {
std::cerr << "Computing 2^18-entry lookup table...";
lut18 = (uint8_t*) std::malloc(0x40000); // don't bother freeing; the OS will do that.
for (uint64_t i = 0; i < 0x40000; i++) {
lut18[i] = xfl9(i) | (xfl9(i >> 1) << 1) | (xfl9(i >> 2) << 2) | (xfl9(i >> 3) << 3);
}
std::cerr << "done!" << std::endl;
}
void assemble_lut24() {
if (lut18 == 0) { assemble_lut18(); }
std::cerr << "Computing 2^24-entry lookup table...";
lut24 = (uint8_t*) std::malloc(0x1000000); // don't bother freeing; the OS will do that.
for (uint64_t i = 0; i < 0x1000000; i++) {
lut24[i] = lut18[i & 0x3ffff] | (lut18[i >> 6] << 4);
}
std::cerr << "done!" << std::endl;
}
void assemble_mix18() {
std::cerr << "Computing 2^18-entry mixing table...";
mix18 = (uint32_t*) std::malloc(0x100000); // see above.
for (uint64_t i = 0; i < 0x40000; i++) {
mix18[i] = (i & 0x3f) | (((i >> 4) & 0x3f) << 8) | (((i >> 8) & 0x3f) << 16) | (((i >> 12) & 0x3f) << 24);
}
std::cerr << "done!" << std::endl;
}
bool iterate_var_leaf(uint64_t *inleaves, uint64_t *outleafx) {
......
......@@ -183,12 +183,8 @@ def isotrope(rulestring):
lord2 = str2tab(rulestring)
print(('Compressing 512-bit lookup table for rule %s...' % rulestring))
lut9 = [sum([(lord2[8*i+j] << j) for j in range(8)]) for i in range(64)]
print(('Creating magic sauce for rule %s...' % rulestring))
def oi(i0, i1, i2, i4, i5, i6):
thisbyte = 0
for i3 in range(2):
......@@ -238,7 +234,3 @@ def isotrope(rulestring):
for j in range(i*18+4, i*18+22):
currstring += ((' %3d};' if (j == 111) else ' %3d,') % lut9[j])
f.write(currstring + '\n')
print('...completed.')
......@@ -15,11 +15,8 @@ rules_dir = os.path.join(lifelib_dir, 'rules')
def table_to_tree(lines):
print('Reading rule table...')
n_states, nhood, transitions = ReadRuleTable(lines)
print('Assembling tree...')
lines = TransitionsToTree(n_states, nhood, transitions)
print('...done!')
return lines
def minkowski_symmetrise(nhood):
......@@ -30,10 +27,8 @@ def analyse_tree(segments):
lines = segments['@TREE']
print('Reading rule tree...')
n_states, nhood, list_of_nodes = ReadRuleTree(lines)
syms = get_symmetries(n_states, nhood, list_of_nodes)
print('Symmetries: %s' % syms)
if len(syms) == 12:
symstring = "HEXAGONAL"
......@@ -44,10 +39,8 @@ def analyse_tree(segments):
is16bit = (n_states > 256)
print('Flattening tree...')
flattened_tree = FlattenRuleTree(n_states, nhood, list_of_nodes)
segments['@FLATTREE'] = MakeStaticTable(flattened_tree)
print('...done!')
# Determine zone of influence for rule:
mink = minkowski_symmetrise(nhood)
......
......@@ -67,11 +67,6 @@ extern "C"
void SavePatternRLE(void *ptr, const char *filename, const char *header, const char *footer) {
std::cerr << "filename: '" << filename << "'\n";
std::cerr << "header: '" << header << "'\n";
std::cerr << "footer: '" << footer << "'\n";
std::cerr << "--------" << std::endl;
std::ofstream out(filename);
auto ppat = reinterpret_cast<apg::pattern*>(ptr);
out << header;
......@@ -81,11 +76,6 @@ extern "C"
void SavePatternMC(void *ptr, const char *filename, const char *header, const char *footer) {
std::cerr << "filename: '" << filename << "'\n";
std::cerr << "header: '" << header << "'\n";
std::cerr << "footer: '" << footer << "'\n";
std::cerr << "--------" << std::endl;
std::ofstream out(filename);
auto ppat = reinterpret_cast<apg::pattern*>(ptr);
auto lab = ppat->getlab();
......
......@@ -441,14 +441,14 @@ namespace apg {
if (posrule != std::string::npos) {
rule = sanirule(line.substr(posrule + 4));
delete grm; grm = getMapper(rule);
std::cerr << line << " interpreted as " << rule << std::endl;
// std::cerr << line << " interpreted as " << rule << std::endl;
}
} else if (line[0] == '#') {
if (line.length() >= 2 && (line[1] == 'R' || line[1] == 'G')) {
if (line[1] == 'R') {
rule = sanirule(line.substr(3));
delete grm; grm = getMapper(rule);
std::cerr << line << " interpreted as " << rule << std::endl;
// std::cerr << line << " interpreted as " << rule << std::endl;
}
} else if ((line.length() > 4) && (line.substr(0, 4) == "#CLL")) {
// Lifelib-specific meta-information
......
......@@ -228,8 +228,6 @@ class WrappedLibrary(object):
if x is None:
import warnings
warnings.warn("Could not ensure stack size, probably due to running on Windows. Expect segfaults soon.")
else:
print("Stack size limit increased to (%d, %d)" % x)
self.last_power = powerof2
def __del__(self):
......
......@@ -380,7 +380,7 @@ class Pattern(object):
x = self
for exponent in range(8, maxexp+2, 2):
if (verbose):
if (verbose) and (exponent > 8):
print("Checking periodicity with exponent %d..." % exponent)
y = x.pdetect_or_advance(exponent)
if isinstance(y, dict):
......
......@@ -124,9 +124,6 @@ bbbbooobobobbboo!''', 'g3b3s23')
p54soup[coords] = values
values2 = p54soup[coords]
print(values)
print(values2)
self.assertEqual(np.all(values == values2), True)
def test_isogeny(self):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment