octave-maintainers
[Top][All Lists]
Advanced

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

Re: Easy project for GSoC students


From: Juan Pablo Carbajal
Subject: Re: Easy project for GSoC students
Date: Sat, 8 Mar 2014 17:57:08 +0100

On Sat, Mar 8, 2014 at 5:04 PM, Eduardo <address@hidden> wrote:
> I have a doubt about the offset. For a triangular lower matrix(lets say 5x5)
> with an offset +1 the index numeration would be
>
>   1  6     0   0    0
>   2  7   11   0    0
>   3  8   12  15   0
>   4  9   13  16  18
>   5  10 14  17  19
>
> And other thing, why if I do sub2ind_tril(5, 1, 5), it is returned 5 as the
> index? Should not be 0 because is above the diagonal ?
>
> Edu
>
>
>
> 2014-03-08 14:19 GMT+01:00 Juan Pablo Carbajal <address@hidden>:
>>
>> On Sat, Mar 8, 2014 at 1:42 PM, Eduardo <address@hidden> wrote:
>> >
>> > Hi Pablo,
>> >
>> > Should the the parameters be checked to be as they are in the m-file
>> > inside
>> > the mechanics module? I mean, N should be a scalar, and r and c may be
>> > vectors of the same size containing scalars or just scalars. Is that
>> > correct?
>> >
>> > Edu
>> >
>> >
>> >
>> > 2014-03-06 23:57 GMT+01:00 Juan Pablo Carbajal <address@hidden>:
>> >
>> >> Dear GSoC applicants,
>> >>
>> >> Please use the mailing list to ask questions, you gain nothing by
>> >> writing a particular person. Indeed you loose the chance to get other
>> >> developers to answer your questions.
>> >>
>> >> Many of you have asked for easy projects. The bug tracker is a source
>> >> of  possible projects. Here there is another one (I added it to the
>> >> tracker)
>> >>
>> >>
>> >> === extend sub2ind and ind2sub ===
>> >> We are extending sub2ind and ind2sub to work with triangular matrices.
>> >> Currently private functions of the mechanics package.
>> >> A string argument triggers the behavior. The string argument can be
>> >> "triu" or "tril". After this str argument we accept an extra scalar
>> >> value indicating that the triangular matrix is off diagonal (as in
>> >> tril and triu).
>> >> So, the first modification to the C++ code will be
>> >> # Check if any of the argument is a str.
>> >> # Check what kind of triangular matrix (up or low).
>> >> # If the argument after the str argument is a scalar, it indicates off
>> >> diagonal triangular matrix (we do not have algo for that yet, though).
>> >
>> >
>> Hi Edu,
>>
>> That's correct.
>> Notice that the best approch would be to go for a separate ind2sub_tri
>> that accepts "up" and "low" as options and then add the callback to
>> the standard ind2sub (assuming jwe doesn't complain too much, but
>> since is easy to remove the functionality if mathworks ever decides to
>> implement it, I do not think that is the case) then yes, you have to
>> perform those checks. The algorithm implemented on the mechanical
>> package functions works for square triangular matrices and it doesn't
>> work with an offset.
>
>
This might be seen as a bug, when the sub indexes are outside the
range (c>r for tril and r>c for triup) an error should be raised.


reply via email to

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