Learn R Programming

CVXR (version 1.0-14)

CallbackParam-class: The CallbackParam class.

Description

This class represents a parameter whose value is obtained by evaluating a function.

Usage

CallbackParam(callback, dim = NULL, ...)

# S4 method for CallbackParam value(object)

Arguments

callback

A callback function that generates the parameter value.

dim

The dimensions of the parameter.

...

Additional attribute arguments. See Leaf for details.

object

A CallbackParam object.

Slots

callback

A callback function that generates the parameter value.

dim

The dimensions of the parameter.

Examples

Run this code
x <- Variable(2)
fun <- function() { value(x) }
y <- CallbackParam(fun, dim(x), nonneg = TRUE)
get_data(y)

Run the code above in your browser using DataLab