check_symmetric: Round a matrix to make if symmetric

View source: R/kernel-to-matrices.R

check_symmetricR Documentation

Round a matrix to make if symmetric

Description

If a matrix is non-symmetric due to numerical errors, round with a decreasing number of digits until the matrix becomes symmetric.

Usage

check_symmetric(mat, digits = 10)

Arguments

mat

A matrix, possibly non-symmetric.

digits

A number, the starting number of digits to round from if mat is not symmetric

Value

A matrix, rounded approximation of mat that is symmetric.

Examples

TRUE

MagmaClustR documentation built on June 29, 2024, 1:06 a.m.