Skip to content

Commit 8b58278

Browse files
committed
Format with air
1 parent 635a745 commit 8b58278

2 files changed

Lines changed: 24 additions & 6 deletions

File tree

R/r2f-matrix.R

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,10 +118,20 @@ register_r2f_handler(
118118
scope,
119119
left = left,
120120
right = right,
121-
left_axis = if (left_rank == 1) NULL else if (left_trans == "N") 2L else
122-
1L,
123-
right_axis = if (right_rank == 1) NULL else if (right_trans == "N") 1L
124-
else 2L
121+
left_axis = if (left_rank == 1) {
122+
NULL
123+
} else if (left_trans == "N") {
124+
2L
125+
} else {
126+
1L
127+
},
128+
right_axis = if (right_rank == 1) {
129+
NULL
130+
} else if (right_trans == "N") {
131+
1L
132+
} else {
133+
2L
134+
}
125135
)
126136

127137
# Matrix-Matrix

tests/testthat/test-blas-guards.R

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,11 @@ test_that("matrix-vector %*% guards an unknown vector length", {
1212
qfn <- expect_no_warning(quick(fn))
1313
expect_equal(qfn(diag(3), as.double(1:3)), diag(3) %*% 1:3)
1414
# was: dgemv read past the end of x, returning garbage
15-
expect_error(qfn(diag(3), as.double(1:2)), "non-conformable arguments in %*%", fixed = TRUE)
15+
expect_error(
16+
qfn(diag(3), as.double(1:2)),
17+
"non-conformable arguments in %*%",
18+
fixed = TRUE
19+
)
1620
})
1721

1822
test_that("vector-matrix %*% guards an unknown vector length", {
@@ -22,7 +26,11 @@ test_that("vector-matrix %*% guards an unknown vector length", {
2226
}
2327
qfn <- expect_no_warning(quick(fn))
2428
expect_equal(qfn(as.double(1:3), diag(3)), t(as.double(1:3)) %*% diag(3))
25-
expect_error(qfn(as.double(1:5), diag(3)), "non-conformable arguments in %*%", fixed = TRUE)
29+
expect_error(
30+
qfn(as.double(1:5), diag(3)),
31+
"non-conformable arguments in %*%",
32+
fixed = TRUE
33+
)
2634
})
2735

2836
test_that("triangular solve guards squareness and RHS length", {

0 commit comments

Comments
 (0)