[julia-users] Re: Backslash or UMFPACK Bug, related to slicing

2014-11-25 Thread Ivar Nesje
This is at least one bug.

In /base/linalg/umfpack.jl#L18 
https://github.com/JuliaLang/julia/blob/master/base/linalg/umfpack.jl#L18, 
we have a convenience function to lookup the status code, seems to be 
restricted to Int64, even though it is called with Int32 on some occations. 
If you compile yourself, or know how to regenerate the system image, it is 
pretty easy to change *Int* to *Integer* on that line. A real fix for this 
would require someone to actually check the return types of the C functions 
called, and include some more tests to ensure that all code paths are 
followed in the test suite.

Would you mind reporting this issue on Github?

kl. 12:10:36 UTC+1 tirsdag 25. november 2014 skrev Christoph Ortner 
følgende:

 I had some unexplained \ behaviour that I'd like to clarify? Possibly a 
 bug? 

 Here is a short code snippet that does work ok. I get the correct solution 
 from it. (primarily the last line is relevant)

 # construct a finite element grid
 X, T = square(10)
 # assemble the stiffness matrix and rhs (for - \Delta u = 1)
 A, F = simple_stiffmat(X, T)
 # find the interior nodes
 Ifree = find( (minimum(X,1) . 0)  (maximum(X, 1) . 1) )
 # solve the linear system and plot the solution
 U = zeros(size(X,2))
 U[Ifree] = cholfact(A[Ifree,Ifree]) \ F[Ifree]


 Now, if I replace the last line with 
 U[Ifree] = A[Ifree,Ifree] \ F[Ifree]
 then I get the following error message:

 `umferror` has no method matching umferror(::Int32)
 while loading In[112], in expression starting on line 3

  in umfpack_symbolic! at linalg/umfpack.jl:155
  in umfpack_numeric! at linalg/umfpack.jl:176
  in lufact at linalg/umfpack.jl:118
  in A_ldiv_B! at linalg/sparse.jl:210
  in \ at linalg/generic.jl:233


 Same happens with `lufact`. I also tried copying B = copy(A[Ifree,Ifree]) 
 first. Same result.


 I have used UMFPack successfully in other cases. E.g., 

U = (A+speye(size(X,2)) \ F

 works fine.


 Any ideas?

 Christoph





[julia-users] Re: Backslash or UMFPACK Bug, related to slicing

2014-11-25 Thread Christoph Ortner
Now reported in as #9146

Thank you, Christoph


On Tuesday, 25 November 2014 11:30:16 UTC, Ivar Nesje wrote:

 This is at least one bug.

 In /base/linalg/umfpack.jl#L18 
 https://github.com/JuliaLang/julia/blob/master/base/linalg/umfpack.jl#L18, 
 we have a convenience function to lookup the status code, seems to be 
 restricted to Int64, even though it is called with Int32 on some occations. 
 If you compile yourself, or know how to regenerate the system image, it is 
 pretty easy to change *Int* to *Integer* on that line. A real fix for 
 this would require someone to actually check the return types of the C 
 functions called, and include some more tests to ensure that all code paths 
 are followed in the test suite.

 Would you mind reporting this issue on Github?

 kl. 12:10:36 UTC+1 tirsdag 25. november 2014 skrev Christoph Ortner 
 følgende:

 I had some unexplained \ behaviour that I'd like to clarify? Possibly a 
 bug? 

 Here is a short code snippet that does work ok. I get the correct 
 solution from it. (primarily the last line is relevant)

 # construct a finite element grid
 X, T = square(10)
 # assemble the stiffness matrix and rhs (for - \Delta u = 1)
 A, F = simple_stiffmat(X, T)
 # find the interior nodes
 Ifree = find( (minimum(X,1) . 0)  (maximum(X, 1) . 1) )
 # solve the linear system and plot the solution
 U = zeros(size(X,2))
 U[Ifree] = cholfact(A[Ifree,Ifree]) \ F[Ifree]


 Now, if I replace the last line with 
 U[Ifree] = A[Ifree,Ifree] \ F[Ifree]
 then I get the following error message:

 `umferror` has no method matching umferror(::Int32)
 while loading In[112], in expression starting on line 3

  in umfpack_symbolic! at linalg/umfpack.jl:155
  in umfpack_numeric! at linalg/umfpack.jl:176
  in lufact at linalg/umfpack.jl:118
  in A_ldiv_B! at linalg/sparse.jl:210
  in \ at linalg/generic.jl:233


 Same happens with `lufact`. I also tried copying B = copy(A[Ifree,Ifree]) 
 first. Same result.


 I have used UMFPack successfully in other cases. E.g., 

U = (A+speye(size(X,2)) \ F

 works fine.


 Any ideas?

 Christoph