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

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

[Octave-bug-tracker] [bug #45080] normest does not work with sparse comp


From: Marco Caliari
Subject: [Octave-bug-tracker] [bug #45080] normest does not work with sparse complex matrices
Date: Tue, 12 May 2015 07:19:10 +0000
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:37.0) Gecko/20100101 Firefox/37.0

URL:
  <http://savannah.gnu.org/bugs/?45080>

                 Summary: normest does not work with sparse complex matrices
                 Project: GNU Octave
            Submitted by: caliari
            Submitted on: Tue 12 May 2015 07:19:08 AM GMT
                Category: Octave Function
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: None
                  Status: None
             Assigned to: None
         Originator Name: 
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: 3.8.2
        Operating System: GNU/Linux

    _______________________________________________________

Details:

Dear all,

if A is sparse complex you get the following


octave:1>normest(sparse(1i))
error: octave_base_value::array_value(): wrong type argument 'sparse complex
matrix'


The problem is in the line


rand("state", trace(A))


As a simple fix, it is enough to replace trace(A) with full(trace(A)). The
state of rand was set in order to get consistent results over multiple runs
with the same argument. I'm wondering if it is real necessary to compute the
trace of a matrix (it involves some computations, in particular in the sparse
case). Would it not enough to use


rand("state",full(A(1,1))


?

Cheers,

Marco




    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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