knitr::opts_chunk$set( error = TRUE, collapse = TRUE, comment = "#>", out.width = "100%" )
library(testthat) library(matrixR) context("Test IsPositiveDefinite.")
test_that("TRUE.", { expect_true( IsPositiveDefinite(diag(2)) ) }) test_that("FALSE.", { expect_false( IsPositiveDefinite( matrix( data = c(1, 2, 3, 2, 4, 5, 3, 5, 6), ncol = 3 ) ) ) # to cover OTHERWISE expect_false( IsPositiveDefinite(matrix(1:10, ncol = 2)) ) })
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.