Creating user-defined geometric spaces
Create a geometric space with default definitions
using SymbolicGA
@geometric_space weird_space (3, 4, 5)@weird_space (macro with 2 methods)x = rand(12); y = rand(12)
@weird_space x::1 ⟑ dual(y::1)(KVector{10, Float64, 12, 66}(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.16812791429334584, -0.18182952842058725, 0.1915883872122957, -0.05639656328346511, 0.1560184914694909, -0.5609377282073231, 0.6066514476310843, -0.639210657703517, 0.1881600697890743, -0.5205361556471386, 0.3444358205388447, 0.14002065001699832, -0.15143165766817906, 0.1595590513682816, -0.04696830673755703, 0.12993565454046815, 0.013026114045328246, -0.3303137764740658, -0.24647836381084723, 0.2665651616864081, -0.2808718136052834, 0.08267831490736299, -0.22872574529498416, 0.14446800837931034, 0.022949318568254384, 0.13941265979034315, -0.45408412986619556, 0.4910897963843404, -0.5174467694161257, 0.15231726672903617, -0.4213786939529301, 0.6959129338129062, -1.391565352144705, 0.6147529602323797, -0.6300372656605457, 0.513539567935033, -0.5553905658998283, 0.5851985852789834, -0.17226090541442987, 0.47655185063036876, -0.7029208735355299, 1.2931428809038956, -0.6251957805071735, 0.5892224893787548, -0.22716997523608418, -0.3534097361187492, 0.38221092510311144, -0.40272432839425265, 0.11854720634455987, -0.3279553792814783, 0.4135900380520647, -0.655877308483282, 0.3718282104359131, -0.3026540557674636, 0.34579465280707555, -0.2142668047508573), KVector{12, Float64, 12, 1}(3.362360535717974))Create a geometric space with extra definitions.
@geometric_space extra_space 3 quote
>>(x, y) = versor_product(y, x)
*(x, y) = geometric_product(y, x)
I = 1.0::e123
end@extra_space (macro with 2 methods)x = rand(3); y = rand(3)
@extra_space begin
yᵈ = y::1 * I
yᵈ >> x::1
endKVector{1, Float64, 3, 3}(0.9345611866139247, 0.5338581252919486, -0.2506994745714826)Create a geometric space with non-default bindings.
bindings = Bindings(refs = Dict(:* => :geometric_product))
@geometric_space no_defaults 3 bindings@no_defaults (macro with 2 methods)x = rand(3); y = rand(3)
@no_defaults x::1 * y::1(KVector{0, Float64, 3, 1}(1.1281418035964415), Bivector{Float64, 3, 3}(0.36807469906184925, -0.09653708817768064, -0.30965790104085966))Note that you will always have access to the built-in functions.
This page was generated using Literate.jl.