octave-maintainers
[Top][All Lists]
Advanced

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

sqrtm test failure


From: John W. Eaton
Subject: sqrtm test failure
Date: Fri, 29 Jul 2011 17:06:29 -0400

On 29-Jul-2011, Marco atzeri wrote:

| on src/DLD-FUNCTIONS/sqrtm.cc
| the following test is failing
| 
| %!assert (isnan (sqrtm ([0 1; 0 0])))
| 
| but it is not clear to me, what is the expected results
| as isnan applied to a matrix produces a matrix

The assert will succeed only if all elements of the matrix returned by
isnan are true.

|  > sqrtm ([0 1; 0 0])
| warning: sqrtm: matrix is singular, may not have a square root
| ans =
| 
|       0   NaN
|       0   NaN
| 
| 
|  > isnan(sqrtm ([0 1; 0 0]))
| warning: sqrtm: matrix is singular, may not have a square root
| ans =
| 
|     0   1
|     0   1

On my system, I see

  octave> sqrtm ([0,1; 0, 0])
  warning: sqrtm: matrix is singular, may not have a square root
  ans =

     NaN - NaNi   NaN - NaNi
     NaN - NaNi   NaN - NaNi

I'm not sure why this result should be complex.

jwe


reply via email to

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