size-methods: Size Properties

size-methodsR Documentation

Size Properties

Description

Determine if an expression is a scalar, vector, or matrix.

Usage

is_scalar(object)

is_vector(object)

is_matrix(object)

Arguments

object

An Expression object.

Value

A logical value.

Examples

x <- Variable()
y <- Variable(3)
z <- Variable(3,2)

is_scalar(x)
is_scalar(y)
is_scalar(x + y)

is_vector(x)
is_vector(y)
is_vector(2*z)

is_matrix(x)
is_matrix(y)
is_matrix(z)
is_matrix(z - x)

CVXR documentation built on June 27, 2024, 5:11 p.m.