Learn R Programming

optimbase (version 1.0-9)

optimbase.checkshape: Check the Dimensions of the Cost Function Output

Description

This function is called by optimbase.checkcostfun to check whether the dimensions of a cost function output match the expectations.

Usage

optimbase.checkshape(this = NULL, varname = NULL, data = NULL, index = NULL, expectednrows = NULL, expectedncols = NULL)

Arguments

this
An optimization object.
varname
The name of the output being checked, either 'f', 'c', or 'g'.
data
A content of the output.
index
The index (see vignette('optimbase',package='optimbase') for more details).
expectednrows
Number of expected rows.
expectedncols
Number of expected columns.

Value

Return the optimization object or an error message if the dimensions are inconsistent.

See Also

optimbase.checkcostfun