[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: how to make a matrix with all combinations of digits efficiently
From: |
Francesco Potortì |
Subject: |
Re: how to make a matrix with all combinations of digits efficiently |
Date: |
Fri, 29 Dec 2017 17:47:27 +0100 |
>>>result=decomp(10,9);
>>>error: out of memory or dimension too large for Octave's index type
>>
>> decomp(B,C) creates a matrix with B^C rows and C columns. In the case
>> you tested this means 9e9 elements. Each element is a double needing 8
>> bytes, which means that you need 72GB of memory only for hosting the
>> final result. In practice, you need additional space for hosting
>> intermediate variables.
>>
>I wonder whether it is possible to make octave store the array more
>efficiently knowing that the elements are all
>integers which can be represented by 1 byte
Yes, you can, but reducing memory footprint is not so obvious, because
you should care about intermediate results.
>> This is the only problem if Octave has been specially compiled for using
>> 64-bit indexes, which is not the general case, and most probably not
>> your case.
>>
>> For the general case, have a look at
>> https://wiki.octave.org/Enable_large_arrays:_Build_octave_such_that_it_can_use_arrays_larger_than_2Gb.
>>
>Unfortunately this wiki-page is empty
Your mail client probably strips the last dot from the URL, try this
one:
<https://wiki.octave.org/Enable_large_arrays:_Build_octave_such_that_it_can_use_arrays_larger_than_2Gb.>
--
Francesco Potortì (ricercatore) Voice: +39.050.621.3058
ISTI - Area della ricerca CNR Mobile: +39.348.8283.107
via G. Moruzzi 1, I-56124 Pisa Skype: wnlabisti
(entrance 20, 1st floor, room C71) Web: http://fly.isti.cnr.it
- how to make a matrix with all combinations of digits efficiently, Jean Dubois, 2017/12/28
- Re: how to make a matrix with all combinations of digits efficiently, Juan Pablo Carbajal, 2017/12/28
- Re: how to make a matrix with all combinations of digits efficiently, Juan Pablo Carbajal, 2017/12/29
- Re: how to make a matrix with all combinations of digits efficiently, Jean Dubois, 2017/12/30
- Re: how to make a matrix with all combinations of digits efficiently, Jean Dubois, 2017/12/30
- Re: how to make a matrix with all combinations of digits efficiently, Juan Pablo Carbajal, 2017/12/30
- Re: how to make a matrix with all combinations of digits efficiently, Juan Pablo Carbajal, 2017/12/30