vdot: Vector dot product (inner product)

View source: R/045_atoms_affine_binary_operators.R

vdotR Documentation

Vector dot product (inner product)

Description

The standard inner product of x and y: both are flattened, multiplied elementwise, and summed. Conjugate-linear in x — x is conjugated before multiplying, matching numpy.vdot() and CVXPY's vdot(). For real arguments conjugation is the identity, so this is the ordinary dot product.

Either argument may also be a (possibly nested) list, which is flattened before the product; the two are flattened independently, so their nesting need not match.

Usage

vdot(x, y)

Arguments

x

An Expression, numeric value, or nested list thereof. The conjugate-linear argument.

y

An Expression, numeric value, or nested list thereof. The linear argument.

Value

A scalar Expression representing sum(Conj(x) * y).

See Also

scalar_product(), cvxr_outer(), deep_flatten()

Examples

x <- Variable(3)
vdot(x, c(1, 2, 3))

a <- Variable(); b <- Variable()
vdot(list(a, b), c(1, 2))

CVXR documentation built on Aug. 24, 2026, 9:10 a.m.