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

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

[Octave-bug-tracker] [bug #53507] Sparse.h:491:57: runtime error: load o


From: Rik
Subject: [Octave-bug-tracker] [bug #53507] Sparse.h:491:57: runtime error: load of value 176, which is not a valid value for type 'bool'
Date: Thu, 29 Mar 2018 11:32:50 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:55.0) Gecko/20100101 Firefox/55.0

Follow-up Comment #7, bug #53507 (project octave):

It is definitely symbfact.cc that is the problem.  And only when you ask for
the 5 output argument which creates a SparseBoolMatrix.

I already found one problem which is that the wrong constructor is called.  In
boolSparse.h there is


  explicit SparseBoolMatrix (octave_idx_type r, octave_idx_type c, bool val)
    : Sparse<bool> (r, c, val) { }

  SparseBoolMatrix (const dim_vector& dv, octave_idx_type nz = 0)
    : Sparse<bool> (dv, nz) { }


Symbfact is calling


      SparseBoolMatrix L (n, n, lnz);


It appears that the original author believed there was a constructor that
accepted row, column, and nnz.  Instead, they were calling row, column, val. 
Since lnz was presumably greater than zero this would be converted to the bool
value true and the array filled with true.

I made this change


-      SparseBoolMatrix L (n, n, lnz);
+      SparseBoolMatrix L (dim_vector (n, n), lnz);


, but the warning message is still there.  I will take a look further.


    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?53507>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

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