library(HMMCPP)
context("Matrix functions")
test_that("distance is zero if same",{
A <- matrix(1:4, nrow = 2)
B <- A
expect_equivalent(get_diff(A, B), 0)
}
)
test_that("Symmetric",{
A <- matrix(1:4, nrow = 2)
B <- matrix(4:1, nrow = 2)
expect_equivalent(get_diff(A, B), get_diff(B, A))
})
test_that("Gives correct value",{
A <- matrix(rep(1, 4), nrow = 2)
B <- matrix(rep(0, 4), nrow = 2)
expect_equal(get_diff(A, B), 2)
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.