diff --git a/dev/.documenter-siteinfo.json b/dev/.documenter-siteinfo.json index 43ef9268..d51bfe47 100644 --- a/dev/.documenter-siteinfo.json +++ b/dev/.documenter-siteinfo.json @@ -1 +1 @@ -{"documenter":{"julia_version":"1.10.4","generation_timestamp":"2024-06-06T15:55:11","documenter_version":"1.4.1"}} \ No newline at end of file +{"documenter":{"julia_version":"1.10.4","generation_timestamp":"2024-06-13T21:46:35","documenter_version":"1.4.1"}} \ No newline at end of file diff --git a/dev/assets/html/JuliaInterface/chap2.html b/dev/assets/html/JuliaInterface/chap2.html index a6c9fbc9..82ba6cd7 100644 --- a/dev/assets/html/JuliaInterface/chap2.html +++ b/dev/assets/html/JuliaInterface/chap2.html @@ -176,7 +176,7 @@
2.2-2 JuliaIncludeFile
‣ JuliaIncludeFile( filename[, module_name] )( function )

Returns: nothing.

-

calls Julia's Base.include with the strings filename (an absolute filename, as returned by Filename (Reference: Filename)) and module_name (the name of a Julia module, the default is "Main"). This means that the Julia code in the file with name filename gets executed in the current Julia session, in the context of the Julia module module_name.

+

calls Julia's Base.include with the strings filename (an absolute filename, as returned by Filename (Reference: Filename)) and module_name (the name of a Julia module, the default is "Main"). This means that the Julia code in the file with name filename gets executed in the current Julia session, in the context of the Julia module module_name.

@@ -429,19 +429,19 @@
2.4-1 Convenience methods for Juli @@ -462,7 +462,7 @@
2.4-1 Convenience methods for Juli

2.5 Access Julia help from a GAP session

-

In a Julia session, one can ask for help about the object with the name obj (a function or a type) by entering ?obj, and Julia prints all matches to the screen. One can get the same output in a GAP session by entering ?Julia:obj, cf. Section Reference: Invoking the Help in the GAP Reference Manual. For example, ?Julia:sqrt shows the Julia help about the Julia function sqrt (which is available in GAP as Julia.sqrt).

+

In a Julia session, one can ask for help about the object with the name obj (a function or a type) by entering ?obj, and Julia prints all matches to the screen. One can get the same output in a GAP session by entering ?Julia:obj, cf. Section Reference: Invoking the Help in the GAP Reference Manual. For example, ?Julia:sqrt shows the Julia help about the Julia function sqrt (which is available in GAP as Julia.sqrt).

Note that this way to access the Julia help is different from the usual access to GAP help books, in the following sense.

@@ -480,7 +480,7 @@

2.5 Access Julia help fro
  • The Julia help system does currently not support menus in case of multiple matches, all matches are shown at once, and this happens also in a GAP session.

  • -
  • No PDF or HTML version of the Julia help is supported in GAP, only the text format can be shown on the screen. Thus it does not make sense to change the help viewer, cf. Section Reference: Changing the Help Viewer in the GAP Reference Manual.

    +
  • No PDF or HTML version of the Julia help is supported in GAP, only the text format can be shown on the screen. Thus it does not make sense to change the help viewer, cf. Section Reference: Changing the Help Viewer in the GAP Reference Manual.

  • Julia functions belong to Julia modules. Many Julia functions can be accessed only relative to their modules, and then also the help requests work only for the qualified names. For example, ?Julia:GAP.julia_to_gap yields the description of the Julia function julia_to_gap that is defined in the Julia module GAP, whereas no match is found for the input ?Julia:julia_to_gap.

    diff --git a/dev/assets/html/JuliaInterface/chap2_mj.html b/dev/assets/html/JuliaInterface/chap2_mj.html index 39cd7a72..8af1b8d3 100644 --- a/dev/assets/html/JuliaInterface/chap2_mj.html +++ b/dev/assets/html/JuliaInterface/chap2_mj.html @@ -179,7 +179,7 @@
    2.2-2 JuliaIncludeFile
    ‣ JuliaIncludeFile( filename[, module_name] )( function )

    Returns: nothing.

    -

    calls Julia's Base.include with the strings filename (an absolute filename, as returned by Filename (Reference: Filename)) and module_name (the name of a Julia module, the default is "Main"). This means that the Julia code in the file with name filename gets executed in the current Julia session, in the context of the Julia module module_name.

    +

    calls Julia's Base.include with the strings filename (an absolute filename, as returned by Filename (Reference: Filename)) and module_name (the name of a Julia module, the default is "Main"). This means that the Julia code in the file with name filename gets executed in the current Julia session, in the context of the Julia module module_name.

    @@ -432,19 +432,19 @@
    2.4-1 Convenience methods for Juli @@ -465,7 +465,7 @@
    2.4-1 Convenience methods for Juli

    2.5 Access Julia help from a GAP session

    -

    In a Julia session, one can ask for help about the object with the name obj (a function or a type) by entering ?obj, and Julia prints all matches to the screen. One can get the same output in a GAP session by entering ?Julia:obj, cf. Section Reference: Invoking the Help in the GAP Reference Manual. For example, ?Julia:sqrt shows the Julia help about the Julia function sqrt (which is available in GAP as Julia.sqrt).

    +

    In a Julia session, one can ask for help about the object with the name obj (a function or a type) by entering ?obj, and Julia prints all matches to the screen. One can get the same output in a GAP session by entering ?Julia:obj, cf. Section Reference: Invoking the Help in the GAP Reference Manual. For example, ?Julia:sqrt shows the Julia help about the Julia function sqrt (which is available in GAP as Julia.sqrt).

    Note that this way to access the Julia help is different from the usual access to GAP help books, in the following sense.

    @@ -483,7 +483,7 @@

    2.5 Access Julia help fro
  • The Julia help system does currently not support menus in case of multiple matches, all matches are shown at once, and this happens also in a GAP session.

  • -
  • No PDF or HTML version of the Julia help is supported in GAP, only the text format can be shown on the screen. Thus it does not make sense to change the help viewer, cf. Section Reference: Changing the Help Viewer in the GAP Reference Manual.

    +
  • No PDF or HTML version of the Julia help is supported in GAP, only the text format can be shown on the screen. Thus it does not make sense to change the help viewer, cf. Section Reference: Changing the Help Viewer in the GAP Reference Manual.

  • Julia functions belong to Julia modules. Many Julia functions can be accessed only relative to their modules, and then also the help requests work only for the qualified names. For example, ?Julia:GAP.julia_to_gap yields the description of the Julia function julia_to_gap that is defined in the Julia module GAP, whereas no match is found for the input ?Julia:julia_to_gap.

    diff --git a/dev/assets/html/JuliaInterface/chap3.html b/dev/assets/html/JuliaInterface/chap3.html index 2bc683d2..7f03146d 100644 --- a/dev/assets/html/JuliaInterface/chap3.html +++ b/dev/assets/html/JuliaInterface/chap3.html @@ -86,7 +86,7 @@
    3.1-1 Guiding principles
    3.1-2 Automatic (implicit) conversions
    -

    GAP has a notion of immediate objects, whose values are stored inside the pointer referencing them. GAP uses this to store small integers and elements of small finite fields, see for example the beginning of Chapter Reference: Integers in the GAP Reference Manual. Since these are not valid pointers, Julia cannot treat them like other GAP objects, which are simply Julia objects of type GAP.GapObj. Instead, a conversion is unavoidable, at least when immediate objects are passed as stand-alone arguments to a function.

    +

    GAP has a notion of immediate objects, whose values are stored inside the pointer referencing them. GAP uses this to store small integers and elements of small finite fields, see for example the beginning of Chapter Reference: Integers in the GAP Reference Manual. Since these are not valid pointers, Julia cannot treat them like other GAP objects, which are simply Julia objects of type GAP.GapObj. Instead, a conversion is unavoidable, at least when immediate objects are passed as stand-alone arguments to a function.

    To this end, the interface converts GAP immediate integers into Julia Int64 objects, and vice versa. However, GAP immediate integers on a 64 bit system can only store 61 bits, so not all Int64objects can be converted into immediate integers; integers exceeding the 61 bits limit are therefore wrapped like any other Julia object. Other Julia integer types, like UInt64, Int32, are also wrapped by default, in order to ensure that conversion round trips do not arbitrary change object types.

    @@ -334,7 +334,7 @@
    3.2-2 JuliaToGAP
    [ [ 1, 2 ], [ 3, 4 ] ] -

    The following values for filt are supported. IsInt (Reference: IsInt), IsRat (Reference: IsRat), IsFFE (Reference: IsFFE), IsFloat (see Reference: Floats), IsBool (Reference: IsBool), IsChar (Reference: IsChar), IsRecord (Reference: IsRecord), IsString (Reference: IsString), IsRange (Reference: IsRange), IsBlist (Reference: IsBlist), IsList (Reference: IsList). See Section 3.1 for the admissible types of juliaobj in these cases.

    +

    The following values for filt are supported. IsInt (Reference: IsInt), IsRat (Reference: IsRat), IsFFE (Reference: IsFFE), IsFloat (see Reference: Floats), IsBool (Reference: IsBool), IsChar (Reference: IsChar), IsRecord (Reference: IsRecord), IsString (Reference: IsString), IsRange (Reference: IsRange), IsBlist (Reference: IsBlist), IsList (Reference: IsList). See Section 3.1 for the admissible types of juliaobj in these cases.

    @@ -395,13 +395,13 @@
    3.3-1 IsRandomSourceJulia
    ‣ IsRandomSourceJulia( obj )( filter )

    Returns: true or false

    -

    This filter allows one to use Julia's random number generators in GAP, see Reference: Random Sources for the background. Calling RandomSource (Reference: RandomSource) with only argument IsRandomSourceJulia yields a GAP random source that uses a copy of Julia's default random number generator Julia.Random.default_rng(). Note that different calls with only argument IsRandomSourceJulia yield different random sources.

    +

    This filter allows one to use Julia's random number generators in GAP, see Reference: Random Sources for the background. Calling RandomSource (Reference: RandomSource) with only argument IsRandomSourceJulia yields a GAP random source that uses a copy of Julia's default random number generator Julia.Random.default_rng(). Note that different calls with only argument IsRandomSourceJulia yield different random sources.

    -

    Called with IsRandomSourceJulia and a positive integer, RandomSource (Reference: RandomSource) returns a random source that is based on a copy of Julia.Random.default_rng() but got initialized with the given integer as a seed.

    +

    Called with IsRandomSourceJulia and a positive integer, RandomSource (Reference: RandomSource) returns a random source that is based on a copy of Julia.Random.default_rng() but got initialized with the given integer as a seed.

    -

    Called with IsRandomSourceJulia and a Julia random number generator, RandomSource (Reference: RandomSource) returns a random source that uses this random number generator. Note that we do not make a copy of the second argument, in order to be able to use the given random number generator both on the GAP side and the Julia side.

    +

    Called with IsRandomSourceJulia and a Julia random number generator, RandomSource (Reference: RandomSource) returns a random source that uses this random number generator. Note that we do not make a copy of the second argument, in order to be able to use the given random number generator both on the GAP side and the Julia side.

    -

    State (Reference: State) for random sources in IsRandomSourceJulia returns a copy of the underlying Julia random number generator.

    +

    State (Reference: State) for random sources in IsRandomSourceJulia returns a copy of the underlying Julia random number generator.

    diff --git a/dev/assets/html/JuliaInterface/chap3_mj.html b/dev/assets/html/JuliaInterface/chap3_mj.html
    index 8eb627b1..8457ba1b 100644
    --- a/dev/assets/html/JuliaInterface/chap3_mj.html
    +++ b/dev/assets/html/JuliaInterface/chap3_mj.html
    @@ -89,7 +89,7 @@ 
    3.1-1 Guiding principles
    3.1-2 Automatic (implicit) conversions
    -

    GAP has a notion of immediate objects, whose values are stored inside the pointer referencing them. GAP uses this to store small integers and elements of small finite fields, see for example the beginning of Chapter Reference: Integers in the GAP Reference Manual. Since these are not valid pointers, Julia cannot treat them like other GAP objects, which are simply Julia objects of type GAP.GapObj. Instead, a conversion is unavoidable, at least when immediate objects are passed as stand-alone arguments to a function.

    +

    GAP has a notion of immediate objects, whose values are stored inside the pointer referencing them. GAP uses this to store small integers and elements of small finite fields, see for example the beginning of Chapter Reference: Integers in the GAP Reference Manual. Since these are not valid pointers, Julia cannot treat them like other GAP objects, which are simply Julia objects of type GAP.GapObj. Instead, a conversion is unavoidable, at least when immediate objects are passed as stand-alone arguments to a function.

    To this end, the interface converts GAP immediate integers into Julia Int64 objects, and vice versa. However, GAP immediate integers on a 64 bit system can only store 61 bits, so not all Int64objects can be converted into immediate integers; integers exceeding the 61 bits limit are therefore wrapped like any other Julia object. Other Julia integer types, like UInt64, Int32, are also wrapped by default, in order to ensure that conversion round trips do not arbitrary change object types.

    @@ -337,7 +337,7 @@
    3.2-2 JuliaToGAP
    [ [ 1, 2 ], [ 3, 4 ] ]
    -

    The following values for filt are supported. IsInt (Reference: IsInt), IsRat (Reference: IsRat), IsFFE (Reference: IsFFE), IsFloat (see Reference: Floats), IsBool (Reference: IsBool), IsChar (Reference: IsChar), IsRecord (Reference: IsRecord), IsString (Reference: IsString), IsRange (Reference: IsRange), IsBlist (Reference: IsBlist), IsList (Reference: IsList). See Section 3.1 for the admissible types of juliaobj in these cases.

    +

    The following values for filt are supported. IsInt (Reference: IsInt), IsRat (Reference: IsRat), IsFFE (Reference: IsFFE), IsFloat (see Reference: Floats), IsBool (Reference: IsBool), IsChar (Reference: IsChar), IsRecord (Reference: IsRecord), IsString (Reference: IsString), IsRange (Reference: IsRange), IsBlist (Reference: IsBlist), IsList (Reference: IsList). See Section 3.1 for the admissible types of juliaobj in these cases.

    @@ -398,13 +398,13 @@
    3.3-1 IsRandomSourceJulia
    ‣ IsRandomSourceJulia( obj )( filter )

    Returns: true or false

    -

    This filter allows one to use Julia's random number generators in GAP, see Reference: Random Sources for the background. Calling RandomSource (Reference: RandomSource) with only argument IsRandomSourceJulia yields a GAP random source that uses a copy of Julia's default random number generator Julia.Random.default_rng(). Note that different calls with only argument IsRandomSourceJulia yield different random sources.

    +

    This filter allows one to use Julia's random number generators in GAP, see Reference: Random Sources for the background. Calling RandomSource (Reference: RandomSource) with only argument IsRandomSourceJulia yields a GAP random source that uses a copy of Julia's default random number generator Julia.Random.default_rng(). Note that different calls with only argument IsRandomSourceJulia yield different random sources.

    -

    Called with IsRandomSourceJulia and a positive integer, RandomSource (Reference: RandomSource) returns a random source that is based on a copy of Julia.Random.default_rng() but got initialized with the given integer as a seed.

    +

    Called with IsRandomSourceJulia and a positive integer, RandomSource (Reference: RandomSource) returns a random source that is based on a copy of Julia.Random.default_rng() but got initialized with the given integer as a seed.

    -

    Called with IsRandomSourceJulia and a Julia random number generator, RandomSource (Reference: RandomSource) returns a random source that uses this random number generator. Note that we do not make a copy of the second argument, in order to be able to use the given random number generator both on the GAP side and the Julia side.

    +

    Called with IsRandomSourceJulia and a Julia random number generator, RandomSource (Reference: RandomSource) returns a random source that uses this random number generator. Note that we do not make a copy of the second argument, in order to be able to use the given random number generator both on the GAP side and the Julia side.

    -

    State (Reference: State) for random sources in IsRandomSourceJulia returns a copy of the underlying Julia random number generator.

    +

    State (Reference: State) for random sources in IsRandomSourceJulia returns a copy of the underlying Julia random number generator.

    diff --git a/dev/basics/index.html b/dev/basics/index.html
    index fffee59c..38126aca 100644
    --- a/dev/basics/index.html
    +++ b/dev/basics/index.html
    @@ -21,7 +21,7 @@
     
     julia> GAP.Globals.Julia   # Julia objects can be values of GAP variables
     Main
    -
    source
    GAP.evalstrFunction
    evalstr(cmd::String)

    Let GAP execute the command(s) given by cmd; if an error occurs then report this error, otherwise if the last command has a result then return it, otherwise return nothing.

    Examples

    julia> GAP.evalstr( "1+2" )
    +
    source
    GAP.evalstrFunction
    evalstr(cmd::String)

    Let GAP execute the command(s) given by cmd; if an error occurs then report this error, otherwise if the last command has a result then return it, otherwise return nothing.

    Examples

    julia> GAP.evalstr( "1+2" )
     3
     
     julia> GAP.evalstr( "x:= []" )
    @@ -32,7 +32,7 @@
     julia> GAP.evalstr( "x" )
     GAP: [ 2 ]
     
    -julia> GAP.evalstr( "Print( x )" )

    Note that screen outputs caused by evaluating cmd are not shown by evalstr; use evalstr_ex for accessing both the outputs and the return values of the command(s).

    In general we recommend to avoid using evalstr, but it sometimes can be a useful escape hatch to access GAP functionality that is otherwise impossible to difficult to reach. But in most typical scenarios it should not be necessary to use it at all.

    Instead, use GAP.GapObj or GAP.Obj for constructing GAP objects that correspond to given Julia objects, and call GAP functions directly in the Julia session. For example, executing GAP.evalstr( "x:= []; Add( x, 2 )" ) can be replaced by the Julia code x = GAP.GapObj([]); GAP.Globals.Add(x, 2). Note that the variable x in the former example lives in the GAP session, i.e., it can be accessed as GAP.Globals.x after the call of GAP.evalstr, whereas x in the latter example lives in the Julia session.

    source
    GAP.evalstr_exFunction
    evalstr_ex(cmd::String)

    Assume that cmd consists of $n$ GAP statements, each terminated by ; or ;;. Let GAP execute these statements and return a GAP list of length $n$ that describes their results. Each entry of the return value is a GAP list of length 5, with the following meaning.

    • The first entry is true if the statement was executed successfully, and false otherwise.
    • If the first entry is true, then the second entry is bound to the result of the statement if there was one, and unbound otherwise.
    • The third entry is unbound if an error occured, true if the statement ends in a double semicolon, and false otherwise.
    • The fourth entry currently is always unbound.
    • The fifth entry contains the captured output of the statement as a string. If there was no double semicolon then also the output of GAP.Globals.ViewObj applied to the result value in the second entry, if any, is part of that string.

    Examples

    julia> GAP.evalstr_ex( "1+2" )        # error due to missing semicolon
    +julia> GAP.evalstr( "Print( x )" )

    Note that screen outputs caused by evaluating cmd are not shown by evalstr; use evalstr_ex for accessing both the outputs and the return values of the command(s).

    In general we recommend to avoid using evalstr, but it sometimes can be a useful escape hatch to access GAP functionality that is otherwise impossible to difficult to reach. But in most typical scenarios it should not be necessary to use it at all.

    Instead, use GAP.GapObj or GAP.Obj for constructing GAP objects that correspond to given Julia objects, and call GAP functions directly in the Julia session. For example, executing GAP.evalstr( "x:= []; Add( x, 2 )" ) can be replaced by the Julia code x = GAP.GapObj([]); GAP.Globals.Add(x, 2). Note that the variable x in the former example lives in the GAP session, i.e., it can be accessed as GAP.Globals.x after the call of GAP.evalstr, whereas x in the latter example lives in the Julia session.

    source
    GAP.evalstr_exFunction
    evalstr_ex(cmd::String)

    Assume that cmd consists of $n$ GAP statements, each terminated by ; or ;;. Let GAP execute these statements and return a GAP list of length $n$ that describes their results. Each entry of the return value is a GAP list of length 5, with the following meaning.

    • The first entry is true if the statement was executed successfully, and false otherwise.
    • If the first entry is true, then the second entry is bound to the result of the statement if there was one, and unbound otherwise.
    • The third entry is unbound if an error occured, true if the statement ends in a double semicolon, and false otherwise.
    • The fourth entry currently is always unbound.
    • The fifth entry contains the captured output of the statement as a string. If there was no double semicolon then also the output of GAP.Globals.ViewObj applied to the result value in the second entry, if any, is part of that string.

    Examples

    julia> GAP.evalstr_ex( "1+2" )        # error due to missing semicolon
     GAP: [ [ false,,,, "" ] ]
     
     julia> GAP.evalstr_ex( "1+2;" )       # one statement with return value
    @@ -51,11 +51,11 @@
     GAP: [ [ true,, false,, "1" ] ]
     
     julia> GAP.evalstr_ex( "" )           # empty input
    -GAP: [  ]
    source
    GAP.promptFunction
    prompt()

    Start a GAP prompt where you can enter GAP commands as in a regular GAP session. This prompt can be left as any GAP prompt by either entering quit; or pressing ctrl-D, which returns to the Julia prompt.

    This GAP prompt allows to quickly switch between writing Julia and GAP code in a session where all data is shared.

    source
    GAP.create_gap_shFunction
    create_gap_sh(dstdir::String)

    Given a directory path, create three files in that directory:

    • a shell script named gap.sh which acts like the gap.sh shipped with a regular GAP installation, but which behind the scenes launches GAP via Julia.
    • two TOML files, Manifest.toml and Project.toml, which are required by gap.sh to function (they record the precise versions of GAP.jl and other Julia packages involved)
    source

    Accessing Julia from GAP

    The GAP-Julia interface is fully bidirectional, so it is also possible to access all Julia functionality from GAP. To learn more about this, please consult the manual of the GAP package JuliaInterface.

    Types

    GAP.FFEType
    FFE

    Wrap a pointer to a GAP FFE ("finite field element") immediate object. This type is defined in the JuliaInterface C code.

    Examples

    julia> x = GAP.Globals.Z(3)
    +GAP: [  ]
    source
    GAP.promptFunction
    prompt()

    Start a GAP prompt where you can enter GAP commands as in a regular GAP session. This prompt can be left as any GAP prompt by either entering quit; or pressing ctrl-D, which returns to the Julia prompt.

    This GAP prompt allows to quickly switch between writing Julia and GAP code in a session where all data is shared.

    source
    GAP.create_gap_shFunction
    create_gap_sh(dstdir::String)

    Given a directory path, create three files in that directory:

    • a shell script named gap.sh which acts like the gap.sh shipped with a regular GAP installation, but which behind the scenes launches GAP via Julia.
    • two TOML files, Manifest.toml and Project.toml, which are required by gap.sh to function (they record the precise versions of GAP.jl and other Julia packages involved)
    source

    Accessing Julia from GAP

    The GAP-Julia interface is fully bidirectional, so it is also possible to access all Julia functionality from GAP. To learn more about this, please consult the manual of the GAP package JuliaInterface.

    Types

    GAP.FFEType
    FFE

    Wrap a pointer to a GAP FFE ("finite field element") immediate object. This type is defined in the JuliaInterface C code.

    Examples

    julia> x = GAP.Globals.Z(3)
     GAP: Z(3)
     
     julia> typeof(x)
    -FFE
    source
    GAP.GapObjType
    GapObj

    This is the Julia type of all those GAP objects that are not "immediate" (booleans, small integers, FFEs).

    Examples

    julia> typeof(GapObj([1, 2]))          # a GAP list
    +FFE
    source
    GAP.GapObjType
    GapObj

    This is the Julia type of all those GAP objects that are not "immediate" (booleans, small integers, FFEs).

    Examples

    julia> typeof(GapObj([1, 2]))          # a GAP list
     GapObj
     
     julia> typeof(GapObj(Dict(:a => 1)))   # a GAP record
    @@ -94,7 +94,7 @@
     GAP: [ [ 1, 2 ], [ 3, 4 ] ]
     
     julia> GapObj(42)
    -ERROR: TypeError: in typeassert, expected GapObj, got a value of type Int64
    source
    GAP.ObjType
    GAP.Obj

    This is an alias for Union{GapObj,FFE,Int64,Bool}. This type union covers all types a "native" GAP object may have from Julia's viewpoint.

    Moreover, it can be used as a constructor, in order to convert Julia objects to GAP objects, whenever a suitable conversion has been defined.

    Recursive conversion of nested Julia objects (arrays, tuples, dictionaries) can be forced either by a second argument true or by the keyword argument recursive with value true.

    Examples

    julia> GAP.Obj(1//3)
    +ERROR: TypeError: in typeassert, expected GapObj, got a value of type Int64
    source
    GAP.ObjType
    GAP.Obj

    This is an alias for Union{GapObj,FFE,Int64,Bool}. This type union covers all types a "native" GAP object may have from Julia's viewpoint.

    Moreover, it can be used as a constructor, in order to convert Julia objects to GAP objects, whenever a suitable conversion has been defined.

    Recursive conversion of nested Julia objects (arrays, tuples, dictionaries) can be forced either by a second argument true or by the keyword argument recursive with value true.

    Examples

    julia> GAP.Obj(1//3)
     GAP: 1/3
     
     julia> GAP.Obj([1 2; 3 4])
    @@ -110,4 +110,4 @@
     GAP: [ [ 1, 2 ], [ 3, 4 ] ]
     
     julia> GAP.Obj(42)
    -42
    source
    GAP.GapIntType
    GapInt

    Any GAP integer object is represented in Julia as either a GapObj (if it is a "large" integer) or as an Int (if it is a "small" integer). This type union can be used to express this conveniently, e.g. when one wants to help type stability.

    Note that also GAP's infinity and -infinity fit under this type (as do many other objects which are not numbers).

    source
    +42source
    GAP.GapIntType
    GapInt

    Any GAP integer object is represented in Julia as either a GapObj (if it is a "large" integer) or as an Int (if it is a "small" integer). This type union can be used to express this conveniently, e.g. when one wants to help type stability.

    Note that also GAP's infinity and -infinity fit under this type (as do many other objects which are not numbers).

    source
    diff --git a/dev/conversion/index.html b/dev/conversion/index.html index 81bbf46e..2974c44e 100644 --- a/dev/conversion/index.html +++ b/dev/conversion/index.html @@ -26,7 +26,7 @@ julia> GAP.gap_to_julia( Matrix{Int}, val ) 2×2 Matrix{Int64}: 1 2 - 3 4

    The following gap_to_julia conversions are supported by GAP.jl. (Other Julia packages may provide conversions for more GAP objects.)

    GAP filterdefault Julia typeother Julia types
    IsIntBigInt`T <: Integer
    IsFFEGapFFE
    IsBoolBool
    IsRatRational{BigInt}`Rational{T}
    IsFloatFloat64`T <: AbstractFloat
    IsCharCucharChar
    IsStringRepStringSymbol, Vector{T}
    IsRangeRepStepRange{Int64,Int64}Vector{T}
    IsBListRepBitVectorVector{T}
    IsListVector{Any}Vector{T}
    IsVectorObjVector{Any}Vector{T}
    IsMatrixObjMatrix{Any}Matrix{T}
    IsRecordDict{Symbol, Any}Dict{Symbol, T}
    source
    GAP.julia_to_gapFunction
    julia_to_gap(input, recursion_dict = IdDict(); recursive::Bool = false)

    Convert a julia object input to an appropriate GAP object. If recursive is set to true, recursive conversions on arrays, tuples, and dictionaries is performed.

    The input recursion_dict should never be set by the user, it is meant to keep egality of input data, by converting equal data to identical objects in GAP.

    Examples

    julia> GAP.julia_to_gap(1//3)
    + 3  4

    The following gap_to_julia conversions are supported by GAP.jl. (Other Julia packages may provide conversions for more GAP objects.)

    GAP filterdefault Julia typeother Julia types
    IsIntBigInt`T <: Integer
    IsFFEGapFFE
    IsBoolBool
    IsRatRational{BigInt}`Rational{T}
    IsFloatFloat64`T <: AbstractFloat
    IsCharCucharChar
    IsStringRepStringSymbol, Vector{T}
    IsRangeRepStepRange{Int64,Int64}Vector{T}
    IsBListRepBitVectorVector{T}
    IsListVector{Any}Vector{T}
    IsVectorObjVector{Any}Vector{T}
    IsMatrixObjMatrix{Any}Matrix{T}
    IsRecordDict{Symbol, Any}Dict{Symbol, T}
    source
    GAP.julia_to_gapFunction
    julia_to_gap(input, recursion_dict = IdDict(); recursive::Bool = false)

    Convert a julia object input to an appropriate GAP object. If recursive is set to true, recursive conversions on arrays, tuples, and dictionaries is performed.

    The input recursion_dict should never be set by the user, it is meant to keep egality of input data, by converting equal data to identical objects in GAP.

    Examples

    julia> GAP.julia_to_gap(1//3)
     GAP: 1/3
     
     julia> GAP.julia_to_gap("abc")
    @@ -37,14 +37,14 @@
     
     julia> GAP.julia_to_gap([ [1, 2], [3, 4]], recursive = true)
     GAP: [ [ 1, 2 ], [ 3, 4 ] ]
    -

    The following julia_to_gap conversions are supported by GAP.jl. (Other Julia packages may provide conversions for more Julia objects.)

    Julia typeGAP filter
    Int8, Int16, ..., BigIntIsInt
    GapFFEIsFFE
    BoolIsBool
    Rational{T}IsRat
    Float16, Float32, Float64IsFloat
    AbstractStringIsString
    SymbolIsString
    CharIsChar
    Vector{T}IsList
    Vector{Bool}, BitVectorIsBList
    Tuple{T}IsList
    Matrix{T}IsList
    Dict{String, T}, Dict{Symbol, T}IsRecord
    UnitRange{T}, StepRange{T, S}IsRange
    FunctionIsFunction
    source

    Constructor Methods for GAP-to-Julia Conversions

    (For Julia-to-GAP conversions, one can use GapObj and GAP.Obj as constructors.)

    Core.Int128Type
    Int128(obj::GapObj)

    Return the Int128 converted from the GAP integer obj. (Note that small GAP integers are represented by Julia Int64 objects, in particular they are not GapObjs; their conversion is not handled by methods installed in GAP.jl.)

    Examples

    julia> val = GAP.Globals.Factorial(25)
    +

    The following julia_to_gap conversions are supported by GAP.jl. (Other Julia packages may provide conversions for more Julia objects.)

    Julia typeGAP filter
    Int8, Int16, ..., BigIntIsInt
    GapFFEIsFFE
    BoolIsBool
    Rational{T}IsRat
    Float16, Float32, Float64IsFloat
    AbstractStringIsString
    SymbolIsString
    CharIsChar
    Vector{T}IsList
    Vector{Bool}, BitVectorIsBList
    Tuple{T}IsList
    Matrix{T}IsList
    Dict{String, T}, Dict{Symbol, T}IsRecord
    UnitRange{T}, StepRange{T, S}IsRange
    FunctionIsFunction
    source

    Constructor Methods for GAP-to-Julia Conversions

    (For Julia-to-GAP conversions, one can use GapObj and GAP.Obj as constructors.)

    Core.Int128Type
    Int128(obj::GapObj)

    Return the Int128 converted from the GAP integer obj. (Note that small GAP integers are represented by Julia Int64 objects, in particular they are not GapObjs; their conversion is not handled by methods installed in GAP.jl.)

    Examples

    julia> val = GAP.Globals.Factorial(25)
     GAP: 15511210043330985984000000
     
     julia> Int128(val)
     15511210043330985984000000
     
     julia> Int(val)
    -ERROR: InexactError: Int64(15511210043330985984000000)
    source
    Base.GMP.BigIntType
    BigInt(obj::GapObj)

    Return the big integer converted from the GAP integer obj. (Note that small GAP integers are not represented by GapObjs, their conversion with BigInt is handled by Julia's methods.)

    Examples

    julia> val = GAP.Globals.Factorial(25)
    +ERROR: InexactError: Int64(15511210043330985984000000)
    source
    Base.GMP.BigIntType
    BigInt(obj::GapObj)

    Return the big integer converted from the GAP integer obj. (Note that small GAP integers are not represented by GapObjs, their conversion with BigInt is handled by Julia's methods.)

    Examples

    julia> val = GAP.Globals.Factorial(25)
     GAP: 15511210043330985984000000
     
     julia> BigInt(val)
    @@ -58,7 +58,7 @@
     
     julia> BigInt(val)
     3628800
    -
    source
    Base.RationalType
    Rational{T}(obj::GapObj) where {T<:Integer}

    Return the rational converted from the GAP integer or the GAP rational obj,

    Examples

    julia> val = GAP.Globals.Factorial(25)
     GAP: 15511210043330985984000000
     
     julia> Rational{Int128}(val)
    @@ -72,7 +72,7 @@
     
     julia> Rational{Int64}(val)
     1//3
    -
    source
    Core.Float64Type
    Float64(obj::GapObj)

    Return the float converted from the GAP float obj.

    Examples

    julia> val = GAP.Obj(2.2)
     GAP: 2.2
     
     julia> Float64(val)
    @@ -80,17 +80,17 @@
     
     julia> Float32(val)
     2.2f0
    -
    source
    Core.CharType
    Char(obj::GapObj)

    Return the character converted from the GAP character obj.

    Examples

    julia> val = GAP.Obj('x')
     GAP: 'x'
     
     julia> Char(val)
     'x': ASCII/Unicode U+0078 (category Ll: Letter, lowercase)
    -
    source
    Base.CucharType
    Cuchar(obj::GapObj)

    Return the UInt8 that belongs to the GAP character obj.

    Examples

    julia> val = GAP.Obj('x')
     GAP: 'x'
     
     julia> Cuchar(val)
     0x78
    -
    source
    Core.StringType
    String(obj::GapObj)

    Return the Julia string converted from the GAP string obj. Note that GAP's String function can be applied to arbitrary GAP objects, similar to Julia's string function; this behaviour is not intended for this String constructor.

    Examples

    julia> val = GAP.Obj("abc")
    +
    source
    Core.StringType
    String(obj::GapObj)

    Return the Julia string converted from the GAP string obj. Note that GAP's String function can be applied to arbitrary GAP objects, similar to Julia's string function; this behaviour is not intended for this String constructor.

    Examples

    julia> val = GAP.Obj("abc")
     GAP: "abc"
     
     julia> String(val)
    @@ -101,12 +101,12 @@
     
     julia> String(val)   # an empty GAP list is a string
     ""
    -
    source
    Core.SymbolType
    Symbol(obj::GapObj)

    Return the symbol converted from the GAP string obj.

    Examples

    julia> str = GAP.Obj("abc")
     GAP: "abc"
     
     julia> Symbol(str)
     :abc
    -
    source
    Base.UnitRangeType
    UnitRange(obj::GapObj)

    Return the unit range converted from the GAP range obj, which has step width 1.

    Examples

    julia> val = GAP.Obj(1:10)
    +
    source
    Base.UnitRangeType
    UnitRange(obj::GapObj)

    Return the unit range converted from the GAP range obj, which has step width 1.

    Examples

    julia> val = GAP.Obj(1:10)
     GAP: [ 1 .. 10 ]
     
     julia> UnitRange(val)
    @@ -114,7 +114,7 @@
     
     julia> UnitRange{Int32}(val)
     1:10
    -
    source
    Base.StepRangeType
    StepRange(obj::GapObj)

    Return the step range converted from the GAP range obj, which may have arbitrary step width.

    Examples

    julia> val = GAP.Obj(1:2:11)
    +
    source
    Base.StepRangeType
    StepRange(obj::GapObj)

    Return the step range converted from the GAP range obj, which may have arbitrary step width.

    Examples

    julia> val = GAP.Obj(1:2:11)
     GAP: [ 1, 3 .. 11 ]
     
     julia> StepRange(val)
    @@ -125,7 +125,7 @@
     
     julia> typeof(r)
     StepRange{Int8, Int8}
    -
    source
    Core.TupleType
    Tuple{Types...}(obj::GapObj; recursive::Bool = true)

    Return the tuple converted from the GAP list obj. The entries of the list are converted to the required types Types..., using gap_to_julia. If recursive is true then the entries of the list are converted recursively, otherwise non-recursively.

    Examples

    julia> val = GAP.Obj([1, 5])
    +
    source
    Core.TupleType
    Tuple{Types...}(obj::GapObj; recursive::Bool = true)

    Return the tuple converted from the GAP list obj. The entries of the list are converted to the required types Types..., using gap_to_julia. If recursive is true then the entries of the list are converted recursively, otherwise non-recursively.

    Examples

    julia> val = GAP.Obj([1, 5])
     GAP: [ 1, 5 ]
     
     julia> Tuple{Int64,Int64}(val)
    @@ -139,7 +139,7 @@
     
     julia> Tuple{GapObj,GapObj}(val; recursive=false)
     (GAP: [ 1 ], GAP: [ 2 ])
    -
    source
    Base.BitVectorType
    BitVector(obj::GapObj)

    Return the bit vector converted from the GAP list of booleans obj.

    Examples

    julia> val = GAP.Obj([true, false, true])
     GAP: [ true, false, true ]
     
     julia> BitVector(val)
    @@ -147,7 +147,7 @@
      1
      0
      1
    -
    source
    Base.VectorType
    Vector{T}(obj::GapObj; recursive::Bool = true)

    Return the 1-dimensional array converted from the GAP list obj. The entries of the list are converted to the type T, using gap_to_julia. If recursive is true then the entries of the list are converted recursively, otherwise non-recursively.

    If T is UInt8 then obj may be a GAP string.

    Examples

    julia> val = GAP.Obj([[1], [2]]; recursive=true)
    +
    source
    Base.VectorType
    Vector{T}(obj::GapObj; recursive::Bool = true)

    Return the 1-dimensional array converted from the GAP list obj. The entries of the list are converted to the type T, using gap_to_julia. If recursive is true then the entries of the list are converted recursively, otherwise non-recursively.

    If T is UInt8 then obj may be a GAP string.

    Examples

    julia> val = GAP.Obj([[1], [2]]; recursive=true)
     GAP: [ [ 1 ], [ 2 ] ]
     
     julia> Vector{Any}(val)
    @@ -182,7 +182,7 @@
      0x61
      0x62
      0x63
    -
    source
    Base.MatrixType
    Matrix{T}(obj::GapObj; recursive::Bool = true)

    Return the 2-dimensional array converted from the GAP matrix obj, which can be a GAP list of lists or a GAP matrix object. The entries of the matrix are converted to the type T, using gap_to_julia. If recursive is true then the entries are converted recursively, otherwise non-recursively.

    Examples

    julia> val = GAP.Obj([[1, 2], [3, 4]]; recursive=true)
    +
    source
    Base.MatrixType
    Matrix{T}(obj::GapObj; recursive::Bool = true)

    Return the 2-dimensional array converted from the GAP matrix obj, which can be a GAP list of lists or a GAP matrix object. The entries of the matrix are converted to the type T, using gap_to_julia. If recursive is true then the entries are converted recursively, otherwise non-recursively.

    Examples

    julia> val = GAP.Obj([[1, 2], [3, 4]]; recursive=true)
     GAP: [ [ 1, 2 ], [ 3, 4 ] ]
     
     julia> Matrix{Int64}(val)
    @@ -197,7 +197,7 @@
     2×2 Matrix{Int64}:
      0  1
      2  3
    -
    source
    Base.SetType
    Set{T}(obj::GapObj; recursive::Bool = true)

    Return the set converted from the GAP list or GAP collection obj. The elements of obj are converted to the required type T, using gap_to_julia. If recursive is true then the elements are converted recursively, otherwise non-recursively.

    This constructor method is intended for situations where the result involves only native Julia objects such as integers and strings. Dealing with results containing GAP objects will be inefficient.

    Examples

    julia> Set{Int}(GAP.Obj([1, 2, 1]))
    +
    source
    Base.SetType
    Set{T}(obj::GapObj; recursive::Bool = true)

    Return the set converted from the GAP list or GAP collection obj. The elements of obj are converted to the required type T, using gap_to_julia. If recursive is true then the elements are converted recursively, otherwise non-recursively.

    This constructor method is intended for situations where the result involves only native Julia objects such as integers and strings. Dealing with results containing GAP objects will be inefficient.

    Examples

    julia> Set{Int}(GAP.Obj([1, 2, 1]))
     Set{Int64} with 2 elements:
       2
       1
    @@ -215,7 +215,7 @@
     julia> Set{Any}(GAP.Obj([[1], [2], [1]]; recursive=true))
     Set{Any} with 2 elements:
       Any[1]
    -  Any[2]
    source
    Base.DictType
    Dict{Symbol,T}(obj::GapObj; recursive::Bool = true)

    Return the dictionary converted from the GAP record obj. If recursive is true then the values of the record components are recursively converted to objects of the type T, using gap_to_julia, otherwise they are kept as they are.

    Examples

    julia> val = GAP.Obj(Dict(:a => 1, :b => 2))
    +  Any[2]
    source
    Base.DictType
    Dict{Symbol,T}(obj::GapObj; recursive::Bool = true)

    Return the dictionary converted from the GAP record obj. If recursive is true then the values of the record components are recursively converted to objects of the type T, using gap_to_julia, otherwise they are kept as they are.

    Examples

    julia> val = GAP.Obj(Dict(:a => 1, :b => 2))
     GAP: rec( a := 1, b := 2 )
     
     julia> Dict{Symbol,Int}(val)
    @@ -237,4 +237,4 @@
     julia> Dict{Symbol,Vector{Int}}(val; recursive=true)
     Dict{Symbol, Vector{Int64}} with 1 entry:
       :l => [1, 2]
    -
    source
    +source diff --git a/dev/examples/index.html b/dev/examples/index.html index 55178a3c..36b22ade 100644 --- a/dev/examples/index.html +++ b/dev/examples/index.html @@ -145,4 +145,4 @@ julia> length(pre3) 116

    ... and we verify that the decomposition is correct:

    julia> GAP.Globals.Image(fhom, pre3) == r
    -true

    This concludes our example.

    +true

    This concludes our example.

    diff --git a/dev/index.html b/dev/index.html index 9a13719c..d4a403a1 100644 --- a/dev/index.html +++ b/dev/index.html @@ -1,2 +1,2 @@ -GAP.jl · GAP.jl

    GAP.jl

    Introduction

    GAP.jl is a low level interface from Julia to the computer algebra system GAP. The term "low level" means that the aim is to give Julia access to all GAP objects, to let Julia call GAP functions, and to provide conversions of low level data (integers, Booleans, strings, arrays/lists, dictionaries/records) between the two systems.

    In particular, it is not the aim of GAP.jl to provide Julia types for higher level GAP objects that represent algebraic structures, such as groups, rings, fields, etc., and mappings between such structures.

    The connection between GAP and Julia is in fact bidirectional, that is, GAP can access all Julia objects, call Julia functions, and perform conversions of low level data. This direction will become interesting on the Julia side as soon as GAP packages provide functionality that is based on using Julia code from the GAP side.

    The viewpoint of an interface from GAP to Julia is described in the manual of the GAP package JuliaInterface.

    Table of contents

    +GAP.jl · GAP.jl

    GAP.jl

    Introduction

    GAP.jl is a low level interface from Julia to the computer algebra system GAP. The term "low level" means that the aim is to give Julia access to all GAP objects, to let Julia call GAP functions, and to provide conversions of low level data (integers, Booleans, strings, arrays/lists, dictionaries/records) between the two systems.

    In particular, it is not the aim of GAP.jl to provide Julia types for higher level GAP objects that represent algebraic structures, such as groups, rings, fields, etc., and mappings between such structures.

    The connection between GAP and Julia is in fact bidirectional, that is, GAP can access all Julia objects, call Julia functions, and perform conversions of low level data. This direction will become interesting on the Julia side as soon as GAP packages provide functionality that is based on using Julia code from the GAP side.

    The viewpoint of an interface from GAP to Julia is described in the manual of the GAP package JuliaInterface.

    Table of contents

    diff --git a/dev/internal/index.html b/dev/internal/index.html index 799bb627..8c08be17 100644 --- a/dev/internal/index.html +++ b/dev/internal/index.html @@ -1,7 +1,7 @@ -Internal · GAP.jl

    Internal

    GAP.get_symbols_in_moduleFunction
    get_symbols_in_module(m::Module) :: Vector{Symbol}

    Return all symbols in the module m. This is used in a GAP method for RecNames.

    source
    GAP.GAPModule

    GAP.jl is the Julia interface to the GAP-System.

    For the package manual see https://oscar-system.github.io/GAP.jl/.

    For more information about GAP see https://www.gap-system.org/.

    source
    GAP.RecDictType
    RecDict

    An internal type of GAP.jl used for tracking conversion results in gap_to_julia.

    source
    GAP.kwarg_wrapperFunction
    kwarg_wrapper(func, args::Vector{T1}, kwargs::Dict{Symbol,T2}) where {T1, T2}

    Call the function func with arguments args and keyword arguments given by the keys and values of kwargs.

    This function is used on the GAP side, in calls of Julia functions that require keyword arguments. Note that jl_call and Core._apply do not support keyword arguments.

    Examples

    julia> range(2, length = 5, step = 2)
    +Internal · GAP.jl

    Internal

    GAP.get_symbols_in_moduleFunction
    get_symbols_in_module(m::Module) :: Vector{Symbol}

    Return all symbols in the module m. This is used in a GAP method for RecNames.

    source
    GAP.GAPModule

    GAP.jl is the Julia interface to the GAP-System.

    For the package manual see https://oscar-system.github.io/GAP.jl/.

    For more information about GAP see https://www.gap-system.org/.

    source
    GAP.RecDictType
    RecDict

    An internal type of GAP.jl used for tracking conversion results in gap_to_julia.

    source
    GAP.kwarg_wrapperFunction
    kwarg_wrapper(func, args::Vector{T1}, kwargs::Dict{Symbol,T2}) where {T1, T2}

    Call the function func with arguments args and keyword arguments given by the keys and values of kwargs.

    This function is used on the GAP side, in calls of Julia functions that require keyword arguments. Note that jl_call and Core._apply do not support keyword arguments.

    Examples

    julia> range(2, length = 5, step = 2)
     2:2:10
     
     julia> GAP.kwarg_wrapper(range, [2], Dict(:length => 5, :step => 2))
     2:2:10
    -
    source
    +
    source
    diff --git a/dev/manualindex/index.html b/dev/manualindex/index.html index e857b832..1107746d 100644 --- a/dev/manualindex/index.html +++ b/dev/manualindex/index.html @@ -1,2 +1,2 @@ -Index · GAP.jl +Index · GAP.jl diff --git a/dev/other/index.html b/dev/other/index.html index fd5ae5fc..a5724582 100644 --- a/dev/other/index.html +++ b/dev/other/index.html @@ -26,7 +26,7 @@ julia> @gap "(1,2)(3,4)" GAP: (1,2)(3,4) -source
    GAP.@g_strMacro
    @g_str

    Create a GAP string by typing g"content".

    Examples

    julia> g"foo"
    +
    source
    GAP.@g_strMacro
    @g_str

    Create a GAP string by typing g"content".

    Examples

    julia> g"foo"
     GAP: "foo"
     
     julia> g"ab\ncd\"ef\\gh"   # special characters are handled as in GAP
    @@ -36,14 +36,14 @@
     [...]
     

    Conversely, there are valid arguments for the macro that are not valid Julia strings.

    julia> g"\c"
     GAP: "\c"
    -
    source
    GAP.@gapwrapMacro
    @gapwrap

    When applied to a method definition that involves access to entries of GAP.Globals, this macro rewrites the code such that the relevant GAP globals are cached, and need not be fetched again and again.

    Examples

    julia> @gapwrap isevenint(x) = GAP.Globals.IsEvenInt(x)::Bool;
    +
    source
    GAP.@gapwrapMacro
    @gapwrap

    When applied to a method definition that involves access to entries of GAP.Globals, this macro rewrites the code such that the relevant GAP globals are cached, and need not be fetched again and again.

    Examples

    julia> @gapwrap isevenint(x) = GAP.Globals.IsEvenInt(x)::Bool;
     
     julia> isevenint(1)
     false
     
     julia> isevenint(2)
     true
    -
    source
    GAP.@gapattributeMacro
    @gapattribute

    This macro is intended to be applied to a method definition for a unary function called attr, say, where the argument has the type T, say, the code contains exactly one call of the form GAP.Globals.Something(X), where Something is a GAP attribute such as Centre or IsSolvableGroup, and attr returns the corresponding attribute value for its argument.

    The macro defines three functions attr, has_attr, and set_attr, where attr takes an argument of type T and returns what the given method definition says, has_attr takes an argument of type T and returns the result of GAP.Globals.HasSomething(X) (which is either true or false), set_attr takes an argument of type T and an object obj and calls GAP.Globals.SetSomething(X, obj).

    In order to avoid runtime access via GAP.Globals.Something etc., the same modifications are applied in the construction of the three functions that are applied by @gapwrap.

    The variables that are created by the macro belong to the Julia module in whose scope the macro is called.

    Examples

    julia> @gapattribute isstrictlysortedlist(obj::GapObj) = GAP.Globals.IsSSortedList(obj)::Bool;
    +
    source
    GAP.@gapattributeMacro
    @gapattribute

    This macro is intended to be applied to a method definition for a unary function called attr, say, where the argument has the type T, say, the code contains exactly one call of the form GAP.Globals.Something(X), where Something is a GAP attribute such as Centre or IsSolvableGroup, and attr returns the corresponding attribute value for its argument.

    The macro defines three functions attr, has_attr, and set_attr, where attr takes an argument of type T and returns what the given method definition says, has_attr takes an argument of type T and returns the result of GAP.Globals.HasSomething(X) (which is either true or false), set_attr takes an argument of type T and an object obj and calls GAP.Globals.SetSomething(X, obj).

    In order to avoid runtime access via GAP.Globals.Something etc., the same modifications are applied in the construction of the three functions that are applied by @gapwrap.

    The variables that are created by the macro belong to the Julia module in whose scope the macro is called.

    Examples

    julia> @gapattribute isstrictlysortedlist(obj::GapObj) = GAP.Globals.IsSSortedList(obj)::Bool;
     
     julia> l = GapObj([ 1, 3, 7 ]);
     
    @@ -68,7 +68,7 @@
     
     julia> isstrictlysortedlist( l )
     true
    -
    source
    GAP.@wrapMacro
    @wrap funcdecl

    When applied to a function declaration of the form NAME(a::T) or NAME(a::T)::S, this macro generates a function which behaves equivalently to NAME(a::T) = GAP.Globals.NAME(a) resp. NAME(a::T) = GAP.Globals.NAME(a)::S, assuming that GAP.Globals.NAME references a GAP function. Function declarations with more than one argument or zero arguments are also supported.

    However, the generated function actually caches the GAP object GAP.Globals.NAME. This minimizes the call overhead. So @wrap typically is used to provide an optimized way to call certain GAP functions.

    If an argument is annotated as ::GapObj (respectively ::GAP.Obj or ::GapInt), the resulting function accepts arguments of any type and attempts to convert them to GapObj (respectively GAP.Obj or GapInt) before passing them to the GAP function.

    Another use case for this macro is to improve type stability of code calling into GAP, via the type annotations for the arguments and return value contained in the function declaration.

    Be advised, though, that if the value of GAP.Globals.NAME is changed later on, the function generated by this macro will not be updated, i.e., it will still reference the original GAP object.

    Examples

    julia> GAP.@wrap IsString(x::GapObj)::Bool
    +
    source
    GAP.@wrapMacro
    @wrap funcdecl

    When applied to a function declaration of the form NAME(a::T) or NAME(a::T)::S, this macro generates a function which behaves equivalently to NAME(a::T) = GAP.Globals.NAME(a) resp. NAME(a::T) = GAP.Globals.NAME(a)::S, assuming that GAP.Globals.NAME references a GAP function. Function declarations with more than one argument or zero arguments are also supported.

    However, the generated function actually caches the GAP object GAP.Globals.NAME. This minimizes the call overhead. So @wrap typically is used to provide an optimized way to call certain GAP functions.

    If an argument is annotated as ::GapObj (respectively ::GAP.Obj or ::GapInt), the resulting function accepts arguments of any type and attempts to convert them to GapObj (respectively GAP.Obj or GapInt) before passing them to the GAP function.

    Another use case for this macro is to improve type stability of code calling into GAP, via the type annotations for the arguments and return value contained in the function declaration.

    Be advised, though, that if the value of GAP.Globals.NAME is changed later on, the function generated by this macro will not be updated, i.e., it will still reference the original GAP object.

    Examples

    julia> GAP.@wrap IsString(x::GapObj)::Bool
     IsString (generic function with 1 method)
     
     julia> IsString("abc")
    @@ -81,14 +81,14 @@
     1
     
     julia> Jacobi(big(35)^100+11, 35)
    -1
    source

    Convenience adapters

    This section describes how one can manipulate GAP objects from the Julia side, using Julia syntax features.

    In particular, the following is available on the Julia side in order to support special GAP syntax beyond function calls with arguments.

    • Call functions with global options via call_gap_func or using Julia's keyword argument syntax. For example, Cyc(1.41421356 : bits:=20) in GAP translates to GAP.Globals.Cyc(GAP.Obj(1.41421356); bits=20) in Julia.

    • Access list/matrix entries via getindex and setindex! respectively the corresponding Julia syntax (described there).

    • Access record components via getproperty and setproperty! respectively the corresponding Julia syntax (described there).

    • Check for bound record components via hasproperty.

    • Access entries of a positional object via getbangindex, equivalent to GAP's ![] operator.

    • Access components of a component object via getbangproperty, equivalent to GAP's !. operator.

    GAP.call_gap_funcFunction
    call_gap_func(func::GapObj, args...; kwargs...)

    Call the GAP object func as a function, with arguments args... and global GAP options kwargs..., and return the result if there is one, and nothing otherwise.

    There is no argument number checking here, all checks on the arguments are done by GAP itself.

    For convenience, one can use the syntax func(args...; kwargs...).

    Examples

    julia> GAP.Globals.Factors( 12 )
    +1
    source

    Convenience adapters

    This section describes how one can manipulate GAP objects from the Julia side, using Julia syntax features.

    In particular, the following is available on the Julia side in order to support special GAP syntax beyond function calls with arguments.

    • Call functions with global options via call_gap_func or using Julia's keyword argument syntax. For example, Cyc(1.41421356 : bits:=20) in GAP translates to GAP.Globals.Cyc(GAP.Obj(1.41421356); bits=20) in Julia.

    • Access list/matrix entries via getindex and setindex! respectively the corresponding Julia syntax (described there).

    • Access record components via getproperty and setproperty! respectively the corresponding Julia syntax (described there).

    • Check for bound record components via hasproperty.

    • Access entries of a positional object via getbangindex, equivalent to GAP's ![] operator.

    • Access components of a component object via getbangproperty, equivalent to GAP's !. operator.

    GAP.call_gap_funcFunction
    call_gap_func(func::GapObj, args...; kwargs...)

    Call the GAP object func as a function, with arguments args... and global GAP options kwargs..., and return the result if there is one, and nothing otherwise.

    There is no argument number checking here, all checks on the arguments are done by GAP itself.

    For convenience, one can use the syntax func(args...; kwargs...).

    Examples

    julia> GAP.Globals.Factors( 12 )
     GAP: [ 2, 2, 3 ]
     
     julia> GAP.Globals.Cyc(GAP.Obj(1.41421356))
     GAP: 35355339/25000000
     
     julia> GAP.Globals.Cyc(GAP.Obj(1.41421356); bits=20)
    -GAP: E(8)-E(8)^3
    source
    GAP.call_with_catchFunction
    call_with_catch(juliafunc, arguments)

    Return a tuple (ok, val) where ok is either true, meaning that calling the function juliafunc with arguments returns the value val, or false, meaning that the function call runs into an error; in the latter case, val is set to the string of the error message.

    Examples

    julia> GAP.call_with_catch(sqrt, 2)
    +GAP: E(8)-E(8)^3
    source
    GAP.call_with_catchFunction
    call_with_catch(juliafunc, arguments)

    Return a tuple (ok, val) where ok is either true, meaning that calling the function juliafunc with arguments returns the value val, or false, meaning that the function call runs into an error; in the latter case, val is set to the string of the error message.

    Examples

    julia> GAP.call_with_catch(sqrt, 2)
     (true, 1.4142135623730951)
     
     julia> flag, res = GAP.call_with_catch(sqrt, -2);
    @@ -98,7 +98,7 @@
     
     julia> startswith(res, "DomainError")
     true
    -
    source
    Base.getindexFunction
    getindex(x::GapObj, i::Int64)
     getindex(x::GapObj, i::Int64, j::Int64)
     getindex(x::GapObj, l::Union{Vector{T},AbstractRange{T}}) where {T<:Integer}

    Return the entry at position i or at position (i,j) in x, or the list of entries in x at the positions described by l, provided that x is a GAP object supporting this, such as a GAP list or matrix object.

    Examples

    julia> l = GapObj([ 1, 2, 3, 5, 8, 13 ])
     GAP: [ 1, 2, 3, 5, 8, 13 ]
    @@ -125,7 +125,7 @@
     2
     
     julia> m[2,1]
    -3
    source
    Base.setindex!Function
    setindex!(x::GapObj, v::Any, i::Int64)
     setindex!(x::GapObj, v::Any, i::Int64, j::Int64)
     setindex!(x::GapObj, v::Any, l::Union{Vector{T},AbstractRange{T}}) where {T<:Integer}

    Set the entry at position i or (i,j) in x to v, or set the entries at the positions in x that are described by l to the entries in v, provided that x is a GAP object supporting this, such as a GAP list or matrix object.

    Examples

    julia> l = GapObj([ 1, 2, 3, 5, 8, 13 ])
     GAP: [ 1, 2, 3, 5, 8, 13 ]
    @@ -152,14 +152,14 @@
     0
     
     julia> m
    -GAP: [ [ 1, 0 ], [ 3, 4 ] ]
    source
    GAP.getbangindexFunction
    getbangindex(x::GapObj, i::Int64)

    Return the entry at position i in the positional object x.

    Examples

    julia> x = GAP.Globals.ZmodnZObj(1, 6)
    +GAP: [ [ 1, 0 ], [ 3, 4 ] ]
    source
    GAP.getbangindexFunction
    getbangindex(x::GapObj, i::Int64)

    Return the entry at position i in the positional object x.

    Examples

    julia> x = GAP.Globals.ZmodnZObj(1, 6)
     GAP: ZmodnZObj( 1, 6 )
     
     julia> GAP.Globals.IsPositionalObjectRep(x)
     true
     
     julia> getbangindex(x, 1)
    -1
    source
    GAP.hasbangindexFunction
    hasbangindex(x::GapObj, i::Int64)

    Return whether the entry at position i exists in the positional object x.

    Examples

    julia> x = GAP.Globals.ZmodnZObj(1, 6)
     GAP: ZmodnZObj( 1, 6 )
     
     julia> GAP.Globals.IsPositionalObjectRep(x)
    @@ -169,19 +169,19 @@
     true
     
     julia> hasbangindex(x, 2)
    -false
    source
    GAP.setbangindex!Function
    setbangindex!(x::GapObj, v::Any, i::Int64)

    Set the entry at position i in the positional object x to v, and return x.

    Examples

    julia> x = GAP.Globals.ZmodnZObj(1, 6)
    +false
    source
    GAP.setbangindex!Function
    setbangindex!(x::GapObj, v::Any, i::Int64)

    Set the entry at position i in the positional object x to v, and return x.

    Examples

    julia> x = GAP.Globals.ZmodnZObj(1, 6)
     GAP: ZmodnZObj( 1, 6 )
     
     julia> GAP.Globals.IsPositionalObjectRep(x)
     true
     
     julia> setbangindex!(x, 0, 1)
    -GAP: ZmodnZObj( 0, 6 )
    source
    Base.getpropertyFunction
    getproperty(x::GapObj, f::Symbol)
     getproperty(x::GapObj, f::Union{AbstractString,Int64})

    Return the record component of the GAP record x that is described by f.

    Examples

    julia> r = GapObj(Dict(:a => 1))
     GAP: rec( a := 1 )
     
     julia> r.a
    -1
    source
    Base.setproperty!Function
    setproperty!(x::GapObj, f::Symbol, v)
     setproperty!(x::GapObj, f::Union{AbstractString,Int64}, v)

    Set the record component of the GAP record x that is described by f to the value v.

    Examples

    julia> r = GapObj(Dict(:a => 1))
     GAP: rec( a := 1 )
     
    @@ -189,7 +189,7 @@
     0
     
     julia> r
    -GAP: rec( a := 1, b := 0 )
    source
    Base.haspropertyFunction
    hasproperty(x::GapObj, f::Symbol)
     hasproperty(x::GapObj, f::Union{AbstractString,Int64})

    Return true if the GAP record x has a component that is described by f, and false otherwise.

    Examples

    julia> r = GapObj(Dict(:a => 1))
     GAP: rec( a := 1 )
     
    @@ -206,14 +206,14 @@
     true
     
     julia> r
    -GAP: rec( a := 1, b := 2 )
    source
    GAP.getbangpropertyFunction
    getbangproperty(x::GapObj, f::Union{AbstractString,Int64,Symbol})

    Return the value of the component f in the component object x.

    Examples

    julia> x = GAP.Globals.Iterator(GAP.Globals.Integers)
    +GAP: rec( a := 1, b := 2 )
    source
    GAP.getbangpropertyFunction
    getbangproperty(x::GapObj, f::Union{AbstractString,Int64,Symbol})

    Return the value of the component f in the component object x.

    Examples

    julia> x = GAP.Globals.Iterator(GAP.Globals.Integers)
     GAP: <iterator of Integers at 0>
     
     julia> GAP.Globals.IsComponentObjectRep(x)
     true
     
     julia> getbangproperty(x, :counter)
    -0
    source
    GAP.hasbangpropertyFunction
    hasbangproperty(x::GapObj, f::Union{AbstractString,Int64,Symbol})

    Return whether the component object x has the component f.

    Examples

    julia> x = GAP.Globals.Iterator(GAP.Globals.Integers)
    +0
    source
    GAP.hasbangpropertyFunction
    hasbangproperty(x::GapObj, f::Union{AbstractString,Int64,Symbol})

    Return whether the component object x has the component f.

    Examples

    julia> x = GAP.Globals.Iterator(GAP.Globals.Integers)
     GAP: <iterator of Integers at 0>
     
     julia> GAP.Globals.IsComponentObjectRep(x)
    @@ -223,7 +223,7 @@
     true
     
     julia> hasbangproperty(x, :x)
    -false
    source
    GAP.setbangproperty!Function
    setbangproperty!(x::GapObj, f::Union{AbstractString,Int64,Symbol}, v)

    Set the value of the component f in the component object x to v, and return x.

    Examples

    julia> x = GAP.Globals.Iterator(GAP.Globals.Integers)
    +false
    source
    GAP.setbangproperty!Function
    setbangproperty!(x::GapObj, f::Union{AbstractString,Int64,Symbol}, v)

    Set the value of the component f in the component object x to v, and return x.

    Examples

    julia> x = GAP.Globals.Iterator(GAP.Globals.Integers)
     GAP: <iterator of Integers at 0>
     
     julia> GAP.Globals.IsComponentObjectRep(x)
    @@ -233,7 +233,7 @@
     GAP: <iterator of Integers at -1>
     
     julia> getbangproperty(x, :counter)
    -3
    source
    GAP.wrap_rngFunction
    wrap_rng(rng::Random.AbstractRNG)

    Return a GAP object in the filter IsRandomSource that uses rng in calls to GAP's Random function. The idea is that GAP's Random methods for high level objects will just hand over the given random source to subfunctions until Random gets called for a list or the bounds of a range, and then Base.rand gets called with rng.

    Examples

    julia> rng1 = Random.default_rng();
    +3
    source
    GAP.wrap_rngFunction
    wrap_rng(rng::Random.AbstractRNG)

    Return a GAP object in the filter IsRandomSource that uses rng in calls to GAP's Random function. The idea is that GAP's Random methods for high level objects will just hand over the given random source to subfunctions until Random gets called for a list or the bounds of a range, and then Base.rand gets called with rng.

    Examples

    julia> rng1 = Random.default_rng();
     
     julia> rng2 = copy(rng1);
     
    @@ -268,7 +268,7 @@
     true
     
     julia> GAP.Globals.Random(gap_rng1, GAP.Globals.GF(2)^10)
    -GAP: <a GF2 vector of length 10>
    source
    GAP.randseed!Function
    GAP.randseed!([seed::Integer])

    Reseed GAP's global RNG with seed.

    The given seed must be a non-negative integer. When seed is not specified, a random seed is generated from Julia's global RNG.

    For a fixed seed, the stream of generated numbers is allowed to change between different versions of GAP.

    source

    For the following Julia functions, methods are provided that deal with the case that the arguments are GAP objects; they delegate to the corresponding GAP operations.

    JuliaGAP
    lengthLength
    in\in
    zeroZeroSameMutability
    oneOneSameMutability
    - (unary)AdditiveInverseSameMutability
    invInverseSameMutability
    +SUM
    - (binary)DIFF
    *PROD
    /QUO
    \LQUO
    ^POW
    modMOD
    <LT
    ==EQ

    The reason why four SameMutability operations are chosen in this list is as follows. In GAP, binary arithmetic operations return immutable results if and only if the two arguments are immutable. Thus it is consistent if unary arithmetic operations return a result with the same mutability as the argument. Note that GAP provides several variants of these unary operations, regarding the mutability of the result (ZeroMutable, ZeroImmutable, ZeroSameMutability, etc.), but here we have to choose one behaviour for the Julia function.

    julia> l = GAP.julia_to_gap( [ 1, 3, 7, 15 ] )
    +GAP: <a GF2 vector of length 10>
    source
    GAP.randseed!Function
    GAP.randseed!([seed::Integer])

    Reseed GAP's global RNG with seed.

    The given seed must be a non-negative integer. When seed is not specified, a random seed is generated from Julia's global RNG.

    For a fixed seed, the stream of generated numbers is allowed to change between different versions of GAP.

    source

    For the following Julia functions, methods are provided that deal with the case that the arguments are GAP objects; they delegate to the corresponding GAP operations.

    JuliaGAP
    lengthLength
    in\in
    zeroZeroSameMutability
    oneOneSameMutability
    - (unary)AdditiveInverseSameMutability
    invInverseSameMutability
    +SUM
    - (binary)DIFF
    *PROD
    /QUO
    \LQUO
    ^POW
    modMOD
    <LT
    ==EQ

    The reason why four SameMutability operations are chosen in this list is as follows. In GAP, binary arithmetic operations return immutable results if and only if the two arguments are immutable. Thus it is consistent if unary arithmetic operations return a result with the same mutability as the argument. Note that GAP provides several variants of these unary operations, regarding the mutability of the result (ZeroMutable, ZeroImmutable, ZeroSameMutability, etc.), but here we have to choose one behaviour for the Julia function.

    julia> l = GAP.julia_to_gap( [ 1, 3, 7, 15 ] )
     GAP: [ 1, 3, 7, 15 ]
     
     julia> m = GAP.julia_to_gap( [ 1 2; 3 4 ] )
    @@ -347,4 +347,4 @@
     
     julia> GAP.show_gap_help( "Size", true )
     [...]  # about 15 entries from GAP manuals
    -
    source +source diff --git a/dev/packages/index.html b/dev/packages/index.html index f60125e9..7b4ca53f 100644 --- a/dev/packages/index.html +++ b/dev/packages/index.html @@ -1,9 +1,9 @@ -Managing GAP packages · GAP.jl

    Managing GAP packages

    The following functions allow one to load/install/update/remove/locate GAP packages.

    GAP.Packages.loadFunction
    load(spec::String, version::String = ""; install::Union{Bool, String} = false, quiet::Bool = true)

    Try to load the GAP package given by spec, which can be either the name of the package or a local path where the package is installed (a directory that contains the package's PackageInfo.g file).

    If version is specified then try to load a version of the package that is compatible with version, in the sense of GAP's CompareVersionNumbers function, otherwise try to load the newest installed version. Return true if this is successful, and false otherwise.

    If install is set to true or to a string and (the desired version of) the required GAP package is not yet installed and spec is the package name then install is called first, in order to install the package; if no version is prescribed then the newest released version of the package will be installed. A string value of install can be the URL of an archive or repository containing a package, or the URL of a PackageInfo.g file, like the first argument of install.

    The function calls GAP's LoadPackage function. If quiet is set to false then package banners are shown for all packages being loaded. The quiet value is also passed on to install.

    source
    GAP.Packages.installFunction
    install(spec::String, version::String = "";
    +Managing GAP packages · GAP.jl

    Managing GAP packages

    The following functions allow one to load/install/update/remove/locate GAP packages.

    GAP.Packages.loadFunction
    load(spec::String, version::String = ""; install::Union{Bool, String} = false, quiet::Bool = true)

    Try to load the GAP package given by spec, which can be either the name of the package or a local path where the package is installed (a directory that contains the package's PackageInfo.g file).

    If version is specified then try to load a version of the package that is compatible with version, in the sense of GAP's CompareVersionNumbers function, otherwise try to load the newest installed version. Return true if this is successful, and false otherwise.

    If install is set to true or to a string and (the desired version of) the required GAP package is not yet installed and spec is the package name then install is called first, in order to install the package; if no version is prescribed then the newest released version of the package will be installed. A string value of install can be the URL of an archive or repository containing a package, or the URL of a PackageInfo.g file, like the first argument of install.

    The function calls GAP's LoadPackage function. If quiet is set to false then package banners are shown for all packages being loaded. The quiet value is also passed on to install.

    source
    GAP.Packages.installFunction
    install(spec::String, version::String = "";
                           interactive::Bool = true, quiet::Bool = false,
                           debug::Bool = false,
    -                      pkgdir::AbstractString = GAP.Packages.DEFAULT_PKGDIR[])

    Download and install the GAP package given by spec into the pkgdir directory.

    spec can be either the name of a package or the URL of an archive or repository containing a package, or the URL of a PackageInfo.g file.

    If spec is the name of a package then the package version can be specified by version, in the format described for GAP's CompareVersionNumbers function. In all other cases the newest released version of the package will get installed.

    Return true if the installation is successful or if (a version compatible with version) of the package was already installed, and false otherwise.

    The function uses the function InstallPackage from GAP's package PackageManager. The info messages shown by this function can be suppressed by passing true as the value of quiet. Specifying interactive = false will prevent PackageManager from prompting the user for input interactively. For details, please refer to its documentation.

    source
    GAP.Packages.updateFunction
    update(spec::String; interactive::Bool = true, quiet::Bool = false,
    +                      pkgdir::AbstractString = GAP.Packages.DEFAULT_PKGDIR[])

    Download and install the GAP package given by spec into the pkgdir directory.

    spec can be either the name of a package or the URL of an archive or repository containing a package, or the URL of a PackageInfo.g file.

    If spec is the name of a package then the package version can be specified by version, in the format described for GAP's CompareVersionNumbers function. In all other cases the newest released version of the package will get installed.

    Return true if the installation is successful or if (a version compatible with version) of the package was already installed, and false otherwise.

    The function uses the function InstallPackage from GAP's package PackageManager. The info messages shown by this function can be suppressed by passing true as the value of quiet. Specifying interactive = false will prevent PackageManager from prompting the user for input interactively. For details, please refer to its documentation.

    source
    GAP.Packages.updateFunction
    update(spec::String; interactive::Bool = true, quiet::Bool = false,
                          debug::Bool = false,
    -                     pkgdir::AbstractString = GAP.Packages.DEFAULT_PKGDIR[])

    Update the GAP package given by spec that is installed in the pkgdir directory, to the latest version. Return true if a newer version was installed successfully, or if no newer version is available, and false otherwise.

    spec can be either the name of a package or the URL of an archive or repository containing a package, or the URL of a PackageInfo.g file.

    The function uses the function UpdatePackage from GAP's package PackageManager. The info messages shown by this function can be suppressed by passing true as the value of quiet. Specifying interactive = false will prevent PackageManager from prompting the user for input interactively. For details, please refer to its documentation.

    source
    GAP.Packages.removeFunction
    remove(spec::String; interactive::Bool = true, quiet::Bool = false,
    +                     pkgdir::AbstractString = GAP.Packages.DEFAULT_PKGDIR[])

    Update the GAP package given by spec that is installed in the pkgdir directory, to the latest version. Return true if a newer version was installed successfully, or if no newer version is available, and false otherwise.

    spec can be either the name of a package or the URL of an archive or repository containing a package, or the URL of a PackageInfo.g file.

    The function uses the function UpdatePackage from GAP's package PackageManager. The info messages shown by this function can be suppressed by passing true as the value of quiet. Specifying interactive = false will prevent PackageManager from prompting the user for input interactively. For details, please refer to its documentation.

    source
    GAP.Packages.removeFunction
    remove(spec::String; interactive::Bool = true, quiet::Bool = false,
                          debug::Bool = false,
    -                     pkgdir::AbstractString = GAP.Packages.DEFAULT_PKGDIR[])

    Remove the GAP package with name spec that is installed in the pkgdir directory. Return true if the removal was successful, and false otherwise.

    The function uses the function RemovePackage from GAP's package PackageManager. The info messages shown by this function can be suppressed by passing true as the value of quiet. Specifying interactive = false will prevent PackageManager from prompting the user for input interactively. For details, please refer to its documentation.

    source
    GAP.Packages.locate_packageFunction
    locate_package(name::String)

    Return the path where the GAP package with name name is installed if this package is loaded, and "" otherwise.

    source
    + pkgdir::AbstractString = GAP.Packages.DEFAULT_PKGDIR[])

    Remove the GAP package with name spec that is installed in the pkgdir directory. Return true if the removal was successful, and false otherwise.

    The function uses the function RemovePackage from GAP's package PackageManager. The info messages shown by this function can be suppressed by passing true as the value of quiet. Specifying interactive = false will prevent PackageManager from prompting the user for input interactively. For details, please refer to its documentation.

    source
    GAP.Packages.locate_packageFunction
    locate_package(name::String)

    Return the path where the GAP package with name name is installed if this package is loaded, and "" otherwise.

    source