bugGNU Octave - Bugs: bug #34328, Can't set entries in...

 
 

bug #34328: Can't set entries in single-precision complex matrices to real values

Submitter:  Nir Krakauer <nir_krakauer>
Submitted:  Sun 18 Sep 2011 11:21:24 PM UTC
   
 
Category:  Interpreter Severity:  3 - Normal
Priority:  6 Item Group:  Incorrect Result
Status:  Fixed Assigned to:  jordigh
Originator Name:  Nir Krakauer Open/Closed:  * Closed
Release:  * 3.4.2 Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Mon 19 Sep 2011 06:06:41 AM UTC, comment #3: 

The following cset on the stable branch fixes the problem for me:

http://hg.savannah.gnu.org/hgweb/octave/rev/6abc581bf2c9

You'll have to wait for our next stable release (which I'm hoping will happen very soon) or build the stable branch from the Mercurial repository to see this fix.

Jordi GutiƩrrez Hermoso <jordigh>
Group Member
Mon 19 Sep 2011 03:25:13 AM UTC, comment #2: 

I've been looking at the assignment operator code recently. I think I know where the fix for this is. I'll look into it.

Jordi GutiƩrrez Hermoso <jordigh>
Group Member
Mon 19 Sep 2011 03:09:01 AM UTC, comment #1: 

This is also the case with a recent development tip (2011/08/18).  Surprisingly, it seems to have been undiscovered in the code base for quite a long time because the same error exists with version 3.2.4.

Rik <rik5>
Group administrator
Sun 18 Sep 2011 11:21:24 PM UTC, original submission:  


With a single-precision complex matrix, e.g.


Y = i * ones(2, 2, "single");


An error is returned when setting an entry to a real value:


Y(1, 1) = 3

error: operator =: no conversion for assignment of `scalar' to indexed `float complex matrix'
error: assignment failed, or no method for `float complex matrix = scalar'


Setting to a complex or imaginary value works fine, as in


Y(1, 1) = 5 + 2*i

Y =

   5 + 2i   0 + 1i
   0 + 1i   0 + 1i




Nir Krakauer <nir_krakauer>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by jordigh (Posted a comment)
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by nir_krakauer (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2011-09-19 jordigh StatusConfirmed Fixed
        Open/ClosedOpen Closed
        Release3.4.0 3.4.2
    2011-09-19 jordigh Assigned toNone jordigh
    2011-09-19 rik5 Priority5 - Normal 6
        StatusNone Confirmed

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code