-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use GF as matrix element type? #15
Comments
For now the best solution is to use LinearAlgebraX.jl for this use case. I'll leave this bug open; maybe we can depend on LinearAlgebraX and add implementations like
FWIW for adding methods to functions from
But in this case it will just complain about other methods next. |
Wonderful, thank you for the direction and pointers!
That sounds like it would be neat; though I might worry about adding a dependency for users that don't use that feature. I'm not sure I've ever encountered this in a software engineering context, multiple dispatch adds a lot of new capabilities to tie libraries together, but also brings some new problems to solve. I wonder if the community has a general strategy for this yet. Perhaps a simple mention in the readme would be sufficient:
So I tried to use LinearAlgebraX, but I ran into an issue where the result of the vector numeric equality binary operation results an array of GaloisField values instead of booleans: using GaloisFields, LinearAlgebraX
const F = @GaloisField ℤ/257ℤ
print(F(10) == 0) # "false" -- ok
print([F(10) F(8)] .== 0) # 𝔽₂₅₇[0 0] -- ??? I expect [false false] instead
all([F(10) F(8)] .== 0) # TypeError: non-boolean (𝔽₂₅₇) used in boolean context This is used in LinearAlgebraX as part of the implementation of Any ideas why that happens? |
Oh interesting, using the extended GF form works fine: const G = @GaloisField! 2^8 β
print([β^10 β^8] .== 0)
all([β^10 β^8] .== 0)
|
@infogulch Thanks for reporting the bug about broadcasting |
Great, thanks! If I find something else I'll put it in a new issue next time. 😄 |
This subject discussed here as well |
Hi! I'm trying to use
GaloisFields
as an element type in matrices, but I'm running into MethodErrors when using some of the stdlib matrix functions, some examples:I did try the obvious defining abs:
But that didn't have any effect.
The stack trace of one of the abs errors is:
And for conj:
I must admit I'm new to both Julia and GF, so it's quite possible I'm doing something wrong. 😅
Thoughts?
The text was updated successfully, but these errors were encountered: