api / koma / allclose

allclose

fun allclose(arr1:Matrix<Double>, arr2:Matrix<Double>, rtol:Double= 1e-05, atol:Double= 1e-08):Boolean

Returns true if all elements are close to equal, as defined by two tolerance values. The matrices are considered equal if

abs(ele1 - ele2) < (atol + rtol * abs(ele1))

is true elementwise for all elements ele1 in arr1, koma.matrix.Matrix((kotlin.Double)), kotlin.Double, kotlin.Double)/arr1) and all elements ele2 in arr2, koma.matrix.Matrix((kotlin.Double)), kotlin.Double, kotlin.Double)/arr2).

Parameters

arr1 - The first matrix to compare

arr2 - The second matrix to compare

rtol - The relative tolerance value

atol - The absolute tolerance value