R/minij.R

Defines functions minij

Documented in minij

# SPD matrix min(i,j) ---------------------------------------------------------

#' @name minij
#' @title Symmetric positive definite matrix \code{MIN(i,j)}
#'
#' @description The \code{N}-by-\code{N} SPD matrix with \code{A[i,j]=min(i,j)}
#'
#' @param n order of the matrix
#'
#' @return Symmetric positive definite matrix with entries \code{A[i,j]=min(i,j)}
#'
#' @export
minij <- function(n){
  A <- matrix(0, n, n)
  pmin(row(A), col(A))
}

Try the gallery package in your browser

Any scripts or data that you put into this service are public.

gallery documentation built on Sept. 26, 2024, 5:07 p.m.