R/258_zzz_R_specific_math_atoms.R

#####
## DO NOT EDIT THIS FILE!! EDIT THE SOURCE INSTEAD: rsrc_tree/zzz_R_specific/math_atoms.R
#####

## R-SPECIFIC: Math, Summary, and standard function dispatch documentation

#' Standard R Functions for CVXR Expressions
#'
#' CVXR registers methods so that standard R functions create the
#' appropriate atoms when applied to \code{Expression} objects.
#'
#' @section Math group (elementwise, via S3 group generic):
#' \describe{
#'   \item{\code{abs(x)}}{Absolute value (convex, nonneg)}
#'   \item{\code{exp(x)}}{Exponential (convex, positive)}
#'   \item{\code{log(x)}}{Natural logarithm (concave, domain x >= 0)}
#'   \item{\code{sqrt(x)}}{Square root via \code{\link{power}(x, 0.5)} (concave)}
#'   \item{\code{log1p(x)}}{log(1+x) compound expression (concave)}
#'   \item{\code{log2(x)}, \code{log10(x)}}{Base-2/10 logarithm}
#'   \item{\code{cumsum(x)}}{Cumulative sum (affine)}
#'   \item{\code{cummax(x)}}{Cumulative max (convex)}
#'   \item{\code{cumprod(x)}}{Cumulative product}
#'   \item{\code{ceiling(x)}, \code{floor(x)}}{Round up/down (MIP)}
#' }
#'
#' @section Summary group (via S3 group generic):
#' \describe{
#'   \item{\code{sum(x)}}{Sum all entries (affine)}
#'   \item{\code{max(x)}}{Maximum entry (convex)}
#'   \item{\code{min(x)}}{Minimum entry (concave)}
#' }
#'
#' @section S3 generic methods:
#' \describe{
#'   \item{\code{mean(x)}}{Arithmetic mean; pass \code{axis}/\code{keepdims} via \code{...}}
#'   \item{\code{diff(x)}}{First-order differences; also \code{\link{cvxr_diff}}}
#' }
#'
#' @section Masking wrappers:
#' These mask the base/stats versions and dispatch on argument type:
#' \describe{
#'   \item{\code{norm(x)}}{2-norm; use \code{type} for "1", "I" (infinity), "F" (Frobenius)}
#'   \item{\code{sd(x)}}{Standard deviation (ddof=0 for expressions)}
#'   \item{\code{var(x)}}{Variance (ddof=0 for expressions)}
#'   \item{\code{outer(X, Y)}}{Outer product of two vector expressions}
#' }
#'
#' @section Advanced usage:
#' For axis-aware reductions, keepdims, or other options not available
#' through the standard interface, use the explicit functions:
#' \code{\link{cvxr_norm}}, \code{\link{cvxr_mean}}, \code{\link{cvxr_diff}},
#' \code{\link{cvxr_std}}, \code{\link{cvxr_var}}, \code{\link{cvxr_outer}}.
#'
#' @seealso \code{\link{power}}, \code{\link{sum_entries}},
#'   \code{\link{max_entries}}, \code{\link{min_entries}}
#' @name math_atoms
NULL

Try the CVXR package in your browser

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

CVXR documentation built on March 6, 2026, 9:10 a.m.