You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In tblgener.gi, you can find this code snippet around line 420:
##LR - This trick is not yet working in GAP4. Until it does,
## the tables will not be printed to the file.
if info then Print("\nSaving the bound tables...\n"); fi;
#file := Filename(LOADED_PACKAGES.guava,
# Concatenation("tbl/bdtable",String(q),".g") );
# The LOADED_PACKAGES record is now defunct. The following was suggested by Alex Konovalov. --JEF (1/18/2016)
file := Filename( DirectoriesPackageLibrary("guava", "tbl"),
Concatenation("bdtable",String(q),".g") );
PrintTo(file, "#A BOUNDS FOR q = ", String(q), help,
"\n\nGUAVA_BOUNDS_TABLE[1", WriteToFile(LBT),
"\n\nGUAVA_BOUNDS_TABLE[2", WriteToFile(UBT) );
I am not quite sure which "trick" the first comment refers to. But what I can confirm is that this code won't print much to the given file -- indeed, I would suspect that it would run into an error, because WriteToFile returns nothing, yet its (non-existant) return value is passed to PrintTo.
Anyway, my guess is that the speed problem refered to using PrintTo(filename, ...) repeatedly, which is indeed very slow: Each such call opens the file, appends a line to it, then closes it again. That causes significant overhead.
If you want to fix this, you could open a stream, print to that, and finally close it, as in this example:
The entire CreateBoundsTable function is broken. In my local devel branch I have a fixed version using String manipulations to get the WriteToFile function working. I'll rework that to use the Stream approach you've suggested and commit to master shortly. Sadly the outputted bounds tables bear very little relation to the existing tables in guava/tbl/. For instance none of the codes from Brouwer's tables get installed, so most of the constructed lower bounds are made w/ concatenations of U|U+V constructions. I thing Cen Tjhai began revamping the CreateBoundsTable code but didn't get it finished and instead hand-edited the bounds tables. I need to work out a way to run the bounds functions (e.g. BestKnownLinearCode) with a choice of whether the legacy bounds table or the new "created" table gets used so the two approaches can be compared (and compare both to Marcus Grassl's database).
In
tblgener.gi
, you can find this code snippet around line 420:I am not quite sure which "trick" the first comment refers to. But what I can confirm is that this code won't print much to the given file -- indeed, I would suspect that it would run into an error, because
WriteToFile
returns nothing, yet its (non-existant) return value is passed toPrintTo
.Anyway, my guess is that the speed problem refered to using
PrintTo(filename, ...)
repeatedly, which is indeed very slow: Each such call opens the file, appends a line to it, then closes it again. That causes significant overhead.If you want to fix this, you could open a stream, print to that, and finally close it, as in this example:
Then, change
WriteToFile
to take thestream
as a parameter, and change itsPrint
calls toPrintTo(stream, ...)
.The text was updated successfully, but these errors were encountered: