44# ' Copyright (c) Adrian Baddeley, Ege Rubak and Rolf Turner 2016-2022
55# ' GNU Public Licence >= 2.0
66# '
7- # ' $Revision: 1.8 $ $Date: 2022/04/18 03:17:30 $
7+ # ' $Revision: 1.9 $ $Date: 2024/06/09 00:01:09 $
88# '
99
1010matrixsqrt <- function (x , complexOK = TRUE ) {
@@ -13,7 +13,7 @@ matrixsqrt <- function(x, complexOK=TRUE) {
1313 stop(" x must be a matrix" )
1414 if (! is.matrix(x ))
1515 x <- as.matrix(x )
16- check.nmatrix(x ) # # requires square matrix
16+ check.nmatrix(x , mname = " x " ) # # requires square matrix
1717 if (missing(complexOK ) && is.complex(x )) complexOK <- TRUE
1818 if (! complexOK ) stopifnot(is.numeric(x )) else
1919 stopifnot(is.numeric(x ) || is.complex(x ))
@@ -45,7 +45,7 @@ matrixinvsqrt <- function(x, complexOK=TRUE) {
4545 stop(" x must be a matrix" )
4646 if (! is.matrix(x ))
4747 x <- as.matrix(x )
48- check.nmatrix(x ) # # requires square matrix
48+ check.nmatrix(x , mname = " x " ) # # requires square matrix
4949 if (missing(complexOK ) && is.complex(x )) complexOK <- TRUE
5050 if (! complexOK ) stopifnot(is.numeric(x )) else
5151 stopifnot(is.numeric(x ) || is.complex(x ))
@@ -79,7 +79,7 @@ matrixpower <- function(x, power, complexOK=TRUE) {
7979 stop(" x must be a matrix" )
8080 if (! is.matrix(x ))
8181 x <- as.matrix(x )
82- check.nmatrix(x ) # # requires square matrix
82+ check.nmatrix(x , mname = " x " ) # # requires square matrix
8383 if (power == 0 ) {
8484 # # power = 0 yields identity matrix even if x is singular
8585 y <- diag(nrow(x ))
0 commit comments