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

Nicholas Jankowski <[email protected]> Wed, 26 Oct 2022 13:52:07 -0400
Newsgroups gmane.comp.gnu.octave.general
Message-ID <CALW4+bJztTxk6QCWDAgzxgZrNGWrU0oeDb3UJmEg0A1Ynqf60g@mail.gmail.com>
>
>
> Bf and Bbus are sparse. But I guess the inverse of Bbus is not sparse
> anymore. Will it be different?
> And is this an Octave problem or computer problem?
>

it is a known issue that certain operations on sparse arrays result in full
arrays. just to confirm, you gave the line:

* sparse(Bf(:, noref)) / sparse(Bbus(noslack, noref))*

so they are both already sparse, you're just recasting them as sparse again
to ensure that the output of your indexing call remains sparse? my
understanding is that indexing operations on sparse arrays stay sparse
whether they result in larger or smaller arrays, so the 'sparse' function
calls there shouldn't be necessary.

I also believe the matrix division preserves sparseness.  that seems to be
the case with some simple tests at least.

is H already sparse?  you're inserting sparse data into an existing array.
maybe that's triggering the full conversion?


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