[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #50575] Integer overflow in whos when calculat
From: |
Colin Macdonald |
Subject: |
[Octave-bug-tracker] [bug #50575] Integer overflow in whos when calculating total elements in matrix |
Date: |
Wed, 22 Aug 2018 13:59:05 -0400 (EDT) |
User-agent: |
Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:61.0) Gecko/20100101 Firefox/61.0 |
Follow-up Comment #3, bug #50575 (project octave):
I don't think this is fixed. Or maybe it has been fixed for dense but not
sparse?
Here is the current master branch:
octave:18> [a, maxint] = computer()
a = x86_64-pc-linux-gnu
maxint = 2.1475e+09
octave:19> A = sprand(1e5, 1e5, 1e-9);
octave:20> prod(size(A))
ans = 1e+10
octave:21> A
A =
Compressed Column Sparse (rows = 100000, cols = 100000, nnz = 10 [1e-07%])
(27568, 526) -> 0.90261
(2571, 9637) -> 0.95277
(74535, 10460) -> 0.72937
(31147, 18753) -> 0.73106
(50591, 21541) -> 0.62384
(22220, 35691) -> 0.23058
(87851, 39654) -> 0.0946
(51929, 81427) -> 0.27443
(41244, 88864) -> 0.29328
(4317, 91034) -> 0.68548
octave:22> A(1,1)
ans = Compressed Column Sparse (rows = 1, cols = 1, nnz = 0 [0%])
octave:23> A(2571, 9637)
ans = Compressed Column Sparse (rows = 1, cols = 1, nnz = 1 [100%])
(1, 1) -> 0.95277
octave:24> numel(A)
error: out of memory or dimension too large for Octave's index type
octave:24> whos
Variables in the current scope:
error: out of memory or dimension too large for Octave's index type
octave:24>
(That is compiled with --disable-64).
Here is a 4.4.1 from flatpak which has --enable-64:
octave:22> [a, maxint] = computer()
a = x86_64-pc-linux-gnu
maxint = 9.2234e+18
octave:23> A = sprand(1e12, 1e7, 1e-15);
octave:24> prod(size(A))
ans = 1e+19
octave:25> nnz(A)
ans = 10000
octave:26> A(1000,11234)
ans = Compressed Column Sparse (rows = 1, cols = 1, nnz = 0 [0%])
octave:27> numel(A)
error: out of memory or dimension too large for Octave's index type
octave:27> whos
Variables in the current scope:
error: out of memory or dimension too large for Octave's index type
octave:27>
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?50575>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
- [Octave-bug-tracker] [bug #50575] Integer overflow in whos when calculating total elements in matrix,
Colin Macdonald <=