Re: out of memory or dimension too large for Octave's index type

"Jiang, Yanda [E CPE]" <[email protected]> Wed, 26 Oct 2022 14:32:47 +0000
Newsgroups gmane.comp.gnu.octave.general
Message-ID <BYAPR04MB52886F7BA14921C713F5D4CFC6309@BYAPR04MB5288.namprd04.prod.outlook.com>
Hi Markus,


Thanks for your reply.
That issue has been resolved.
Then how about this below one? (nbr and nb are very large). I encountered the same problem as before.
H = sparse(zeros(nbr, nb));


Best,
Yanda
________________________________
From: Markus Mützel <[email protected]>
Sent: Wednesday, October 26, 2022 4:37 AM
To: Jiang, Yanda [E CPE] <[email protected]>
Cc: [email protected] <[email protected]>
Subject: Re: out of memory or dimension too large for Octave's index type

Am 26. Oktober 2022 um 07:06 Uhr schrieb "Jiang, Yanda [E CPE]":
> Dear Sir/Madam,
>
>
> I am a phd student who is using octave for my research work.
> While running my code, I got this error message.
>
>
> After hours of investigation, I believe the reason is one matrix is 232100*71368.
> Do you have any method to solve this problem?


For the future: Please don't use images of text. Paste the text directly instead.


I'm guessing your input to `glpk` is sparse. Line 507 of `glpk.m` uses:
  if (any (! isfinite (A(:))))
    error ("glpk: The values in A must be finite");
  endif

`isfinite (A(:))` creates a sparse Boolean matrix. However, it is likely not sparsely populated which might be the cause for the memory issue.

Does it work if you edit that file and change the above lines to the following?
  if (any (isinf (A(:))) || any (isnan(A(:))))
    error ("glpk: The values in A must be finite");
  endif


Alternatively, try:
  if (any (any (! isfinite (A))))
    error ("glpk: The values in A must be finite");
  endif


Markus


----------
We are transitioning to a web based forum
for community help discussions at
https://octave.discourse.group/c/help