Skip to content

Commit

Permalink
Add FiltersObj and FiltersType functions
Browse files Browse the repository at this point in the history
* FiltersType returns the list of filters set in the
  passed type
* FiltersObj does the same for the passed object
  • Loading branch information
markuspf committed Oct 26, 2016
1 parent b6c12ed commit f958b4b
Show file tree
Hide file tree
Showing 5 changed files with 61 additions and 8 deletions.
2 changes: 2 additions & 0 deletions doc/ref/makedocreldata.g
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 1 addition & 0 deletions doc/ref/types.xml
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ as well as sections&nbsp;<Ref Sect="Logical Implications"/>,
</ManSection>

<#Include Label="ShowImpliedFilters">
<#Include Label="FiltersType">

</Section>

Expand Down
1 change: 1 addition & 0 deletions lib/read3.g
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
##
#X now read all the definition parts
##
ReadLib( "type.gd" );
ReadLib( "tuples.gd" );
ReadLib( "rvecempt.gd" );

Expand Down
38 changes: 38 additions & 0 deletions lib/type.gd
Original file line number Diff line number Diff line change
@@ -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( <type> )
#O FiltersObj( <type> )
##
## list of filters of a type
##
## <#GAPDoc Label="FiltersType">
## <ManSection>
## <Oper Name="FiltersType" Arg='type'/>
## <Oper Name="FiltersObj" Arg='object'/>
##
## <Description>
## returns a list of the filters in the type <A>type</A>, or in the
## type of the object <A>object</A> respectively.
## <Example><![CDATA[
## gap> FiltersObj(fail);
## [ <Category "IsBool">, <Representation "IsInternalRep"> ]
## gap> FiltersType(TypeOfTypes);
## [ <Representation "IsPositionalObjectRep">, <Category "IsType">, <Representation "IsTypeDefaultRep"> ]
## ]]></Example>
## </Description>
## </ManSection>
## <#/GAPDoc>
##
DeclareOperation( "FiltersType", [ IsType ] );
DeclareOperation( "FiltersObj", [ IsObject ] );
27 changes: 19 additions & 8 deletions lib/type.gi
Original file line number Diff line number Diff line change
Expand Up @@ -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( <type> )
##
## Return list of filters set in the given type.
##
InstallMethod(FiltersType, "for a type", [ IsType ],
type -> FILTERS{ TRUES_FLAGS(type![2]) });

#############################################################################
##
#M FiltersObj( <object> )
##
## Return list of filters set in the type of <object>.
##
InstallMethod(FiltersObj, "for an object", [ IsObject ],
obj -> FiltersType(TypeObj(obj)));

#############################################################################
##
#M NamesFilterShort( flags, max )
Expand Down Expand Up @@ -129,8 +145,3 @@ function ( type )
fi;
return res;
end);





0 comments on commit f958b4b

Please sign in to comment.