2011/12/9 Jordi Gutiérrez Hermoso <jord...@octave.org>:
> On 9 December 2011 09:56, Juan Pablo Carbajal <carba...@ifi.uzh.ch> wrote:
>> What is the status of ind2sub and sub2ind extension to triangular matrices?
>>
>> Are we going to extend ind2sub and sub2ind or we just add ind2sub_tril
>> and sub2ind_tril (and unvech) to the linear-algebra package?
>
> I've been lazy/busy about doing this when I realised that it required
> a new implementation in C++.
>
> I would be happy to add those options, if someone else codes them. Do
> you want to try? I think it's a fairly simple task for C++. It should
> even require less trickery than any m-script implementation. If you
> write the initial implementation, I can polish it later (not sure how
> confident you are with C++) and then push the changes to the repo.
>
> - Jordi G.H.

Hi,

I have been working on the change set for sub2ind and ind2sub.
I want to ask how to trigger the new functionality.

I observed that calls to any of the functions ind2sub or sub2ind (I
use foo to name them) fails if they are in the form
foo(N,i,j)
with N a scalar.

The implementation of sub2ind_tril we have, assumes the triangular
matrix is square (indeed if it is not it doesn't make much sense in
general), or in other words it will number only the first square block
(as tril and triup do, test tril(ones(3,8))).

Therefore, we could extend the behavior of the foo functions by using
the case of scalar first argument.

What do you think?

Note: The  other possibility is to check if the fourth argument is a
string (indicating tril or triup), so
foo(N,i,j,str)
will trigger the extended behavior, and N will be checked to be a scalar.



-- 
M. Sc. Juan Pablo Carbajal
-----
PhD Student
University of Zürich
http://ailab.ifi.uzh.ch/carbajal/

------------------------------------------------------------------------------
Learn Windows Azure Live!  Tuesday, Dec 13, 2011
Microsoft is holding a special Learn Windows Azure training event for 
developers. It will provide a great way to learn Windows Azure and what it 
provides. You can attend the event by watching it streamed LIVE online.  
Learn more at http://p.sf.net/sfu/ms-windowsazure
_______________________________________________
Octave-dev mailing list
Octave-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/octave-dev

Reply via email to