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

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

[Octave-bug-tracker] [bug #39000] Can't override BLAS XERBLA handler on


From: Rik
Subject: [Octave-bug-tracker] [bug #39000] Can't override BLAS XERBLA handler on Windows
Date: Tue, 21 Nov 2017 12:50:38 -0500 (EST)
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:55.0) Gecko/20100101 Firefox/55.0

Update of bug #39000 (project octave):

                  Status:                    None => Confirmed              

    _______________________________________________________

Follow-up Comment #34:

The problem is that the 1-norm of the matrix is being calculated.  The code
is


      anorm = xnorm (*this, 1);

      if (octave::math::isinf (anorm) || octave::math::isnan (anorm))
        {
          rcon = 0.0;
          octave::warn_singular_matrix ();
          retval = Matrix (n, b_nc, 0.0);
        }


The 1-norm is the largest column sum of the absolute value of A, but NaN
always fails in comparisons, so the fact that one column sum yields NaN is not
enough to make the norm NaN.


max ([1 2 3 NaN])
ans =  3


This can be fixed by changing the norm to something else, like 2, but this
implies a singular value decomposition and a lot, lot more computation.

Maybe this is worth it, but I also hate having to code to a specific operating
system.  If Windows has a problem then perhaps this section of code should be
protected by #ifdefs so that only Windows users have to experience the slow
down.

As a possible intermediate solution one could write a routine to calculate the
1-norm, but respect the presence of NaNs.

Possible code



    double anorm;
    ColumnVector colsum = *this.abs ().sum ().row
(static_cast<octave_idx_type>(0));
    double maxcol = -octave::numeric_limits<double>::Inf ();

    for (octave_idx_type i = 0; i < anorm.numel (); i++)
      {
        if (octave::math::isnan (colsum(i)))
          {
            anorm = octave::numeric_limits<double>::NaN ();
            break;
          }
        else
          anorm = std::max (anorm, colsum(i))
    }






    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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