1############################################################################# 2## 3#W random.gd Manuel Delgado <mdelgado@fc.up.pt> 4#W Pedro A. Garcia-Sanchez <pedro@ugr.es> 5#W Jose Morais <josejoao@fc.up.pt> 6## 7## 8#Y Copyright 2005 by Manuel Delgado, 9#Y Pedro Garcia-Sanchez and Jose Joao Morais 10#Y We adopt the copyright regulations of GAP as detailed in the 11#Y copyright notice in the GAP manual. 12## 13############################################################################# 14 15 16############################################################################# 17## 18#F RandomListForNS(n,m) 19## 20## Returns a set of length not greater than n of random integers in [1..m] 21## whose GCD is 1. 22## It is used to create "random" numerical semigroups. 23## 24############################################################################# 25DeclareGlobalFunction( "RandomListForNS" ); 26 27 28############################################################################# 29## 30#F RandomNumericalSemigroup(n,m) 31## 32## Returns a "random" numerical semigroup with no more 33## than n generators in [1..m]. 34## 35############################################################################# 36DeclareGlobalFunction( "RandomNumericalSemigroup" ); 37 38 39 40############################################################################# 41## 42#F RandomListRepresentingSubAdditiveFunction(m, a) 43## 44## Produces a list representing a subadditive function which is periodic 45## with period m (or less). When possible, the images are in [a..20*a]. 46## (Otherwise, the list of possible images is enlarged.) 47## 48############################################################################# 49DeclareGlobalFunction( "RandomListRepresentingSubAdditiveFunction" ); 50 51 52 53 54############################################################################# 55## 56#F RandomProportionallyModularNumericalSemigroup(k) 57## 58## Produces a "random" proportionally modular semigroup. 59## 60############################################################################# 61DeclareGlobalFunction( "RandomProportionallyModularNumericalSemigroup" ); 62 63 64 65############################################################################# 66## 67#F RandomModularNumericalSemigroup(k) 68## 69## Produces a "random" modular semigroup. 70## 71############################################################################# 72DeclareGlobalFunction( "RandomModularNumericalSemigroup" ); 73 74############################################################################# 75## 76#F NumericalSemigroupWithRandomElementsAndFrobenius(n,mult,frob) 77## 78## Produces a "random" semigroup containing (at least) <n> elements greater than or equal to <mult> and less than <frob>, choosen at random. The semigroup returned has multiplicity choosen at random but no smaller than <mult> and having Frobenius number choosen at random but not greater than <frob>. 79## 80############################################################################# 81DeclareGlobalFunction( "NumericalSemigroupWithRandomElementsAndFrobenius" ); 82 83############################################################################# 84## 85#F RandomNumericalSemigroupWithGenus(g) 86## 87## Produces a pseudo-random numerical semigroup with genus g 88############################################################################# 89DeclareGlobalFunction( "RandomNumericalSemigroupWithGenus" ); 90 91############################################################################# 92## For affine semigroups 93############################################################################# 94## 95#F RandomAffineSemigroupWithGenusAndDimension(g,d) 96## 97## Produces a pseudo-random affine semigroup with genus g in dimension d 98############################################################################# 99DeclareGlobalFunction( "RandomAffineSemigroupWithGenusAndDimension" ); 100 101############################################################################### 102## 103#F RandomAffineSemigroup 104# Returns an affine semigroup generated by a random n'*d' matrix where d' (the dimension) is randomly choosen from [1..d] and n' (the number of generators) is randomly choosen from [1..n] 105########################################################################### 106DeclareGlobalFunction("RandomAffineSemigroup"); 107 108############################################################################### 109## 110#F RandomFullAffineSemigroup 111# Computes the tame degree of the affine semigroup a 112########################################################################### 113DeclareGlobalFunction("RandomFullAffineSemigroup"); 114 115############################################################################### 116# Random functions for good semigroups 117############################################################################# 118## 119##################################################### 120#F RandomGoodSemigroupWithFixedMultiplicity:=function(m,cond) 121# It produces a Good Semigroup with multiplicity m and conductor bounded by cond 122##################################################### 123DeclareGlobalFunction("RandomGoodSemigroupWithFixedMultiplicity");