File: unknown.gd

package info (click to toggle)
gap 4r4p12-2
  • links: PTS
  • area: main
  • in suites: squeeze, wheezy
  • size: 29,584 kB
  • ctags: 7,113
  • sloc: ansic: 98,786; sh: 3,299; perl: 2,263; makefile: 498; asm: 63; awk: 6
file content (125 lines) | stat: -rw-r--r-- 4,675 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
##############################################################################
##
#W  unknown.gd                 GAP Library                   Martin Schoenert
##
#H  @(#)$Id: unknown.gd,v 4.15 2002/08/23 14:39:20 gap Exp $
##
#Y  Copyright (C)  1997,  Lehrstuhl D fuer Mathematik,  RWTH Aachen,  Germany
#Y  (C) 1998 School Math and Comp. Sci., University of St.  Andrews, Scotland
#Y  Copyright (C) 2002 The GAP Group
##
##  This file declares the operations for unknowns.
##
Revision.unknown_gd :=
    "@(#)$Id: unknown.gd,v 4.15 2002/08/23 14:39:20 gap Exp $";


#############################################################################
#1
##  Sometimes the result of an operation does not allow further
##  computations with it.
##  In many cases, then an error is signalled,
##  and the computation is stopped.
##  
##  This is not appropriate for some applications in character theory.
##  For example, if one wants to induce a character of a group to a
##  supergroup (see~"InducedClassFunction") but the class fusion is only a
##  parametrized map (see Chapter~"Maps Concerning Character Tables"),
##  there may be values of the induced character which are determined by the
##  fusion map, whereas other values are not known.
##
##  For this and other situations, {\GAP} provides the data type *unknown*.
##  An object of this type, further on called an *unknown*,
##  may stand for any cyclotomic (see Chapter~"Cyclotomic Numbers"),
##  in particular its family (see~"Families") is `CyclotomicsFamily'.
##  
##  Unknowns are parametrized by positive integers.
##  When a {\GAP} session is started, no unknowns exist.
##  
##  The only ways to create unknowns are to call the function `Unknown'
##  or a function that calls it,
##  or to do arithmetical operations with unknowns.
##  
##  {\GAP} objects containing unknowns will contain *fixed* unknowns
##  when they are printed to files, i.e.,
##  function calls `Unknown( <n> )' instead of `Unknown()'.
##  So be careful to read files printed in different {\GAP} sessions,
##  since there may be the same unknown at different places.
##  
##  The rest of this chapter contains information about the unknown
##  constructor, the category,
##  and comparison of and arithmetical operations for unknowns;
##  more is not known about unknowns in {\GAP}.
##  


#############################################################################
##
#2
##  Unknowns can be *compared* via `=' and `\<' with all cyclotomics
##  and with certain other {\GAP} objects (see~"Comparisons").
##  We have `Unknown( <n> ) >= Unknown( <m> )' if and only if `<n> >= <m>'
##  holds; unknowns are larger than all cyclotomics that are not unknowns.


#############################################################################
##
#3
##  The usual arithmetic operations `+', `-', `*' and `/' are defined for
##  addition, subtraction, multiplication and division of unknowns and
##  cyclotomics.
##  The result will be a new unknown except in one of the following cases.
##
##  Multiplication with zero yields zero,
##  and multiplication with one or addition of zero yields the old unknown.
##  *Note* that division by an unknown causes an error, since an unknown
##  might stand for zero.
##
##  As unknowns are cyclotomics, dense lists of unknowns and other
##  cyclotomics are row vectors and
##  they can be added and multiplied in the usual way.
##  Consequently, lists of such row vectors of equal length are (ordinary)
##  matrices (see~"IsOrdinaryMatrix").


#############################################################################
##
#C  IsUnknown( <obj> )
##
##  is the category of unknowns in {\GAP}.
##
DeclareCategory( "IsUnknown", IsCyclotomic );
    
    
#############################################################################
##
#V  LargestUnknown  . . . . . . . . . . . . largest used index for an unknown
##
##  `LargestUnknown' is the largest <n> that is used in any `Unknown( <n> )'
##  in the current {\GAP} session.
##  This is used in `Unknown' which increments this value when asked to make
##  a new unknown.
##
LargestUnknown := 0;


#############################################################################
##
#O  Unknown()
#O  Unknown( <n> )
##
##  In the first form `Unknown' returns a new unknown value, i.e., the first
##  one that is larger than all unknowns which exist in the current {\GAP}
##  session.
##
##  In the second form `Unknown' returns the <n>-th unknown;
##  if it did not exist yet, it is created.
##
DeclareOperation( "Unknown", [] );
DeclareOperation( "Unknown", [ IsPosInt ] );


#############################################################################
##
#E