@@ -334,6 +334,60 @@ InstallMethod( FVector,
334
334
335
335
end );
336
336
337
+ # #
338
+ InstallMethod( PrimitiveCollections,
339
+ " for fans" ,
340
+ [ IsFan ] ,
341
+
342
+ function ( fan )
343
+ local rays, max_cones, facets, all_points, d_max, primitive_collections, d, checked, facet,
344
+ I_minus_j, scanner, j, I;
345
+
346
+ # collect data of the fan
347
+ rays := RayGenerators( fan );
348
+ max_cones := MaximalCones( fan );
349
+ facets := List( [ 1 .. Length( max_cones ) ] ,
350
+ i -> List( RayGenerators( max_cones[ i ] ), k -> Position( rays, k ) ) );
351
+ all_points := [ 1 .. Length( rays ) ] ;
352
+ d_max := Maximum( List( facets, i -> Length( i ) ) ) + 1 ;
353
+
354
+ # identify and return the primitive collections
355
+ primitive_collections := [] ;
356
+ for d in [ 1 .. d_max ] do
357
+ checked := [] ;
358
+ for facet in facets do
359
+ for I_minus_j in Combinations( facet, d ) do
360
+ scanner := Difference( all_points, Flat( I_minus_j ) );
361
+ for j in scanner do
362
+ I := Concatenation( I_minus_j, [ j ] );
363
+
364
+ if not I in checked then
365
+
366
+ Add( checked, I );
367
+
368
+ # (1) I is contained in the primitive collections iff it is not contained in any facet
369
+ if ForAll( [ 1 .. Length( facets ) ] ,
370
+ i -> not IsSubsetSet( facets[ i ] , I ) ) then
371
+
372
+ # (2) I is generator of the primitive collections iff
373
+ # primitive_collections does not contain a "smaller" generator
374
+ if ForAll( [ 1 .. Length( primitive_collections ) ] ,
375
+ i -> not IsSubsetSet( I, primitive_collections[ i] ) ) then
376
+
377
+ # then add this new generator
378
+ Append( primitive_collections, [ I ] );
379
+
380
+ fi ;
381
+ fi ;
382
+ fi ;
383
+ od ;
384
+ od ;
385
+ od ;
386
+ od ;
387
+ return primitive_collections;
388
+
389
+ end );
390
+
337
391
# ###################################
338
392
# #
339
393
# # Properties
0 commit comments