% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/S3_diagonal.R
\name{diag_scale}
\alias{diag_scale}
\alias{diag_scale.HDF5Matrix}
\title{Scalar diagonal operation on an HDF5Matrix}
\usage{
diag_scale(x, scalar, op = "multiply", ...)

\method{diag_scale}{HDF5Matrix}(
  x,
  scalar,
  op = "multiply",
  outgroup = NULL,
  outdataset = NULL,
  overwrite = FALSE,
  ...
)
}
\arguments{
\item{x}{An \code{HDF5Matrix}.}

\item{scalar}{Numeric scalar.}

\item{op}{Operation: \code{"add"}, \code{"subtract"},
\code{"multiply"} (default), or \code{"divide"}.}

\item{\dots}{Additional arguments passed to \code{x$diag_scale()}:
\code{outgroup}, \code{outdataset}, \code{overwrite},
\code{threads}, \code{compression}.}

\item{outgroup}{Character or \code{NULL}. HDF5 group where the result is
stored. Default \code{"OUTPUT"}.}

\item{outdataset}{Character or \code{NULL}. Dataset name for the result.}

\item{overwrite}{Logical. If \code{TRUE}, overwrite the existing result
dataset. Default \code{FALSE}.}
}
\value{
A new \code{HDF5Matrix}.
}
\description{
Applies a scalar arithmetic operation to the diagonal elements of an
\code{HDF5Matrix}. Off-diagonal elements are not modified.
Delegates to \code{bdDiag_scalar_hdf5()}.
}
\examples{
\donttest{
tmp <- tempfile(fileext = ".h5")
M   <- hdf5_create_matrix(tmp, "data/M", data = diag(5))
R   <- diag_scale(M, scalar = 3, op = "multiply")
hdf5_close_all()
unlink(tmp)
}

}
\seealso{
\code{\link{diag_op}}
}
