From e2e349fec5ca0fb9ba7d6fed3e3b09a44a7e357a Mon Sep 17 00:00:00 2001 From: Palash Tyagi <23239946+Magnus167@users.noreply.github.com> Date: Fri, 2 May 2025 23:30:23 +0100 Subject: [PATCH 1/5] Implement logical NOT for references to boolean matrices --- src/matrix/mat.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/matrix/mat.rs b/src/matrix/mat.rs index 02a042b..b3d93b6 100644 --- a/src/matrix/mat.rs +++ b/src/matrix/mat.rs @@ -364,6 +364,21 @@ impl Not for Matrix { } } +// implement for &Matrix +impl<'a> Not for &'a Matrix { + type Output = Matrix; + + fn not(self) -> Matrix { + // Invert each boolean element in the matrix + let data = self.data.iter().map(|&v| !v).collect(); + Matrix { + rows: self.rows, + cols: self.cols, + data, + } + } +} + pub type FloatMatrix = Matrix; pub type BoolMatrix = Matrix; pub type IntMatrix = Matrix; From cf6cd18fad30ba1e8b390d094fa1a864f671b22d Mon Sep 17 00:00:00 2001 From: Palash Tyagi <23239946+Magnus167@users.noreply.github.com> Date: Fri, 2 May 2025 23:33:39 +0100 Subject: [PATCH 2/5] Add pull request types to workflow trigger for unit tests --- .github/workflows/run-unit-tests.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/run-unit-tests.yml b/.github/workflows/run-unit-tests.yml index 6fe312d..f503111 100644 --- a/.github/workflows/run-unit-tests.yml +++ b/.github/workflows/run-unit-tests.yml @@ -2,9 +2,11 @@ name: run-unit-tests on: pull_request: + types: [review_requested, ready_for_review] branches: - main + jobs: run-unit-tests: if: github.event.pull_request.draft == false From 44e15ae489aa746a4b2838713a292071a2d0ffc4 Mon Sep 17 00:00:00 2001 From: Palash Tyagi <23239946+Magnus167@users.noreply.github.com> Date: Fri, 2 May 2025 23:35:54 +0100 Subject: [PATCH 3/5] Update pull request types in workflow trigger for unit tests --- .github/workflows/run-unit-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/run-unit-tests.yml b/.github/workflows/run-unit-tests.yml index f503111..4896437 100644 --- a/.github/workflows/run-unit-tests.yml +++ b/.github/workflows/run-unit-tests.yml @@ -2,7 +2,7 @@ name: run-unit-tests on: pull_request: - types: [review_requested, ready_for_review] + types: [review_requested, ready_for_review, synchronize, opened, reopened] branches: - main From 55a3c788ea1e60f6c9d2db24e17a85b7355e31bc Mon Sep 17 00:00:00 2001 From: Palash Tyagi <23239946+Magnus167@users.noreply.github.com> Date: Fri, 2 May 2025 23:36:30 +0100 Subject: [PATCH 4/5] Add concurrency settings to unit test workflow --- .github/workflows/run-unit-tests.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/run-unit-tests.yml b/.github/workflows/run-unit-tests.yml index 4896437..2811fca 100644 --- a/.github/workflows/run-unit-tests.yml +++ b/.github/workflows/run-unit-tests.yml @@ -6,6 +6,9 @@ on: branches: - main +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true jobs: run-unit-tests: From 9209579a65cc39b1cade14ef68844a9fb026128d Mon Sep 17 00:00:00 2001 From: Palash Tyagi <23239946+Magnus167@users.noreply.github.com> Date: Fri, 2 May 2025 23:36:54 +0100 Subject: [PATCH 5/5] testing commit