|
From: | anonyme |
Subject: | [Octave-bug-tracker] [bug #56232] Octave crash when inverting an empty sparse matrix. |
Date: | Tue, 7 May 2019 10:52:54 -0400 (EDT) |
User-agent: | Mozilla/5.0 (Windows NT 6.1; WOW64; rv:60.0) Gecko/20100101 Firefox/60.0 |
Follow-up Comment #21, bug #56232 (project octave): Proposition for a simple fix. 1/ Rather than use Rik's patch in sparse-lu.cc around line 459, male a change like // If nz is zero then ridx is probably a nullptr. In this case // the value of ridx is not important but UMFPACK needs a valid // pointer in any case, so just set it to cidx that is always // valid const octave_idx_type *Ai = (a.cidx(nc+1) == 0 ? a.cidx() : a.ridx ()); This should fix the LU factorization problem 2/ In tinverse (line 718 in dsparse.cc) make the change octave_idx_type nz2 = nz == 0 ? 1 ; nz; and the same in CSparse.cc. This should fix the segfault I can't test it but this will probably work, even if inelegant David _______________________________________________________ Reply to this item at: <https://savannah.gnu.org/bugs/?56232> _______________________________________________ Message posté via Savannah https://savannah.gnu.org/
[Prev in Thread] | Current Thread | [Next in Thread] |