Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
609 changes: 18 additions & 591 deletions README.md

Large diffs are not rendered by default.

Binary file modified man/figures/README-unnamed-chunk-3-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified man/figures/README-unnamed-chunk-6-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified man/figures/README-unnamed-chunk-7-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified man/figures/README-unnamed-chunk-8-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified man/figures/README-unnamed-chunk-9-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 14 additions & 14 deletions tests/testthat/test-matrix.R
Original file line number Diff line number Diff line change
Expand Up @@ -141,24 +141,24 @@ test_that("1x1 matrix preserves matrix result with length-1 vector", {
})

test_that("1x1 matrix with length-n vector yields a vector", {
fn <- function(vec, mat_1_1) {
declare(
type(vec = double(n)),
type(mat_1_1 = double(1, 1))
)
a <- vec + mat_1_1
b <- mat_1_1 + vec
out <- list(a = a, b = b)
out
}
## Note: base R emits a warning:
fn <- function(vec, mat_1_1) {
declare(
type(vec = double(n)),
type(mat_1_1 = double(1, 1))
)
a <- vec + mat_1_1
b <- mat_1_1 + vec
out <- list(a = a, b = b)
out
}

## Note: base R emits a warning:
## Recycling array of length 1 in vector-array arithmetic is deprecated
## suppressWarnings is used to pass test as this path may arrise in code
## suppressWarnings is used to pass test as this path may arrise in code
## e.g crossprod(1:4) or other matrix operation that gives 1 by 1 matrix
suppressWarnings(expect_quick_identical(
fn,
list(c(1,2,3), matrix(1, nrow = 1L, ncol = 1L))
list(c(1, 2, 3), matrix(1, nrow = 1L, ncol = 1L))
))
})

Expand Down