isSymmetric | R Documentation |
Efficient function to test if 'object' is symmetric or not.
# isSymmetric.spam(object, ...)
## S3 method for class 'spam'
isSymmetric(object, tol = 100 * .Machine$double.eps, ...)
object |
a |
tol |
numeric scalar >= 0. Smaller differences are not considered,
see |
... |
further arguments passed to |
symmetry is assessed by comparing the sparsity structure of
object
and t(object)
via the function
all.equal.spam
. If a difference is detected, the matrix is
cleaned with cleanup
and compared again.
logical indicating if object
is symmetric or not.
Reinhard Furrer
all.equal.spam
, cleanup
.
obj <- diag.spam(2)
isSymmetric(obj)
obj[1,2] <- .Machine$double.eps
isSymmetric(obj)
all.equal(obj, t(obj))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.