MonumoLtd / SimpleGA.jl

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

`isapprox` fails on two vectors of multivectors #19

Closed tpgillam closed 11 months ago

tpgillam commented 11 months ago

Simple example:

using SimpleGA

const e = basis(3)
a = [1.0 * e[1]]
isapprox(a, a)

Gives the stack trace:

ERROR: LoadError: MethodError: no method matching SimpleGA.GA30.Odd{Float64}(::Int64)

Closest candidates are:
  (::Type{T})(::T) where T<:Number
   @ Core boot.jl:792
  (::Type{SimpleGA.GA30.Odd{T}} where T<:Real)(::Any, ::Any, ::Any, ::Any)
   @ SimpleGA ~/.julia/packages/SimpleGA/Mluux/src/core30.jl:15
  (::Type{T})(::AbstractChar) where T<:Union{AbstractChar, Number}
   @ Base char.jl:50
  ...

Stacktrace:
 [1] convert(#unused#::Type{SimpleGA.GA30.Odd{Float64}}, x::Int64)
   @ Base ./number.jl:7
 [2] zero(#unused#::Type{SimpleGA.GA30.Odd{Float64}})
   @ Base ./number.jl:309
 [3] real(T::Type)
   @ Base ./complex.jl:120
 [4] rtoldefault(x::Type{SimpleGA.GA30.Odd{Float64}}, y::Type{SimpleGA.GA30.Odd{Float64}}, atol::Int64)
   @ Base ./floatfuncs.jl:347
 [5] isapprox(x::Vector{SimpleGA.GA30.Odd{Float64}}, y::Vector{SimpleGA.GA30.Odd{Float64}})
   @ LinearAlgebra ~/.julia/juliaup/julia-1.9.4+0.x64.linux.gnu/share/julia/stdlib/v1.9/LinearAlgebra/src/generic.jl:1772
 [6] top-level scope
   @ ~/moo.jl:6
 [7] include(fname::String)
   @ Base.MainInclude ./client.jl:478
 [8] top-level scope
   @ REPL[3]:1
in expression starting at /home/tom/moo.jl:5

This could be related to #18 .