help-octave
[Top][All Lists]
Advanced

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

Re: senseless warning in octave-3.6.2


From: Sergei Steshenko
Subject: Re: senseless warning in octave-3.6.2
Date: Sun, 1 Jul 2012 17:20:31 -0700 (PDT)




----- Original Message -----
> From: Ben Abbott <address@hidden>
> To: Sergei Steshenko <address@hidden>
> Cc: Jordi Gutiérrez Hermoso <address@hidden>; Octave users list 
> <address@hidden>
> Sent: Monday, July 2, 2012 3:01 AM
> Subject: Re: senseless warning in octave-3.6.2
> 
> 
> On Jul 1, 2012, at 7:53 PM, Sergei Steshenko wrote:
> 
>> 
>> 
>> 
>> 
>>  ----- Original Message -----
>>>  From: Jordi Gutiérrez Hermoso <address@hidden>
>>>  To: Sergei Steshenko <address@hidden>
>>>  Cc: c. <address@hidden>; Octave users list 
> <address@hidden>
>>>  Sent: Monday, July 2, 2012 12:01 AM
>>>  Subject: Re: senseless warning in octave-3.6.2
>>> 
>>>  On 1 July 2012 16:42, Sergei Steshenko <address@hidden> 
> wrote:
>>>>  Why on earth two _vectors_ are promoted to a matrix ?
>>> 
>>>  http://www.gnu.org/software/octave/doc/interpreter/Broadcasting.html
>>> 
>>>  HTH,
>>>  - Jordi G. H.
>>> 
>> 
>>  No, the document does _not_ help. Because it does _not_ explain _why_ in a 
> context of _only_ vector operands a matrix is produced (and, by the way, as I 
> wrote, it's not "broadcasting", in programming WRT types 
> "promotion" and "demotion" is used).
>> 
>>  As wrote much much earlier, essentially column vector vs row vector is a 
> nuisance - one type of vector would suffice.
>> 
>>  IIUC, column vector is kind of default in Octave, that's why I expect
>> 
>>  vec = row_vec OP col_vec
>> 
>>  to be implemented as
>> 
>>  vec = row_vec(:) .OP col_vec(:)
>>  .
>> 
>>  Regards,
>>    Sergei.
> 
> Strictly speaking there are no vectors or scalars.  Only matrices.
> 
> [1] -> is a 1x1 matrix
> [1;1] -> is a 2x1 matrix
> [1,2] -> is a 1x2 matrix
> 
> This is a result of legacy Matlab code.
> 
> Ben

Strictly speaking 2d matrices with one dimension equal to one are still vectors.

Strictly speaking row by column vector product is scalar vector product, i.e.

row_vec * col_vec

in Octave terms by _mathematical_ default should be implemented as 
sum(row_vec(:) .* col_vec(:)), but it's not the default I want - in most of the 
cases I really don't care whether a vector is a row or a column one, and I'm 
wondering if anybody else cares.

I still don't understand the motive of promoting a N elements vector to N x N 
elements matrix.

Regards,
  Sergei.


>


reply via email to

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