|
From: | Mathieu Dubois |
Subject: | Re: Memory exhausted when using \ |
Date: | Mon, 16 Jul 2012 16:02:23 +0200 |
User-agent: | Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.15) Gecko/20101027 Fedora/3.0.10-1.fc12 Lightning/1.0b2pre Thunderbird/3.0.10 |
Le 16/07/2012 15:43, Martin Helm a écrit :
Am 16.07.2012 15:13, schrieb Mathieu Dubois:Le 16/07/2012 15:04, marco atzeri a écrit :On 7/16/2012 2:55 PM, Markus Bergholz wrote:like that? octave:1> A=[246 710, 49 260] A = 246 710 49 260 octave:2> B=[49 260, 1] B = 49 260 1 octave:3> A \ B ans = 1.8994e-02 1.0079e-01 3.8764e-04 5.4820e-02 2.9088e-01 1.1188e-03 3.7834e-03 2.0075e-02 7.7212e-05 2.0075e-02 1.0652e-01 4.0970e-04 octave:4> or am i wrong? but updating octave and use an up to date version is always a good idea! regards markus On Mon, Jul 16, 2012 at 2:43 PM, Mathieu Dubois wrote:Hello, I was porting some code from Matlab to Octave but I'm facing a "memory exhausted" error. I'm using Octave 3.2 on a i386 system (I may have access to more powerful systems but I would like to be able to run the code on this machine). This happens when using "\" to solve a linear system. The matrix A is (246 710, 49 260) and b is (49 260, 1). I have seen that Octave have other solvers for linear system. Do you think that may help? Do you have any idea if upgrading to 3.6 could help? Thanks in advance, MathieuI suspect he means a matrix with dimension 246710 x 49260 a vector with 49260 x 1 As the matrix is almost 10 Gb no surprise of memory exhausted Regards MarcoYou're right Marco I mean a 246710 x 49260 matrix (I wrote the size of the matrix). The construction of A and b works because they are sparse. It's the division that don't work.Try an iterative solver like pcg and check if it is fast enough it uses less memory than the direct solvers (there are other iterative solvers as well if pcg does not fit your needs) http://www.gnu.org/software/octave/doc/interpreter/Iterative-Techniques.html
Naively replacing: X = A\b by: X = pcg(A, b) gives:error: operator *: nonconformant arguments (op1 is 246710x49260, op2 is 246710x1)
error: called from: error: /usr/share/octave/3.2.3/m/sparse/pcg.m at line 262, column 3 Any idea?
[Prev in Thread] | Current Thread | [Next in Thread] |