The R Project SVN R

Rev

Rev 70477 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 70477 Rev 75395
Line 1... Line 1...
1
% File src/library/base/man/isSymmetric.Rd
1
% File src/library/base/man/isSymmetric.Rd
2
% Part of the R package, https://www.R-project.org
2
% Part of the R package, https://www.R-project.org
3
% Copyright 1995-2016 R Core Team
3
% Copyright 1995-2018 R Core Team
4
% Distributed under GPL 2 or later
4
% Distributed under GPL 2 or later
5
 
5
 
6
\name{isSymmetric}
6
\name{isSymmetric}
7
\alias{isSymmetric}
7
\alias{isSymmetric}
8
\alias{isSymmetric.matrix}
8
\alias{isSymmetric.matrix}
Line 25... Line 25...
25
  \item{tol1}{numeric scalar >= 0.  \code{isSymmetric.matrix()}
25
  \item{tol1}{numeric scalar >= 0.  \code{isSymmetric.matrix()}
26
    \sQuote{pre-tests} the first and last few rows for fast detection of
26
    \sQuote{pre-tests} the first and last few rows for fast detection of
27
    \sQuote{obviously} asymmetric cases with this tolerance.  Setting it
27
    \sQuote{obviously} asymmetric cases with this tolerance.  Setting it
28
    to length zero will skip the pre-tests.}
28
    to length zero will skip the pre-tests.}
29
  \item{\dots}{further arguments passed to methods; the matrix method
29
  \item{\dots}{further arguments passed to methods; the matrix method
30
    passes these to \code{\link{all.equal}}.}
30
    passes these to \code{\link{all.equal}}.  If the row and column
-
 
31
    names of \code{object} are allowed to differ for the symmetry check
-
 
32
    do use \code{check.attributes = FALSE}!}
31
}
33
}
32
\value{
34
\value{
33
  logical indicating if \code{object} is symmetric or not.
35
  logical indicating if \code{object} is symmetric or not.
34
}
36
}
35
\details{
37
\details{
Line 56... Line 58...
56
Z <- sqrt(matrix(-1:2 + 0i, 2)); Z <- t(Conj(Z)) \%*\% Z
58
Z <- sqrt(matrix(-1:2 + 0i, 2)); Z <- t(Conj(Z)) \%*\% Z
57
Z
59
Z
58
isSymmetric(Z)      # TRUE
60
isSymmetric(Z)      # TRUE
59
isSymmetric(Z + 1)  # TRUE
61
isSymmetric(Z + 1)  # TRUE
60
isSymmetric(Z + 1i) # FALSE -- a Hermitian matrix has a *real* diagonal
62
isSymmetric(Z + 1i) # FALSE -- a Hermitian matrix has a *real* diagonal
-
 
63
 
-
 
64
colnames(D3) <- c("X", "Y", "Z")
-
 
65
isSymmetric(D3)                         # FALSE (as row and column names differ)
-
 
66
isSymmetric(D3, check.attributes=FALSE) # TRUE  (as names are not checked)
61
}
67
}
62
\keyword{array}
68
\keyword{array}
63
\keyword{utilities}
69
\keyword{utilities}