IsSquareMatrix: Test for a Square Matrix

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/IsSquareMatrix.R

Description

IsSquareMatrix() returns TRUE if A is a square matrix, and FALSE otherwise.

Usage

1
2
3
4
5
6
7
IsSquareMatrix(A)

## Default S3 method:
IsSquareMatrix(A)

## S3 method for class 'yac_symbol'
IsSquareMatrix(A)

Arguments

A

Input.

Details

A matrix \mathbf{A} is square if it has the same number of rows and columns

\mathbf{A}_{m \times m} .

A is considered to be a square matrix if dim(A)[1] == dim(A)[2] returns TRUE.

Value

Logical.

Author(s)

Ivan Jacob Agaloos Pesigan

References

Wikipedia: Square matrix

See Also

Other predicate functions: IsDiagonal(), IsIdempotent(), IsInvertible(), IsMatrix(), IsNilpotent(), IsOrthogonal(), IsPositiveDefinite(), IsScalar(), IsSingular(), IsSymmetric(), IsVector(), MatrixCheck()

Examples

1
2
3
4
5
6
# TRUE
IsSquareMatrix(matrix(1:9, ncol = 3))

# FALSE
IsSquareMatrix(1:5)
IsSquareMatrix(matrix(1:10, nrow = 2))

jeksterslab/matrixR documentation built on Feb. 22, 2021, 8:10 a.m.