From 10c232bb764b2a4bc89ebe5cc3b75f240dfa7d54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Rapa=C5=88?= <71029912+davidrapan@users.noreply.github.com> Date: Tue, 29 Sep 2020 15:47:10 +0200 Subject: [PATCH 1/3] Update MatrixH.cs This one was pretty straight forward. --- Sources/Accord.Imaging/MatrixH.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/Accord.Imaging/MatrixH.cs b/Sources/Accord.Imaging/MatrixH.cs index 9875bbbf9..c80f7d315 100644 --- a/Sources/Accord.Imaging/MatrixH.cs +++ b/Sources/Accord.Imaging/MatrixH.cs @@ -97,7 +97,7 @@ public MatrixH(float[] elements) else if (elements.Length == 9) { this.elements = new float[8]; - for (int i = 0; i < elements.Length; i++) + for (int i = 0; i < this.elements.Length; i++) this.elements[i] = (float)(elements[i] / elements[8]); } else From 2047fbc90e3f0aef32c490d2069530cf096ca026 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Rapa=C5=88?= <71029912+davidrapan@users.noreply.github.com> Date: Tue, 29 Sep 2020 16:05:31 +0200 Subject: [PATCH 2/3] Update MatrixHTest.cs --- Unit Tests/Accord.Tests.Imaging/MatrixHTest.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Unit Tests/Accord.Tests.Imaging/MatrixHTest.cs b/Unit Tests/Accord.Tests.Imaging/MatrixHTest.cs index 7aeb8b10a..8ebdd14ca 100644 --- a/Unit Tests/Accord.Tests.Imaging/MatrixHTest.cs +++ b/Unit Tests/Accord.Tests.Imaging/MatrixHTest.cs @@ -42,6 +42,15 @@ public void MultiplyTest() Assert.IsTrue(Accord.Math.Matrix.IsEqual( expected.Elements, actual.Elements)); + try + { + A = new MatrixH(new float[8] {1, 0, 0, 0, 1, 0, 0, 1}); + B = new MatrixH(new float[9] {1, 0, 0, 0, 1, 0, 0, 0, 1}); + } + catch (Exception e) + { + Assert.Fail(e.Message); + } double[,] a = { From 91859acb374616f296d46688a85ca035e572fd4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Rapa=C5=88?= <71029912+davidrapan@users.noreply.github.com> Date: Tue, 29 Sep 2020 17:31:37 +0200 Subject: [PATCH 3/3] Update MatrixHTest.cs Little copy-paste faux pas. --- Unit Tests/Accord.Tests.Imaging/MatrixHTest.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Unit Tests/Accord.Tests.Imaging/MatrixHTest.cs b/Unit Tests/Accord.Tests.Imaging/MatrixHTest.cs index 8ebdd14ca..e93791ae1 100644 --- a/Unit Tests/Accord.Tests.Imaging/MatrixHTest.cs +++ b/Unit Tests/Accord.Tests.Imaging/MatrixHTest.cs @@ -47,7 +47,7 @@ public void MultiplyTest() A = new MatrixH(new float[8] {1, 0, 0, 0, 1, 0, 0, 1}); B = new MatrixH(new float[9] {1, 0, 0, 0, 1, 0, 0, 0, 1}); } - catch (Exception e) + catch (System.Exception e) { Assert.Fail(e.Message); }