JuliaLinearAlgebra / AlgebraicMultigrid.jl

Algebraic Multigrid in Julia
Other
117 stars 23 forks source link

Error showing value of type ... #50

Closed yoczhang closed 5 years ago

yoczhang commented 5 years ago

Hello everyone,

I want to use the AlgebraicMultigrid in julia - Version 1.0.2 (2018-11-08) to solve the equations, and I run the example like that

julia> using AlgebraicMultigrid

julia> A = poisson(1000);

julia> ml = ruge_stuben(A)

but I get the following error

julia> ml = ruge_stuben(A)
Error showing value of type AlgebraicMultigrid.MultiLevel{AlgebraicMultigrid.Pinv{Float64},GaussSeidel{SymmetricSweep},GaussSeidel{SymmetricSweep},SparseArrays.SparseMatrixCSC{Float64,Int64},LinearAlgebra.Adjoint{Float64,SparseArrays.SparseMatrixCSC{Float64,Int64}},SparseArrays.SparseMatrixCSC{Float64,Int64},AlgebraicMultigrid.MultiLevelWorkspace{Array{Float64,1},1}}:
ERROR: MethodError: no method matching round(::Float64, ::Int64)
Closest candidates are:
  round(::Float64, ::RoundingMode{:Nearest}) at float.jl:368
  round(::Float64, ::RoundingMode{:Up}) at float.jl:366
  round(::Float64, ::RoundingMode{:Down}) at float.jl:364
  ...
Stacktrace:
 [1] show(::IOContext{REPL.Terminals.TTYTerminal}, ::AlgebraicMultigrid.MultiLevel{AlgebraicMultigrid.Pinv{Float64},GaussSeidel{SymmetricSweep},GaussSeidel{SymmetricSweep},SparseArrays.SparseMatrixCSC{Float64,Int64},LinearAlgebra.Adjoint{Float64,SparseArrays.SparseMatrixCSC{Float64,Int64}},SparseArrays.SparseMatrixCSC{Float64,Int64},AlgebraicMultigrid.MultiLevelWorkspace{Array{Float64,1},1}}) at ./printf.jl:159
...
...

Can this error be solved? Thank you!

ranjanan commented 5 years ago

Hi @yoczhang , thanks for considering this package. This error is only a display error, which means if you executed ml = ruge_stuben(A);, it should just work. I currently have some final exams to deal with, after which I shall push a fix for this.

yoczhang commented 5 years ago

Hi @yoczhang , thanks for considering this package. This error is only a display error, which means if you executed ml = ruge_stuben(A);, it should just work. I currently have some final exams to deal with, after which I shall push a fix for this.

Ok, I got it, thank you very much!