[GAP Forum] Boolean matrix
Alexander Konovalov
alexk at mcs.st-and.ac.uk
Tue Mar 8 22:34:19 GMT 2016
Dear Gordon, Sara, dear Forum,
> On 2 Mar 2016, at 07:24, Gordon Royle <gordon.royle at uwa.edu.au> wrote:
>
> Each iteration of Add(A,B) simply adds (to A) another reference to the same copy of B, so all four rows of A refer to a single copy of B.
>
> If you change that one copy (using *any* of the references) then every reference to that copy will reflect the change.
>
> You need to actually create four genuine “deep copies" of B if you want them to be independent.
>
> (I am also not sure whether GAP treats arrays of booleans as bit patterns which is what you would need in order to really save memory)
GAP indeed has boolean lists (blists) which are internally represented in
a compact form - see http://www.gap-system.org/Manuals/doc/ref/chap22.html
for further details and some pitfalls to avoid.
Best wishes
Alexander
More information about the Forum
mailing list