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

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

[Octave-bug-tracker] [bug #50105] __ilu__ and __ichol__ should use liboc


From: Jordi Gutiérrez Hermoso
Subject: [Octave-bug-tracker] [bug #50105] __ilu__ and __ichol__ should use liboctave functions instead of feval
Date: Wed, 9 Jan 2019 17:07:59 -0500 (EST)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0

Follow-up Comment #4, bug #50105 (project octave):

I just noticed that this introduced a bug.

I think this should fix it:


     {
       SparseMatrix L;
       SparseMatrix sm_l = Ftril (args(0))(0).sparse_matrix_value ();
+      Array <Complex> cols_norm = xcolnorms (sm_l, 1);
       ichol_t <SparseMatrix,
                double, ichol_mult_real, ichol_checkpivot_real>
-               (sm_l, L, xcolnorms (sm_l, 1).fortran_vec (), droptol,
michol);
+               (sm_l, L, cols_norm.fortran_vec (), droptol, michol);
 
       return ovl (L);
     }


The issue is that the function call to xcolnorms returns a matrix object,
which after getting its fortran_vec goes out of scope, so the pointer now
points to memory that has been freed by the dtor of the intermediate xcolnorms
matrix.

    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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