mirror of
https://github.com/Magnus167/rustframe.git
synced 2025-08-20 13:00:00 +00:00
Compare commits
10 Commits
caa1cd32fa
...
fcd5cc245e
Author | SHA1 | Date | |
---|---|---|---|
![]() |
fcd5cc245e | ||
d2d4764c17 | |||
3007db1d02 | |||
34cff9f05e | |||
ccab83e501 | |||
![]() |
9209579a65 | ||
![]() |
55a3c788ea | ||
![]() |
44e15ae489 | ||
![]() |
cf6cd18fad | ||
![]() |
e2e349fec5 |
5
.github/workflows/run-unit-tests.yml
vendored
5
.github/workflows/run-unit-tests.yml
vendored
@ -2,9 +2,14 @@ name: run-unit-tests
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
|
types: [review_requested, ready_for_review, synchronize, opened, reopened]
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: ${{ github.workflow }}-${{ github.ref }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
run-unit-tests:
|
run-unit-tests:
|
||||||
if: github.event.pull_request.draft == false
|
if: github.event.pull_request.draft == false
|
||||||
|
@ -435,6 +435,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 FloatMatrix = Matrix<f64>;
|
||||||
pub type BoolMatrix = Matrix<bool>;
|
pub type BoolMatrix = Matrix<bool>;
|
||||||
pub type IntMatrix = Matrix<i32>;
|
pub type IntMatrix = Matrix<i32>;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user