tests/isSymmetric.r

suppressPackageStartupMessages(library(float))

x = matrix(1:30, 10)
y = matrix(1:10, 10, 2)
z = crossprod(x)
w = z
w[1, 2] = -123456

xs = fl(x)
ys = fl(y)
zs = fl(z)
ws = fl(w)


test = isSymmetric(xs)
truth = isSymmetric(x)
stopifnot(identical(test, truth))

test = isSymmetric(ys)
truth = isSymmetric(y)
stopifnot(identical(test, truth))

test = isSymmetric(zs)
truth = isSymmetric(z)
stopifnot(identical(test, truth))

test = isSymmetric(ws)
truth = isSymmetric(w)
stopifnot(identical(test, truth))

Try the float package in your browser

Any scripts or data that you put into this service are public.

float documentation built on Feb. 16, 2023, 6:43 p.m.