MonumoLtd / SimpleGA.jl

Geometric algebra in Julia.
MIT License
23 stars 2 forks source link

Implement `LinearAlgebra.norm` where appropriate #17

Closed tpgillam closed 10 months ago

tpgillam commented 11 months ago

e.g. for GA30 it would be valid to say:

LinearAlgebra.norm(v::GA30.Odd) = sqrt(dot(v, v))

But I think this holds more generally for all algebras(?). Currently attempting to compute a norm fails, since e.g. GA30.Odd <: Number, so we fall back to an implementation that attempts to cast the multivector to a float, which naturally fails.

tpgillam commented 11 months ago

Note that doing this should give us LinearAlgebra.normalize for free, since it is implemented in terms of norm.