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)

anqif/CVXR documentation built on Feb. 6, 2024, 4:28 a.m.