From 8744a616df40d295eb9542d89106c32f018b8ae0 Mon Sep 17 00:00:00 2001 From: Joseph Edwards Date: Tue, 27 Aug 2024 13:01:18 +0100 Subject: [PATCH] Add MeetBlist --- doc/ref/blist.xml | 1 + lib/list.g | 28 ++++++++++++++++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/doc/ref/blist.xml b/doc/ref/blist.xml index 79f780b687..f0e0210455 100644 --- a/doc/ref/blist.xml +++ b/doc/ref/blist.xml @@ -56,6 +56,7 @@ In function names we call boolean lists blists for brevity. <#Include Label="UniteBlistList"> <#Include Label="IntersectBlist"> <#Include Label="SubtractBlist"> +<#Include Label="MeetBlist"> <#Include Label="FlipBlist"> <#Include Label="SetAllBlist"> <#Include Label="ClearAllBlist"> diff --git a/lib/list.g b/lib/list.g index 33866ac617..5f132bad75 100644 --- a/lib/list.g +++ b/lib/list.g @@ -881,6 +881,34 @@ DeclareSynonym( "IntersectBlist", INTER_BLIST ); ## DeclareSynonym( "SubtractBlist", SUBTR_BLIST ); +############################################################################# +## +#F MeetBlist( , ) +## +## <#GAPDoc Label="MeetBlist"> +## +## +## +## +## Returns true if blist1 and blist2 have true in the same +## position and false otherwise. It is equivalent to, but faster than +## SizeBlist(IntersectionBlist(blist1, blist2)) <> 0. +## The lists must have the same length. +## blist1 := [ true, true, true, true ];; +## gap> blist2 := [ true, false, true, false ];; +## gap> MeetBlist( blist1, blist2 ); +## true +## gap> FlipBlist( blist1 ); +## gap> MeetBlist( blist1, blist2 ); +## false +## ]]> +## +## +## <#/GAPDoc> +## +DeclareSynonym( "MeetBlist", MEET_BLIST ); + ############################################################################# ## #F FlipBlist( )