Compare commits

...

10 Commits

Author SHA1 Message Date
Palash Tyagi
9638a45d17
Merge 4d846287e8f8c1f9a0ddebe916209f5c781de60b into d2d4764c17a3c9fc5dc0b24a4877f41a2d12ff4c 2025-05-02 23:49:40 +01:00
d2d4764c17
Merge pull request #31 from Magnus167/bugfix/not_operator
Implement logical NOT for references to boolean matrices
2025-05-02 23:40:12 +01:00
3007db1d02
Merge branch 'main' into bugfix/not_operator 2025-05-02 23:38:58 +01:00
4d846287e8
Merge branch 'main' into floatops 2025-05-02 23:38:46 +01:00
ccab83e501
Merge pull request #32 from Magnus167/bugfix/wkflow
Add pull request types for unit test workflow
2025-05-02 23:38:31 +01:00
Palash Tyagi
9209579a65 testing commit 2025-05-02 23:36:54 +01:00
Palash Tyagi
55a3c788ea Add concurrency settings to unit test workflow 2025-05-02 23:36:30 +01:00
Palash Tyagi
44e15ae489 Update pull request types in workflow trigger for unit tests 2025-05-02 23:35:54 +01:00
Palash Tyagi
cf6cd18fad Add pull request types to workflow trigger for unit tests 2025-05-02 23:33:39 +01:00
Palash Tyagi
e2e349fec5 Implement logical NOT for references to boolean matrices 2025-05-02 23:30:23 +01:00
2 changed files with 20 additions and 0 deletions

View File

@ -2,9 +2,14 @@ name: run-unit-tests
on:
pull_request:
types: [review_requested, ready_for_review, synchronize, opened, reopened]
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
run-unit-tests:
if: github.event.pull_request.draft == false

View File

@ -364,6 +364,21 @@ impl Not for Matrix<bool> {
}
}
// implement for &Matrix<bool>
impl<'a> Not for &'a Matrix<bool> {
type Output = Matrix<bool>;
fn not(self) -> Matrix<bool> {
// 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<f64>;
pub type BoolMatrix = Matrix<bool>;
pub type IntMatrix = Matrix<i32>;