[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Problem with large array
From: |
George |
Subject: |
Problem with large array |
Date: |
Tue, 20 Mar 2012 07:18:03 -0700 |
Hi,
I am creating a large matrix, and got the following error:
error: memory exhausted or requested size too large for range of Octave's index type -- trying to return to prompt.
The size of the matrix when the error occurs is 23,289 x 2,387 or about 55,000,000 elements.
Working in WIndows XP, on Octave 3.2.4. I have a 64 bit CPU, but I think running Windows 32 bit version.
I am combining the elements of two matrices. Here is the code:
X_big = [];
Y_big = [];
nm = size(R, 1);
np = size(R, 2);
for m_counter = 1 : nm
printf("%i...", m_counter);
for p_counter = 1 : np
if R(m_counter, p_counter) == 1
this_row = [features(m_counter, :), Y'(p_counter,:) ];
X_big = [X_big; this_row];
Y_big = [ Y_big; Y(m_counter, p_counter) ];
endif
endfor
endfor
The final matrix should be approximately of size 34,000 x 2,387 or about 80,000,000 elements.
Can you please answer a few questions?
1. How can I fix this error?
2. This process is very slow...taking about 6 hours (if it finished.) Is there a better way to do this?
Thank you for your help.
George
- Problem with large array,
George <=