Skip to content
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

exp/log/sqrt are not imported #439

Open
DanielVandH opened this issue Dec 7, 2024 · 1 comment
Open

exp/log/sqrt are not imported #439

DanielVandH opened this issue Dec 7, 2024 · 1 comment

Comments

@DanielVandH
Copy link

DanielVandH commented Dec 7, 2024

exp/log./sqrt are defined in

for op in (:exp, :log, :sqrt)
, but those methods are not imported so not actually used. Is it intended to be private to BlockArrays?

@DanielVandH
Copy link
Author

e.g. (I'd give a simpler example but I don't see how to properly create a BlockDiagonal)

julia> length(methods(exp))
22

julia> length(methods(BlockArrays.exp))
1

julia> D = Fourier() \ diff(Fourier()); D = D[Block(1):Block(5), Block(1):Block(5)]; D
5×5-blocked 9×9 BlockBandedMatrices.BlockSkylineMatrix{Float64, Vector{Float64}, BlockBandedMatrices.BlockSkylineSizes{Tuple{BlockedOneTo{Int64, StepRange{Int64, Int64}}, BlockedOneTo{Int64, StepRange{Int64, Int64}}}, Fill{Int64, 1, Tuple{Base.OneTo{Int64}}}, Fill{Int64, 1, Tuple{Base.OneTo{Int64}}}, BandedMatrices.BandedMatrix{Int64, Matrix{Int64}, Base.OneTo{Int64}}, Vector{Int64}}}:
 0.0  │   ⋅     ⋅   │   ⋅     ⋅   │   ⋅     ⋅   │   ⋅     ⋅
 ─────┼─────────────┼─────────────┼─────────────┼───────────
  ⋅   │  0.0  -1.0  │   ⋅     ⋅   │   ⋅     ⋅   │   ⋅     ⋅
  ⋅   │  1.0   0.0  │   ⋅     ⋅   │   ⋅     ⋅   │   ⋅     ⋅
 ─────┼─────────────┼─────────────┼─────────────┼───────────
  ⋅   │   ⋅     ⋅   │  0.0  -2.0  │   ⋅     ⋅   │   ⋅     ⋅
  ⋅   │   ⋅     ⋅   │  2.0   0.0  │   ⋅     ⋅   │   ⋅     ⋅
 ─────┼─────────────┼─────────────┼─────────────┼───────────
  ⋅   │   ⋅     ⋅   │   ⋅     ⋅   │  0.0  -3.0  │   ⋅     ⋅
  ⋅   │   ⋅     ⋅   │   ⋅     ⋅   │  3.0   0.0  │   ⋅     ⋅
 ─────┼─────────────┼─────────────┼─────────────┼───────────
  ⋅   │   ⋅     ⋅   │   ⋅     ⋅   │   ⋅     ⋅   │  0.0  -4.0
  ⋅   │   ⋅     ⋅   │   ⋅     ⋅   │   ⋅     ⋅   │  4.0   0.0

julia> exp(D)
9×9 Matrix{Float64}:
  1.0   0.0        0.0        0.0        0.0        0.0        0.0        0.0        0.0
  0.0   0.540302  -0.841471   0.0        0.0        0.0        0.0        0.0        0.0
  0.0   0.841471   0.540302   0.0        0.0        0.0        0.0        0.0        0.0
 -0.0  -0.0       -0.0       -0.416147  -0.909297  -0.0       -0.0       -0.0       -0.0
  0.0   0.0        0.0        0.909297  -0.416147   0.0        0.0        0.0        0.0
 -0.0  -0.0       -0.0       -0.0       -0.0       -0.989992  -0.14112   -0.0       -0.0
  0.0   0.0        0.0        0.0        0.0        0.14112   -0.989992   0.0        0.0
 -0.0  -0.0       -0.0       -0.0       -0.0       -0.0       -0.0       -0.653644   0.756802
  0.0   0.0        0.0        0.0        0.0        0.0        0.0       -0.756802  -0.653644

julia> BlockArrays.exp(D)
ERROR: MethodError: no method matching exp(::BlockBandedMatrices.BlockSkylineMatrix{Float64, Vector{…}, BlockBandedMatrices.BlockSkylineSizes{…}})
You may have intended to import Base.exp
The function `exp` exists, but no method is defined for this combination of argument types.

Closest candidates are:
  exp(::BlockedMatrix{T} where T)
   @ BlockArrays C:\Users\djv23\.julia\packages\BlockArrays\tOOU0\src\blocklinalg.jl:409

Stacktrace:
 [1] top-level scope
   @ REPL[79]:1
Some type information was truncated. Use `show(err)` to see complete types.

@DanielVandH DanielVandH changed the title exp/log/sqrt exp/log/sqrt are not imported Dec 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant