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 12:47:43 -0400 (EDT)
User-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like Gecko

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

I think this is going to require several steps and several patches to properly
fix.  I believe the patch for lu-sparse.cc is still a part of the overall
solution.

For starters, what should the internal representation of a sparse, empty
matrix be in Octave?  Right now there are two models used simultaneously which
is not good coding practice.  The first model is from the Sparse constructor
which assigns a nullptr to the data and row indices.  The second model is used
by an existing Sparse matrix which becomes empty.  In that case, a pointer is
assigned to the row and data indices, but it is *expected* that they not be
used because there is no valid data there.

Either will work, but I think some practical concerns lean towards the first
model.  First, it is more intuitive to me that if the matrix is empty, there
are no row or data entries.  Second, although there is not a real performance
hit on modern computers with lots of memory, why allocate two pointers worth
of memory with new() and have the runtime maintain that information when it
isn't necessary.  Third, changing over to the second convention will, I think,
involve more changes to the code base.  The second representation is, I
believe, only used in the change_length routine so a single modification
converts all of Octave to the first representation.



    _______________________________________________________

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]