From f958b4b4603ccfe031ec80309a50ba777ec28e0a Mon Sep 17 00:00:00 2001 From: Markus Pfeiffer Date: Mon, 24 Oct 2016 14:11:26 +0100 Subject: [PATCH] Add FiltersObj and FiltersType functions * FiltersType returns the list of filters set in the passed type * FiltersObj does the same for the passed object --- doc/ref/makedocreldata.g | 2 ++ doc/ref/types.xml | 1 + lib/read3.g | 1 + lib/type.gd | 38 ++++++++++++++++++++++++++++++++++++++ lib/type.gi | 27 +++++++++++++++++++-------- 5 files changed, 61 insertions(+), 8 deletions(-) create mode 100644 lib/type.gd diff --git a/doc/ref/makedocreldata.g b/doc/ref/makedocreldata.g index a03ee3bd47..0d380f53c5 100644 --- a/doc/ref/makedocreldata.g +++ b/doc/ref/makedocreldata.g @@ -189,6 +189,8 @@ GAPInfo.ManualDataRef:= rec( "../../lib/tuples.gd", "../../lib/twocohom.gd", "../../lib/type.g", + "../../lib/type.gd", + "../../lib/type.gi", "../../lib/type1.g", "../../lib/unknown.gd", "../../lib/upoly.gd", diff --git a/doc/ref/types.xml b/doc/ref/types.xml index c53857cb6a..ff10375f8a 100644 --- a/doc/ref/types.xml +++ b/doc/ref/types.xml @@ -160,6 +160,7 @@ as well as sections , <#Include Label="ShowImpliedFilters"> +<#Include Label="FiltersType"> diff --git a/lib/read3.g b/lib/read3.g index b4febe5dc3..51a34f2894 100644 --- a/lib/read3.g +++ b/lib/read3.g @@ -2,6 +2,7 @@ ## #X now read all the definition parts ## +ReadLib( "type.gd" ); ReadLib( "tuples.gd" ); ReadLib( "rvecempt.gd" ); diff --git a/lib/type.gd b/lib/type.gd new file mode 100644 index 0000000000..bf50fde282 --- /dev/null +++ b/lib/type.gd @@ -0,0 +1,38 @@ +############################################################################# +## +#W type.gd GAP library +## +## +#Y Copyright (C) 2016 The GAP Group +## +## This file declares some additional functionality relating to types and +## families. +## + +############################################################################# +## +#O FiltersType( ) +#O FiltersObj( ) +## +## list of filters of a type +## +## <#GAPDoc Label="FiltersType"> +## +## +## +## +## +## returns a list of the filters in the type type, or in the +## type of the object object respectively. +## FiltersObj(fail); +## [ , ] +## gap> FiltersType(TypeOfTypes); +## [ , , ] +## ]]> +## +## +## <#/GAPDoc> +## +DeclareOperation( "FiltersType", [ IsType ] ); +DeclareOperation( "FiltersObj", [ IsObject ] ); diff --git a/lib/type.gi b/lib/type.gi index 1763b81010..0265334a7d 100644 --- a/lib/type.gi +++ b/lib/type.gi @@ -3,14 +3,30 @@ #W type.gi GAP library ## ## -#Y Copyright (C) 1997, Lehrstuhl D für Mathematik, RWTH Aachen, Germany -#Y (C) 1998 School Math and Comp. Sci., University of St Andrews, Scotland -#Y Copyright (C) 2002 The GAP Group +#Y Copyright (C) 2016 The GAP Group ## ## This file implements some additional functions relating to types and ## families. ## +############################################################################# +## +#M FiltersType( ) +## +## Return list of filters set in the given type. +## +InstallMethod(FiltersType, "for a type", [ IsType ], + type -> FILTERS{ TRUES_FLAGS(type![2]) }); + +############################################################################# +## +#M FiltersObj( ) +## +## Return list of filters set in the type of . +## +InstallMethod(FiltersObj, "for an object", [ IsObject ], + obj -> FiltersType(TypeObj(obj))); + ############################################################################# ## #M NamesFilterShort( flags, max ) @@ -129,8 +145,3 @@ function ( type ) fi; return res; end); - - - - -