bugGNU Octave - Bugs: bug #50574, error: operator =: no conversion...

 
 

bug #50574: error: operator =: no conversion for assignment of 'scalar' to indexed 'float complex scalar'

Submitter:  Ceral Paquet <octavebugs>
Submitted:  Sat 18 Mar 2017 08:51:57 AM UTC
   
 
Category:  Libraries Severity:  3 - Normal
Priority:  5 - Normal Item Group:  None
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * 4.2.1 Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Tue 21 Mar 2017 11:01:28 PM UTC, comment #4: 

Verified fix with both original example and my simpler one.  Marking as Fixed and closing report.

Rik <rik5>
Group administrator
Tue 21 Mar 2017 01:45:34 PM UTC, comment #3: 

I checked in the following changeset:

http://hg.savannah.gnu.org/hgweb/octave/rev/f77d840f0f7c

John W. Eaton <jwe>
Group administrator
Sat 18 Mar 2017 05:06:04 PM UTC, comment #2: 

Confirmed.  Octave is missing a conversion template.

A simpler method to reproduce is


x = single (0+1i);
typeinfo (x)
ans = float complex scalar
x(1) = NaN;
error: operator =: no conversion for assignment of 'scalar' to indexed 'float complex scalar'


The corresponding method of assigning assigning to doubles works


x = 0+1i;
typeinfo (x)
ans = complex scalar
x(1) = single (NaN);
typeinfo (x)
ans = scalar


The error message is quite specific and quite accurate.  It is the conversion of a double scalar to an indexed 'float complex scalar' that is missing.  The conversion to a 'float matrix' exists and works correctly.


x = single ([i, 2i]);
typeinfo (x)
ans = float complex matrix
x(1) = single (NaN)
x =

   NaN +   0i     0 +   2i
typeinfo (x)
ans = float complex matrix



Rik <rik5>
Group administrator
Sat 18 Mar 2017 09:10:30 AM UTC, comment #1: 

Strange.  I have a really recent development version and see a problem here, but it manifests a little differently:


octave:3> a=complex(1:3,1:3);
octave:4> median(a)
error: kth_element: complex argument not supported (yet).
error: called from
    median at line 74 column 31


It looks like my median() comes from the nan package:


octave:4> type median
median is the user-defined function defined from: /home/sebald/octave/nan-3.1.2/median.m

function [y]=median(x,DIM)


Where is your median originating from?  I don't think there is a line #93 in my version.

Your guess does make sense in a way, i.e., that there is some missing C++ conversion whose definition was overlooked.  But check where median is coming from and if it is an external file, check what line 93 is.

Dan Sebald <sebald>
Sat 18 Mar 2017 08:51:57 AM UTC, original submission:  

I ran into this error - not really sure what it means. Maybe a missing template somewhere deep in the C++ ...


>> a=complex(1:3,1:3);
>> median(a)
ans =  2 + 2i
>> a=single(a);
>> median(a)
error: operator =: no conversion for assignment of 'scalar' to indexed 'float complex scalar'
error: called from
    median at line 93 column 34


Ceral Paquet <octavebugs>

 

(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 jwe (Posted a comment)
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by sebald (Posted a comment)
  • -email is unavailable- added by octavebugs (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
    2017-03-21 rik5 StatusReady For Test Fixed
        Open/ClosedOpen Closed
    2017-03-21 jwe StatusConfirmed Ready For Test
    2017-03-18 rik5 CategoryNone Libraries
        StatusNone Confirmed
        SummarySingle complex median error: no conversion for assignment error: operator =: no conversion for assignment of 'scalar' to indexed 'float complex scalar'

    Back to the top

    Powered by Savane 3.13-3230.
    Corresponding source code