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

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

[Octave-bug-tracker] [bug #63785] float compared to 0 in __ichol__.cc


From: Dmitri A. Sergatskov
Subject: [Octave-bug-tracker] [bug #63785] float compared to 0 in __ichol__.cc
Date: Fri, 10 Feb 2023 16:10:48 -0500 (EST)

URL:
  <https://savannah.gnu.org/bugs/?63785>

                 Summary: float compared to 0 in __ichol__.cc
                 Project: GNU Octave
               Submitter: dasergatskov
               Submitted: Fri 10 Feb 2023 09:10:46 PM UTC
                Category: Octave Function
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Incorrect Result
                  Status: None
             Assigned to: None
         Originator Name: 
        Originator Email: 
             Open/Closed: Open
                 Release: 8.0.90
         Discussion Lock: Any
        Operating System: Any
           Fixed Release: None
         Planned Release: None


    _______________________________________________________

Follow-up Comments:


-------------------------------------------------------
Date: Fri 10 Feb 2023 09:10:46 PM UTC By: Dmitri A. Sergatskov <dasergatskov>
With some high (but "safe") optimization
(-O2 -mavx -mavx2 -flto) while using gcc 11 and gcc12
"test ichol" fails with 


octave:1> test ichol
***** test
 opts.type = "nofill";
 opts.michol = "off";
 assert (nnz (tril (A1)), nnz (ichol (A1, opts)));
 assert (nnz (tril (A2)), nnz (ichol (A2, opts)));
 assert (nnz (tril (A3)), nnz (ichol (A3, opts)));
 assert (nnz (tril (A4)), nnz (ichol (A4, opts)));
 assert (nnz (tril (A5)), nnz (ichol (A5, opts)));

!!!!! test failed
ichol: non-real pivot encountered.  The matrix must be Hermitian.


In particular:


octave:2> A5 = [ 0.37, -0.05,         -0.05,  -0.07;
       -0.05,  0.116,         0.0,   -0.05 + 0.05i;
       -0.05,  0.0,           0.116, -0.05;
       -0.07, -0.05 - 0.05i, -0.05,   0.202];
 A5 = sparse (A5);
octave:4> ishermitian (A5)
ans = 1 
octave:5> ichol(A5)
error: ichol: non-real pivot encountered.  The matrix must be Hermitian.
error: called from
    ichol at line 246 column 9


I think this is due to line 60 in __ichol__.cc


  if (pivot.imag () != 0)


If I replace it with 


if (std::fabs(pivot.imag ()) > std::numeric_limits<double>::epsilon() *
std::fabs(pivot.real ()))


test passes. 

This applies both to stable and dev versions.

Dmitri.
-- 













    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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