[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #65178] [octave forge] (statistics) pdist2 BIS
From: |
Dmitri A. Sergatskov |
Subject: |
[Octave-bug-tracker] [bug #65178] [octave forge] (statistics) pdist2 BIST failures |
Date: |
Thu, 18 Jan 2024 19:50:40 -0500 (EST) |
Follow-up Comment #5, bug#65178 (group octave):
If I remove the comma at line 318 of pdist2.m
and add "D14 = D(1,2) - D(4,2)"
D = reshape (D, size (Y, 1), size (X, 1))'
D14 = D(1,2) - D(4,2)
Then do
octave:1> format long
octave:2> x = [1, 1, 1; 2, 2, 2; 3, 3, 3];
octave:3> y = [0, 0, 0; 1, 2, 3; 0, 2, 4; 4, 7, 1];
octave:4> [D, I] = pdist2 (y, x, "mahalanobis", "smallest", 2)
then on machine where the test passes I see
D =
2.121320343559651 4.242640687119303 6.363961030678953
1.224744871391590 2.449489742783189 4.415880433163943
3.240370349203942 4.898979485566378 6.819090848492960
2.738612787525838 4.242640687119302 6.123724356957971
D14 = 8.881784197001252e-16
D =
1.224744871391590 2.449489742783189 4.415880433163943
2.121320343559651 4.242640687119302 6.123724356957971
I =
2 2 2
1 4 4
and on the machine where the test fail:
D =
2.121320343559651 4.242640687119303 6.363961030678956
1.224744871391590 2.449489742783189 4.415880433163943
3.240370349203942 4.898979485566378 6.819090848492960
2.738612787525845 4.242640687119303 6.123724356957972
D14 = -8.881784197001252e-16
D =
1.224744871391590 2.449489742783189 4.415880433163943
2.121320343559651 4.242640687119303 6.123724356957972
I =
2 2 2
1 1 4
I am not sure if this is a bug with an algorithm (which should be robust WRT
such things; or just the test case data needs to be changed.
Dmitri.
--
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?65178>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/