help-octave
[Top][All Lists]
Advanced

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

Re: cat does not convert sparse matrices?


From: dbateman
Subject: Re: cat does not convert sparse matrices?
Date: Sat, 13 Sep 2008 05:06:52 -0700 (PDT)

In fact I think I see two bugs here


Francesco Potorti`-2 wrote:
> 
> In Octave 3.0.1, I cannot catenate a full double matrix with a sparse
> logical matrix.  Is this normal or a bug?
> 
> octave> a=zeros(3,3,0);
> octave> b1=zeros(3,3);
> octave> b2=sparse(1,1,true,3,3);
> octave> whos a b1 b2
> 
> *** local user variables:
> 
>   Prot Name        Size                     Bytes  Class
>   ==== ====        ====                     =====  ===== 
>    rwd a           3x3x0                        0  double
>    rwd b1          3x3                         72  double
>    rwd b2          3x3                         21  logical
> 
> Total is 10 elements using 93 bytes
> 
> octave> size(cat(3,a,b1))
> ans =
> 
>    3   3   1
> 

Trailing singleton dimensions should be dropped, So I suspect there is a
function call missing in the cat function that should do this.



> octave> size(cat(3,a,b2))
> error: invalid conversion of NDArray to Matrix
> error: range error for insert
> error: evaluating argument list element number 1
> 

The sparse logical matrix should be promoted to a sparse matrix and the
concatenation allowed. Ok, I'll look at this wen I'm on a development
machine.

D.

-- 
View this message in context: 
http://www.nabble.com/cat-does-not-convert-sparse-matrices--tp19457143p19469934.html
Sent from the Octave - General mailing list archive at Nabble.com.



reply via email to

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