octave-maintainers
[Top][All Lists]
Advanced

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

Re: [GSoC interval] Re: Update and questions regarding vecorization


From: Joel Dahne
Subject: Re: [GSoC interval] Re: Update and questions regarding vecorization
Date: Thu, 6 Jul 2017 18:05:12 +0000

Oliver Heimlich writes:

> On 05.07.2017 22:11, Joel Dahne wrote:
>>
>> Oliver Heimlich writes:
>>
>>> Hi Joel,
>>> In the meantime I have reviewed your latest changes to the code.  It
>>> looks very good so far and I have only minor remarks:
>>>
>>> 1. I have noticed a failing test in @infsup/disp for ND arrays, which
>>> should probably be fixed.
>> For me all 9 tests passes, what is the error you get and under what
>> circumstances?
>
> This test is failing for me in Octave 4.0.3:
>
>>> test @infsup/disp
> ***** test
>  i = infsupdec (reshape (1:24, 2, 3, 4));
>  i(1, 1, 2) = entire ();
>  i(1, 1, 3) = empty ();
>  i(1, 1, 4) = nai ();
>  assert (disp (i(1,1,:)), "ans(:,:,1) =   [1]_com\nans(:,:,2) =
> [Entire]_dac\nans(:,:,3) =   [Empty]_trv\nans(:,:,4) =   [NaI]\n")
> !!!!! test failed
> ASSERT errors for:  assert (disp (i (1, 1, :)),"ans(:,:,1) =
> [1]_com\nans(:,:,2) =   [Entire]_dac\nans(:,:,3) =
> [Empty]_trv\nans(:,:,4) =   [NaI]\n")
>
>   Location  |  Observed  |  Expected  |  Reason
>      []      ans(:,:,1) =   [1]_com
> ans(:,:,1) =   [Entire]_dac
> ans(:,:,1) =   [Empty]_trv
> ans(:,:,1) =   [NaI]
>  ans(:,:,1) =   [1]_com
> ans(:,:,2) =   [Entire]_dac
> ans(:,:,3) =   [Empty]_trv
> ans(:,:,4) =   [NaI]
>    Strings don't match
>
>
> Looking at the code, I guess that ind2sub is not computed correctly, it
> should be changed from
>
>   [matrixpartsubscript{:}] = ind2sub (size (x.inf), matrixpart);
>
> into
>
>   [matrixpartsubscript{:}] = ind2sub (size (x.inf)(3:end), matrixpart);
>
> However, it is strange that you are not affected by this.
>
You are right! I have added a patch for it now. The reason the test
passed for me is that ind2sub have been updated in 4.2.1 and it now
works differently when nargout is less than the number of
dimensions. This meant that disp would always give the correct result
for 3-dimensional arrays (which the test is for). But now it should work
for any input!
>
> Best
> Oliver



reply via email to

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