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

4200 by 3 matrix has "overflow error" on input #11458

Closed
gwhowell opened this issue May 27, 2015 · 12 comments
Closed

4200 by 3 matrix has "overflow error" on input #11458

gwhowell opened this issue May 27, 2015 · 12 comments

Comments

@gwhowell
Copy link

   _       _ _(_)_     |  A fresh approach to technical computing
  (_)     | (_) (_)    |  Documentation: http://docs.julialang.org
   _ _   _| |_  __ _   |  Type "help()" for help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 0.4.0-dev+5040 (2015-05-27 08:31 UTC)
 _/ |\__'_|_|_|\__'_|  |  Commit cfbd68c (0 days old master)
|__/                   |  x86_64-unknown-linux-gnu

julia> include("b1ss.m")
15x3 Array{Float64,2}:
 5.0  1.0  -0.0359994 
 6.0  1.0  -0.0176371 
 7.0  1.0  -0.00772178
 1.0  2.0   1.0       
 2.0  2.0  -1.0       
 1.0  3.0   1.0       
 3.0  3.0  -1.0       
 1.0  4.0   1.0       
 4.0  4.0  -1.0       
 2.0  5.0   0.45      
 5.0  5.0   1.0       
 3.0  6.0   0.1       
 6.0  6.0   1.0       
 4.0  7.0   0.45      
 7.0  7.0   1.0       

julia> include("b2ss.m")
ERROR: LoadError: OverflowError()
 in include at ./boot.jl:252
 in include_from_node1 at ./loading.jl:133
while loading /home/howell/howell/progs/matdirs/simpleLUjulia/b2ss.m, in expression starting on line 1

Here's the file b1ss.m

a = [ 5 1 -.03599942 ; 
6 1 -.0176371 ; 
7 1 -.007721779 ; 
1 2 1 ; 
2 2 -1 ; 
1 3 1 ; 
3 3 -1 ; 
1 4 1 ; 
4 4 -1 ; 
2 5 .45 ; 
5 5 1 ; 
3 6 .1 ; 
6 6 1 ; 
4 7 .45 ; 
7 7 
] ;

the file b2ss.m is similar (but has around 4228 rows in the matrix )

too big to drag and drop .. so posted it online

http://ncsu.edu/hpc/Courses/CSC302/b2ss.html

Note,
julia>include("b222.m")
is fine in 0.3.7

0.3.7 was from
yum install julia
in fedora 19,

The 0.4.0 is today's generic linux binary (fedora 20 )

Thanks,
Gary Howell

@gwhowell
Copy link
Author

include("b222.m") was a misprint, should be include("b2ss.m")

@andreasnoack
Copy link
Member

These is a typo in the link at http://ncsu.edu/hpc/Courses/CSC302/b2ss.html

@timholy
Copy link
Sponsor Member

timholy commented May 27, 2015

@gwhowell, I added backticks for you with your post, it makes it much more readable.

In b1ss.m, is it really true that the final row contains only 2 numbers? How does that final 1 get in there?

@andreasnoack
Copy link
Member

For matrices of that size, I think you should read the numbers from a file. Is it a sparse matrix in triplet format? If you add the dimensions and the number of lines in the top you can read it with

A = sparse(Base.SparseMatrix.CHOLMOD.Sparse(b2ss.m"))

@JeffBezanson
Copy link
Sponsor Member

Probably same issue as #11449

@gwhowell
Copy link
Author

I fixed the link.
Yes, it is a triplet matrix for a sparse matrix (produced from Davis
collection by a perl
script).

On Wed, May 27, 2015 at 3:36 PM, Andreas Noack notifications@github.com
wrote:

These is a typo in the link at
http://ncsu.edu/hpc/Courses/CSC302/b2ss.html


Reply to this email directly or view it on GitHub
#11458 (comment).

@gwhowell
Copy link
Author

Yes, there should be a 3rd entry in the final row (failed cut and paste).

On Wed, May 27, 2015 at 3:37 PM, Tim Holy notifications@github.com wrote:

@gwhowell https://github.com/gwhowell, I added backticks for you with
your post, it makes it much more readable.

In b1ss.m, is it really true that the final row contains only 2 numbers?
How does that final 1 get in there?


Reply to this email directly or view it on GitHub
#11458 (comment).

@gwhowell
Copy link
Author

Hi Andreas,

converting b1ss.m to b1ss.jl

7 7 15
5 1 -.03599942 ;
6 1 -.0176371 ;
7 1 -.007721779 ;
1 2 1 ;
2 2 -1 ;
1 3 1 ;
3 3 -1 ;
1 4 1 ;
4 4 -1 ;
2 5 .45 ;
5 5 1 ;
3 6 .1 ;
6 6 1 ;
4 7 .45 ;
7 7 1 ;

and using
A = sparse(Base.SparseMatrix.CHOLMOD.Sparse("b1ss.jl"))

did work fine (and similarly for b2ss.m and b2ss.jl)
Thanks,
Gary

On Wed, May 27, 2015 at 3:44 PM, Andreas Noack notifications@github.com
wrote:

For matrices of that size, I think you should read the numbers from a
file. Is it a sparse matrix in triplet format? If you add the dimensions
and the number of lines in the top you can read it with

A = sparse(Base.SparseMatrix.CHOLMOD.Sparse(b2ss.m"))


Reply to this email directly or view it on GitHub
#11458 (comment).

@ViralBShah ViralBShah added the domain:arrays:sparse Sparse arrays label May 28, 2015
@JeffBezanson JeffBezanson removed the domain:arrays:sparse Sparse arrays label May 28, 2015
@JeffBezanson
Copy link
Sponsor Member

Closing as dup of #11320.

@gwhowell
Copy link
Author

HI Andreas,

I haven't been able to figure out how to reconstruct sparse A from lufact(A).

The formula give by help(lufact) does not appear to work

F[:L]F[:U] == F[:Rs] . A[F[:p], F[:q]]

but

julia> A = sparse(Base.SparseMatrix.CHOLMOD.Sparse("b1ss.jl"))
7x7 sparse matrix with 15 Float64 entries:
[5, 1] = -0.0359994
[6, 1] = -0.0176371
[7, 1] = -0.00772178
[1, 2] = 1.0
[2, 2] = -1.0
[1, 3] = 1.0
[3, 3] = -1.0
[1, 4] = 1.0
[4, 4] = -1.0
[2, 5] = 0.45
[5, 5] = 1.0
[3, 6] = 0.1
[6, 6] = 1.0
[4, 7] = 0.45
[7, 7] = 1.0

julia> F = lufact(A)
UMFPACK LU Factorization of a 7-by-7 sparse matrix
Ptr{Void} @0x0000000002c85540

julia> F[:L]F[:U] - F[:Rs] . A[F[:p], F[:q]]
7x7 sparse matrix with 13 Float64 entries:
[1, 1] = 0.631918
[6, 1] = -0.131856
[2, 2] = 0.293013
[5, 2] = -0.00561606
[3, 3] = 0.0832465
[7, 4] = -0.659004
[5, 5] = 0.0561606
[7, 5] = -0.659004
[6, 6] = 0.293013
[7, 6] = -0.659004
[1, 7] = -0.0227487
[2, 7] = -0.00516791
[3, 7] = -0.000642811

Also I'd like a way to get all 3 of the following

just row pivoting,

just row and column pivoting

-- row and column pivoting with row scaling ..

In matlab or octave, these options can be acomplished by a combination of
how many arguments specified on the left hand side, e.g. to get LU
factorization with
only row pivoting

[L,U,P] = lu(a,"vector")

(vector specifes that P is a permutation vector, else P would be the matrix
such that

L_U = P_A

This (vector P) happens to be the option I was attempting to use.

I'm willing to help on this, but am not very good at julia.

Regards,
Gary Howell

The b1ss.jl file is

7 7 15
5 1 -.03599942 ;
6 1 -.0176371 ;
7 1 -.007721779 ;
1 2 1 ;
2 2 -1 ;
1 3 1 ;
3 3 -1 ;
1 4 1 ;
4 4 -1 ;
2 5 .45 ;
5 5 1 ;
3 6 .1 ;
6 6 1 ;
4 7 .45 ;
7 7 1 ;

[howell@gary2 julia]$ julia --version
julia version 0.4.0-dev

I had also tried this with some versions of julia I downloaded a few months
ago.

On Wed, May 27, 2015 at 3:44 PM, Andreas Noack notifications@github.com
wrote:

For matrices of that size, I think you should read the numbers from a
file. Is it a sparse matrix in triplet format? If you add the dimensions
and the number of lines in the top you can read it with

A = sparse(Base.SparseMatrix.CHOLMOD.Sparse(b2ss.m"))


Reply to this email directly or view it on GitHub
#11458 (comment).

@andreasnoack
Copy link
Member

There is a set of parentheses missing in the documentation. It should be F[:L]*F[:U] == (F[:Rs] .* A)[F[:p], F[:q]] such that the scaling is done before the permutations. I'll update the documentation.

The easiest way to get the extra pivoting options you are asking for is to try implement it. I can try to help with comments, but I will probably not do implement it. There are more important issues.

@gwhowell
Copy link
Author

Thanks,
That worked ..

On Mon, Jul 13, 2015 at 12:33 PM, Andreas Noack notifications@github.com
wrote:

There is a set of parentheses missing in the documentation. It should be F[:L]F[:U]
== (F[:Rs] .
A)[F[:p], F[:q]] such that the scaling is done before the
permutations. I'll update the documentation.

The easiest way to get the extra pivoting options you are asking for is to
try implement it. I can try to help with comments, but I will probably not
do implement it. There are more important issues.


Reply to this email directly or view it on GitHub
#11458 (comment).

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

5 participants