bugGNU Octave - Bugs: bug #55077, automatic broadcasting for dot...

 
 

bug #55077: automatic broadcasting for dot product

Submitter:  CarnĂ« Draug <carandraug>
Submitted:  Fri 23 Nov 2018 11:56:37 AM UTC
   
 
Category:  Octave Function Severity:  1 - Wish
Priority:  3 - Low Item Group:  Feature Request
Status:  Confirmed Assigned to:  None
Originator Name:  Open/Closed:  * Open
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Post a Comment

Add a New Comment Rich Markup
   

Discussion

Sat 24 Nov 2018 02:51:36 AM UTC, comment #1: 

Matlab doesn't broadcast (https://www.mathw ... tlab/ref/dot.html), but I think your interpretation makes a lot of sense.

It would be nicer to use a for loop in dot.cc, rather than repmat which would require more memory usage (if only temporarily).


Rik <rik5>
Group administrator
Fri 23 Nov 2018 11:56:37 AM UTC, original submission:  

I'm thinking it would be nice if automatic broadcasting also worked in the dot function, so it would compute dot product between one and many vectors. Like so:


>> a = [1; 2];
>> b = [4; 5];
>> c = [6; 7];
>> dot (a, b, 1)
ans =  14
>> dot (a, c, 1)
ans =  20
>> dot (a, [b c], 1) # currently it fails
error: dot: sizes of X and Y must match

>> dot (repmat (a, 1, 2), [b c], 1) # could work like this
ans =

   14   20

## And for this very simple case, this already works if we don't use dot at all
>> a' * [b c]
ans =

   14   20


Carnë Draug <carandraug>
Group Member

 

Attached Files

This item currently has no attached files.

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

Attach Files:
   
   
Comment:
   

 

Dependencies

This item does not depend on any other items.

No items depend on this one.

 

Mail Notification Carbon-Copy List

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

    Votes

    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.

     

    History

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2018-11-24 rik5 Severity3 - Normal 1 - Wish
        Priority5 - Normal 3 - Low
        StatusNone Confirmed

    Back to the top

    Powered by Savane 3.16-ed84.
    Corresponding source code