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.543709433827525, -0.3645328964460081, 0.6085099851147182, -0.19686174621103678, 0.5533079413188591, -0.4555559603705602, 0.3054299289200897, -0.5098501762467986, 0.16494387677636477, -0.4635982289542717, 0.17554157555581562, 0.09223316267829842, -0.06183821697337245, 0.10322572491221221, -0.03339500905032348, 0.09386142337755624, 0.06685796822932538, -0.08579637894415643, -0.33260845011556806, 0.2229991134226069, -0.3722494965813992, 0.1204280746673012, -0.3384802347517861, 0.16178442220220463, -0.02816807195167237, 0.06834425119467383, -0.3044234722744784, 0.20410234435911814, -0.3407053677149859, 0.11022309456302663, -0.30979768650981837, 1.0824755570061226, -0.808684176941879, 0.22106160295232802, -0.5716096179336585, 0.14113296991301197, -0.09462335414017799, 0.1579535245809362, -0.05110024063669045, 0.14362449532107394, -0.9150527832137562, 0.7211260668868056, -0.17258129065625988, 0.517778715049683, 0.23135621259377376, -0.39261801269608115, 0.2632328454510119, -0.43941113800363085, 0.1421558331794108, -0.39954919082474954, 0.9749722501825901, -0.6901363336383525, 0.21367004055674654, -0.47960273352811694, 0.23577844384551863, -0.40769106109841446), KVector{12, Float64, 12, 1}(2.931104292892194))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}(1.0912921030913492, 0.4728870364583919, 0.1020445392841869)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}(0.42634536545879065), Bivector{Float64, 3, 3}(-0.21216577072617276, -0.20207239229068608, -0.2832899234693677))Note that you will always have access to the built-in functions.
This page was generated using Literate.jl.