length_expr: Length of a Vector (Last Nonzero Index)

View source: R/116_atoms_length.R

length_exprR Documentation

Length of a Vector (Last Nonzero Index)

Description

Returns the index of the last nonzero element of a vector (1-based). This atom is quasiconvex but NOT convex, so it can only be used in DQCP problems (solved with qcp = TRUE).

Usage

length_expr(x)

Arguments

x

A CVXR vector expression.

Value

A Length expression (scalar).

See Also

ceil_expr, floor_expr


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