[Top][All Lists]

[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

>>>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
>Unfortunately this wiki-page is empty

Your mail client probably strips the last dot from the URL, try this

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:

reply via email to

[Prev in Thread] Current Thread [Next in Thread]