R/utils.R

Defines functions .lossL2 .repmat

#' Repeat matrix in two dimensions
#'
#' @param a Matrix to repeat.
#' @param n Dimension 1.
#' @param m Dimension 2.
#'
#' @return Larger Matrix.
#'
#' @noRd
.repmat <- function(a, n, m) {
  kronecker(matrix(1, n, m), a)
}

#' Squared Loss Function
#'
#' @param w Input matrix.
#'
#' @return Sum of squares.
#'
#' @noRd
.lossL2 <- function(w) {
  sum(w^2)
}

Try the adproclus package in your browser

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

adproclus documentation built on Nov. 10, 2023, 1:07 a.m.