octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #56232] Octave crash when inverting an empty s


From: Rik
Subject: [Octave-bug-tracker] [bug #56232] Octave crash when inverting an empty sparse matrix.
Date: Tue, 7 May 2019 18:04:53 -0400 (EDT)
User-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like Gecko

Follow-up Comment #30, bug #56232 (project octave):

I'm attaching a file mex_sparse.c that we need someone to compile and run in
Matlab to verify what it does.  On looking through the documentation, it seems
that nzmax must always be a minimum of 1.  I.e., they always allocate space
for at least one element.

Within Matlab, I tried


S = sparse (zeros (2));
nzmax (S)
=> 1


so this minimum is preserved in the interpreter as well, not just the mex
interface.

After compiling and running the mex_sparse.c in Octave I get


octave:4> mex_sparse
Reported nzmax size when created with 0 elements: 0
mxGetIr returns valid pointer when nzmax == 0
mxGetPr returns valid pointer when nzmax == 0
Reported nzmax size when created with 1 elements: 1
mxGetIr returns valid pointer when nzmax == 1
mxGetPr returns valid pointer when nzmax == 1


So Octave allows the creation of fully empty (nzmax = 0, nnz = 0) sparse
matrices.  The pointer returned from mxGetIr and mxGetPr is not NULL even in
this instance.



(file #46880)
    _______________________________________________________

Additional Item Attachment:

File name: mex_sparse.c                   Size:1 KB
    <https://savannah.gnu.org/file/mex_sparse.c?file_id=46880>



    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?56232>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

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